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

Nested grid diagrams do not occupy full width #2259

Open
marcortw opened this issue Dec 22, 2024 · 0 comments
Open

Nested grid diagrams do not occupy full width #2259

marcortw opened this issue Dec 22, 2024 · 0 comments

Comments

@marcortw
Copy link

marcortw commented Dec 22, 2024

I am trying to use the grid diagram feature to describe the composition of a service - similar to your example, but using nesting. The documentation here says that "Cells expand to fill". It seems like this doesn't apply to the nested maps in grid diagrams? I am new to d2 and I might be totally misunderstanding something here. Thanks for any help!

Generated diagram:
image

From this:

vars: {
  d2-config: {
    pad: 0
  }
}
classes: {
  and: {
    style: {
      stroke-width: 3
    }
  }
  xor: {
    style: {
      stroke-dash: 1
    }
  }
  or: {
    style: {
      stroke-dash: 5
    }
  }
}
"Some Service": {
  grid-columns: 1
  "Optional services": {
    grid-rows: 2
    class: or
    "Something nice".class: or
    "Something pointless": {
      grid-columns: 2
      class: or
      "Default Option".class: and
      "With xor'd options": {
        grid-rows: 3
        class: and
        "Option 1".class: xor
        "Option 2".class: xor
        "Option 3".class: xor
      }
    }
  }
  "Mandatory packages within service": {
    grid-columns: 3
    class: and
    "A subscription": {
      grid-rows: 4
      class: and
      "Custom".class: xor
      "Medium".class: xor
      "Large".class: xor
      "Small".class: xor
    }
    "Something else".class: and
    "And some Professional Services".class: and
  }
}
@cyborg-ts cyborg-ts added this to D2 Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant