Skip to main content
100%

Fork of Clickable Circles from CSV

✓ Published0🌍 Public
KKamil Poprawa
Last edited Sep 19, 2026
Created on Sep 19, 2026

This example displays a scatterplot of colorful circles loaded from a CSV file, with click interaction to highlight a selected node. Written in React, it uses D3’s `selectAll` and `data` join to bind CSV rows to SVG circle elements, mapping `cx`, `cy`, `r`, and `fill` attributes. A React `useState` hook tracks the selected circle’s ID, and clicking a circle triggers a re-render that adds a black stroke to the chosen node. The code imports `csv` from D3 to parse the data and passes it to a reusable `viz` function that updates the visualization.

AI-generated description
MIT Licensed

Similar vizzes