-
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
Edge labels not placed with line #433
Comments
Try using the Ref: For more from diagrams import Diagram, Edge, Cluster
from diagrams.oci.compute import VM as ociVM
from diagrams.oci.storage import FileStorage
with Diagram("Diagram", outformat="svg", graph_attr=graph_attr, show=False) as diag:
with Cluster("cluster01"):
s1prox1 = ociVM("Proxy01")
s1prox2 = ociVM("Proxy02")
proxygrp = [ s1prox1, s1prox2 ]
with Cluster("cluster02"):
s1 = ociVM("s1")
with Cluster("cluster03"):
nfs1 = FileStorage("/nfs1")
nfs2 = FileStorage("/nfs2")
nfs3 = FileStorage("/nfs3")
mounts = [nfs1,nfs2,nfs3]
# s1 - s1prox1
s1 - Edge(color="blue", style="bold") - proxygrp
s1prox1 - Edge(color="blue", style="bold") - s1prox2
s1 >> Edge(xlabel="collect", color="green") >> mounts
s1prox1 >> Edge(xlabel="collect", color="green", minlen="1") >> mounts
s1prox2 >> Edge(xlabel="collect", color="green", minlen="2") >> mounts
diag |
For a slightly cleaner look, try the following: from diagrams import Diagram, Node, Edge, Cluster
from diagrams.oci.compute import VM as ociVM
from diagrams.oci.storage import FileStorage
graph_attr = {
"splines": "spline",
"concentrate":"true",
}
with Diagram("Diagram", outformat="svg", graph_attr=graph_attr, show=False) as diag:
blank1 = Node("", shape="plaintext", height="0.0", width="0.0")
blank2 = Node("", shape="plaintext", height="0.0", width="0.0")
with Cluster("cluster02"):
s1 = ociVM("s1")
with Cluster("cluster01"):
s1prox1 = ociVM("Proxy01")
s1prox2 = ociVM("Proxy02")
proxygrp = [ s1prox1, s1prox2 ]
with Cluster("cluster03"):
nfs1 = FileStorage("/nfs1")
nfs2 = FileStorage("/nfs2")
nfs3 = FileStorage("/nfs3")
mounts = [nfs1,nfs2,nfs3]
(s1 -
Edge(color="blue", style="bold", tailport="se", headport="nw", minlen="1") -
proxygrp)
(s1prox1 -
Edge(color="blue", style="bold", tailport="e", headport="w", minlen="1") -
s1prox2)
(s1 -
Edge(color="green", tailport="e", headport="w", minlen="1") -
blank1)
(proxygrp -
Edge(color="green", tailport="se", headport="w", minlen="2") -
blank1)
(blank1 -
Edge(xlabel="collect", color="green", tailport="e", headport="w", minlen="1") -
blank2 >>
Edge(color="green", tailport="e", headport="w", minlen="1") >>
mounts)
diag |
Thank you @clayms ! Legend! Works like a charm. |
@clayms |
@gabriel-tessier I can add it and do a pull request when I get time. |
@gabriel-tessier #432 (comment) |
Green line labels not displaying correctly.
The text was updated successfully, but these errors were encountered: