canvas2d-data-visualization

Render high-density interactive data visualizations with the Canvas2D API.

5.3k|765|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/openai/plugins --skill canvas2d-data-visualization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: canvas2d-data-visualization
Source: https://github.com/openai/plugins/tree/main/plugins/build-web-data-visualization/skills/canvas2d-data-visualization
Command: npx skills add https://github.com/openai/plugins --skill canvas2d-data-visualization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SVG and DOM-based charts degrade when visualizations need tens of thousands to millions of marks, continuous updates, or fluid pan and zoom. This Skill guides the design and implementation of Canvas2D-based charts that stay fast and interactive under those workloads.

Core Features & Use Cases

  • High-Density Rendering: Draw dense scatterplots, heatmaps, streaming traces, and sparkline walls with layered canvases, batched draw calls, and typed-array geometry.
  • Deterministic Hit Testing: Implement clickable, hoverable, and draggable marks using spatial indexes, Path2D replay, color-picking buffers, and pointer capture.
  • Hybrid Architecture: Combine Canvas marks with HTML/SVG overlays for axes, labels, tooltips, keyboard focus, and accessibility.
  • Use Case: Build a million-point scatterplot with brushing and zoom, or render sparklines for every row of a large data table without exhausting backing-store memory.

Quick Start

Use the canvas2d-data-visualization skill to build a fast Canvas timeline chart with brushing and zoom for my streaming dataset.

Frequently Asked Questions about canvas2d-data-visualization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I render a million-point scatterplot in the browser?

Use Canvas2D with batched draw calls, typed-array geometry, off-screen culling, and data decimation when the viewport cannot resolve individual points. Keep a retained scene model and redraw only invalidated layers instead of the full scene.

Canvas vs SVG for data visualization: which should I choose?

Choose Canvas2D when the chart has tens of thousands of marks, continuous updates, or many repeated instances where SVG node count dominates layout and memory. Prefer SVG when the chart is small, text-heavy, accessibility-driven, or needs editable vector export.

How do I make Canvas chart marks clickable and draggable?

Canvas pixels carry no semantics, so maintain a retained scene model and hit test with analytic geometry, spatial indexes, Path2D replay via isPointInPath, or a color-picking buffer. Use setPointerCapture for drags and clean up on pointercancel and lostpointercapture.

Why is my Canvas chart blurry when the browser is zoomed?

Blurriness happens when the backing store does not match CSS size times devicePixelRatio, which changes with page zoom. Set canvas.width and canvas.height to cssSize times pixelRatio, reset the context with setTransform, and redraw on DPR changes.

When should I use WebGL instead of Canvas2D?

Move to WebGL when the visualization needs GPU picking, custom shaders, instancing, very large particle or point layers, true 3D, or high-volume geospatial overlays. Canvas2D is simpler and often faster for flat immediate-mode workloads without shader setup.

How do I render sparklines for every row in a large table?

Use one shared Canvas over a virtualized table viewport, pooled Canvas elements, or pre-rendered bitmaps instead of one Canvas per row. Compute backing-store memory as width times height times pixelRatio squared times 4 times layer and instance counts.