Transforming Data
✓ Published0🌍 Public
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 descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed