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

Block Diagrams - variable resuse in groups and group labels #5588

Open
andar1an opened this issue Jun 21, 2024 · 0 comments
Open

Block Diagrams - variable resuse in groups and group labels #5588

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

Comments

@andar1an
Copy link

Description

When creating Groups in a block diagram, it may be expected that the same variables can be used to represent port numbers for example. Also, it would be nice to be able to include a label in a group graphical area instead of being required to use additional column space or a block.

Steps to reproduce

For variable replication you can use the following:

block-beta
  columns 12
    %% horizontal spacing for centering
    space:3
    %% router block
    id1("router"):1
    block:router:5
      columns 6
      1 2 3 4 5 6
    end
    %% horizontal spacing for centering
    space:3
    %% vertical spacing
    space 12
    %% wireless ap block
    id3("wireless ap"):1
    block:ap:5
      columns 6
      1 2 3 4 5 6
    end

For Labeling, there are many ways one can try to include labels, I found the easiest to be a side block, because trying to add a label into a group would not allow for a block to take up full width of group columns. e.g.

    block:router:5
      columns 6
      t["router"]:6
      r1 r2 r3 r4 r5 r6
    end

Screenshots

image
image

Code Sample

code samples in steps to reproduce

Setup

  • Mermaid version: not sure - in markdown - likely applicable to github, gitlabl, codeberg, gitea, forgejo versions used
  • Browser and Version: [Chrome, Edge, Firefox]

Suggested Solutions

workaround is currently to prefix with a letter to differentiate variables, solution would likely revolve around when code is parsing variables in a group some logic or a macro may add context of group to the variable name to prevent conflicts.

Additional Context

No response

@andar1an andar1an added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Jun 21, 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