Skip to content
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

Display Order between clusters and nodes #368

Open
boubou191911 opened this issue Nov 3, 2020 · 1 comment
Open

Display Order between clusters and nodes #368

boubou191911 opened this issue Nov 3, 2020 · 1 comment

Comments

@boubou191911
Copy link

boubou191911 commented Nov 3, 2020

I am running the following code

from diagrams import Cluster, Diagram, Edge
from diagrams.azure.compute import AvailabilitySets
from diagrams.azure.compute import VMLinux
from diagrams.azure.network import VirtualNetworkClassic

with Diagram("Pure Replacement 1"):
    with Cluster(""):
        VMLinux("ms-int-gtwmq-vm-we-01")

        with Cluster("iib-intmig6-as"):        
            VMLinux("ms-dev-iibmig6-vm-we-01") - Edge(color="transparent") - VMLinux("ms-dev-iibmig6-vm-we-02")  

        with Cluster("iib-int-as"):        
            VMLinux("ms-int-iib-vm-we-01") - Edge(color="transparent") - VMLinux("ms-int-iib-vm-we-02")

        with Cluster("iib-dev-as"):        
            VMLinux("ms-dev-iib-vm-we-01") - Edge(color="transparent") - VMLinux("ms-dev-iib-vm-we-02")

        VirtualNetworkClassic("app-sn")  

I would expect that the VirtualNetworkClassing will appear at the top in the cluster before the other sub-clusters but it is not.

pure_replacement_1

Is it a bug or does it work as designed? i.e. the clusters are always at the top

@clayms
Copy link

clayms commented Nov 4, 2020

The easiest thing to do is to put it in its own Cluster and set the graph_attr for it if you don't want to see that particular Cluster.

Otherwise you can change the "layout" program engine and specify the pos (position) for each node independently.
see this answer: #243 (comment)

from diagrams import Cluster, Diagram, Edge
from diagrams.azure.compute import AvailabilitySets
from diagrams.azure.compute import VMLinux
from diagrams.azure.network import VirtualNetworkClassic

vn_attr = {
    "bgcolor":"transparent",
    "pencolor":"transparent",
    }

with Diagram("Pure Replacement 1", show=False) as diag:
    with Cluster(""):
        with Cluster("", graph_attr=vn_attr):
            VirtualNetworkClassic("app-sn")

        VMLinux("ms-int-gtwmq-vm-we-01")

        with Cluster("iib-intmig6-as"):
            VMLinux("ms-dev-iibmig6-vm-we-01") - Edge(color="transparent") - VMLinux("ms-dev-iibmig6-vm-we-02")  

        with Cluster("iib-int-as"):
            VMLinux("ms-int-iib-vm-we-01") - Edge(color="transparent") - VMLinux("ms-int-iib-vm-we-02")

        with Cluster("iib-dev-as"):
            VMLinux("ms-dev-iib-vm-we-01") - Edge(color="transparent") - VMLinux("ms-dev-iib-vm-we-02")

diag

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants