Skip to content
Merged
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
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
**/testdata/**/*.json linguist-generated
go.mod linguist-generated
go.sum linguist-generated
d2layouts/d2dagrelayout/dagre.js linguist-vendored
d2layouts/d2elklayout/elk.js linguist-vendored
d2renderers/d2svg/github-markdown.css linguist-vendored
d2renderers/d2latex/mathjax.js linguist-vendored
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
d2layouts/d2dagrelayout/dagre.js
d2layouts/d2elklayout/setup.js
d2renderers/d2latex/mathjax.js
d2renderers/d2latex/polyfills.js
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------

This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
defined by the Mozilla Public License, v. 2.0.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ bundled with the build or separately installed as a standalone binary.

**Layout engines**:

- [dagre](https://github.com/dagrejs/dagre) (default, bundled): A fast, directed graph
layout engine that produces layered/hierarchical layouts. Based on Graphviz's DOT
algorithm.
- [Dagro](https://github.com/d2lang/dagro) (default, bundled): A native Go port of the
Dagre directed graph layout engine that produces layered/hierarchical layouts. Based
on Graphviz's DOT algorithm.
- [ELK](https://github.com/kieler/elkjs) (bundled): A directed graph layout engine
particularly suited for node-link diagrams with an inherent direction and ports.
- [TALA](https://github.com/terrastruct/TALA) (binary): Novel layout engine designed
Expand Down
38 changes: 38 additions & 0 deletions THIRD_PARTY_NOTICES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
D2 Third-Party Notices

Dagro
https://github.com/d2lang/dagro

Dagro is a Go port of Dagre 0.8.5 and the subset of Graphlib 2.1.8 required by
Dagre's layout implementation. The port is based on these upstream sources:

Dagre 0.8.5
https://github.com/dagrejs/dagre
commit f56edb1abbb8530e532158f7cbd403228f5b0018

Graphlib 2.1.8
https://github.com/dagrejs/graphlib
commit 64375bb8d96bce0d906d238853c2b5afa2f2c231

MIT License

Copyright (c) 2012-2014 Chris Pettitt
Copyright (c) 2026 Dagro contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 0 additions & 4 deletions ci/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ it depends on from ../sub/lib.
- ./build.sh builds the release archives for each platform into ./build/<VERSION>/*.tar.gz
Run with --help for usage.

> note: Remember for production releases you need to set the $TSTRUCT_OS_ARCH_BUILDER
> variables as we must compile d2 directly on each release target to include dagre.
> See https://github.com/d2lang/d2/issues/31

Use `--host-only` to build only the release for the host's `$OS-$ARCH` pair.

### Docker image helper
Expand Down
1 change: 1 addition & 0 deletions ci/release/_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cd -- "$(dirname "$0")/../.."
sh_c rm -Rf "$HW_BUILD_DIR"
sh_c mkdir -p "$HW_BUILD_DIR"
sh_c cp ./ci/release/template/LICENSE.txt "$HW_BUILD_DIR"
sh_c cp ./THIRD_PARTY_NOTICES.txt "$HW_BUILD_DIR"
sh_c cp ./ci/release/template/Makefile "$HW_BUILD_DIR"
sh_c cp -R ./ci/release/template/man "$HW_BUILD_DIR"
sh_c cp -R ./ci/release/template/scripts "$HW_BUILD_DIR"
Expand Down
1 change: 1 addition & 0 deletions ci/release/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ build_windows_msi() {
REMOTE_HOST=$CI_D2_WINDOWS_AMD64

ln -sf "../build/$VERSION/windows-amd64/d2-$VERSION/bin/d2.exe" ./ci/release/windows/d2.exe
ln -sf "../build/$VERSION/windows-amd64/d2-$VERSION/THIRD_PARTY_NOTICES.txt" ./ci/release/windows/THIRD_PARTY_NOTICES.txt
sh_c rsync --archive --human-readable --copy-links --delete ./ci/release/windows/ "'$REMOTE_HOST:windows/'"
if ! echo "$VERSION" | grep '[0-9]\.[0-9]\.[0-9]'; then
WIX_VERSION=0.0.0
Expand Down
1 change: 1 addition & 0 deletions ci/release/changelogs/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#### Improvements 🧹

- d2dagre: replace the embedded JavaScript runtime with the native Go Dagro port without changing layout output
- d2ascii:
- sql_table and uml class shapes are supported [#2623](https://github.com/d2lang/d2/pull/2623)
- newlines are handled [#2626](https://github.com/d2lang/d2/pull/2626)
Expand Down
1 change: 1 addition & 0 deletions ci/release/windows/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
d2.exe
THIRD_PARTY_NOTICES.txt
4 changes: 4 additions & 0 deletions ci/release/windows/d2.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This file was pieced together from:

<Feature Id="Complete" Level="1">
<ComponentRef Id="Executable" />
<ComponentRef Id="ThirdPartyNotices" />
</Feature>

<MajorUpgrade AllowSameVersionUpgrades='yes' DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/>
Expand All @@ -33,6 +34,9 @@ This file was pieced together from:
System="yes"
Value="[INSTALLDIR]" />
</Component>
<Component Id="ThirdPartyNotices" Guid="aa19f8b5-c7c4-4e94-b322-1cd32bf3d649">
<File Id="ThirdPartyNoticesFile" Name="THIRD_PARTY_NOTICES.txt" Source="THIRD_PARTY_NOTICES.txt" KeyPath="yes" />
</Component>
</Directory>
</StandardDirectory>
</Package>
Expand Down
Loading
Loading