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 =)