Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Let's make a bar graph

Public visualization

Fork of Let's make a bar graph

0 stars0🌍 Public
MMatiasmedrano66
Last edited Dec 27, 2020
Created on Dec 27, 2020

This example displays a horizontal bar chart of country populations using SVG rectangles. It loads data from a local CSV file and renders each bar with D3 v5’s `scaleLinear` for widths and `scaleBand` for vertical positioning. The code imports `select`, `csv`, `scaleLinear`, `max`, and `scaleBand` from the D3 module, fetches the CSV asynchronously, and appends `rect` elements to an SVG. The data values are multiplied by 1,000 to convert population figures.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

Comments

Sign in to join the discussion.

MIT Licensed