Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Data Joins

Public visualization

Viewing a saved revision (read-only)

0972868b1d864f1492b6a2b669740bfc

Data Joins

0 stars1🌍 Public
Cchris.shimotake@gmail.com
Last edited May 1, 2024
Created on May 1, 2024

This example demonstrates D3 data joins by binding a dataset of country-weight pairs to SVG elements across two canvases. It starts by selecting and restyling existing rectangles with D3’s `select` and `attr`, then appends circles manually before using `data()` and `join()` to automatically create new circles mapped from the array’s `size` and `weight` values. The code also shows data transformation with `forEach`, grouping countries into weight arrays, and renders everything as SVG in a React setup using D3 v7.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.