Fork of ICE-6: Rendering Marks and Channels with React & D3
✓ Published0🌍 Public
Ssudhamshu24
Last edited Mar 7, 2022
Created on Mar 7, 2022
This example visualizes the top 10 soap products by their 2008 population values using a horizontal bar chart rendered as SVG. The chart employs React’s `useState` and `useEffect` hooks to asynchronously fetch CSV data from a GitHub URL, then maps each product to a rectangle whose width is proportional to its population via `d3.scaleLinear` and `d3.scaleBand`. Axes ticks are generated with `xScale.ticks()`, and the layout uses explicit margins and dimensions. The code demonstrates manual rendering of marks and channels with React components and D3 scales.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed