diagrams icon indicating copy to clipboard operation
diagrams copied to clipboard

Subgraphs, Rank, and Samehead

Open dlamblin opened this issue 1 year ago • 1 comments

Could you provide some examples of how this grammar supports subgraphs which aren't clusters, ranks of nodes being set to the same rank, and edges that have samehead or sametail set? I can't seem to use these features of graphviz.

dlamblin avatar Aug 29 '23 21:08 dlamblin

Well, I could use nodeA >> Edge(sametail="at") >> [nodeB, nodeC]. But: https://gitlab.com/graphviz/graphviz/-/issues/1856 means it doesn't render for splines=ortho

I also think that:

  1. __curvestyles = ("ortho", "curved") should be __curvestyles = ("ortho", "curved", "", "none", "spline", "true", "false", "line", "polyline")
  2. Cluster's __init__'s graph_attr should be **graph_attr or just **attr like the Node and Edge classes.
  3. Cluster's self.name = "cluster_" + self.label should be self.name = nodeid or uuid.uuid4().hex.
  4. _default_graph_attrs should include "cluster": "true", if the __init__ doesn't have any special subgraph vs cluster boolean argument.
  5. **attrs: Dict would likely work better as **attrs: str in most places.
  6. I'm not sure if there's something that would make node1 >> node2 - node3 work. Probably, since node1>>node2;node2-node3 works.

I had some difficulty trying to add a few multi-line labels using html formatting, as then the node sizes blew up vertically, and many labels expanded horizontally outside their node which looks bad in colored clusters. Trying to address this with fixedsize as false scaled the images up, In a number of cases, like a mysql node, the label wasn't clearly under the image when fixedsize was true. These are likely less to do with this codebase, though maybe, having all the resource png files the exact same size, dpi, etc could allow them to be place in html table specifications for nodes instead and optionally badge a shape rather than replace a shape? I actually don't know exactly… I am just variously disappointed by my attempts to apply rank=source or rank=sink to a subgraph only to find those cannot apparently contain clusters themselves. And the issue around ortho lines.

dlamblin avatar Aug 30 '23 22:08 dlamblin