0.1.4
This release introduces interactive diagrams. Namely, tooltip and link can now be set, which allows you to hover to see more or click to go to an external link. This small change enables many possibilities, including richer integrations like internal wiki's that can be linked together through diagrams. An icon will indicate that a shape has a tooltip that can be hovered over for more information, or a link. We have much more in store for interactivity, stay tuned!
Since interactive features obviously won't work on static export formats like PNG, they will be included automatically in an appendix when exporting to those formats, like so:

This release also gives more power to configure layouts. width and height are D2 keywords which previously only worked on images, but now work on any non-containers. Additionally, all the layout engines have configurations exposed. D2 sets sensible defaults to each layout engine without any input, so this is meant to be an advanced feature for users who want that extra control.
Happy new years!
Features ๐โ
- Tooltips can be set on shapes. See https://d2lang.com/tour/interactive/. #548
- Links can be set on shapes. See https://d2lang.com/tour/interactive/. #548
- The
widthandheightattributes are no longer restricted to images and can be applied to non-container shapes. #498 - Layout engine options are exposed and configurable. See individual layout pages on https://d2lang.com/tour/layouts/ for list of configurations. #563
Improvements ๐งนโ
- Watch mode renders fit to screen. #560
Bugfixes โ๏ธโ
- Fixes rendering
classandtablewith empty headers. #498 - Fixes rendering of
sql_tablewith no columns. #553 - Diagram bounding boxes account for stroke widths. #574
- Restricts where
nearkey constant values can be used, with good error messages, instead of erroring (e.g. settingnear: top-centeron a container would cause bad layouts or error). #538 - Fixes panic when images with empty labels are rendered with ELK. #555
Breaking changesโ
- For usages of D2 as a library,
d2dagrelayout.Layoutandd2elklayout.Layoutnow accept a third parameter for options. If you would like to keep the defaults, please change your code to calldagrelayout.DefaultLayoutandd2elklayout.DefaultLayoutrespectively.