Skip to main content
100%

Top 25 Countries with confirmed covid cases

✓ Published0🌍 Public
Ddheeraj1509
Last edited Mar 6, 2023
Created on Mar 6, 2023

This horizontal bar chart ranks the top 25 countries by confirmed COVID-19 cases, using a linear x-scale and band y-scale. It loads CSV data via `d3.csv`, slices the first 25 rows, and renders SVG rectangles with `d3.scaleBand` and `d3.scaleLinear`. Axes are manually drawn using `xScale.ticks()` and `yScale.domain()`, with blue gridlines. Built with React and D3 v6, the visualization uses a fixed 960×500 viewport and margin convention.

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