-
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
Incorrect edge and label positions #658
Comments
@rbarzic |
It is attached :-) (example1.py.gz) |
@rbarzic I think it's more easy to have reply and support if you put the original code instead of a gz file that people may not be able to open. Here the original code from the file from diagrams import Cluster, Diagram, Edge
from diagrams.aws.compute import ECS, EKS, Lambda
from diagrams.aws.database import Redshift
from diagrams.aws.integration import SQS
from diagrams.aws.storage import S3
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB
with Diagram("example1", show=False):
source = EKS("k8s source")
with Cluster("Top Core"):
with Cluster("Event Workers"):
ahb_masters = [ECS("jtagif"),
ECS("cpu"),
ECS("debug")]
ahb_matrix= SQS("AHB Matrix")
apb_bridge= RDS("APB Bridge")
nvm = ELB("NVM")
ram = ELB("RAM")
rom = ELB("ROM")
with Cluster("APB Peripherals"):
nvmctrl = Lambda("nvmctrl")
ramctrl = Lambda("ramctrl")
romctrl = Lambda("romctrl")
sysctrl = Lambda("sysctrl")
aes = Lambda("aes")
freqm = Lambda("freqm")
apb_peripherals = [nvmctrl, ramctrl, romctrl,sysctrl,aes, freqm]
#store = S3("events store")
#dw = Redshift("analytics")
source >> ahb_masters
ahb_masters >> Edge(label="AHB", color="black", style="bold") >> ahb_matrix
ahb_matrix >> Edge(label="AHB", color="black", style="bold") >> apb_bridge
apb_bridge >> Edge(label="APB", color="blue", style="bold") >> apb_peripherals
ahb_matrix >> Edge(label="AHB", color="black", style="bold") >> nvmctrl
ahb_matrix >> Edge(label="AHB", color="black", style="bold") >> ramctrl
ahb_matrix >> Edge(label="AHB", color="black", style="bold") >> romctrl
nvmctrl >> nvm
ramctrl >> ram
romctrl >> rom With my limited knowledge I try to apply the solution to group edge for the first parts and here how it render, check the other issues for more example that my better fit your need. and the related code with comment to pin point the changes I made from diagrams import Cluster, Diagram, Edge, Node # I added node import
from diagrams.aws.compute import ECS, EKS, Lambda
from diagrams.aws.database import Redshift
from diagrams.aws.integration import SQS
from diagrams.aws.storage import S3
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB
with Diagram("example1", show=False):
source = EKS("k8s source")
with Cluster("Top Core"):
# blank node to group the edges from source to Event workers
blankAHB = Node("", shape="plaintext", width="0", height="0")
# blank node to group the edges from Event workers to AHB matrix
blankMatrix = Node("", shape="plaintext", width="0", height="0")
with Cluster("Event Workers"):
ahb_masters = [ECS("jtagif"),
ECS("cpu"),
ECS("debug")]
ahb_matrix= SQS("AHB Matrix")
apb_bridge= RDS("APB Bridge")
nvm = ELB("NVM")
ram = ELB("RAM")
rom = ELB("ROM")
with Cluster("APB Peripherals"):
nvmctrl = Lambda("nvmctrl")
ramctrl = Lambda("ramctrl")
romctrl = Lambda("romctrl")
sysctrl = Lambda("sysctrl")
aes = Lambda("aes")
freqm = Lambda("freqm")
apb_peripherals = [nvmctrl, ramctrl, romctrl,sysctrl,aes, freqm]
#store = S3("events store")
#dw = Redshift("analytics")
# link between source and event workers with the blank node in middle
source >> blankAHB >> ahb_masters
# link between event workers and ahb matrix, note that the label is only between the blank node and the matrix
ahb_masters >> Edge(label="", color="black", style="bold") >> blankMatrix >> Edge(label="AHB", color="black", style="bold") >> ahb_matrix
ahb_matrix >> Edge(label="AHB", color="black", style="bold") >> apb_bridge
apb_bridge >> Edge(label="APB", color="blue", style="bold") >> apb_peripherals
ahb_matrix >> Edge(label="AHB", color="black", style="bold") >> nvmctrl
ahb_matrix >> Edge(label="AHB", color="black", style="bold") >> ramctrl
ahb_matrix >> Edge(label="AHB", color="black", style="bold") >> romctrl
nvmctrl >> nvm
ramctrl >> ram
romctrl >> rom
|
Hi @gabriel-tessier : Thank you. I'll have a look at the examples linked in #433. Sorry if I attached a .gz file but it is because GitHub doesn't allow drag & drop of Python files but allows compressed files. As the file was more than a few lines, I thought it was better to not include it directly. |
In the attached diagram,
example1.py.gz
The text was updated successfully, but these errors were encountered: