.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SVG::TT::Graph::HeatMap 3pm" .TH SVG::TT::Graph::HeatMap 3pm "2020-02-07" "perl v5.30.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" SVG::TT::Graph::HeatMap \- Create presentation quality SVG HeatMap graph of XYZ data points easily .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use SVG::TT::Graph::HeatMap; \& \& my @data_cpu = ( \& { x => x_point1, \& y_point1 => 10, \& y_point2 => 200, \& y_point3 => 1000, \& }, \& { x => x_point2, \& y_point1 => 100, \& y_point2 => 400, \& y_point3 => 500, \& }, \& { x => x_point3, \& y_point1 => 1000, \& y_point2 => 600, \& y_point3 => 0, \& }, \& ); \& \& my $graph = SVG::TT::Graph::HeatMap\->new( \& { block_height => 24, \& block_width => 24, \& gutter_width => 1, \& } ); \& \& $graph\->add_data( \& { \*(Aqdata\*(Aq => \e@data_cpu, \& \*(Aqtitle\*(Aq => \*(AqCPU\*(Aq, \& } ); \& \& print "Content\-type: image/svg+xml\en\en"; \& print $graph\->burn(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This object aims to allow you to easily create high quality \&\s-1SVG\s0 HeatMap graphs of \s-1XYZ\s0 data. You can either use the default style sheet or supply your own. .PP Please note, the height and width of the final image is computed from the size of the labels, block_height/block_with and gutter_size. .SH "METHODS" .IX Header "METHODS" .SS "\fBnew()\fP" .IX Subsection "new()" .Vb 1 \& use SVG::TT::Graph::HeatMap; \& \& my $graph = SVG::TT::Graph::HeatMap\->new({ \& \& # Optional \- defaults shown \& block_height => 24, \& block_width => 24, \& gutter_width => 1, \& \& \*(Aqy_axis_order\*(Aq => [], \& }); .Ve .PP The constructor takes a hash reference with values defaulted to those shown above \- with the exception of style_sheet which defaults to using the internal style sheet. .SS "\fBadd_data()\fP" .IX Subsection "add_data()" .Vb 10 \& my @data_cpu = ( \& { x => x_point1, \& y_point1 => 10, \& y_point2 => 200, \& y_point3 => 1000, \& }, \& { x => x_point2, \& y_point1 => 100, \& y_point2 => 400, \& y_point3 => 500, \& }, \& { x => x_point3, \& y_point1 => 1000, \& y_point2 => 600, \& y_point3 => 0, \& }, \& ); \& or \& \& my @data_cpu = ( [\*(Aqx\*(Aq, \*(Aqy_point1\*(Aq, \*(Aqy_point2\*(Aq, \*(Aqy_point3\*(Aq], \& [\*(Aqx_point1\*(Aq, 10, 200, 5], \& [\*(Aqx_point2\*(Aq, 100, 400, 1000], \& [\*(Aqx_point3\*(Aq, 1000, 600, 0], \& ); \& \& $graph\->add_data({ \& \*(Aqdata\*(Aq => \e@data_cpu, \& \*(Aqtitle\*(Aq => \*(AqCPU\*(Aq, \& }); .Ve .PP This method allows you to add data to the graph object. The data are expected to be either a array of hashes or as a 2D matrix (array of arrays), with the Y\-axis as the first arrayref, and the X\-axis values in the first element of subsequent arrayrefs. .SS "\fBclear_data()\fP" .IX Subsection "clear_data()" .Vb 1 \& my $graph\->clear_data(); .Ve .PP This method removes all data from the object so that you can reuse it to create a new graph but with the same config options. .SS "\fBburn()\fP" .IX Subsection "burn()" .Vb 1 \& print $graph\->burn(); .Ve .PP This method processes the template with the data and config which has been set and returns the resulting \s-1SVG.\s0 .PP This method will croak unless at least one data set has been added to the graph object. .SS "config methods" .IX Subsection "config methods" .Vb 2 \& my $value = $graph\->method(); \& my $confirmed_new_value = $graph\->method($value); .Ve .PP The following is a list of the methods which are available to change the config of the graph object after it has been created. .IP "\fBcompress()\fR" 4 .IX Item "compress()" Whether or not to compress the content of the \s-1SVG\s0 file (Compress::Zlib required). .IP "\fBtidy()\fR" 4 .IX Item "tidy()" Whether or not to tidy the content of the \s-1SVG\s0 file (XML::Tidy required). .IP "\fBblock_width()\fR" 4 .IX Item "block_width()" The width of the blocks in px. .IP "\fBblock_height()\fR" 4 .IX Item "block_height()" The height of the blocks in px. .IP "\fBgutter()\fR" 4 .IX Item "gutter()" The space between the blocks in px. .IP "\fBy_axis_order()\fR" 4 .IX Item "y_axis_order()" .Vb 3 \& This is order the columns are presented on the y\-axis, if the data is in a Array of hashes, \& this has to be set, however is the data is in an 2D matrix (array of arrays), it will use \& the order presented in the header array. \& \& If the data is given in a 2D matrix, and the y_axis_order is set, the y_axis_order will take \& prescience. .Ve .SH "EXAMPLES" .IX Header "EXAMPLES" For examples look at the project home page http://leo.cuckoo.org/projects/SVG\-TT\-Graph/ .SH "EXPORT" .IX Header "EXPORT" None by default. .SH "SEE ALSO" .IX Header "SEE ALSO" SVG::TT::Graph, SVG::TT::Graph::Line, SVG::TT::Graph::Bar, SVG::TT::Graph::BarHorizontal, SVG::TT::Graph::BarLine, SVG::TT::Graph::Pie, SVG::TT::Graph::Bubble, Compress::Zlib, XML::Tidy