Skip to main content
100%

D3 group() example

✓ Published0🌍 Public
AAxVa 🐍 💪
Last edited Feb 3, 2024
Created on Feb 3, 2024

This example demonstrates how D3’s `group()` method partitions a small array of Nobel Prize laureate records by their year of award, producing an `InternMap` with two keys (1901 and 1902) and corresponding arrays of names. The code logs the grouping result and then uses `Array.from` with destructuring assignment `([k, v])` to iterate over each key-value pair, printing the key’s type (number) and the value’s type (object). The visualization relies on the D3 v7 library, loaded via CDN, while the raw dataset is embedded directly in the script.

AI-generated description
MIT Licensed

Similar vizzes