Skip to content

renders: add native isometric exports - #2881

Merged
alixander merged 4 commits into
masterfrom
agent/isometric-renderer
Oct 11, 2026
Merged

alixander merged 4 commits into
masterfrom
agent/isometric-renderer

Conversation

@alixander

@alixander alixander commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

Human


AI

Adds native isometric rendering to D2's existing SVG, PNG, GIF, PDF, and PPTX exports. Shapes become solid forms with a gentle orthographic skew, raised container levels, planar connections, and labels printed onto their surfaces. Rendering preserves the compiled layout and runs in Go without a browser exporter, GPU, or new module dependencies.

Fulcro RAD architecture rendered in isometric perspective

Fulcro RAD, rendered from the existing real-world fixture with ELK. D2 source · Full-size SVG · Source provenance and license

d2 --isometric --layout=elk input.d2 output.svg

Rendering and configuration

  • Classic isometric ink, solid curved shapes, page folds, cloud/person reliefs, and raised ivory Markdown cards.
  • Tables/classes use individual row rails; sequence diagrams have native actors, activation rails, notes, and planar messages. Connections include crossing bridges and visible arrowheads at raised endpoints.
  • SVG contains vector geometry and outlined text, including authored gradient paints. Connection captions retain compiled text dimensions. GIF supports animation; PDF/PPTX retain link annotations. Exported links reject unsafe URL schemes and preserve resolved board filenames.
  • Enable through --isometric, D2_ISOMETRIC=true, vars.d2-config.isometric, or Go/JS render options. Explicit false overrides, imports, board selection, and watch use the existing configuration paths.
  • The renderer lives in d2renderers/d2isometric, with native exports in d2isometricimg. Release checks retain the 45 MB binary budget and raise the archive budget to 20 MB so all six release targets fit.

Coverage and validation

  • 870 isometric SVG snapshots across Dagre, ELK, and TALA alongside existing E2E renders, including nine real-world diagrams rendered with all three layouts. PNG coverage uses a separate 20-snapshot bundle; ASCII fixtures are excluded.
  • Boards needing external artwork or additional fonts check explicit missing-resource errors. The suite uses existing bundled resources; separate renderer/CLI tests cover supplied image and font resolvers.
  • Repository Go tests, the native renderer suite, and the separate 20-snapshot PNG bundle passed. Targeted regressions cover caption overflow, gradient paint roles, unsafe links, exported board URLs, and malformed caller-owned texture storage.
  • Full SVG E2E tests passed with normal arithmetic and with fused multiply-add disabled. Projection, clipping, ink triangulation, and SVG serialization now use consistent precision across CPU architectures.
  • Built JS package: 52 unit tests and eight installed-package ESM/CJS integration tests, including TALA + isometric, passed. TypeScript API checks and direct Go WASM tests passed.
  • Release archives for Linux, macOS, and Windows on amd64 and arm64 passed binary/archive size and checksum verification.
  • Formatting, generated-file checks, and go vet passed. Caption and gradient fixtures were rendered and visually checked.

Current limitations

Responsive dark themes, SVG board animation, forced appendices, and combining sketch with isometric are unsupported. GIF provides animation. Positioned tooltip callouts are not painted; physical depth governs occlusion, and dense source layouts can still overlap after projection. Native framing and embedded-artwork behavior have some differences from ordinary SVG export.

See the renderer documentation for complete export behavior, API details, and limitations.

  • sent from alixander's Codex

@alixander
alixander force-pushed the agent/isometric-renderer branch from 65bf76e to 4c3072b Compare October 11, 2026 19:38
- sent from alixander's Codex
Preserve compiled caption dimensions and authored gradient paints, validate
exported links and texture storage, and retain resolved board filenames.
Keep SVG clipping, ink geometry, text transforms, and edge-on lighting
consistent across CPU architectures. Refresh isometric snapshots and cover
the corrected cases with targeted regressions.

Raise the archive budget to 20 MB for the six supported release targets;
retain the existing 45 MB binary budget.

- sent from alixander's Codex
@alixander
alixander force-pushed the agent/isometric-renderer branch from 4c3072b to 10c4145 Compare October 11, 2026 20:34
Canonicalize rich-content transform matrices and omit redundant polygon
splits below SVG coordinate precision. Keep scene geometry, layout, and
raster rendering unchanged, with regression cases from hosted CI.
Regenerate only isometric SVG snapshots.

- sent from alixander's Codex
Make aspect-ratio viewport arithmetic deterministic across CPUs with
explicit rounding barriers, and retain full precision when serializing
authored SVG transforms. Add a public-render regression for tiny
translations magnified by enclosing scales and viewport fitting cases.

- sent from alixander's Codex
@alixander
alixander enabled auto-merge October 11, 2026 23:35
@alixander
alixander merged commit 6a7b483 into master Oct 11, 2026
13 checks passed
@alixander
alixander deleted the agent/isometric-renderer branch October 11, 2026 23:37
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