Hi Kevin
What you want is already possible! Run the code below both with and
without the call to $parser -> graph(...) and view the output. You'll
need to set $ENV{DR} first. For me, $DR points to my nginx Doc Root,
/run/shm/html, i.e. the place in Debian's RAM disk where I have my web
site. You could try setting it to '.', say.
The reason you can't do it the way you were thinking is that the call to
GraphViz2::Parse::ISA -> new creates an instance of GraphViz2, and
within the sub BUILD() of GraphViz2, the code starts to output DOT
commands, including setting the directedness. So, I've circumvented that
by generating a GraphViz2 object before instantiating a
GraphViz2::Parse::ISA object.
#!/usr/bin/env perl
use 5.018;
use feature 'say';
use strict;
use warnings;
use GraphViz;
use GraphViz2::Parse::ISA;
# -----------------
my($graph) = GraphViz2 -> new
(
edge => {color => 'grey'},
global => {directed => 0}, # Was 1.
graph => {rankdir => 'BT'},
logger => '',
node => {color => 'red', shape => 'Mrecord'}, # Was blue.
);
my($parser) = GraphViz2::Parse::ISA -> new(graph => $graph);
$parser -> add(class => 'GraphViz2::Parse::ISA');
my($graph) = $parser -> generate_graph;
$graph -> run(format => 'svg', output_file => "$ENV{DR}/x.svg");
On 13/05/17 12:00, Kevin Ryde via RT wrote:
Show quoted text> Queue: GraphViz2
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=121600 >
>
> "RSAVAGE via RT" <bug-GraphViz2@rt.cpan.org> writes:
>>
>> The problem of course is whether or
>> not I should add a method for every possible such attribute, and I
>> really don't like that idea.
>
> What about a default_global() in the style of default_graph()?
> But perhaps I misunderstand what default_graph() quite means.
>
--
Ron Savage - savage.net.au