Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity 6 Question 1.1

Public visualization

Viewing a saved revision (read-only)

f432ddd300a0402b845dbf5b3e0a8361

Activity 6 Question 1.1

0 stars0🌍 Public
HHarshita Vairagade
Last edited Apr 14, 2024
Created on Apr 14, 2024

This example renders a horizontal bar chart comparing the population of ten countries for the year 2000. The visualization uses React to construct SVG elements, with D3's `scaleBand` and `scaleLinear` functions mapping categorical country names and continuous population values to the chart's axes. The bars display a tooltip with the formatted population value. The code imports D3 functions like `csv`, `scaleBand`, `scaleLinear`, and `format`, and loads data asynchronously from a GitHub-hosted CSV file.

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.