MOTHBALLED-graphviz
MOTHBALLED-graphviz copied to clipboard
[Neato] neato/circo/twopi lack cluster graphs
Ported Issue from Mantis Original ID: 475 Reported By: Dag Lem
SEVERITY: MINOR Submitted: 2004-09-09 14:05:34
OS: X86-LINUX-2.4.26 (FEDORA CORE 1)
VERSION: 1.15 2004-09-09
DESCRIPTION
neato/circo/twopi don't display cluster graphs.
dotneato/neato -Tpng test.dot > test.png
STEPS TO REPRODUCE
graph test { node [shape=plaintext]; edge [dir=none];
A -- B;
subgraph clusterA { A; }
subgraph clusterB { B; }
}
ADDITIONAL INFORMATION
[erg] Correct. In fact, by their nature, it's not clear how well clusters would work in twopi and circo. However, we do now provide fdp, which gives neato-like layouts and allows clusters.
fdp allows cluster / subgraphs, but only if each node is in at most one subgraph. dot can render a graph where a node is in two subgraphs.
I don’t believe dot is able to do that.
On Feb 6, 2020, at 3:29 AM, skorsky [email protected] wrote:
fdp allows cluster / subgraphs, but only if each node is in at most one subgraph. dot can render a graph where a node is in two subgraphs.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
On 2/6/20 10:40 PM, Stephen North wrote:
I don’t believe dot is able to do that.
On Feb 6, 2020, at 3:29 AM, skorsky [email protected] wrote:
fdp allows cluster / subgraphs, but only if each node is in at most one subgraph. dot can render a graph where a node is in two subgraphs.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ellson/MOTHBALLED-graphviz/issues/1057?email_source=notifications&email_token=ABKP6MRDGLMSAAEU6ZHSHOLRBTJ3RA5CNFSM4CISXKO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELBTWPA#issuecomment-583220028, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKP6MUW34J325FW5HHZWKDRBTJ3RANCNFSM4CISXKOQ.
Both dot and fdp work the same as regards clusters. A node can be in multiple clusters as long as the clusters nest. I assume that is what is relevant here. In general, subgraphs have a variety of uses and nodes can occur in multiple subgraphs. See the Subgraphs and Clusters section in the language documentation. https://graphviz.gitlab.io/_pages/doc/info/lang.html
Emden
I have a small test-example:
digraph g1 {
name="testSubgraph"
x1
x2
y1
y2
subgraph cluster_1 { label="cluster 1"
x1 -> x2
}
subgraph cluster_2 { label="cluster 2"
y1 -> y2
y1 -> x2
}
}
With fdp test-subgraphs.dot -o test-subgraphs-fdp.dot I get:
Error: node "x2" is contained in two non-comparable clusters "cluster_2" and "cluster_1"
With dot test-subgraphs.dot -o test-subgraphs-dot.dot I get the expected diagram.
On 2/10/20 4:16 AM, skorsky wrote:
With |dot test-subgraphs.dot -o test-subgraphs-dot.dot| I get the expected diagram. No, you don't. The expected diagram would have x2 in both clusters and the edge y1 -> x2 totally within cluster 2. Another way to look at this is you would expect the drawings to be topologically the same regardless of the order in which the two clusters appear. But if you flip the cluster order, you get totally different abstract graphs. I recall we fixed the code to warn about this. Whether it was only a partial fix or the fix was removed, I don't know.
Emden | |
Yes,, changing the order of the subgraph definitions changes the layout drastically. But the graph G = (V, E) does not change. That's what I expect. I'd not expect that x2 in my example occurs in poth subgraphs. I use subgraphs or clusters as a layout constraint but not to define vertices V and edges E.
On 2/13/20 3:08 AM, skorsky wrote:
Yes,, changing the order of the subgraph definitions changes the layout drastically. But the graph G = (V, E) does not change. That's what I expect. I'd not expect that x2 in my example occurs in poth subgraphs. I use subgraphs or clusters as a layout constraint but not to define vertices V and edges E.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ellson/MOTHBALLED-graphviz/issues/1057?email_source=notifications&email_token=ABKP6MXQVB26ZEDJA5L3O3DRCT5XNA5CNFSM4CISXKO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELTZLSQ#issuecomment-585602506, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKP6MUMKMAR7HRGG7CYTQ3RCT5XNANCNFSM4CISXKOQ.
I'm not entirely sure what you mean by using clusters as a layout constraint. For Graphviz, this is well-defined if supported. If a node or edge appears in a cluster in the input graph, it will appear inside the cluster in the drawing. Indeed, dot and fdp support the richer graph model G = (V,E,C) of compound graphs, where C is a forest of rooted trees whose vertices are subsets of V and an edge implies subset inclusion. E is a subset of V' x V' where V' is V union C. For drawings of such graphs to not get bogged down in the complexity of Euler diagrams, Graphviz requires that C is a forest, i.e., if a vertex appears in two clusters, one cluster must include other. (Technically, dot only supports clustered graphs, which disallows edges with cluster endpoints.)
Note that this constraint does not apply to general subgraphs.
Emden
Thanks for the clarification with the compound graphs. For my task I have to look for a different solution which avoids cluster subgraphs.
On 2/19/20 3:31 AM, skorsky wrote:
Thanks for the clarification with the compound graphs. For my task I have to look for a different solution which avoids cluster subgraphs. Can you describe what you are trying to do? We might be able to suggest something.
Emden