Skip to main content
Public

Share visualization

Loading preview…

Animated Reusable D3 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

Animated Reusable D3 Scatter Plot

36
CCurran Kelleher
Last edited May 22, 2021
Created on May 22, 2021

This example demonstrates a reusable scatter plot that animates between different dimensions of the Iris dataset, cycling through petal width, sepal width, petal length, and sepal length every 3 seconds. The visualization uses D3 v6’s `scaleLinear`, `axisLeft`, and `axisBottom` to render axes, while `transition` and selection joins animate circle positions and axes smoothly. The code loads CSV data via `d3.csv` and implements a configurable chart function with setter methods for width, height, data, and margin.

AI-generated description

A reusable scatter plot inspired by Towards Reusable Charts and Observable: selection.join.

Shows the Iris Dataset.

Comments

Sign in to join the discussion.

MIT Licensed