Skip to main content
100%

Loading Data

✓ Published136🌍 Public
CCurran Kelleher
Last edited Aug 28, 2025
Created on Jan 18, 2023
Forked from Mouse Follower

This example demonstrates how to load and parse a CSV file in D3.js, displaying the Iris dataset as formatted JSON text in a `<pre>` element. The visualization initially shows a "LOADING" state, then fetches `data.csv` via the Fetch API and parses it using `d3.csvParse`. The code explicitly converts string measurements into numbers for all four numeric columns. State management is handled through a simple `setState` pattern, where the `viz` function checks whether data is loaded, triggers the asynchronous fetch, and re-renders once the parsed array of objects is available.

AI-generated description

Loading a CSV file, the Iris Dataset.

MIT Licensed

Similar vizzes