Fork of ICE-6: Rendering Marks and Channels with React & D3
✓ Published0🌍 Public
Nnagamaheswar
Last edited Mar 3, 2022
Created on Mar 3, 2022
This example visualizes the top 10 most populous countries in 2020 using a horizontal bar chart rendered as SVG. It loads medal data from a CSV via `d3.csv`, slices the first 10 rows, and uses `scaleBand` for the y-axis and `scaleLinear` for the x-axis to map country names and population values. The React app manages data with `useState` and `useEffect`, while custom tick labels and grid lines are generated manually with D3 scales instead of using `axisLeft` or `axisBottom`. Bars are drawn as `<rect>` elements inside a translated `<g>` group.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed