Source for file treemap_reporter.php
Documentation is available at treemap_reporter.php
* extension file for SimpleTest
* @version $Id: treemap_reporter.php 1579 2007-11-02 04:17:44Z maetl_ $
require_once(dirname(__FILE__
) .
'/../scorer.php');
require_once(dirname(__FILE__
) .
'/treemap_reporter/treemap_recorder.php');
* Constructs and renders a treemap visualization of a test run
* basic CSS for floating nested divs
* @todo checkout some weird border bugs
$css =
".pass{background-color:green;}.fail{background-color:red;}";
$css .=
"body {background-color:white;margin:0;padding:1em;}";
$css .=
"div{float:right;margin:0;color:black;}";
$css .=
"div{border-left:1px solid white;border-bottom:1px solid white;}";
$css .=
"h1 {font:normal 1.8em Arial;color:black;margin:0 0 0.3em 0.1em;}";
$css .=
".clear { clear:both; }";
* paints the HTML header and sets up results
echo
"<title>{$title}</title>";
echo
"<style type=\"text/css\">" .
$this->_getCss() .
"</style>";
echo
"<h1>{$title}</h1>";
* places a clearing break below the end of the test nodes
echo
"<br clear=\"all\">";
* paints start tag for div representing a test node
$name =
$node->getName();
$description =
$node->getDescription();
$status =
$node->getStatus();
echo
"<div title=\"$name: $description\" class=\"$status\" style=\"width:{$horiz}%;height:{$vert}%\">";
* paints end tag for test node div
* paints wrapping treemap divs
* @todo how to configure aspect and other parameters?
* divides the test results based on a slice and dice algorithm
* @param TreemapNode $map sorted
* @param boolean $aspect flips the aspect between horizontal and vertical
$divisions =
$map->getSize();
$total =
$map->getTotalSize();
foreach($map->getChildren() as $node) {
$dist =
$node->getTotalSize() /
$total *
100;
$dist =
1 /
$total *
100;
Documentation generated on Sun, 04 May 2008 09:22:20 -0500 by phpDocumentor 1.3.0