Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

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

Public visualization

Viewing a saved revision (read-only)

0f58afc9ac9145cda5d4c969f240a50a

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

0 stars0🌍 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.