🌍 Public
Viewing a saved revision (read-only)
864af92c98b942f5bfe739a8669859bf
Transforming Data
This example demonstrates data transformation using the Iris dataset. It loads a CSV file and computes the average sepal length for each species, displaying the resulting summary as JSON text in a `<pre>` element. The visualization uses D3 v7 APIs including `csvParse` for data loading, `flatRollup` for grouping and aggregation, and `sum` for calculating totals. The implementation follows a state-based pattern with a `setState` function to manage the asynchronous data fetching and rendering lifecycle.
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.