Skip to main content
100%

Reusable Scatter Plot with Menus

✓ Published0🌍 Public
SSharankumar02
Last edited Jul 20, 2023
Created on Jul 17, 2023
Forked from Hello VizHub

This example shows an interactive scatter plot of automotive data from the auto-mpg CSV file, with dropdown menus that let the user switch which columns appear on the x- and y-axes. The plot uses D3 v5’s `scaleLinear`, `axisLeft`, `axisBottom`, and `extent` to build axes, while circles drawn in SVG animate into position via a chained `transition().duration(2000).delay()`. The dropdown options are generated by a custom ES6 module, `dropdownMenu`, imported alongside the reusable `scatterPlot` module that handles rendering.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes