Open xu4wang opened 3 years ago
@xu4wang did you find any solution around this?
not yet... looking forward a solution.
Abhi Ramani notifications@github.com 于 2020年9月12日周六 下午4:50写道:
@xu4wang https://github.com/xu4wang did you find any solution around this?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mingrammer/diagrams/issues/249#issuecomment-691458744, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACMAZKXYUVPWM5KEBW6TL3SFNAAFANCNFSM4P45ONMA .
I need to find a solution to this issue too. Thank you for reporting it.
Hi!, just found this project, (It's really cool). I found a workaround for this issue (while we work out how to do it properly)
I was having exactly the same problem and what I did was to remove the "internal" communication edge between the items causing the problem:
with Cluster("Multitenancy #1"):
odoo1 = Docker("Application #1")
db1 = PostgreSQL("db #1")
# By commenting this out, Postgres and Docker will show Vertically instead
# odoo1 - Edge(color="brown") - db1
Since the arrow goes from the Docker node to the SessionsHA nodes, if we go horizontally as intended, it will have go on top of the Postgres node, and that's why it does this weird rendering.
The ideal solution is to allow Cluster to Cluster arrows, or even Cluster to Node.
Open issues asking for this: https://github.com/mingrammer/diagrams/issues/261 https://github.com/mingrammer/diagrams/issues/128 https://github.com/mingrammer/diagrams/issues/17
Another solution is to use a custom image node (made from another diagram???) that is a combination of docker+postgres?
Best!
EDIT: Attaching demo:
If you don't mind the arrows coming off of your db
s and placing some Custom
transparent 'spacers'.
with Diagram(name=" Architecture", show=False) as diag:
nginx = Nginx("LoadBalancer")
metrics = Prometheus("metric")
metrics << Edge(color="firebrick", style="dashed") << Grafana("monitoring")
with Cluster("Service Cluster"):
with Cluster("Multitenancy #1"):
odoo1 = Docker("Application #1")
db1 = PostgreSQL("db #1")
odoo1 - Edge(color="brown") - db1
with Cluster("Multitenancy #2"):
odoo2 = Docker("Application #2")
db2 = PostgreSQL("db #2")
odoo2 - Edge(color="brown") - db2
with Cluster("Dedicated #3"):
odoo3 = Docker("Application #3")
db3 = PostgreSQL("db #3")
odoo3 - Edge(color="brown") - db3
nginx >> Edge(color="darkgreen") << odoo1
nginx >> Edge(color="darkgreen") << odoo2
nginx >> Edge(color="darkgreen") << odoo3
blank1 = Custom("","transparent.png")
db2 - Edge(penwidth="0.0") - blank1 - Edge(penwidth="0.0") - metrics
with Cluster("Sessions HA"):
master = Redis("session")
replica = Redis("replica")
master - Edge(color="brown", style="dashed") - replica << Edge(label="collect")
master << metrics
db1 >> Edge(color="brown") >> master
db2 >> Edge(color="brown") >> master
db3 >> Edge(color="brown") >> master
with Cluster("Messenging HA"):
zmq = Custom("Broker Active", zmq_icon)
zmq2 = Custom("Broker Standby", zmq_icon)
zmq - Edge(color="brown", style="dashed") - zmq2 << Edge(label="collect")
zmq << metrics
db1 >> Edge(color="brown") >> zmq
db2 >> Edge(color="brown") >> zmq
db3 >> Edge(color="brown") >> zmq
with Cluster("Client Integration"):
client1 = CloudServices("client #1")
client2 = CloudServices("client #2")
client3 = CloudServices("client #3")
client1 - Edge(color="brown", style="dashed") - client2 - Edge(color="brown", style="dashed") - client3
zmq2 >> Edge(color="red") >> client1
diag
Thanks for the help. I like this workaround.
If you don't mind the arrows coming off of your
db
s and placing someCustom
transparent 'spacers'.
@xu4wang
Another option you might like is to set the graph_attr
"splines"
to "polyline"
or "line"
. See output below.
graph_attr = {"splines":"polyline",}
with Diagram(name=" Architecture", show=False, graph_attr=graph_attr) as diag:
# ... Same as previous posts
@xu4wang Another option you might like is to set the
graph_attr
"splines"
to"polyline"
or"line"
. See output below.
Yes! Thanks for sharing the magic. 👍
I have one diagram as below:
The generated diagram is as below:
Is there a way I can set the position of the cluster? to make them aligned..