Skip to main content
100%

Fork of Animated Reusable D3 Scatter Plot prueba

✓ Published0🌍 Public
AAleOG
Last edited Apr 28, 2023
Created on Apr 27, 2023

This example cycles through the numerical columns of the Iris dataset, using each as the x-axis variable while the y-axis remains fixed on the last column. Animated transitions, driven by `setInterval` and D3’s `transition`, move the scatter plot circles and update the x-axis title every three seconds. The visualization is built with D3 v6, using reusable chart functions, `scaleLinear`, `axisBottom`, and `axisLeft` to render the SVG. The data is loaded asynchronously via `d3.csv` from a GitHub Gist.

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

MIT Licensed

Similar vizzes