Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.6.7 #233

Merged
merged 4 commits into from
Sep 28, 2024
Merged

0.6.7 #233

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/releases/0.6.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#### Features 🚀

- Glob inverse filters are implemented (e.g. `*: {!&shape: circle; style.fill: red}` to turn all non-circles red) [#2008](https://github.com/terrastruct/d2/pull/2008)
- Globs can be used in glob filter values, including checking for existence (e.g. `*: {&link: *; style.fill: red}` to turn all objects with a link red) [#2009](https://github.com/terrastruct/d2/pull/2009)

#### Improvements 🧹

- Opacity 0 shapes no longer have a label mask which made any segment of connections going through them lower opacity [#1940](https://github.com/terrastruct/d2/pull/1940)
- Bidirectional connections are now animated in opposite directions rather than one direction [#1939](https://github.com/terrastruct/d2/pull/1939)

#### Bugfixes ⛑️

- Local relative icons are relative to the d2 file instead of CLI invoke path [#1924](https://github.com/terrastruct/d2/pull/1924)
- Custom label positions weren't being read when the width was smaller than the label [#1928](https://github.com/terrastruct/d2/pull/1928)
- Using `shape: circle` for arrowheads no longer removes all arrowheads along path in sketch mode [#1942](https://github.com/terrastruct/d2/pull/1942)
- Globs to null connections work [#1965](https://github.com/terrastruct/d2/pull/1965)
- Edge globs setting styles inherit correctly in child boards [#1967](https://github.com/terrastruct/d2/pull/1967)
- Board links imported with spread imports work [#1972](https://github.com/terrastruct/d2/pull/1972)
- Fix importing a file with nested boards [#1998](https://github.com/terrastruct/d2/pull/1998)
- Fix importing a file with underscores in links [#1999](https://github.com/terrastruct/d2/pull/1999)
- Replace a panic with an error message resulting from invalid `link` usage [#2011](https://github.com/terrastruct/d2/pull/2011)
- Fix globs not applying to scenarios on keys that were applied in earlier scenarios [#2021](https://github.com/terrastruct/d2/pull/2021)
- Fix edge case of invalid SVG from code blocks [#2031](https://github.com/terrastruct/d2/pull/2031)

38 changes: 38 additions & 0 deletions docs/releases/0.6.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#### Features 🚀

- Vars: Variable definitions can refer to other variables in the current scope [#2052](https://github.com/terrastruct/d2/pull/2052)
- Composition: Imported boards can use underscores to reference boards beyond its own scope (e.g. to a sibling board at the scope its imported to) [#2075](https://github.com/terrastruct/d2/pull/2075)
- Autoformat: Reserved keywords are formatted to be lowercase [#2098](https://github.com/terrastruct/d2/pull/2098)
- Misc: support for characters in the Latin-1 and geometric shapes unicode range [#2100](https://github.com/terrastruct/d2/pull/2100)
- Imports: can now import from absolute file paths [#2113](https://github.com/terrastruct/d2/pull/2113)
- Render: linear and radial gradients are now available for `fill`, `stroke` and `font-color` [#2120](https://github.com/terrastruct/d2/pull/2120)

#### Improvements 🧹

- Sequence diagram: edge groups account for edge label heights [#2038](https://github.com/terrastruct/d2/pull/2038)
- Sequence diagram: self-referential edges account for edge label heights [#2040](https://github.com/terrastruct/d2/pull/2040)
- Sequence diagram: The spacing between self-referential edges and regular edges is uniform [#2043](https://github.com/terrastruct/d2/pull/2043)
- Compiler: Error on multi-line labels in `sql_table` shapes [#2057](https://github.com/terrastruct/d2/pull/2057)
- Sequence diagram: Image shape actors can use spans and notes [#2056](https://github.com/terrastruct/d2/issues/2056)
- Globs: Filters work with default values (e.g. `&opacity: 1` will capture everything without opacity explicitly set) [#2090](https://github.com/terrastruct/d2/pull/2090)
- Render: connection label fills have a bit of padding and border-radius for better aesthetics [#2094](https://github.com/terrastruct/d2/pull/2094)
- Sequence diagram: the padding between message labels and message endpoints are slightly increased [#2096](https://github.com/terrastruct/d2/pull/2096)
- Render: code syntax highlighter dependency upgrade caused some slight subtle color changes in code snippets [#2119](https://github.com/terrastruct/d2/pull/2119)


#### Bugfixes ⛑️

- Sequence diagram: multi-line edge labels no longer can collide with other elements [#2049](https://github.com/terrastruct/d2/pull/2049)
- Sequence diagram: long self-referential edge labels no longer can collide neighboring actors (or its own) lifeline edges [#2050](https://github.com/terrastruct/d2/pull/2050)
- Sequence diagram: fixes layout when sequence diagrams are in children boards (e.g. a layer) [#1692](https://github.com/terrastruct/d2/issues/1692)
- Globs: An edge case was fixed where globs used in edges were creating nodes when it shouldn't have [#2051](https://github.com/terrastruct/d2/pull/2051)
- Render: Multi-line class labels/headers are rendered correctly [#2057](https://github.com/terrastruct/d2/pull/2057)
- CLI: Watch mode uses correct backlinks (`_` usages) [#2058](https://github.com/terrastruct/d2/pull/2058)
- Vars: Spread variables are inserted in place instead of appending to end of scope [#2062](https://github.com/terrastruct/d2/pull/2062)
- Imports: fix local icon imports from files that are imported [#2066](https://github.com/terrastruct/d2/pull/2066)
- CLI: fixes edge case of watch mode links to nested board that had more nested boards not working [#2070](https://github.com/terrastruct/d2/pull/2070)
- CLI: fixes theme flag not being passed to GIF outputs [#2071](https://github.com/terrastruct/d2/pull/2071)
- CLI: fixes scale flag not being passed to animated SVG outputs [#2071](https://github.com/terrastruct/d2/pull/2071)
- CLI: pptx exports use theme flags correctly [#2099](https://github.com/terrastruct/d2/pull/2099)
- Imports: importing files with url links is fixed [#2105](https://github.com/terrastruct/d2/pull/2105)
- Composition: linking to invalid boards no longer produces an invalid link [#2118](https://github.com/terrastruct/d2/pull/2118)
4 changes: 2 additions & 2 deletions docs/releases/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

:::info Latest

Version: [0.6.5](/releases/0.6.5) (released April 17, 2024)
Version: [0.6.7](/releases/0.6.7) (released September 28, 2024)

Downloads: [Assets](https://github.com/terrastruct/d2/releases/tag/v0.6.5)
Downloads: [Assets](https://github.com/terrastruct/d2/releases/tag/v0.6.7)

:::

Expand Down
27 changes: 24 additions & 3 deletions docs/tour/globs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import GlobsRecursive from '@site/static/d2/globs-recursive.d2';
import GlobsRecursive2 from '@site/static/d2/globs-recursive-2.d2';
import GlobsFilter from '@site/static/d2/globs-filter.d2';
import GlobsFilter2 from '@site/static/d2/globs-filter-2.d2';
import GlobsFilterGlobValue from '@site/static/d2/globs-filter-glob-value.d2';
import GlobsInverseFilter from '@site/static/d2/globs-inverse-filter.d2';
import GlobsNested from '@site/static/d2/globs-nested.d2';

# Globs
Expand Down Expand Up @@ -125,6 +127,8 @@ Use `&` to filter what globs target.

<div style={{width: 600}} className="embedSVG" dangerouslySetInnerHTML={{__html: require('@site/static/img/generated/globs-filter.svg2')}}></div>

### Filters on array values

If the filtered attribute has an array value, the filter will match if it matches any
element of the array.

Expand All @@ -134,9 +138,26 @@ element of the array.

<div style={{width: 600}} className="embedSVG" dangerouslySetInnerHTML={{__html: require('@site/static/img/generated/globs-filter-2.svg2')}}></div>

:::info
We are working on adding more filters, as well as the "not-filter", `!&`.
:::
### Globs as filter values

Globs can also appear in the value of a filter. `*` by itself as a value for a filter
means the key must be specified.

<CodeBlock className="language-d2">
{GlobsFilterGlobValue}
</CodeBlock>

<div style={{width: 600}} className="embedSVG" dangerouslySetInnerHTML={{__html: require('@site/static/img/generated/globs-filter-glob-value.svg2')}}></div>

## Inverse filters

Use `!&` to inverse-filter what globs target.

<CodeBlock className="language-d2">
{GlobsInverseFilter}
</CodeBlock>

<div style={{width: 600}} className="embedSVG" dangerouslySetInnerHTML={{__html: require('@site/static/img/generated/globs-inverse-filter.svg2')}}></div>

## Nested globs

Expand Down
6 changes: 0 additions & 6 deletions docs/tour/imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,3 @@ Unnecessary relative imports are removed by autoformat.

`@./x` will be autoformatted to `@x`.
:::

:::caution
Absolute imports are not currently available. We are considering designs to set a root, so
that you can import like `@~/my/d2/x.d2`. If you have a use case for absolute imports,
please file an issue (or upvote an existing one) on GitHub.
:::
6 changes: 3 additions & 3 deletions docs/tour/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Float between `0` and `1`.

## Stroke

CSS color name or hex code.
CSS color name, hex code, or a subset of CSS gradient strings.

<CodeBlock className="language-d2">
{StylesStroke}
Expand All @@ -85,7 +85,7 @@ already used to control header's `fill`).

## Fill

CSS color name or hex code.
CSS color name, hex code, or a subset of CSS gradient strings.

<CodeBlock className="language-d2">
{StylesFill}
Expand Down Expand Up @@ -228,7 +228,7 @@ Integer between `8` and `100`.

## Font Color

CSS color name or hex code.
CSS color name, hex code, or a subset of CSS gradient strings.

<CodeBlock className="language-d2">
{StylesFontColor}
Expand Down
2 changes: 2 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ const sidebars = {
link: { type: "doc", id: "releases/intro" },
items: [
"releases/intro",
"releases/0.6.7",
"releases/0.6.6",
"releases/0.6.5",
"releases/0.6.4",
"releases/0.6.3",
Expand Down
7 changes: 7 additions & 0 deletions static/d2/globs-filter-glob-value.d2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*: {
&link: *
style.fill: red
}

x.link: https://google.com
y
9 changes: 9 additions & 0 deletions static/d2/globs-inverse-filter.d2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bravo team.shape: person
charlie team.shape: person
command center.shape: cloud
hq.shape: rectangle

*: {
!&shape: person
style.multiple: true
}
2 changes: 2 additions & 0 deletions static/d2/styles-fill.d2
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
direction: right
x -> y: hi
y -> z
x.style.fill: "#f4a261"
y.style.fill: honeydew
z.style.fill: "linear-gradient(#f69d3c, #3f87a6)"
2 changes: 1 addition & 1 deletion static/img/generated/animated.svg2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.6-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 1882 494"><svg id="d2-svg" width="1882" height="494" viewBox="11 11 1882 494"><style type="text/css"><![CDATA[
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.7-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 1882 494"><svg id="d2-svg" width="1882" height="494" viewBox="11 11 1882 494"><style type="text/css"><![CDATA[
.d2-1872084757 .text {
font-family: "d2-1872084757-font-regular";
}
Expand Down
Binary file modified static/img/generated/cat.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion static/img/generated/chicken.svg2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.6-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 314 465"><svg id="d2-svg" width="314" height="465" viewBox="-106 -66 314 465"><style type="text/css"><![CDATA[
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.7-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 314 465"><svg id="d2-svg" width="314" height="465" viewBox="-106 -66 314 465"><style type="text/css"><![CDATA[
.d2-4130279961 .text {
font-family: "d2-4130279961-font-regular";
}
Expand Down
2 changes: 1 addition & 1 deletion static/img/generated/classes-1.svg2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.6-HEAD" preserveAspectRatio="xMidYMid meet" viewBox="0 0 409 186"><svg id="d2-svg" class="d2-3478011237" width="409" height="186" viewBox="-1 -1 409 186"><rect x="-1.000000" y="-1.000000" width="409.000000" height="186.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.7-HEAD" preserveAspectRatio="xMidYMid meet" viewBox="0 0 409 186"><svg id="d2-svg" class="d2-3478011237" width="409" height="186" viewBox="-1 -1 409 186"><rect x="-1.000000" y="-1.000000" width="409.000000" height="186.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
.d2-3478011237 .text-mono {
font-family: "d2-3478011237-font-mono";
}
Expand Down
2 changes: 1 addition & 1 deletion static/img/generated/classes-2.svg2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.6-HEAD" preserveAspectRatio="xMidYMid meet" viewBox="0 0 481 628"><svg id="d2-svg" class="d2-1924837604" width="481" height="628" viewBox="-1 -1 481 628"><rect x="-1.000000" y="-1.000000" width="481.000000" height="628.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.7-HEAD" preserveAspectRatio="xMidYMid meet" viewBox="0 0 481 628"><svg id="d2-svg" class="d2-1924837604" width="481" height="628" viewBox="-1 -1 481 628"><rect x="-1.000000" y="-1.000000" width="481.000000" height="628.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
.d2-1924837604 .text-bold {
font-family: "d2-1924837604-font-bold";
}
Expand Down
2 changes: 1 addition & 1 deletion static/img/generated/classes-3.svg2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.6-HEAD" preserveAspectRatio="xMidYMid meet" viewBox="0 0 2267 2502"><svg id="d2-svg" class="d2-726627142" width="2267" height="2502" viewBox="11 11 2267 2502"><rect x="11.000000" y="11.000000" width="2267.000000" height="2502.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.6.7-HEAD" preserveAspectRatio="xMidYMid meet" viewBox="0 0 2267 2502"><svg id="d2-svg" class="d2-726627142" width="2267" height="2502" viewBox="11 11 2267 2502"><rect x="11.000000" y="11.000000" width="2267.000000" height="2502.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
.d2-726627142 .text-italic {
font-family: "d2-726627142-font-italic";
}
Expand Down
Loading
Loading