canvas: add 3D parity with a breaking 1.0.0 API

AN
1h ago
+6277-844

Summary

  • Complete 2D/3D parity with a breaking 1.0.0 API: shared configuration stays top-level, renderer-specific configuration is grouped under twoD / threeD, and mode-specific operations use typed canvas.twoD / canvas.threeD namespaces. Legacy flat mode-specific names are removed; canvas.setDimension() remains shared and both mode configurations survive switches.
  • Add 3D camera save/restore, accurate frustum diagnostics, custom Three.js visuals, world-unit dashed links, supported advanced graph access, and configurable unselected 3D link width while preserving native culling and large-graph optimizations.
  • Render the selected 3D border and halo through the existing outline mesh, avoiding a second per-selected-node mesh. Keep the 2D renderer and yellow expansion pulse behavior unchanged.
  • Include the 1.0.0 migration guide, package documentation, tests, and the main runnable example.

Custom Three.js resource ownership

Canvas replaces each leased resource objects dispose() method with a no-op while a Canvas visual holds a lease. Explicit calls are suppressed during that period, and the captured original is called once at final Canvas release; external references do not extend the lease. Removal, replacement, or 3D teardown disposes on the final Canvas release, so resources that must outlive a visual need independent copies. The migration guide documents this contract.

Validation

  • npm --prefix web-components/canvas test — 20 files, 477 tests passed.
  • Canvas typecheck, lint, build, git diff --check, and package dry-run all passed; the package archive includes MIGRATION-v1.0.0.md.
  • Browser inspection confirmed the selected 3D glow fades as a ring instead of a filled pale shell. The outline-mesh regression test verifies selection adds no extra mesh; mode-switch, culling, and 2D behavior remain covered by tests.
  • The existing 256-node / 960-link benchmark showed median draw calls of 1216 (mostly visible), 649–662 (partial), and 0 (mostly offscreen), with CPU submission medians of 7.3–11.4 ms, 4.6–6.4 ms, and 2.3–3.9 ms respectively. These local measurements are not cross-device guarantees. No new quantitative timing was collected specifically for the final halo shader; structural checks confirm it reuses the outline mesh.

Major release

This is a breaking major release. After PR #45 is merged, create the release from the merged commit with tag canvas-v1.0.0. The release workflow derives and publishes the package version from the tag; do not edit the placeholder package version or publish separately. This PR does not publish a release.

Closes #38
Closes #39
Closes #40
Closes #41
Closes #42
Closes #43
Closes #44