Skip to main content
Public

Share visualization

Loading preview…

Fork of 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

Fork of Animated Reusable D3 Scatter Plot

0
CCurran Kelleher
Last edited May 29, 2021
Created on May 29, 2021

This animated scatter plot cycles through the numeric columns of the Iris dataset, updating the x-axis and its title every three seconds while keeping the y-axis fixed on petal width. The visualization uses D3 v6 with a reusable scatter plot component that leverages `scaleLinear`, `axisBottom`, `axisLeft`, and `transition` to smoothly animate point positions and axis labels. Rendering is done via SVG, and the data is loaded from a CSV file hosted on GitHub.

AI-generated description

Added axis titles and animation to the x-axis label.

A couple of questions when making this update:

  1. When using the ternary operator continue does not seem to work whithin a for loop. line 43 of index.js

  2. Need to call the plot() function before i is incremented. Is this related to the fact that this is an async function? So will i only be evaluated within call() and not when the scatterPlot() instance is created? line 65 of index.js

Comments

Sign in to join the discussion.

MIT Licensed