Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^3: Bucketing,Slicing and Reporting data across multiple dimensions

by pvaldes (Chaplain)
on Aug 17, 2011 at 20:22 UTC ( #920786=note: print w/replies, xml ) Need Help??

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

Still too abstract to me, but I think that when you say impact quantification you say: the last column number
use GraphViz; open DATA, "<", "/my/data"; my $plot = GraphViz->new( layout => 'dot', # <--or neato, or circo etc node => {height => '0.05', shape => 'box',fontsize => '11', fontname = +> 'Times-Roman', style=>'filled', color=>'lightgray'}, bgcolor=> 'white', center=> 'true', dpi=> '1800', #resolution of the graph, higher = sloower ... more general parameters following here... ); while (<DATA>){ my ($idname, $fooname, $blah, $blah2, $impact) = split //,$_, 5 # spli +t ID in fields next if $impact = 0 # no impact between tests, so we discard this id-> +foo node $plot->add_node($idname, label => "$idname"); #create parent node $plot->add_edge($idname => $fooname, size => $impact) # trace an arrow + from to each id to its foo #i don't remember if size is valid, but instead you could use better +the tag color => $mycolor The goal with this is that you can create easily a customized %colorha +sh (when key = impact and value is a custom color... you can have mor +e, less hot, more blue, more red... for any impact range } # whe close while loop # and we print the plot to a svg file, or gv, or png, or txt... svg fi +le looks reasonably good in a browser and you can zoom it a loot $plot->as_svg("my_big_plot.svg"); system("iceweasel my_big_plot.svg");

something like this, I warn you that in real life this is not so simple and this is only an skeleton and WILL fail for sure until you work and tune this a little, but you can explore this idea in any case, specially if you feel comfortable with dot files.

  • Comment on Re^3: Bucketing,Slicing and Reporting data across multiple dimensions
  • Download Code

Replies are listed 'Best First'.
Re^4: Bucketing,Slicing and Reporting data across multiple dimensions
by Voronich (Hermit) on Aug 17, 2011 at 20:36 UTC

    hey thanks very much. I'm sufficiently familiar with dot files from Doxygen in my C++ stuff, so this isn't going to be SO out there. I'll definitely pick this up, noodle with it and let you know how it goes. o/

    UPDATE:Yes, the last column is just the difference between the two test runs (the previous two columns) so it measure the impact of the other changes that were made between the baseline and the test.

      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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://920786]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2017-05-27 18:19 GMT
Find Nodes?
    Voting Booth?