/usr/share/perl5/graphincludes/renderer/tulip.pm is in libdeps-renderer-tulip-perl 0.13-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | # This file is part of the DEPS/graph-includes package
#
# (c) 2005,2006 Yann Dirson <ydirson@altern.org>
# Distributed under version 2 of the GNU GPL.
package graphincludes::renderer::tulip;
use warnings;
use strict;
use base qw(graphincludes::renderer);
use Hash::Util qw(lock_keys);
use graphincludes::params;
sub new {
my $class = shift;
my $self = {};
bless ($self, $class);
lock_keys (%$self);
return $self;
}
sub printgraph {
my $self = shift;
my ($graphnode, $nodestylers, $edgestylers) = @_;
my $graph = eval { defined $graphnode->{DATA} } ? $graphnode->{DATA} : $graphnode;
# give unique numeric IDs to nodes, starting at 1
my $nodecount = 0;
my %nodeids;
foreach my $node ($graph->get_nodes) {
my $label = $node->{LABEL};
unless (defined $nodeids{$label}) {
$nodecount++;
$nodeids{$label} = $nodecount;
}
}
# declare nodes
print '(nodes';
for (my $i=1; $i<=$nodecount; $i++) {
print " ", $i;
}
print ")\n";
# set node labels
print "(property 0 string \"viewLabel\"\n";
print " (default \"\" \"\" )\n";
foreach my $node (keys %nodeids) {
print " (node $nodeids{$node} \"$node\")\n";
}
print ")\n";
# simple edges
my $edgecount = 0;
foreach my $file ($graph->get_edge_origins) {
foreach my $dest ($graph->get_dep_names_from($file)) {
$edgecount++;
print "(edge $edgecount ", $nodeids{$file}, ' ', $nodeids{$dest}, ")\n";
}
}
}
sub wait {
}
1;
|