Skip to main content
100%

Fork of Fork of React + D3 Viz Starter

✓ Published1🌍 Public
NNita
Last edited Feb 23, 2025
Created on Feb 23, 2025

This interactive circle-packing visualization displays world population data by continent and country. It uses D3.js v6 within a React framework, leveraging the `d3.hierarchy` and `d3.pack` layout algorithms to arrange circles according to population values. The React components integrate with D3 selectors, while a reusable `VizContainer` component handles SVG structure and margin management. The visualization renders with SVG, using a sequential color scale for continents and showing country names with relative font sizes.

AI-generated description

Boilerplate code for a React + D3 visualization with:

  • CDN links for React, ReactDOM, and D3
  • Basic React boilerplate
  • Variables for dimensions and margins
  • A VizContainer component that:
    • Abstracts SVG/group container elements
    • Follows the margin convention
    • Show the margins, which can be easily removed by deleting the showMargins={true} prop
MIT Licensed

Similar vizzes