Skip to content

RFC: Canvas and SVG Renderer Implementation Plan#2299

Closed
kswenson wants to merge 1 commit intomainfrom
CODAP-295-canvas-svg-renderer-plan
Closed

RFC: Canvas and SVG Renderer Implementation Plan#2299
kswenson wants to merge 1 commit intomainfrom
CODAP-295-canvas-svg-renderer-plan

Conversation

@kswenson
Copy link
Copy Markdown
Member

Summary

This PR adds an implementation plan for two new renderers to address WebGL context limitations and SVG export needs:

  • CanvasPointRenderer: Canvas 2D fallback when WebGL contexts are exhausted (browsers limit to ~16)
  • SVG Export Utility: Clean SVG generation for image export (replacing foreignObject approach)

Purpose

This is a Request for Comments - the PR contains only the plan document (v3/doc/point-rendering-plan.md) for team review before implementation begins.

Key Design Decisions

  1. Keep PIXI.js - Continue using PIXI for WebGL rendering rather than writing custom WebGL code
  2. Canvas for runtime fallback - Use Canvas 2D when WebGL unavailable (better performance than SVG for large datasets)
  3. SVG as utility function - Export-only, no event handling needed, simpler than full renderer class
  4. d3-quadtree for hit testing - O(log n) lookups for Canvas event handling

Open Questions

  1. Is d3-quadtree already available as a dependency?
  2. What performance threshold should trigger degraded experience messaging?
  3. Should SVG export read from CanvasPointRenderer state or directly from PointsState?

Review Request

Please review the plan and leave comments on:

  • Overall approach
  • Implementation phases
  • Any concerns or alternative suggestions

🤖 Generated with Claude Code

This plan outlines the approach for adding:
- CanvasPointRenderer: Canvas 2D fallback when WebGL contexts exhausted
- SVG export utility: Clean SVG generation for image export

The plan is intended for team review and discussion before implementation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.39%. Comparing base (5b7e73d) to head (46addba).
⚠️ Report is 146 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (5b7e73d) and HEAD (46addba). Click for more details.

HEAD has 9 uploads less than BASE
Flag BASE (5b7e73d) HEAD (46addba)
cypress 10 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2299       +/-   ##
===========================================
- Coverage   86.54%   69.39%   -17.16%     
===========================================
  Files         733      733               
  Lines       39292    39292               
  Branches     9697     9688        -9     
===========================================
- Hits        34006    27266     -6740     
- Misses       4971    11288     +6317     
- Partials      315      738      +423     
Flag Coverage Δ
cypress 40.54% <ø> (-30.89%) ⬇️
jest 55.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress
Copy link
Copy Markdown

cypress Bot commented Jan 19, 2026

codap-v3    Run #9660

Run Properties:  status check passed Passed #9660  •  git commit 46addba789: docs: add implementation plan for Canvas and SVG renderers
Project codap-v3
Branch Review CODAP-295-canvas-svg-renderer-plan
Run status status check passed Passed #9660
Run duration 03m 13s
Commit git commit 46addba789: docs: add implementation plan for Canvas and SVG renderers
Committer Kirk Swenson
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
View all changes introduced in this branch ↗︎

@kswenson kswenson added the v3 CODAP v3 label Jan 19, 2026
@kswenson kswenson changed the base branch from main to CODAP-295-graph-render-refactor January 20, 2026 17:29
Base automatically changed from CODAP-295-graph-render-refactor to main February 4, 2026 02:50
@kswenson
Copy link
Copy Markdown
Member Author

kswenson commented Feb 7, 2026

The features described here have already been implemented. No need for this PR any more.

@kswenson kswenson closed this Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 CODAP v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant