plugins/build-web-data-visualization/skills/canvas2d-data-visualization/SKILL.md
Render data visualizations with Canvas2D. Use when the visualization needs high mark counts, fast redraws, immediate-mode rendering, custom hit testing, or a hybrid Canvas plus SVG or HTML architecture.
npx skillsauth add openai/plugins canvas2d-data-visualizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when raster rendering is the practical choice. Canvas2D is strong for dense scatterplots, sparkline walls, heatmaps, streaming traces, tiled timelines, draggable analytical workspaces, and other views where SVG or DOM overhead becomes the limiting factor.
Default assumption: keep a retained scene model in application state even if the actual drawing is immediate-mode Canvas. Any visualization or interaction that can be built in SVG can usually be built in Canvas2D too, but the retained geometry, hit testing, focus model, and accessibility layer become the application's responsibility. Choose Canvas for performance or rendering control; keep SVG/HTML when native DOM semantics, text, accessibility, or exportability matter more than redraw speed. Canvas2D can also be simpler or faster than WebGL for flat immediate-mode workloads because it avoids shader setup, buffer uploads, GPU context pressure, and custom WebGL lifecycle code. Move from Canvas2D to WebGL when GPU picking, shader effects, particle count, custom blending, smooth animation, true 3D, or high-volume geospatial layers justify that extra complexity.
For browser-facing Canvas work, use ../../references/foundations/mobile-first-responsive-visualization.md so backing-store size, hit testing, touch gestures, keyboard overlays, spotty connection states, and mobile performance budgets are part of the design contract.
Prefer SVG, HTML, or a declarative grammar when the chart is small, static, text-heavy, annotation-heavy, primarily accessibility-driven, or needs straightforward copy/paste/editable-vector export. Prefer WebGL or the Three.js/WebGL skill when the chart needs GPU-scale particles, custom shaders, instancing, very large graph or point layers, 3D, or map overlays that Canvas2D would struggle to animate or pick interactively.
style.width and style.height in CSS pixelscanvas.width and canvas.height attributes to cssSize * pixelRatioglobalThis.devicePixelRatio || 1 as the page-zoom-aware ratiovisualViewport.scale only when deliberately redrawing for pinch-zoom crispnessctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0) so drawing code can stay in CSS pixelsPath2D geometry replay against candidate subsets with isPointInPath() and isPointInStroke()PointerEvent.clientX/clientY through getBoundingClientRect()setPointerCapture() for drags so movement continues outside the canvaspointerup, pointercancel, and lostpointercapturetouch-action deliberately for touch and pen surfacesThis is usually better than forcing all responsibilities into Canvas. Use absolutely positioned HTML overlays for elements that need native layout, selection, input, focus rings, links, or accessible semantics; keep them synchronized by deriving every overlay position from the same world-to-screen transform used by the Canvas renderer. For sparklines and other microcharts, nearby row labels, headers, and inline values usually work better than a shared detached legend.
OffscreenCanvas and workers when main-thread contention is significantwidth * height * pixelRatio^2 * 4 * layerCount * instanceCountgetContext("2d", { willReadFrequently: true }) only for canvases that repeatedly call getImageData(), such as color-picking buffersgetImageData() readback cost, and when the buffer invalidates.devicePixelRatio, and redraw invalidation are handled.../../references/foundations/perception-color-and-encoding.md../../references/foundations/mobile-first-responsive-visualization.md../../references/foundations/domain-contextual-surfaces.md../../references/foundations/implementation-design-and-tradeoffs.md./references/rendering-architecture.md./references/high-density-interaction.md./references/performance-playbook.md./references/sparklines-and-microcharts.mdtools
Top-level workflow skill for USD performance diagnosis and optimization. Use for slow loading, high memory, low FPS, or 'optimize my scene' requests; delegates auth/runtime setup to Phase 0 owners.
data-ai
Use when the user mentions MagicPath, designs, UI components, themes, canvas selections, or repo-to-canvas UI work; run magicpath-ai to search, inspect, install, or author components.
documentation
Use as the top-level router for Omniverse Realtime Viewer USD app requests and focused viewer reference documents.
tools
Turn Notion specs into implementation plans, tasks, and progress tracking; use when implementing PRDs/feature specs and creating Notion plans + tasks from them.