Skip to main content
100%

Fork of Bar chart with margin convention

✓ Published0🌍 Public
SShashwat Kumar
Last edited Jul 27, 2021
Created on Jul 27, 2021
Forked from Bar chart

This fork of a bar chart displays the top 10 countries by population for 2020, using horizontal bars ranked from largest to smallest. The visualization loads CSV data from a GitHub gist and renders it as SVG rectangles within a specified margin convention. Built with React and D3 v7, the code uses `scaleBand` for the y-axis, `scaleLinear` for the x-axis, and `max` to determine the domain. The React `useState` and `useEffect` hooks manage asynchronous data loading, while SVG `<rect>` elements are mapped within a translated group to respect the margins.

AI-generated description

A progran that follows our mouse.

MIT Licensed

Similar vizzes