Skip to content

Add native Go port of ELK.js 0.8.2 - #1

Merged
alixander merged 1 commit into
mainfrom
agent/port-elkjs-0.8.2
Aug 9, 2026
Merged

alixander merged 1 commit into
mainfrom
agent/port-elkjs-0.8.2

Conversation

@alixander

@alixander alixander commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • port the 12 layout providers exposed by ELK.js 0.8.2 / ELK 0.8.1 to native Go
  • expose typed graph and JSON APIs while preserving observable ordering, topology, options, Java/GWT semantics, and numeric behavior
  • cover Layered compounds, ports, hierarchy, labels, self-loops, components, routing modes, and every strategy exposed by the frozen bundle
  • document exact source provenance and licensing, including two Apache-licensed GWT adaptations
  • add pure-Go, race, vet, Go 1.23/1.25, and pinned ELK.js differential CI

Compatibility target

This targets the exact ELK.js 0.8.2 behavior embedded by D2, not current ELK. Structural JSON output is compared exactly; only finite layout coordinates use a narrow tolerance.

The differential suite covers all registered algorithms, the valid option-family surface, 100 D2-shaped randomized graphs, 100 generic randomized graphs, and the extracted D2 ELK corpus.

Validation

  • GOWORK=off go test ./...
  • GOWORK=off go test -race ./...
  • GOWORK=off go vet ./...
  • GOWORK=off GOTOOLCHAIN=go1.23.12 go test ./...
  • pinned ELK.js 0.8.2 oracle matrix
  • go test -tags audit ./internal/layeredlayout
  • D2 ELK corpus: 322/322 exact within the coordinate tolerance

Licensing

The port is EPL-2.0, matching ELK and ELK.js. The two translated GWT runtime routines retain their Apache-2.0 notices and license. Exact upstream commits and file mappings are recorded in PROVENANCE.md.

Companion integration: d2lang/d2#2820.

Draft only: do not merge until the companion integration is reviewed and a release version is chosen.

@alixander
alixander marked this pull request as ready for review August 9, 2026 04:47
@alixander
alixander merged commit 32b11ab into main Aug 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant