Skip to main content
100%

CSV Data Loading and Display

✓ Published2🌍 Public
CCurran Kelleher
Last edited Sep 4, 2025
Created on Sep 4, 2025

This example demonstrates loading the classic Iris dataset from a CSV file and displaying it as formatted JSON text on a web page. The React app uses the `useEffect` hook to fetch data with D3’s `csv` function, then passes it to a separate visualization module. That module uses `selection.selectAll`, `join`, and `text` to render the parsed data into a `<pre>` element, with `.style` adjusting the font size. The dataset, originally published at the UCI Machine Learning Repository, contains measurements of sepal and petal dimensions across three iris species.

AI-generated description

This is the "Iris" dataset. Originally published at UCI Machine Learning Repository: Iris Data Set, this small dataset from 1936 is often used for testing out machine learning algorithms and visualizations (for example, Scatter Plot). Each row of the table represents an iris flower, including its species and dimensions of its botanical parts, sepal and petal, in centimeters.

The HTML page provides the basic code required to load the data and display it on the page (as JSON) using D3.js.

For a more up to date code example with React & D3, see (VizHub: Stylized Scatter Plot)[https://vizhub.com/curran/3d631093c2334030a6b27fa979bb4a0d?edit=files&file=index.js].

MIT Licensed

Similar vizzes