Skip to main content
Public

Share visualization

Loading preview…

Reusable Scatter Plot

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Reusable Scatter Plot

1
GGARIDIDEEKSHITHREDDY
Last edited Mar 29, 2022
Created on Mar 29, 2022

This example animates the classic Iris dataset in a reusable scatter plot, cycling through four different feature pairs on the x-axis while keeping sepal length fixed on the y-axis. Points are colored by species (setosa, versicolor, virginica) with a custom legend, and the plot updates every few seconds using `setInterval`. Built with D3 v6, it uses `d3.scaleLinear` for axes, `d3.axisLeft` and `d3.axisBottom` for scales, and SVG circles for marks. The `scatterPlot` factory function encapsulates the chart’s dimensions, margins, and scales, making the visualization modular and reusable.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed