Skip to main content
100%

Activity6_4_Transforming the Data

✓ Published0🌍 Public
AArun Pratap
Last edited Jul 10, 2023
Created on Jul 10, 2023
Forked from Hello VizHub

This example demonstrates data transformation by loading the classic Iris flower dataset from a CSV file and computing the average sepal length for each species using D3’s `flatRollup` and `sum` functions. The results are displayed as a formatted JSON summary in a `<pre>` element. The visualization fetches the local CSV with `fetch`, parses it via `csvParse`, and converts numeric fields to numbers. The code also shows state management patterns, including a loading state and conditional rendering, relying on D3 v7’s selection and join methods.

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