Fork of ICE-6: Rendering Marks and Channels with React & D3
✓ Published0🌍 Public
NNeeharikaGali
Last edited Mar 11, 2023
Created on Mar 11, 2023
This example shows state sales data as a horizontal bar chart, ordered by descending sales values and rendered as SVG rectangles. The visualization combines React’s state management with D3 scales and axes, using `scaleBand` for the y-axis categories and `scaleLinear` for the x-axis values. It loads data from a CSV file via D3’s `csv` method, then constructs custom tick marks and labels for both axes. React’s `useState` and `useEffect` hooks manage the asynchronous data fetching, while the rendering loop maps each data entry to a `<rect>` element with computed width and height.
AI-generated descriptionA bare minimum HTML page.
MIT Licensed