Skip Menu |

This queue is for tickets about the GraphViz CPAN distribution.

Report information
The Basics
Id: 24272
Status: resolved
Priority: 0/
Queue: GraphViz

People
Owner: Nobody in particular
Requestors: T.J.Adye [...] rl.ac.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.02
Fixed in: (no value)



Subject: add_node does not format record shape when defaulted
When the default node shape is specified as 'record' with GraphViz->new(node => {shape => 'record'}); then the label text is not formatted into sub-boxes according to the "{A|B}" syntax. This does work if the shape is specified directly in the add_node method. This bug causes schema graphs produced by SQL::Translator::Producer::GraphViz to be incorrectly formatted. The attached patch fixes the problem. (Linux 2.4.21-47.EL, perl 5.0.8, GraphViz-2.02)
Subject: GraphViz-2.02-1.patch
diff -ur GraphViz-2.02-orig/lib/GraphViz.pm GraphViz-2.02/lib/GraphViz.pm --- GraphViz-2.02-orig/lib/GraphViz.pm 2005-01-07 18:24:54.000000000 +0000 +++ GraphViz-2.02/lib/GraphViz.pm 2007-01-04 18:28:36.000000000 +0000 @@ -534,6 +534,7 @@ } $node = \%node; } + $node->{$_}= $self->{NODE_ATTRS}{$_} for (keys %{$self->{NODE_ATTRS}}); $self->add_node_munge($node) if $self->can('add_node_munge');
From: T.J.Adye [...] rl.ac.uk
Sorry, I attached the wrong patch. Use this one instead.
diff -ur GraphViz-2.02-orig/lib/GraphViz.pm GraphViz-2.02/lib/GraphViz.pm --- GraphViz-2.02-orig/lib/GraphViz.pm 2005-01-07 18:24:54.000000000 +0000 +++ GraphViz-2.02/lib/GraphViz.pm 2007-01-08 17:13:24.000000000 +0000 @@ -534,6 +534,10 @@ } $node = \%node; } + for my $attr (keys %{$self->{NODE_ATTRS}}) { + $node->{$attr}= $self->{NODE_ATTRS}{$attr} + unless exists $node->{$attr}; + } $self->add_node_munge($node) if $self->can('add_node_munge');
From: T.J.Adye [...] rl.ac.uk
and, of course, I'm using perl 5.8.0 (not 5.0.8)!
This issue is fixed in GraphViz2 V 1.00. There're won't be any further development on GraphViz. At least, this code has been rewritten, so if there is still a problem, please let me (Ron) know.