Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refactored Bar Chart

Public visualization

Viewing a saved revision (read-only)

e6d2333338ca46adb2a39d27bb3e3e9a

Refactored Bar Chart

0 stars0🌍 Public
OOlof Ollerstam
Last edited May 18, 2021
Created on Apr 30, 2021

A refactored bar chart displays the top ten countries by 2020 population from a United Nations dataset, using horizontal bars to compare values. The React application loads the CSV with d3.csv and renders an SVG, splitting visualization into reusable components for axes and marks. D3 scales—scaleBand for the categorical y-axis and scaleLinear for the quantitative x-axis—position the bars, while axis components generate ticks and labels. The code separates data fetching, rendering, and layout concerns, demonstrating a modular approach to building interactive charts with React and D3 v6.

AI-generated description

A program that loads in some data about CSS named color data using D3 utilities, and uses React to render the data as a radial burst!