Skip to main content
Public

Share visualization

Loading preview…

Working Zoom/Pan

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

Working Zoom/Pan

0 stars1Public
Bbepnye@gmail.com
Last edited Dec 5, 2024
Created on Dec 5, 2024

This visualization displays Colorado county voting data for a ballot proposition, showing stacked bars of yes and no votes for each county. The chart uses D3 v4’s `d3.zoom` and `d3.event.transform` with `rescaleX` to enable panning and zooming along the horizontal axis, while vertical movement is locked. Hovering over bars or counties reveals a tooltip with county-specific vote counts, using the `tooltip` module from `svgGlobals.js`. Data originates from a GeoJSON file of Colorado counties and a CSV of proposition results, rendered as SVG.

AI-generated description

An example showing the capabilities of VizHub:

  • if you hover over a county it will display the number of yes votes and no votes for the current proposition
  • TODO:
  • -color the map according to the number of votes
  • -add a selector for multiple propositions
  • -clean up code and functions into multiple classes

Comments

Sign in to join the discussion.

MIT Licensed