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

Newlines in labels result in padding issues #32

Closed
josegonzalez opened this issue Feb 20, 2020 · 4 comments
Closed

Newlines in labels result in padding issues #32

josegonzalez opened this issue Feb 20, 2020 · 4 comments
Labels
bug Something isn't working kind/feature New feature or request

Comments

@josegonzalez
Copy link

The following code:

from diagrams import Diagram
from diagrams.aws.network import Route53 as DNS


with Diagram("Newline example", show=False):
    other_dns = DNS("One line DNS")
    newline_dns = DNS("Newline\nDNS")

Results in bad formatting for labels:

newline_example

Not sure how I can properly push the label down. Looks fine for single line, but multi-line labels end up pretty bad.


Relevant debugging info:

$ python -V
Python 3.7.6
$ pip freeze | grep diagrams
diagrams==0.5.0
$ brew info graphviz
graphviz: stable 2.42.2 (bottled), HEAD
@mingrammer
Copy link
Owner

mingrammer commented Feb 22, 2020

The label area has a fixed height, so multi-line text will be printed badly. Any reasons to use multi-line labels?

@josegonzalez
Copy link
Author

I have some cases where the label is otherwise too long, so it goes over the cluster boundary.

@mingrammer
Copy link
Owner

@josegonzalez Diagrams v0.6.2 supports multi-line labels. Try with this version.

@mingrammer mingrammer added bug Something isn't working kind/feature New feature or request labels Feb 23, 2020
@josegonzalez
Copy link
Author

Works great. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants