Reusable Scatterplot with D3.js
✓ Published0🌍 Public
This example demonstrates a reusable scatterplot built with D3.js that visualizes two different CSV datasets, each containing X, Y, and Group columns. It shows how the same chart component can be dynamically updated by switching between datasets using a button. The chart renders as SVG, using d3.scaleLinear for axes, d3.axisBottom and d3.axisLeft for ticks, and d3.scaleOrdinal with d3.schemeCategory10 for colored groups. A legend and axis titles are included. The code relies on d3.csvParse to convert embedded CSV strings into data objects and d3.select to manage the SVG lifecycle.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed