http://www.perlmonks.org?node_id=920808


in reply to Re^4: Bucketing,Slicing and Reporting data across multiple dimensions
in thread Bucketing,Slicing and Reporting data across multiple dimensions

maybe the idea of a %colorhash could be refined... I'm thinking that there is not a good way to indicate a range as a key

my $color = "lightgrey"; while (<DATA>) # chomp and split next if (impact = 0); $plot->add_node($idname, label => $idname"); # parent node if ($impact in range(1..10){ $plot->add_edge($idname => $fooname, color => "darkblue"); } elsif ($impact in range(11..30){ $plot->add_edge($idname => $fooname, color => "blue"); } elsif ($impact in range(31..50){ $plot->add_edge($idname => $fooname, color => "cyan"); } # etc ... else { $plot->add_edge($idname => $fooname, color => "red"); } } # we close the while loop # and create the plot...

we can choose a range of custom colors from blue to red, white to black or something like this. And we could also wish to ignore all nodes with an impact of, for example, <40

The final plot will be typically very big, thus to ignore some low impact nodes can be a good idea

For the same reason a vector (svg) file is a good output extension. pdf is also good, you can zoom it a selection a lot, but you will need to convert an eps to a pdf, and can get lost in the process.

Of course, there are caveats: The big files with thousands of nodes are always a little problematic creature for viewing purposes, I really wish to be able to fit all the scaled plot in the firefox or inkscape screen

And you need always a lot of patience when you try to create a plot like this. It takes some time to compile, (in fact can take a LOT of time with big node nets) but we can't be very fussy when we try to push thousands of nodes connected by thousands of lines in a single plot