onclick change color
✓ Published1🌍 Public
This example presents the classic Iris dataset as a scatter plot of sepal length against sepal width, with each flower represented by a large circle. It shows how a user can interact with the visualization by clicking on a data point, which immediately changes that circle’s fill color to red. The implementation uses D3 v6’s `select`, `csv`, `scaleLinear`, and `extent` functions to load the data, project it into SVG coordinates, and render the circles within an SVG container. The click interaction is encoded directly via an `onclick` attribute on each circle, setting its style to a red fill.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed