-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot figure out alignment order - Help Needed #243
Comments
You need to change the "layout" engine to either "neato" or "fdp", then for each see: https://graphviz.gitlab.io/doc/info/attrs.html#d:pos Note: I also set "splines" to "spline" instead of the default "ortho". from diagrams import Diagram, Edge, Node
graph_attr = {
"splines":"spline",
"layout":"neato",
}
with Diagram("\n\nInfra", show=False, graph_attr=graph_attr) as diag:
node_shape = "invtrapezium"
label_loc = "c"
with Cluster("1"):
A = Node("A", shape=node_shape, labelloc=label_loc, pin="true", pos="0,1")
B = Node("B", shape=node_shape, labelloc=label_loc, pin="true", pos="2,0")
C = Node("C", shape=node_shape, labelloc=label_loc, pin="true", pos="2,2")
with Cluster("2"):
D = Node("D", shape=node_shape, labelloc=label_loc, pin="true", pos="4,1")
E = Node("E", shape=node_shape, labelloc=label_loc, pin="true", pos="6,0")
F = Node("F", shape=node_shape, labelloc=label_loc, pin="true", pos="6,2")
with Cluster("3"):
G = Node("G", shape=node_shape, labelloc=label_loc, pin="true", pos="8,0")
H = Node("H", shape=node_shape, labelloc=label_loc, pin="true", pos="8,2")
A >> [B, C]
[B, C] >> D
D >> [E, F]
E >> G
F >> H
diag Output: |
@AdrianSimionov from diagrams import Diagram, Cluster
from diagrams.aws.storage import S3
graph_attr = {
"bgcolor": "transparent",
"dpi": "192"
}
root_clus_attr = {
"bgcolor": "transparent",
"pencolor":"transparent",
}
with Diagram("Infra", show=False, graph_attr=graph_attr) as diag:
with Cluster("", graph_attr=root_clus_attr):
with Cluster("1"):
A = S3("A")
B = S3("B")
C = S3("C")
with Cluster("2"):
D = S3("D")
E = S3("E")
F = S3("F")
with Cluster("3"):
G = S3("G")
H = S3("H")
A >> [B, C]
[B, C] >> D
D >> [E, F]
E >> G
F >> H
diag |
With the below code, I am trying to figure out the following:
I personally believe there is not enough documentation to explain this behaviour, and I realised looking at older bug reports that it has to do with the way edge connections are defined.
The text was updated successfully, but these errors were encountered: