Skip to main content
100%

Top 25 Countries with confirmed covid cases

✓ Published1🌍 Public
Ddheeraj1509
Last edited Mar 5, 2023
Created on Mar 5, 2023

This visualization shows the top 15 countries with the highest number of confirmed COVID-19 cases using horizontal bar charts. The bars represent case counts with a linear scale on the x-axis and country names on the y-axis. The code loads data from a CSV file hosted on GitHub and uses React’s useEffect hook to fetch and parse the data asynchronously. D3’s scaleBand and scaleLinear functions map the data to SVG rectangles, while d3.csv handles the data import. The chart is embedded within a React component that renders the SVG output directly.

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