Exemple #1
0
        for ($k = 0; $k < sizeof($b->node); $k++) {
            $temp -= $b->node[k]->modificationSum;
            //TODO check accuracy of this
            if (log($temp, 2) > $this->minThickness) {
                $b->node[k]->thickness = log($temp, 2);
            } else {
                $b->node[k]->thickness = $this->minThickness;
            }
        }
        $this->branches[] = $b;
        //add this branch to the list
    }
}
$extractor = new Extractor();
//	echo "Time ~ Position: ".$extractor->timePositionRatio."<br />";
$extractor->recBranch("e99cc29");
//echo "Size of branch is: ".sizeof($extractor->branches)."<br />";
//print_r($extractor->branches);
//Traverse the branch data and draw it
echo '<script type="text/javascript" charset="utf-8">
		window.onload = function () {';
echo "var paper = Raphael(\"chart\", {$extractor->canvasW}, {$extractor->canvasH});\n";
echo "var color0 = Raphael.getColor();";
echo "paper.path(\"M0,450L 2000,450\").attr({stroke: color0, \"stroke-width\": 20});";
echo "var color1 = Raphael.getColor();\n";
echo 'function curve(x, y, ax, ay, bx, by, zx, zy, thickness, color) {
                    paper.path("M" x, y "C", ax, ay, bx, by, zx, zy").attr({stroke: color, "stroke-width": thickness});
}';
for ($i = 0; $i < sizeof($extractor->branches); $i++) {
    //$s=sizeof($extractor->branches[$i]->node);
    //echo "<b>New Branch [$i] size: $s</b><br />";