Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

d3 Dispatch V5 - reusable

Public visualization

Viewing a saved revision (read-only)

f2bfa6f7b2f94a06b59d7378e48daf3c

d3 Dispatch V5 - reusable

0 stars0🌍 Public
JJimMaltby
Last edited Apr 12, 2022
Created on Apr 12, 2022
Forked from d3 Dispatch V5

This reusable D3 v5 example displays U.S. state population data by age group, initially showing a bar chart for a single state that can be updated dynamically. It uses an event dispatcher (`d3.dispatch`) to handle state changes, triggering transitions between bar and pie chart visualizations. The code builds SVG output with scales (`d3.scaleLinear`, `d3.scaleOrdinal`) and axes (`d3.axisLeft`), while loading data from a CSV file. Although the bar and pie drawing functions are present, the visible interaction logic is incomplete.

AI-generated description

Dispatching Events https://bl.ocks.org/mbostock/5872848

converted to v5