Re: [graphviz-interest] Using HTML to name a node

"Emden R. Gansner" <[email protected]> Wed, 17 Sep 2014 13:38:07 -0400
Newsgroups gmane.comp.video.graphviz
Message-ID <[email protected]>
On 9/16/14 9:49 PM, Ron Savage wrote:
> This is for dot - graphviz version 2.38.0 (20140413.2041).
>
> I've found an effect which I regard as an anomaly when a HTML label is 
> used to name a node.
>
> Firstly, I think on this page 
> http://www.graphviz.org/content/dot-language at the 1st reference to 
> HTML labels - "an HTML string (<...>)." - there should be a link to 
> this page/anchor http://www.graphviz.org/content/node-shapes#html.
>
This page describes the DOT language, for which an HTML string can be 
any legal XML string and used like any other array of uninterpreted 
bytes. But
I did add a note concerning labels and a link to the more restrictive 
syntax.
> As for the attached, would it make more sense that the name of 
> node_59_1 be rendered as node_59_1 and not as <....>?
For the language and parser, it was simpler to treats strings as 
strings. And we assumed users wanting the special HTML-like labels would
use an HTML string for the label value. So you are touching on a dark, 
unclarified aspect. By default, a node label is "\N", which is replaced 
by the node's name
fairly late during processing. The label is an ordinary string, so it is 
interpreted as an ordinary string, with \N being replaced with the raw 
bytes of the
node's name. So what you are seeing is what would be expected.

One could suggest that we should catch the case of a raw label=\N, 
replace it with an HTML string if that is the node's name, and go on 
from there.
With this interpretation, node node_59_1 would appear like node 
node_59_3. Another alternative is the one you suggest but what happens when
there are multiple text fields?

My feeling is that these last two interpretations aren't that helpful to 
justify the coding changes required, especially in the latter case. My 
inclination would
be to leave things as they are with a comment stressing that, if you 
want an HTML-like label, use an HTML string for the label value.

     Emden

_______________________________________________
[email protected]
http://lists.research.att.com/mailman/listinfo/graphviz-interest