Bug#737781: [PATCH 1/3] Honour edge attributes `style', `label', `color': pass them to graphviz.

Ian Jackson ijackson at chiark.greenend.org.uk
Fri Feb 7 17:59:59 UTC 2014


Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
---
 lib/Graph/Writer/GraphViz.pm |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/Graph/Writer/GraphViz.pm b/lib/Graph/Writer/GraphViz.pm
index 8302354..bbdcb22 100644
--- a/lib/Graph/Writer/GraphViz.pm
+++ b/lib/Graph/Writer/GraphViz.pm
@@ -81,6 +81,12 @@ sub add_edges {
 	    my $w = $g->get_edge_weight($a,$b);
 	    $param{weight} = $w;
 	}
+        for my $attr (qw/style label color/) {
+            if($g->has_edge_attribute($a,$b,$attr)) {
+                my $w = $g->get_edge_attribute($a,$b,$attr);
+                $param{$attr} = $w;
+            }
+        }
 	$r->add_edge($a,$b,%param);
     }
 }
-- 
1.7.10.4



More information about the pkg-perl-maintainers mailing list