Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

The margin convention

Public visualization

Viewing a saved revision (read-only)

41d5fd7a64924346b91345b569385da5

The margin convention

0 stars1🌍 Public
Aaparnasj-sj
Last edited Oct 11, 2023
Created on Oct 8, 2023

A bar chart displays the ten most populous countries in 2020, using data from the UN Population 2019 dataset. The visualization demonstrates the margin convention by placing scales and axes inside a translated SVG group, separating the plot area from the chart edges. React manages the component state and renders the SVG, while D3’s `csv`, `scaleBand`, `scaleLinear`, and `max` functions handle data loading, scaling, and axis generation. Tick marks and labels for both axes are generated from the scale domains, with bars sized by population values.

AI-generated description

use react to render data d3 to generate bar chart