Skip Menu |

This queue is for tickets about the GraphViz2 CPAN distribution.

Report information
The Basics
Id: 85976
Status: resolved
Worked: 4 hours (240 min)
Priority: 0/
Queue: GraphViz2

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.09
Fixed in: (no value)



Subject: use of '{}' in node labels in conjunction with arrays not clear:

According do the docus:

o Judicious use of '{' and '}' in the label can make this record appear horizontally or vertically, and even nested

^ While this may be true in the case of  label => $string, it is apparently not true in the case of label => \@array

I've tried everything I can think of:

1. Arrays of arrays (

  ie : label => [  [ 'y' ,  'z' ] , 'c' ] ) , but that only emits   " ARRAY0xDEADBEF | c "

2. Arrays containing nested labels: 

    ie: label => [ '{ a | b }',  'c' ]

But that only emits  \{ a | b \} c  and renders the same as [ '{ a ' , 'b }' , 'c' ]

And it seems that all elements in the passed array are subject to being escaped as such, meaning that if you want deeply-nested records, you'd have to implement them yourself and pass the compiled label directly.

The alternative solutions seem to be either

a) Request some way to turn off the escaping of '{'

b) interpret nested arrays so that

[ [ a , b ], c ]     == '{ a | b } | c '

Something else you may wish to consider adding support for is hashes, and using the hash structure to indicate Label + Port , ie:

label => { 0 => "hello" }

could render as '<0> hello'

label => [ { 0 => 'hello' }, { world => 'bar' } ]

could render as

      '<0> hello | <world> bar'

label => [ { 0 => [ 'hello', 'world' ] }, { world => 'bar' } ]

could render as

  '<0> { hello | world } | <world> bar '

label => [    { 0 => [    {  1 =>  'hello' } , 'world' ] }, { world => 'bar' } ]

could render as

 ' <0> {  <1> hello | world } | <world> bar '

And you could (optionally) extend a similar syntax to the 'from' and 'to' edge components, so

->add_edge( from  => [ bar => 0 ] , to => [ quux => 1 ] )

or something of that nature, and that could be equivalent of doing

  bar:0 -- quux:1  ( route an edge from node 'bar' on port '0' to node 'quux' on port '1' )

^ This would be much preferred imho for creating graphs with port-connected paths, because trying to guess what port number might get assigned to a given label on a different node, so that you can create a path to that port on that node, is a rather convoluted task  =)
 

Subject: Re: [rt.cpan.org #85976] use of '{}' in node labels in conjunction with arrays not clear:
Date: Sun, 09 Jun 2013 10:02:10 +1000
To: bug-GraphViz2 [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Kent Thanx for your email. You've certainly raised some interesting issues. I'll have to think about these, but if I find bugs I'll release fixes of course. On 08/06/13 18:54, Kent Fredric via RT wrote: Show quoted text
> Sat Jun 08 04:54:12 2013: Request 85976 was acted upon. > Transaction: Ticket created by KENTNL > Queue: GraphViz2 > Subject: use of '{}' in node labels in conjunction with arrays not clear: > Broken in: 2.09 > Severity: (no value) > Owner: Nobody > Requestors: KENTNL@cpan.org > Status: new > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=85976> > > > According do the docus: > > o Judicious use of '{' and '}' in the label can make this record appear > horizontally or vertically, and even nested > > ^ While this may be true in the case of label => $string, it is apparently not > true in the case of label => \@array > > I've tried everything I can think of: > > 1. Arrays of arrays ( > > ie : label => [ [ 'y' , 'z' ] , 'c' ] ) , but that only emits " ARRAY0xDEADBEF > | c " > > 2. Arrays containing nested labels: > > ie: label => [ '{ a | b }', 'c' ] > > But that only emits \{ a | b \} c and renders the same as [ '{ a ' , 'b }' , > 'c' ] > > And it seems that all elements in the passed array are subject to being escaped > as such, meaning that if you want deeply-nested records, you'd have to > implement them yourself and pass the compiled label directly. > > The alternative solutions seem to be either > > a) Request some way to turn off the escaping of '{' > > b) interpret nested arrays so that > > [ [ a , b ], c ] == '{ a | b } | c ' > > Something else you may wish to consider adding support for is hashes, and using > the hash structure to indicate Label + Port , ie: > > label => { 0 => "hello" } > > could render as '<0> hello' > > label => [ { 0 => 'hello' }, { world => 'bar' } ] > > could render as > > '<0> hello |<world> bar' > > label => [ { 0 => [ 'hello', 'world' ] }, { world => 'bar' } ] > > could render as > > '<0> { hello | world } |<world> bar ' > > label => [ { 0 => [ { 1 => 'hello' } , 'world' ] }, { world => 'bar' } ] > > could render as > > '<0> {<1> hello | world } |<world> bar ' > > And you could (optionally) extend a similar syntax to the 'from' and 'to' edge > components, so > > ->add_edge( from => [ bar => 0 ] , to => [ quux => 1 ] ) > > or something of that nature, and that could be equivalent of doing > > bar:0 -- quux:1 ( route an edge from node 'bar' on port '0' to node 'quux' on > port '1' ) > > ^ This would be much preferred imho for creating graphs with port-connected > paths, because trying to guess what port number might get assigned to a given > label on a different node, so that you can create a path to that port on that > node, is a rather convoluted task =) >
-- Ron Savage http://savage.net.au/ Ph: 0421 920 622
Subject: Re: [rt.cpan.org #85976] use of '{}' in node labels in conjunction with arrays not clear:
Date: Fri, 21 Jun 2013 15:46:42 +1000
To: bug-GraphViz2 [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Kent OK. Your suggestions are now top of the TODO list :-). On 08/06/13 18:54, Kent Fredric via RT wrote: Show quoted text
> Sat Jun 08 04:54:12 2013: Request 85976 was acted upon. > Transaction: Ticket created by KENTNL > Queue: GraphViz2 > Subject: use of '{}' in node labels in conjunction with arrays not clear: > Broken in: 2.09 > Severity: (no value) > Owner: Nobody > Requestors: KENTNL@cpan.org > Status: new > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=85976> > > > According do the docus: > > o Judicious use of '{' and '}' in the label can make this record appear > horizontally or vertically, and even nested > > ^ While this may be true in the case of label => $string, it is apparently not > true in the case of label => \@array > > I've tried everything I can think of: > > 1. Arrays of arrays ( > > ie : label => [ [ 'y' , 'z' ] , 'c' ] ) , but that only emits " ARRAY0xDEADBEF > | c " > > 2. Arrays containing nested labels: > > ie: label => [ '{ a | b }', 'c' ] > > But that only emits \{ a | b \} c and renders the same as [ '{ a ' , 'b }' , > 'c' ] > > And it seems that all elements in the passed array are subject to being escaped > as such, meaning that if you want deeply-nested records, you'd have to > implement them yourself and pass the compiled label directly. > > The alternative solutions seem to be either > > a) Request some way to turn off the escaping of '{' > > b) interpret nested arrays so that > > [ [ a , b ], c ] == '{ a | b } | c ' > > Something else you may wish to consider adding support for is hashes, and using > the hash structure to indicate Label + Port , ie: > > label => { 0 => "hello" } > > could render as '<0> hello' > > label => [ { 0 => 'hello' }, { world => 'bar' } ] > > could render as > > '<0> hello |<world> bar' > > label => [ { 0 => [ 'hello', 'world' ] }, { world => 'bar' } ] > > could render as > > '<0> { hello | world } |<world> bar ' > > label => [ { 0 => [ { 1 => 'hello' } , 'world' ] }, { world => 'bar' } ] > > could render as > > '<0> {<1> hello | world } |<world> bar ' > > And you could (optionally) extend a similar syntax to the 'from' and 'to' edge > components, so > > ->add_edge( from => [ bar => 0 ] , to => [ quux => 1 ] ) > > or something of that nature, and that could be equivalent of doing > > bar:0 -- quux:1 ( route an edge from node 'bar' on port '0' to node 'quux' on > port '1' ) > > ^ This would be much preferred imho for creating graphs with port-connected > paths, because trying to guess what port number might get assigned to a given > label on a different node, so that you can create a path to that port on that > node, is a rather convoluted task =) >
-- Ron Savage http://savage.net.au/ Ph: 0421 920 622
Hi Kent These issues have been addressed in V 2.10. $many x $thanx;