Skip to content

Port D2's sketch surface to Rough.js 4.6.6 - #2

Merged
alixander merged 2 commits into
mainfrom
agent/rough-4.6.6-d2-surface
Aug 12, 2026
Merged

Port D2's sketch surface to Rough.js 4.6.6#2
alixander merged 2 commits into
mainfrom
agent/rough-4.6.6-d2-surface

Conversation

@alixander

Copy link
Copy Markdown
Contributor

Summary

  • port the Rough.js 4.6.6 renderer behavior used by D2 to native Go
  • update SVG path normalization, solid path fills, hachure scanning, zigzag fills, ellipse/line behavior, and seeded stream handling
  • represent the 4.6.6 multi-stroke, vertex-preservation, dash, fixed-decimal, and fill-roughness options
  • pin the official npm 4.6.6 bundle as the CI oracle and raise the module Go version to 1.26.5
  • refresh MIT notices and source provenance for Rough.js, hachure-fill, and path-data-parser

Compatibility scope

The exact contract is D2's sketch-rendering surface: line, rectangle, ellipse, linearPath, polygon, and SVG path, using D2's solid and zigzag profiles. Other existing generator APIs remain available for source compatibility, but this PR does not claim every expert Rough.js 4.6.6 option or filler combination is exact.

This intentionally changes seeded sketch geometry to the current Rough.js output. It should be released as rough-go v0.2.0 because the output behavior and Go toolchain floor change.

Validation

  • 1,000 deterministic randomized D2-profile calls against the SHA-pinned official Rough.js 4.6.6 browser bundle
  • full native test suite
  • full race suite
  • go vet ./...
  • native and js/wasm builds
  • full D2 sketch suite: every rough-generated SVG path matches official Rough.js 4.6.6 after D2's normal six-decimal serialization

@alixander
alixander marked this pull request as ready for review August 12, 2026 04:37
@alixander
alixander merged commit e7169d5 into main Aug 12, 2026
2 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