packages = ["bokeh", "pandas", "numpy", "networkx", "diagrams", "scikit-learn", "pillow", "matplotlib", "plotly"] [[fetch]] files = ["diagrams_base.py"] from = "../../python/diagrams/" [[fetch]] files = ["pyscript_manager.py", "data.py"] to_folder = "lib" from = "../../python/lib/" [[fetch]] files = ["bokeh_utils.py"] from = "../../python/bokeh/" [[fetch]] files = ["matplotlib_utils.py", "plotly_utils.py"] from = "../../python/matplotlib/" [[fetch]] files = ["agent.py", "trainer.py", "utils.py", "metrics_chart.py", "crossover.py", "__init__.py"] to_folder = "ml/neuro" from = "../../python/ml/neuro/" [[fetch]] files = ["trainer.py"] to_folder = "ml/grokking" from = "../../python/ml/grokking/"

Loading...

COVID-19 Interactive World Map

Geographic visualization of pandemic data using Plotly choropleth maps

πŸ—ΊοΈ Map 1: Total Deaths

Darker red indicates higher death toll. Hover over countries for details.

Deaths choropleth with red color scale:

🌐 Map 2: Confirmed Cases

Darker blue indicates more confirmed cases. Shows total outbreak size using the SAME cached data.

Confirmed cases choropleth with blue color scale:

⚠️ Map 3: Case Fatality Rate

Shows death rate as percentage of confirmed cases (countries with 1000+ cases for statistical significance).

CFR choropleth with filtering and calculation:

πŸ“ˆ Map 4: New Cases Activity

Recent new cases, showing areas of active transmission.

New cases choropleth with orange color scale:

COVID-19 World Map

πŸ—ΊοΈ What is a Choropleth Map?

A choropleth map is a thematic map where areas are colored or shaded according to a statistical variable. In our case, we're coloring countries based on COVID-19 metrics.

  • Geographic Representation: Each country is a polygon with accurate boundaries
  • Color Encoding: The color intensity represents data magnitude
  • Interactive: Hover to see exact values and country names
  • Zoom & Pan: Click and drag to explore different regions

πŸ“Š What is Plotly?

Plotly is an interactive graphing library for Python. Unlike Matplotlib (which creates static images), Plotly generates interactive HTML visualizations that users can explore. It excels at geographic visualizations with built-in support for choropleth maps, and handles country matching automatically using ISO-3 codes.

πŸ”¬ The Four Maps Explained

  • Deaths Map (Red): Shows the human toll. Absolute numbers highlight heavily populated countries.
  • Confirmed Cases (Blue): Visualizes total outbreak size. Useful for understanding scale of spread.
  • Case Fatality Rate (Yellow-Red): Death rate relative to cases. Indicates healthcare capacity and population vulnerability.
  • New Cases (Orange): Shows active transmission areas, identifying current hotspots.

πŸ” Technical Implementation

  • ISO-3 Country Codes: Uses standardized codes (USA, GBR, FRA) for reliable country matching
  • Natural Earth Projection: A visually pleasing pseudo-cylindrical map projection
  • Plotly Choropleth: Built-in geographic support with country geometries
  • Data Caching: All 4 maps share the same loaded CSV (efficient!)
  • Async Display: 0.5s delay ensures Plotly library fully initializes

πŸ’‘ Geographic Insights

  • Spatial Patterns: Maps reveal regional clusters not visible in tables
  • Absolute vs Relative: Deaths map shows population, CFR normalizes by cases
  • Temporal Dimension: New cases map captures the dynamic nature of the pandemic
  • Missing Data: Gray/white countries indicate no data or no ISO-3 match

🎯 Interactive Features

Try these interactions with the maps:

  • Hover over any country to see detailed statistics
  • Click and drag to pan the map
  • Use scroll wheel to zoom in/out
  • Double-click to reset view
  • Click the camera icon (top-right) to download as PNG

View source files

🐍 Python Console