terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.
https://d2lang.com
Mozilla Public License 2.0
16.61k stars 417 forks source link

`circle` doesn't maintain aspect ratio in dagre #985

Open alixander opened 1 year ago

alixander commented 1 year ago

https://play.d2lang.com/?script=HM6xCYAwFEXR_k1xibUL_G00pgh8G3mCYNxdSHuqswWl8ApmPKj9qtkEfhyM8xDAgrsnw8p-ZzYLhj79AQAA__8%3D&layout=dagre&

a: "" {
  shape: circle
  txt: |md
    # title
    - bullet
  |
}

d2 (34)

gavin-ts commented 1 year ago

this is caused by dagre layout resizing containers around its children and ignoring any width/height values set

https://play.d2lang.com/?script=LM5BCsQgDEDRfU7x8RjeJmgYAxIhOJRSevdC6fptnlZK4RJ445Xm2aYJeIQlbfjsxOqGB_oxh-9B118aU8_133LLEwAA__8%3D&layout=dagre& Screen Shot 2023-03-06 at 5 17 37 PM

the dagre container limitations also cause issues like this: Screen Shot 2023-03-06 at 5 19 48 PM

alixander commented 1 year ago

ohh i see. right right