1 # This file is part of the DEPS/graph-includes package
3 # (c) 2005,2006 Yann Dirson <ydirson@altern.org>
4 # Distributed under version 2 of the GNU GPL.
6 package graphincludes
::renderer
::tulip
;
11 use base
qw(graphincludes::renderer);
12 use Hash
::Util
qw(lock_keys);
14 use graphincludes
::params
;
20 bless ($self, $class);
27 my ($graph, $nodestylers, $edgestylers) = @_;
29 # give unique numeric IDs to nodes, starting at 1
34 foreach my $node ($graph->get_nodes) {
35 my $label = $node->{LABEL
};
36 unless (defined $nodeids{$label}) {
38 $nodeids{$label} = $nodecount;
45 for (my $i=1; $i<=$nodecount; $i++) {
52 print "(property 0 string \"viewLabel\"\n";
53 print " (default \"\" \"\" )\n";
54 foreach my $node (keys %nodeids) {
55 print " (node $nodeids{$node} \"$node\")\n";
64 foreach my $file ($graph->get_edge_origins) {
65 foreach my $dest ($graph->get_dep_names_from($file)) {
67 print "(edge $edgecount ", $nodeids{$file}, ' ', $nodeids{$dest}, ")\n";