Fork of CV: Loading CSV Data
✓ Published0🌍 Public
This example demonstrates loading CSV data in a React application and rendering interactive circles in an SVG. It uses d3.csv to fetch data.csv, mapping string values to numbers for the id, x, and y fields. The d3.scaleLinear function scales the x and y coordinates to fit the container’s dimensions, which are tracked via a ResizeObserver. The circles are redrawn with d3’s join method, responding to click events by toggling a selected circle’s fill color between white and black, managed through React state.
AI-generated descriptionMIT Licensed