News regarding GraphViz2

Ed J has taken over maintenance of my suite of GraphViz2 modules.

The first change has been to split it into multiple distros, so that anyone using just GraphViz2 will have a much smaller download and only 6 pre-reqs.

Another change is to rework the decision, which I copied from the original, and which meant nodes and port names were joined with a colon. For e.g. MS Windows users wanting to represent disk names like C:, this is clearly problematic.

There is a new option combine_node_and_port, which defaults to true but in May 2021 or so will switch to defaulting to false. When true, the current problematic behaviour occurs. When false, more DWIM-ish behaviour happens:

my $gv = GraphViz2->new(global => {combine_node_and_port => 0});

$gv->add_node(name => 'struct3', shape => 'record', label => [
   { text => "hello\\nworld" },
     { text => 'b' },
       { text => 'c{}' }, # reproduced literally
       { text => 'd', port => 'here' },
       { text => 'e' },
     { text => 'f' },
   { text => 'g' },
   { text => 'h' },

$gv->add_edge(from => 'c:\\autoexec.bat', to => 'struct3',
  headport => 'here');

Also, Ed will in due course be introducing an internal object based on the Graph module, as a way of storing nodes etc. For all users who have not made assumptions about the internal storage (hint, hint), there should be no visible changes.

Leave a comment

About Ron Savage

user-pic I try to write all code in Perl, but find I end up writing in bash, CSS, HTML, JS, and SQL, and doing database design, just to get anything done...