terrastruct / d2

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

fit within a specific size? #1005

Open jgranduel opened 1 year ago

jgranduel commented 1 year ago

Hi,

I haven't seen any way to make the diagram fit within a specific size. I think mainly of diagrams which should be included within a paper format like A4, for sharing diagrams with users using Windows Word or pdf? Thanks

bo-ku-ra commented 1 year ago

> d2 foobar.d2 foobar.pdf

i print the foobar.pdf on A4 paper.

alixander commented 1 year ago

this is layout engine dependent. i'm pretty sure we can't control widths of connected graphs in dagre and elk. but, we can control how subgraphs get placed.

for example,

Screen Shot 2023-03-13 at 11 49 50 AM