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

Architecture Diagram group box sizing issue with long wrapping labels #6042

Open
estranged42 opened this issue Nov 9, 2024 · 0 comments
Open
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@estranged42
Copy link

Description

Architecture diagrams with labels that wrap to multiple lines seem to cause the enclosing group box to be sized as if the label was not wrapping.

Steps to reproduce

Diagram with short labels sized appropriately

Screenshot 2024-11-08 at 5 34 22 PM
architecture-beta
    service source(internet)[S0 Label]

    group g1(internet)[Group 1]

    service s1(internet)[S1 Label] in g1
    service s2(internet)[S2 Label] in g1
    service s3(internet)[S3 Label] in g1

    source:B <--> T:s1
    s1:R --> L:s2
    s2:R --> L:s3

Live Editor Link

Diagram with long wrapping labels

Screenshot 2024-11-08 at 5 34 09 PM
architecture-beta
    service source(internet)[S0 Label]

    group g1(internet)[Group 1]

    service s1(internet)[S1 Label that wraps a few time and makes the group box longer as if the label did not wrap] in g1
    service s2(internet)[S2 Label] in g1
    service s3(internet)[S3 Label] in g1

    source:B <--> T:s1
    s1:R --> L:s2
    s2:R --> L:s3

Live Editor Link

Screenshots

No response

Code Sample

No response

Setup

  • Mermaid version: 11.3.0
  • Browser and Version: Safari Version 17.6 (19618.3.11.11.5), mermaidjs-cli Firefox (linux-stable_131.0.3)

Suggested Solutions

I haven't had a chance to look at the code that figures the box sizing, but it feels like the dimensions of the label used for calculating the enclosing group box is done before any line wrapping happens. Maybe it's possible to wrap the lines first, then find the resulting label bounding box?

Additional Context

No response

@estranged42 estranged42 added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant