v0.2.2

d2lang/d2v0.2.2Feb 28, 2023by alixander

AI Summary

This release adds PDF as an export format, allows styling the diagram background and frame, and supports 3D hexagon shapes.

Key Highlights

  • PDF export support is now available.
  • Diagram background and frame can be added and styled.
  • `3d` works on `hexagon` shapes.
  • Arm64 Docker container supports rendering diagrams to PNGs.

New Features

  • PDF exports
  • Diagram background and frame can be added and styled
  • `3d` works on `hexagon` shapes
  • Arm64 docker container supports rendering to PNGs

Full Release Notes

`style` keywords now apply at the root level, letting you style the diagram background and frame like so:

![chilly](https://user-images.githubusercontent.com/3120367/221755385-22e9078e-a8db-418d-81e4-282c8b33f1d7.svg)
[playground link](https://play.d2lang.com/?script=tFRdaxs7EH3fXzEP15cErry-GwJFlIC9cdJAXIL9kJeCUbSTtchacqVZ56P4v5eRd9d2k9LkofjFGs3HOXPOKnaR8CMB4G1KGKEpMQHYzpNwrvzDqKp3oS0ECZ8SgAPNJJCvMdkkCRlqm8bFSvhiygVUuMYKjL33KpCvNdU-tuWNSSB8ogSA1yyB3EpotIQ-zu0wAnRCSjg9TQA2PFA9Bgl1EKgCif9j5mFRpEZe2bBSHi3F6N6mJWx7JQB55eri3jtLbTWbRcKCaBVkmvIp9Al9y6Kv3TJVjyH9ivTo_IOxZS8b_NvLBrmzhJZ62eAcK7NG_5wOl-rFWRGHXPCQecV-FHdlP6zLBtYe8jdQNjgBbocXu7T3gpyhrr2h5_962eCqQEvN_y3e5aoyympMh7czcTu8eI1u83pPIM5govwDkrElBEPI93-KcFU-ncRW00lLpDHDAp9U6exuH_2TovFXM3528lF5ZuS8KrGVYHYiLiulDfpfSb5Bj6cFUmQ0qBCQAqdgdSdhfD2Co2unCrhTFa_OH_8F24wrFchowYPEKA4ythTj69G8KRcVX7UY3kEpoh_eXIHH7zWGjhLfjfOMT-M863Q5NGX7KHaabI3xftLzS-_qFXuQU9JxngljAzF4oZ0lZexvWAxrWsAM_dro6CqP8UGrJEyQ1Bp9QJg2MTj69g__jhs2zK3N3wuxupdIoGviNx3jKnKlF_ghj73UHtM5f0TKGgzpkAOsJ3fqZYMpFib0ssGNd0WtWV9utPvut9Y3S1V2Lm_BwmdxBpr7sEg6oj5YxCZJ4vnGu7Up0If4KPb3c7qaXc7PAAAA__8%3D&sketch=1&)

(also showcases a little 3d hexagon, newly supported thanks to our newest contributor @JettChenT !)

PDF is also now supported as an export format:

[demo.pdf](https://github.com/terrastruct/d2/files/10846644/demo.pdf)

#### Features ๐Ÿš€

- PDF exports. See [docs](https://d2lang.com/tour/exports#pdf). [#120](https://github.com/terrastruct/d2/issues/120)
- Diagram background and frame can be added and styled. See [docs](https://d2lang.com/tour/style#root). [#910](https://github.com/terrastruct/d2/pull/910)
- `3d` works on `hexagon` shapes. [#869](https://github.com/terrastruct/d2/issues/869)
- The arm64 docker container supports rendering diagrams to PNGs. [#917](https://github.com/terrastruct/d2/pull/917)

#### Improvements ๐Ÿงน

- `near` key set to sequence diagram children get an appropriate error message. [#899](https://github.com/terrastruct/d2/pull/899)
- `class` and `sql_table` shape respect `font-color` styling as header font color. [#899](https://github.com/terrastruct/d2/pull/899)
- SVG fits to screen by default in both watch mode and as a standalone SVG (this time with just CSS, no JS). [#725](https://github.com/terrastruct/d2/pull/725)
- Only chromium is installed when rendering png diagrams instead of also installing webkit and firefox. [#835](https://github.com/terrastruct/d2/issues/835)
- Multiboard output is now self-contained and less confusing. See [#923](https://github.com/terrastruct/d2/pull/923)

#### Bugfixes โ›‘๏ธ

- Error reported when no actors are declared in sequence diagram. [#886](https://github.com/terrastruct/d2/pull/886)
- Fixes img bundling on image shapes. [#889](https://github.com/terrastruct/d2/issues/889)
- `class` shape as sequence diagram actors had wrong colors. [#899](https://github.com/terrastruct/d2/pull/899)
- Fixes regression in last release where some hex codes were not working. [#922](https://github.com/terrastruct/d2/pull/922)