Fork of Animated Reusable D3 Scatter Plot
This animated scatter plot cycles through the numeric columns of the classic Iris dataset, changing the x-axis variable every three seconds while keeping sepal width on the y-axis. Using D3 v6, it leverages `scaleLinear`, `extent`, `axisBottom`, and `axisLeft` to render axes, and D3's `transition` with a one-second duration to animate both the movement of circles and the fading of axis titles. The visualization is drawn as an SVG, with the data fetched as CSV from a GitHub gist, and updates a reusable chart component via D3's join operation for enter, update, and exit states.
AI-generated descriptionAdded axis titles and animation to the x-axis label.
A couple of questions when making this update:
When using the ternary operator
continuedoes not seem to work whithin aforloop. line 43 of index.jsNeed to call the
plot()function beforeiis incremented. Is this related to the fact that this is anasyncfunction? So willionly be evaluated withincall()and not when thescatterPlot()instance is created? line 65 of index.js