Skip to main content
100%

Transforming Data

✓ Published0🌍 Public
Hharsha
Last edited Jul 22, 2023
Created on Jul 22, 2023
Forked from Hello VizHub

This example demonstrates data transformation with the Iris flower dataset, computing the average sepal length for each species and displaying the result as formatted JSON text. The visualization begins by fetching data.csv and parsing it with `d3.csvParse`, converting numeric fields from strings to numbers. It then uses `d3.flatRollup` combined with `d3.sum` to group records by species and calculate mean sepal lengths, with the final output rendered as a `<pre>` element via D3's `select` 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