]> granicus.if.org Git - graphviz/commitdiff
support normal "\N" "\E" "\G" substitutions on externally provided ids.
authorellson <devnull@localhost>
Sun, 21 Sep 2008 03:49:25 +0000 (03:49 +0000)
committerellson <devnull@localhost>
Sun, 21 Sep 2008 03:49:25 +0000 (03:49 +0000)
doc/infosrc/attrs
doc/infosrc/output.2
lib/common/emit.c

index 610ac3edefc05b965d56a24277acb6c8008eec3c..a902808dc202ec54ec70a9659571da56772d3481 100644 (file)
@@ -355,10 +355,12 @@ value given to <B>height</B> will be the final value.
 Synonym for <A HREF=#d:URL>URL</A>.
 :id:GNE:lblString:"";  map,ps,svg
 Allows the graph author to provide an id for graph objects which is to be included in the output.
-If no id is provided, then the internal id is used in the outputs, however this value is unpredictable by the graph writer.
-An externally provided id is not used internally.
+Normal "\N", "\E", "\G" substitutions are applied.
 If provided, it is the reponsiblity of the provider to keep
 its values sufficiently unique for its intended downstream use.
+Note, in particular, that "\E" does not provide a unique id for multi-edges.
+If no id attribute is provided, then a unique internal id is used, however this value is unpredictable by the graph writer.
+An externally provided id is not used internally.
 :image:N:string:"";
 Gives the name of a file containing an image to be displayed inside
 a node. The image file must be in one of the recognized formats,
index 7d99512a0048c13dd704b707bbe54dcb1de21baf..d573e74b9f4b8814fc690c7ca0f1626d6aa4cd36 100644 (file)
@@ -4,7 +4,9 @@
 <OL TYPE="1">
 <LI>
 <A NAME=ID>In the formats: -Tcmap, -Tcmapx, -Tsvg, -Tvml, the output generates
-'id="node#"' properties for nodes, 'id="edge#"' properties for edges, and 'id="cluster#"' properties for clusters, with the '#' replaced by an internally assigned integer. These strings can be provided instead by an "id=xxx" attribute on the object.
-Externally provided id values are not used internally, but it is the users reponsibilty to ensure
-that they are sufficiently unique for any downstream use.
+'id="node#"' properties for nodes, 'id="edge#"' properties for edges, and 'id="cluster#"' properties for clusters, with the '#' replaced by an internally assigned integer. These strings can be provided instead by an externally provided "id=xxx" attribute on the object.
+Normal "\N" "\E" "\G" substitutions are applied.
+Externally provided id values are not used internally, and it is the use's reponsibilty to ensure
+that they are sufficiently unique for their intended downstream use.
+Note, in particular, that "\E" is not a unique id for multiedges.
 </OL>
index 3c49fbc9008d5ff387dccaa22d5e8f6dbc3ef099..fd6febf3f7c87ae2cfb679c099681943368b5c84 100644 (file)
@@ -105,7 +105,7 @@ initMapData (GVJ_t* job, char* lbl, char* url, char* tooltip, char* target, char
     if ((flags & GVRENDER_DOES_LABELS) && lbl)
         obj->label = lbl;
     if (flags & GVRENDER_DOES_MAPS) {
-        obj->id = strdup(id);
+        obj->id = strdup_and_subst_obj(id, gobj);
        if (url && url[0]) {
             obj->url = strdup_and_subst_obj(url, gobj);
            assigned = 1;
@@ -1564,7 +1564,7 @@ static void emit_begin_edge(GVJ_t * job, edge_t * e, char** styles)
            sprintf(buf,"edge%d", e->id);
            s = buf;
         }
-       obj->id = strdup(s);
+       obj->id = strdup_and_subst_obj(s, (void*)e);
         if (((s = agget(e, "href")) && s[0]) || ((s = agget(e, "URL")) && s[0]))
             dflt_url = strdup_and_subst_obj(s, (void*)e);
        if (((s = agget(e, "edgehref")) && s[0]) || ((s = agget(e, "edgeURL")) && s[0]))