Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 group() example

Public visualization

Viewing a saved revision (read-only)

d51ae69a27c94811b28c9a6cee93124c

D3 group() example

0 stars0🌍 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

D3 select() and selectAll() example

Visit also https://github.com/ax-va/Interactive-Data-Visualization-Dale-2023