...
1This release improves on the features introduced in 0.4, with `class` keyword now accepting multiple class values with an array, and grid diagrams becoming faster and more robust.
2
3Multiple classes example:
4
5<img src="https://user-images.githubusercontent.com/3120367/235749202-aa85830e-8f4a-4a2c-be16-599302919122.svg" style="width: 600px" />
6
7```d2
8classes: {
9 base: {
10 style: {
11 stroke-dash: 2
12 border-radius: 5
13 font: mono
14 text-transform: uppercase
15 }
16 }
17 error: {
18 style.fill: "#e07d7d"
19 style.stroke: "#a60c0c"
20 style.font-color: white
21 }
22 success: {
23 style.fill: "#86f499"
24 style.stroke: "#017f07"
25 style.font-color: black
26 }
27}
28
29server-1.class: [base; error]
30server-2.class: [base; success]
31
32```
33
34#### Features ๐
35
36- `class` field now accepts arrays. See [docs](https://d2lang.com/tour/classes/#multiple-classes). [#1256](https://github.com/terrastruct/d2/pull/1256)
37- Pill shape is implemented with rectangles of large border radius. See [docs](https://d2lang.com/tour/style/#border-radius). Thanks @Poivey ! [#1006](https://github.com/terrastruct/d2/pull/1006)
38
39#### Improvements ๐งน
40
41- ELK self loops get distributed around the object instead of stacking [#1232](https://github.com/terrastruct/d2/pull/1232)
42- ELK preserves order of objects in cycles [#1235](https://github.com/terrastruct/d2/pull/1235)
43- Improper usages of `class` and `style` get error messages [#1254](https://github.com/terrastruct/d2/pull/1254)
44- Improves scaling of object widths/heights in grid diagrams [#1263](https://github.com/terrastruct/d2/pull/1263)
45- Enhance Markdown parsing error message by appending link to docs [#1269](https://github.com/terrastruct/d2/pull/1269)
46
47#### Bugfixes โ๏ธ
48
49- Fixes an issue with markdown labels that are empty when rendered [#1223](https://github.com/terrastruct/d2/issues/1223)
50- ELK self loops always have enough space for long labels [#1232](https://github.com/terrastruct/d2/pull/1232)
51- Fixes panic when setting `shape` to be `class` or `sql_table` within a class [#1251](https://github.com/terrastruct/d2/pull/1251)
52- Fixes rare panic exporting to gifs [#1257](https://github.com/terrastruct/d2/pull/1257)
53- Fixes bad performance in large grid diagrams [#1263](https://github.com/terrastruct/d2/pull/1263)
54- Fixes bug in ELK when container has ID "root" [#1268](https://github.com/terrastruct/d2/pull/1268)
55- Fixes edge case panic with invalid CLI arguments [#1271](https://github.com/terrastruct/d2/pull/1271)
View as plain text