Skip to main content
100%

React Starter

✓ Published0🌍 Public
0007ebey
Last edited Sep 7, 2020
Created on Sep 3, 2020
Forked from React Starter

A React component hierarchy wraps D3-generated SVG axes and rectangles to render a horizontal bar chart from a hardcoded object of key-value pairs. The chart maps object keys to an ordinal y-axis via `d3.scaleBand` and values to a linear x-axis via `d3.scaleLinear`, with `d3.axisLeft` and `d3.axisBottom` for ticks. Bars are drawn as SVG `rect` elements that change fill color on click. The code imports `d3` v5 and uses React refs to attach D3 selections within `componentDidMount` and `componentDidUpdate` lifecycle methods.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes