Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Clickable Circles from CSV

Public visualization

Fork of Clickable Circles from CSV

0 stars0🌍 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

Comments

Sign in to join the discussion.

MIT Licensed