I understand that node ids should be unique within a graphviz (here: dot) file.
However, I wish I could have them be unique within their cluster only, that is, I'd like the following file to produce 4 nodes:
digraph G {
  subgraph cluster_clust_one {
     node [shape=record];
     a [label = "A / 1"];
     b [label = "B / 1"];
     a -> b;
  }
  subgraph cluster_clust_two {
     node [shape=record];
     a [label = "A / 2"];
     b [label = "B / 2"];
     a -> b;
  }
}
However, it doesn't, because the node ids are not unique. Obviously, I can solve this by assigning unique ids, for example by changing cluster_clust_two to
  subgraph cluster_clust_two {
     node [shape=record];
     c [label = "A / 2"];
     d [label = "B / 2"];
     c -> d;
  }
Unfortunately, this would entail changing a script that produces the dot files which I wouldn't want to do if not absolutely necessary. So if there is a flag or something I could set instead, I'd prefer this route.
You could prepend the node name with the name of the cluster like cluster_clust_two__a. It would still mean a change in the generating script.
As far as I know, there is no way to have separate nodes with identical IDs. A sensible workaround was proposed by dgw =)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With