Menus for Animated Reusable D3 Scatter Plot
This interactive scatter plot visualizes the Iris dataset, allowing users to dynamically change which attributes are mapped to the X and Y axes via HTML dropdown menus. The plot animates transitions between states, smoothly moving circles and updating axis labels when the selected variables change. Built with D3 v6, the example demonstrates a reusable chart architecture using custom components like `scatterPlot` and `menu`, leveraging D3's `dispatch` for event handling and `transition` for smooth animations.
AI-generated descriptionA reusable scatter plot inspired by Towards Reusable Charts and Observable: selection.join.
Shows the Iris Dataset.
Howto add menus?
- using html select tag https://www.w3schools.com/tags/tag_select.asp
Using event listeners - https://github.com/d3/d3-dispatch
Data from https://gist.github.com/curran/a08a1080b88344b0c8a7