diagrams
diagrams copied to clipboard
Subgraphs, Rank, and Samehead
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.
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:
-
__curvestyles = ("ortho", "curved")
should be__curvestyles = ("ortho", "curved", "", "none", "spline", "true", "false", "line", "polyline")
-
Cluster
's__init__
'sgraph_attr
should be**graph_attr
or just**attr
like theNode
andEdge
classes. -
Cluster
'sself.name = "cluster_" + self.label
should beself.name = nodeid or uuid.uuid4().hex
. -
_default_graph_attrs
should include"cluster": "true",
if the__init__
doesn't have any special subgraph vs cluster boolean argument. -
**attrs: Dict
would likely work better as**attrs: str
in most places. - I'm not sure if there's something that would make
node1 >> node2 - node3
work. Probably, sincenode1>>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.