Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity6-Tutorial

Public visualization

Viewing a saved revision (read-only)

d63ebd9f0d76479584aa03b573f0c6ec

Activity6-Tutorial

0 stars0🌍 Public
Sswapnadabburi@my.unt.edu
Last edited Oct 24, 2024
Created on Oct 24, 2024

This example shows a horizontal bar chart of 2020 population figures for 30 countries, with bars colored light green and a blue axis. It uses React with D3 v5 scales—`scaleBand` for the categorical country axis and `scaleLinear` for the population axis—to render SVG rectangles via the `Marks` component. Axis labels are generated with custom `AxisBottom` and `AxisLeft` components, and population values are formatted using D3’s `format('.2s')` to display abbreviations like "B" for billions. Data is loaded asynchronously from a CSV file via `d3.csv`.

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.