Working Zoom/Pan
✓ Published1🌍 Public
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 descriptionAn 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
MIT Licensed