Fork of ICE-6: Rendering Marks and Channels with React & D3
✓ Published0🌍 Public
Aaashrithd4
Last edited Mar 7, 2022
Created on Mar 7, 2022
This visualization displays the top 20 countries by COVID-19 case counts using a horizontal bar chart rendered as SVG marks within a React component. The code uses React’s `useState` and `useEffect` hooks to load and parse CSV data via `d3.csv`, with `scaleBand` and `scaleLinear` mapping country names and case numbers to pixel positions. Axis ticks and gridlines are generated manually by iterating over `xScale.ticks()` and the band domain, while each bar’s width derives from the numeric value. The example demonstrates combining D3’s scales and data loading with React’s declarative element creation.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed