Fork of F-Fork of ICE-6: Rendering Marks and Channels with React & D3
✓ Published0🌍 Public
Aaashrithd4
Last edited Mar 5, 2022
Created on Mar 5, 2022
This example visualizes the top 10 most populous countries in 2019 using a horizontal bar chart rendered as SVG. The React component uses the `useState` and `useEffect` hooks to load the data from a CSV URL via `d3.csv`, then applies `d3.scaleBand` for the country categories and `d3.scaleLinear` for the population values. It renders grid lines, tick labels, and bars using React's JSX syntax within the SVG element, demonstrating a hybrid approach where React manages the marks and channels while D3 provides the scaling and data-loading utilities.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed