๐ Public
Diverging Bar chart in D3
This diverging bar chart visualizes population percent changes across U.S. states between April 2020 and July 2019, using horizontal bars that extend left or right from a central zero axis. The visualization first loads CSV data via `d3.csv`, then applies `d3.scaleLinear` for axes and bar lengths, `d3.scaleBand` for the categorical y-axis, and `d3.scaleSequential` with an `interpolateRdBu` color scheme. A color legend is generated using `d3.legendColor` from the d3-legend plugin, while bars are rendered as SVG `<rect>` elements. The chart includes axis labels, a title, and subtitle, all styled with D3 v7.
AI-generated descriptionThe dataset 'State Demographics' from the CORGIS Dataset Project. 'https://corgis-edu.github.io/corgis/csv/state_demographics/'
MIT Licensed
Comments
Sign in to join the discussion.