Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity 6

Public visualization

Viewing a saved revision (read-only)

dfe53ebccee24eba9c7776c734270a40

Activity 6

0 stars0🌍 Public
Mmayasuedorman@gmail.com
Last edited Oct 25, 2024
Created on Oct 23, 2024
Forked from Hello VizHub

This example uses a horizontal bar chart rendered with React and SVG to compare the 2010 populations of twenty countries. The chart sorts countries vertically using an ordinal scale and encodes population values with a linear scale, formatting large numbers with abbreviations (e.g., “1.5B”). It pulls data from a CSV file hosted on GitHub. The code leverages d3’s `scaleBand`, `scaleLinear`, `format`, and `csv` functions, along with custom React components (`AxisBottom`, `AxisLeft`, `Marks`) that render SVG elements. Tooltips display the formatted population value for each bar.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.