Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Refarctored Bar Chart

Public visualization

Viewing a saved revision (read-only)

12ccc7025ef44a2c81d1ba27db448a3a

Refarctored Bar Chart

0 stars1🌍 Public
AAnthony Zornig
Last edited Oct 3, 2021
Created on Oct 3, 2021

This example visualizes the population of the top 10 countries in 2020 using a horizontal bar chart. The bars are scaled proportionally to population values, with country names displayed on the vertical axis and population numbers on the horizontal scale. Built with React and D3 v5, the code loads CSV data via `d3.csv`, uses `scaleBand` and `scaleLinear` for axes, and renders SVG rectangles for each bar. The React component structure separates axes and marks into distinct modules, with data fetched asynchronously using a custom `useData` hook.

AI-generated description

A program that loads in some [data about css named Colors] https://gist.github.com/curran/b236990081a24761f7000567094914e0 using D3 utilities, and uses React statr to render the Data.