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

Arrow size, legend and saving path #722

Open
ROMA96x opened this issue Jun 30, 2022 · 3 comments
Open

Arrow size, legend and saving path #722

ROMA96x opened this issue Jun 30, 2022 · 3 comments

Comments

@ROMA96x
Copy link

ROMA96x commented Jun 30, 2022

Hello,

I have some problems doing the following things:

  1. Saving the diagram in a specific path.
    I'm using the option filename to change the name of the file generated, but how can I choose the path where the image will be created?
    "diagram", show=false, filename="architecture_diagram"):

  2. Changing the size of the line in an arrow.
    I've seen the Graphviz attribute "arrowsize" but this only change the size of the head of the arrow. What can I do if I want also to increase the bodyline of the arrow?

  3. Add a legend
    I have tried this approach:

legend_text = (
"legend: \l"
"red arrow = incompability found \l"
"green arrow = compatible \l"
)

with Diagram(diagram_label, show=False) as diag:
    Node(label=legend_text, width="8", shape="plaintext", )

However, this Node appears overlapped to the rest of the diagram. Is there a way to fix his position to a certain area?
For example, on the top left of the image.

@EChebelyon
Copy link

@ROMA96x I am a novice user of this module and do not have answers for questions 2 and 3. For question one, you can include the path in the filename, for example; filename="./images/architecture.png" will save the image in a folder named images, if it exists.

@clayms
Copy link

clayms commented Aug 8, 2022

To change Edge() weight, use the penwidth attribute, e.g. Edge(penwidth="2.0").

See: https://graphviz.org/docs/attrs/penwidth/

@clayms
Copy link

clayms commented Aug 8, 2022

For a Legend, see #447 (comment)

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

3 participants