Skip to main content
100%

Fork of d3 and canvas - the bind, the draw and the pick

✓ Published0🌍 Public
Oonceup
Last edited Apr 24, 2022
Created on Apr 24, 2022

This example demonstrates a grid of colored rectangles, where each cell represents a data point and its color is mapped from its value using a spectral color scale. The visualization implements a picking mechanism for canvas-based interactivity by assigning each rectangle a unique, hidden color stored in a separate off-screen canvas. Using D3 v4, the code binds data to custom elements, then draws the visible grid with animations, while the hidden canvas enables precise hit-testing through color lookup, demonstrated with a tooltip.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes