Fork of React + D3 Viz Starter
✓ Published0🌍 Public
This example shows a stacked bar chart displaying sample invoice data, with categories A, B, and C broken into three value segments. The chart is built with React and D3 v6, using d3.stack to aggregate values, d3.scaleBand and d3.scaleLinear for axes, and d3.scaleOrdinal for color encoding. Bars are rendered as SVG rectangles within a React component, using a Card layout and a VizContainer that follows the margin convention. The code includes commented-out margin visualization props for debugging layout.
AI-generated descriptionBoilerplate code for a React + D3 visualization with:
- CDN links for React, ReactDOM, and D3
- Basic React boilerplate
- Variables for dimensions and margins
- A
VizContainercomponent that:- Abstracts SVG/group container elements
- Follows the margin convention
- Show the margins, which can be easily removed by deleting the
showMargins={true} prop
MIT Licensed