Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Transforming Data

Public visualization

Viewing a saved revision (read-only)

0c61430871e647e3a3c058895a91c586

Transforming Data

0 stars0🌍 Public
Hharsha
Last edited Jul 19, 2023
Created on Jul 19, 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.