Open arihantsurana opened 3 years ago
Likely related to issue https://github.com/mingrammer/diagrams/issues/367 , as you can see in the output below when I run your code in a notebook.
This does not address the bug you reported, but see if the following work-around will help.
from diagrams.onprem.database import PostgreSQL
from diagrams import Diagram
graph_attr = {
"splines":"spline",
}
with Diagram("check", show=False, graph_attr=graph_attr) as diag:
a = PostgreSQL("A")
b = PostgreSQL("B")
c = PostgreSQL("C")
d = PostgreSQL("D")
a >> b >> c
b >> d >> a
diag
See graphviz splines
docs for more info.
I think it may be related to the headclip
and tailclip
Edge
attributes.
from diagrams.onprem.database import PostgreSQL
from diagrams import Diagram, Edge
graph_attr = {
"splines":"curved",
}
with Diagram("check", show=False, graph_attr=graph_attr) as diag:
a = PostgreSQL("A")
b = PostgreSQL("B")
c = PostgreSQL("C")
d = PostgreSQL("D")
a >> Edge(headclip="a", tailclip="a") >> b >> Edge(headclip="b", tailclip="b") >> c
b >> Edge(headclip="c", tailclip="c") >> d >> Edge(headclip="d", tailclip="d") >> a
diag
looks like an underlying issue with Graphviz:
https://github.com/mdaines/viz.js/issues/29#issuecomment-41865753
Perhaps Stephen North, Graphviz Developer (github) knows. see this post on the Graphviz forums.
from diagrams.onprem.database import PostgreSQL
from diagrams import Diagram
graph_attr = {
"splines":"spline",
}
with Diagram("check", show=False, graph_attr=graph_attr) as diag:
a = PostgreSQL("A")
b = PostgreSQL("B")
c = PostgreSQL("C")
d = PostgreSQL("D")
a >> b >> c
b >> d >> a
diag
This workaround works for me!
@arihantsurana are you being facetious, or does it actually plot correctly for you? I can't imagine that you want the double arrows. Also, one of the arrows from D to A is still reversed.
The second plot in this comment is closer to what you want, no?
@arihantsurana are you being facetious, or does it actually plot correctly for you? I can't imagine that you want the double arrows. Also, one of the arrows from D to A is still reversed.
The second plot in this comment is closer to what you want, no?
Apologies. I must have incorrectly quote replied. You are correct, the second plot is what works. Updated my comment.
Using version 0.19.1 when there are cycles within a diagram, the edge arrow direction seems to reverse.
to reproduce:
Output:
the arrow from d to a is reversed.