Subject: | HTML::InfoVis::Graph->new() documentation not clear |
Date: | Sat, 28 Jan 2012 11:48:02 +0100 |
To: | bug-HTML-InfoVis [...] rt.cpan.org |
From: | Alberto <macros123 [...] gmail.com> |
HTML-InfoVis-0.02
This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi
Linux 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686
GNU/Linux
As per documentation
http://search.cpan.org/~adamk/HTML-InfoVis-0.02/lib/HTML/InfoVis/Graph.pm#new
,
I would expect the constructor to accept an optional existing graph
structure object.
my $graph = HTML::InfoVis::Graph->new(
Graph->new,
);
That is true only if you pass a named param like:
my $json_graph = HTML::InfoVis::Graph->new(graph => $g,);
Indeed looking at HTML/InfoVis/Graph.pm
55 sub new {
56 my $class = shift;
57 my $self = bless { @_ }, $class;
58 unless ( defined $self->{graph} ) {
59 $self->{graph} = Graph->new;
60 }
61 return $self;
62 }
My proposal is just to clarify the documentation.
Best regards,
--
Alberto Cerato