d2elk: upgrade to ELK.js 0.12 through native elk-go - #2843
Draft
alixander wants to merge 2 commits into
Draft
Conversation
alixander
force-pushed
the
agent/elk-0.12-native
branch
from
August 10, 2026 14:04
e0d8995 to
700e933
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on: d2lang/elk-go#3
Summary
NODES_AND_EDGES+GREEDY_MODEL_ORDERat the root, with forced model order disabledNONE+GREEDYbelow the root because ELK 0.12 cannot safely run the former model-order profile on compound subgraphsstable/ent2d2_right/elkCompatibility
This is an intentional layout-output change, not an output-compatible runtime swap. Existing ELK diagrams can receive new node ordering and coordinates, routes, labels, and component packing. Nested children may reorder, and
--elk-algorithm=discois no longer supported.The accepted E2E update contains 45 board-JSON, 51 SVG, and 8 text golden changes. The root-only model-order policy restores the checked-in
cycle-order,dense, andextended-asciiresults and removes the earlierus_maprouting-quality concern.The nested migration is required: the former nested model-order profile crashes official ELK.js 0.12 on compound graphs. No safe universal compatibility flag restores the old nested sibling order.
Validation
CI=1 GOWORK=off go test ./... -count=1passes on Go 1.26.5.gotartifactsPerformance and size
No material CPU regression was established. At the dense 250-node / 1,000-edge case, the candidate used +4.56% B/op and +1.20% allocs/op. The full stripped D2 binary changed by +0.51%, and optimized WASM by +1.11%.
Dependency publishing
This draft intentionally uses the pushed elk-go commit as pseudo-version
v0.1.2-0.20260810135209-9e8a6161e5be. Before merge, elk-go PR #3 must land and receive its real release tag, then this PR must replace the pseudo-version and rerun CI.