mingrammer / diagrams

:art: Diagram as Code for prototyping cloud system architectures
https://diagrams.mingrammer.com
MIT License
37.17k stars 2.42k forks source link

links between object misaligned and straight #971

Open maximegy opened 7 months ago

maximegy commented 7 months ago

Hello, I have a fresh install of this tool in mac OS with brew for graphviz. I try to generate diagrams but I encounter a problem in the interconnection of objects.

Indeed, the links are straight and misaligned instead of making right angles as I saw in the example diagrams.

image

This is the code :

from diagrams import Diagram, Edge, Cluster
from diagrams.custom import Custom

with Diagram("", show=False, direction="LR", filename="schema_archi"):
    internet = Custom("Internet", "SVG/cloud-public.svg")

    with Cluster("On Site"):
        CPE1 = Custom("router1", "SVG/routeur1.svg")
        CPE2 = Custom("router2", "SVG/routeur1.svg")
        switch = Custom("Switch", "SVG/SWICH.svg")
        on_site = [CPE1,
                   CPE2] - Edge(style="") - switch

    with Cluster("Backbone"):
        as30781 = Custom("Backbone", "SVG/routeur1.svg")
        ER1 = Custom("edge router 1", "SVG/routeur1.svg")
        ER2 = Custom("edge router 2", "SVG/routeur1.svg")
        routeur = Custom("Routeur", "SVG/routeur1.svg")
        backbone = routeur << as30781 >> [ER1,
                                        ER2]

    internet - routeur
    ER1 - CPE1
    ER2 - CPE2

Thanks a lot for your help.

maximegy commented 7 months ago

I fix the problem with use of "splines":"spline" and I have direct link. When I use "splines":"ortho" I habe the same problem as described.

maximegy commented 7 months ago

I have another problem whe i want to add a vertical line between "cpe1" and "cpe2", Vertical align of these nodes goes away :

Capture d’écran 2024-02-17 à 00 12 37

do you have an idea for keep vertical align of those and add line between them ?