Skip to main content
Public

Share visualization

Loading preview…

Fork of Svelte + D3: Map (with visible hidden canvas) on canvas with zoom on click

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 Svelte + D3: Map (with visible hidden canvas) on canvas with zoom on click

0

This interactive map of US counties uses D3’s geoAlbersUsa projection and geoPath to draw each county’s outlines onto two overlapping canvas layers. The top layer renders semi-transparent steel-blue shapes, while the hidden bottom layer paints each county with a unique color ID; the browser’s Canvas getImageData function reads pixels under the mouse to identify hovered counties for highlighting. Clicking a county triggers a smooth, animated zoom via a Svelte tweened transform, with a press of Escape returning to the full view.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed