Pseudo Scatter Plot with Clickable Circles
✓ Published5🌍 Public
A set of six fixed circles, rendered as an SVG scatter plot, highlights the selected point by changing its fill to white with a thick black stroke via D3's attribute and filter methods. Clicking any circle triggers a state update through a unidirectional data flow, setting a `selectedId` that re-renders all circles. The code uses D3 v7 selections and joins (`selectAll`, `data`, `join`) within an SVG set up by `setupSVG`, with click interaction bound directly to each circle.
AI-generated descriptionMIT Licensed