Viewing a saved revision (read-only)
ZtR8czDKwO2baoCgIQnLB
Created from react-d3-starter template
React D3 Starter
A minimal React + D3 starter for building interactive data visualizations.
Files
index.html— page shell and import map (React + D3 from a CDN).index.jsx— mounts the<App />component.App.jsx— loadsdata.csvand renders the visualization.viz.js— D3 render entry point.renderCircles.js— draws the circles.useContainerDimensions.js— tracks the container size.data.csv— sample data.styles.css— page styles.
Getting started
Edit App.jsx to change what gets rendered; the preview updates live as you type.
Visualization Ideas
Dataset context: data/ebola-cases-and-deaths-who-gar-sitrep(Jan 06, 2016).csv has columns Country, Case def., Total cases, Cases last 21 days, Total deaths, Country Report Date. It is a cumulative snapshot from a WHO sitrep, not a weekly series. There is one row per country and case definition (Confirmed, Probable, Suspected, All), and many cells are blank. Country Report Date is filled only on the first row of each country block. Liberia appears twice (Liberia and Liberia2). The file has no epidemiological-week field, so weekly new cases and deaths cannot be derived from it. Every idea below uses only these fields, leaves blanks as missing, and never estimates values. Each one supports the brief's goal of comparing cases with mortality across Guinea, Liberia and Sierra Leone, and of documenting data limits honestly.
Cumulative-Data Diagnostic Panel
- Main question: Is the data weekly incident or cumulative, and can weekly differences be calculated?
- Fields:
Country,Case def.,Total cases,Total deaths,Country Report Date. - Encoding: a checklist-style table with status icons (cumulative snapshot, one date per country, no weekly series), plus a count of rows per country.
- Interaction: hover an icon to see the rule that triggered it.
- Note: compute row counts and distinct non-empty dates with
d3.rollup. Show "weekly differences not possible" when there is only one date per country.
Total Cases vs Total Deaths by Country (Grouped Bars)
- Question: How do cumulative cases and deaths compare across countries?
- Fields:
Country,Case def.= All,Total cases,Total deaths. - Encoding: grouped bars (cases vs deaths) per country with a band x-scale.
- Interaction: tooltip with the exact values and the report date.
- Note: filter to
Allrows and render blank values as hatched "not reported" bars.
Case Fatality Ratio Lollipop
- Question: What is the crude deaths-to-cases ratio per country?
- Fields:
Country,Total deaths,Total cases(Allrows). - Encoding: lollipop chart on a 0–100% axis, sorted by ratio.
- Annotation: label it "cumulative deaths ÷ cumulative cases, not an adjusted CFR".
- Note: compute only where both values are present.
Case Definition Composition (Stacked Bars)
- Question: How are cases split between Confirmed, Probable and Suspected?
- Fields:
Country,Case def.,Total cases. - Encoding: stacked horizontal bars with a categorical color per definition. Exclude
Allfrom the stack. - Interaction: toggle between absolute and 100% normalized.
- Note: use
d3.stackwith missing values left as missing, not coerced to 0.
Case Classification Legend and Note Panel
- Question: What does each case definition mean, and what data is available for each?
- Fields:
Case def.,Total cases,Total deaths. - Encoding: a small matrix of definition × metric with filled or empty cells showing availability.
- Interaction: click a definition to filter the other views.
- Note: this fulfills the brief's classification note. Use WHO wording only as a static caption.
Data Completeness Heatmap
- Question: Which fields are missing for which country and definition?
- Fields: all columns, by
Country×Case def.. - Encoding: a grid of cells colored present/blank, one column per metric.
- Interaction: hover to see the raw value or "blank in source".
- Note: treat both empty strings and undefined as missing.
Recent Activity (Last 21 Days) Bullet Chart
- Question: Is there recent transmission relative to the cumulative total?
- Fields:
Country,Cases last 21 days,Total cases. - Encoding: a bullet chart with a thin bar for recent cases against a wide bar for the total, on a log or symlog scale.
- Annotation: mark zero as "0 reported in last 21 days", and blank as "not reported".
- Note: use
scaleSymlogso that zeros remain visible.
Report Date Timeline Strip
- Question: How current is each country's data, and how aligned are the reporting dates?
- Fields:
Country,Country Report Date. - Encoding: a dot plot on a time axis with one dot per country.
- Interaction: tooltip with the date and the gap to the latest date.
- Note: forward-fill dates only within the same country block for display, and mark them as inherited from the block header.
Confirmed-Only Cases and Deaths Scatter
- Question: Do confirmed cases and deaths scale together across countries?
- Fields:
Country,Case def.= Confirmed,Total cases,Total deaths. - Encoding: scatter with x = cases, y = deaths, and a dashed y = x reference line.
- Interaction: hover labels. Points with missing deaths are shown as ticks on the x-axis.
- Note: with so few points, label every point directly.
Probable vs Confirmed Slope Chart
- Question: How does the weight of probable cases compare with confirmed ones in each country?
- Fields:
Country,Case def.,Total cases. - Encoding: slope lines from Confirmed to Probable per country.
- Interaction: highlight a country on hover.
- Note: skip countries where either value is missing.
Cases-to-Deaths Sankey Fragment
- Question: Of the total cases, how many are linked to recorded deaths, and how many have no death figure?
- Fields:
Total cases,Total deaths, forAllrows. - Encoding: a two-node flow from cases to deaths plus an "unaccounted or not reported" remainder, labeled as a difference rather than survivors.
- Note: use d3-sankey if available. Otherwise draw simple proportional bars. Show it only where deaths are present.
Small Multiples per Country
- Question: How does each country's profile compare using the same scales?
- Fields: all numeric fields by
Country. - Encoding: one panel per country, each holding a mini bar set (Confirmed, Probable, Suspected, All) for cases and deaths on a shared y-scale.
- Interaction: linked hover across panels.
- Note: use
d3.groupand a shared domain to keep the panels comparable.
Regional Total Treemap
- Question: Which countries and case definitions contribute most to the regional case count?
- Fields:
Country,Case def.,Total cases. - Encoding: treemap, with country as the parent, definition as the child, and area proportional to cases.
- Interaction: click to zoom into a country.
- Note: exclude
Allrows to avoid double counting. Used3.hierarchyandd3.treemap.
Aggregation Reconciliation Check
- Question: Do the components sum to the
Allrow? - Fields:
Case def.,Total cases,Country. - Encoding: a diverging bar of (All − sum of Confirmed, Probable and Suspected) per country.
- Annotation: flag non-zero differences, and cases where a component is blank, as "cannot verify".
- Note: this guards the brief's "do not invent values" rule.
- Question: Do the components sum to the
Duplicate Entity Alert (Liberia vs Liberia2)
- Question: Is
Liberia2a separate block that should not be merged silently? - Fields:
Country,Country Report Date,Total cases,Total deaths. - Encoding: side-by-side cards with the values and dates for each block, connected by a "check before merging" badge.
- Interaction: toggle "include Liberia2 in regional total" and show the effect on the totals.
- Note: keep the default exclusion and document the choice in the footer.
- Question: Is
Regional Overview KPI Cards with Sparkless Context
- Question: What are the headline regional totals, and how complete are they?
- Fields:
Total cases,Total deaths,Country,Case def.= All. - Encoding: large-number cards with a "n of 3 countries reporting" completeness indicator.
- Interaction: hover to see the per-country contributions.
- Note: sum only the non-missing values and show the completeness caveat.
Placeholder Dual-Chart Layout for Future Weekly Data
- Question: What would the brief's two aligned charts look like once a weekly file is available?
- Fields: none from this file for the series. The layout shows only the
Country Report Datesnapshot. - Encoding: two stacked panels sharing an x-axis, empty of lines, with an explanatory overlay that no weekly series exists.
- Note: build the shared-axis scaffolding so a weekly dataset can be plugged in later. Do not draw synthetic lines.
Single-Date Snapshot Markers on a Shared Time Axis
- Question: Where do the available snapshot totals sit on the 2014–2016 time axis?
- Fields:
Country Report Date,Total cases,Total deaths,Country. - Encoding: unconnected points in two aligned panels (cases on top, deaths below) on a shared date x-axis, with a different shape per country.
- Annotation: a note that the points are cumulative snapshots, not weekly increments, so there are no lines.
- Note: plot only rows with both a date and a value, and use the block's header date for
Allrows only as labeled.
Radial Country Comparison
- Question: How do countries differ across several reported measures at once?
- Fields:
Total cases,Cases last 21 days,Total deaths, byCountry. - Encoding: a radar or polar chart with each metric normalized per axis, one polygon per country.
- Interaction: toggle countries on and off.
- Note: omit axes with missing values for a country instead of plotting them as zero.
Guided Data-Story Stepper
- Question: What can and cannot be concluded from this file?
- Fields: all columns.
- Encoding: a scrollytelling sequence moving through diagnostics, totals, ratios, composition and gaps, reusing the earlier charts with consistent colors.
- Interaction: next and previous buttons, with keyboard support.
- Note: keep one React state
stepand re-render the D3 charts per step. Include the data source and classification footnote on every step.