Skip to main content
100%

Transforming Data

✓ Published0🌍 Public
VVarshareddy2912
Last edited Jun 24, 2023
Created on Jun 24, 2023
Forked from Hello VizHub

This example demonstrates how data can be loaded, parsed, and aggregated in the browser using D3 v7 and ES6 modules. It loads the classic Iris dataset from a CSV file, converts the numeric fields, and then uses `d3.flatRollup` with `d3.sum` to compute the average sepal length for each species. The result is displayed as formatted JSON text within a `<pre>` element. The code also illustrates a pattern for handling asynchronous data loading with a state machine that manages `undefined`, `'LOADING'`, and loaded data states.

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