Skip to main content
100%

Reusable Charts

✓ Published2🌍 Public
Aadventuresenglish.info@gmail.com
Last edited Dec 6, 2023
Created on Dec 6, 2023
Forked from D3 Starter

This example demonstrates a reusable D3 chart component that visualizes the Iris dataset as a scatter plot, cycling through different variable pairings every two seconds. The `scatterPlot` function creates a configurable plot with settable properties like width, height, data, x/y value functions, margin, and radius. Using D3’s `scaleLinear`, `extent`, `axisLeft`, and `axisBottom`, it renders SVG circles with animated axes that update as the selected columns change. The plot is applied to the SVG via the `.call()` method, and `setInterval` drives the rotation through the dataset’s four numeric columns.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes