Skip to main content
100%

Transforming Data

✓ Published0🌍 Public
Mmn0658
Last edited Jun 26, 2023
Created on Jun 26, 2023
Forked from Hello VizHub

This example demonstrates how to load, transform, and summarize the classic Iris dataset. It fetches a CSV file, parses it with `d3.csvParse`, converts numeric fields, and then uses `d3.flatRollup` and `d3.sum` to compute the average sepal length for each species. The resulting summary is displayed as a JSON string in a `<pre>` element. The code relies on D3 v7 for data parsing and aggregation, and uses a simple state-management pattern with `setState` to handle asynchronous loading.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes