Skip to main content
Public

Share visualization

Loading preview…

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

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

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

0
Yyar
Last edited Jun 3, 2022
Created on Jun 3, 2022

This example shows an interactive canvas visualization of 5,000 colored grid cells, where users can adjust the number of cells via a text input and hover to see a tooltip with the cell’s value. It uses D3 v4 for data binding and scales, while rendering both a visible canvas and a hidden canvas for color-based picking—mapping each cell to a unique RGB color via `getImageData` to identify hovered elements. The demo includes a timer-driven animation that redraws the grid over 300 milliseconds.

AI-generated description

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

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed