Skip to main content
Public

Share visualization

Loading preview…

Data Analysis

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportHTML, source ZIP

Data Analysis

0 stars1Public
ZZach M
Last edited Nov 12, 2026
Created on Nov 12, 2026

Created from react-d3-starter template

EIA 6-Hour Electricity Generation, January 2026

An interactive visualization of hourly-interval (6-hour block) electricity generation by fuel type across 13 US regions for January 2026, built with React + D3.

Dataset

data/eia_generation_6hour.csv

  • Rows: 48,754 (header is the first CSV record and is parsed with a real CSV parser; cells may contain quoted content).
  • Size: ~4.0 MB
  • Subject: Reported net electricity generation (MWh) by US balancing region and fuel type, aggregated into 6-hour intervals during January
    1. Each row is one (region, fuel, interval) cell.
  • Grain: one row per region_code × fuel_code × period_start_local.

Columns

Column Type (Munzner) Meaning Notes
period_start_local Temporal (local wall-clock timestamp, 6h resolution) Start of the 6-hour reporting interval in the region's local time Values 2026-01-01T00:00 .. 2026-01-31T18:00 (cardinality 8 measured; actual distinct values span the month). Parsed as a string and sliced to YYYY-MM-DDTHH for display; grouped by day.
interval_hours Ordinal (constant 6) Nominal length of the interval in hours Constant, no variation.
month Ordinal (constant 2026-01) Reporting month Constant.
region_code Nominal (geographic identifier) Short code for the balancing region (e.g. CAL). 13 distinct codes.
region Nominal (geographic identifier) Human-readable region name (e.g. California). 13 distinct names; 1:1 with region_code (verified).
reference_timezone Nominal IANA timezone name used as the region's local reference (e.g. America/Los_Angeles). 4 distinct values.
fuel_code Nominal Short fuel code (e.g. NG, SUN). 16 distinct codes.
fuel Nominal Human-readable fuel name (e.g. Natural Gas). 16 distinct names; 1:1 with fuel_code (verified).
generation_mwh Quantitative (interval energy, Megawatt-hours) Net generation for the interval. Range ≈ −18,780 .. 296,468. Negative values are meaningful (pumped storage pumping, behind-the-meter solar, etc.) and are retained as such.
reported_hours Quantitative/Ordinal (1 or 6) Hours actually reported in the interval. Almost always 6.
expected_hours Ordinal (constant 6) Expected hours in the interval. Constant.

Missing values

None reported across any column at profile time.

Parsing assumptions

  • Header is read via d3's CSV parser (the first CSV record; safe for quoted embedded newlines).
  • generation_mwh is coerced with +, and NaN is filtered out defensively.
  • period_start_local is kept as a string, and the day key is produced by slicing the first 10 characters (YYYY-MM-DD). No timezone conversion is performed; "date" here means the local wall-clock date in each region's own reference timezone.

Caveats

  • Generation is reconciled by region and fuel. region/region_code and fuel/fuel_code are 1:1 pairs in this dataset, so either can be used as a grouping key; both are documented.
  • reference_timezone differs across regions, so aggregating period_start_local across regions interprets the timestamps as wall-clock labels, not as a shared instant.
  • Negative generation_mwh values must not be treated as missing; they represent real net metering/pump losses.

Relationships

Only one dataset is provided, so no cross-dataset joins are performed. Within the single dataset, the verified semantic joins are:

  • region_code ↔ region (1:1 identity pair).
  • fuel_code ↔ fuel (1:1 identity pair).

Both were validated by inspecting distinct value counts (13 ↔ 13, 16 ↔ 16) and checking that each code maps to a single name.

Visualization Mappings

Heatmap grid (SVG rect cells).

  • X encoding: period_start_local day (YYYY-MM-DD), sorted temporally. Temporal axis (position → time).
  • Y encoding: fuel (nominal), sorted by total generation_mwh descending so the highest-volume fuels sit at the top.
  • Cell value: sum of generation_mwh for the (fuel, day) group.
  • Color encoding: diverging color scale centered on 0 (RdBu); negative values shading blue, positive red. The scale domain is set from the symmetric max absolute value across all cells so both directions are readable. Cell tooltip shows the exact fuel, date, and summed MWh.
  • Interactions:
    • Hover a cell to highlight it (stroke) and show an HTML tooltip positioned at the cursor with the fuel, date, and total MWh.
    • Click a legend entry for a fuel to toggle its row on/off (focus filter) so crowded categories can be isolated.
  • Responsive: the SVG width/height is driven by a ResizeObserver on the container, so the heatmap reflows on resize.
  • Accessibility: each cell is a focusable element and carries an aria-label with fuel, date, and value; the visible title attribute duplicates that for non-hover users. A legend with color swatches is rendered beneath the chart with plain text labels.

Rationale

A heatmap with time on x and a nominal fuel category on y is the simplest faithful encoding of a (category × time) → total quantity table. It lets a reader scan for daily patterns in each fuel (solar diurnality, gas ramping, coal baseload, negative values for pumped/battery charging) without requiring a multi-series line chart that would be unreadable for 16 categories. A diverging scale is required because the quantity can be negative, and the centered zero point makes the sign visually salient.

Visualization Ideas

Framing: the Energy source analyzer dashboard compares how energy is generated in a region for an "average day" versus other periods or other regions. Because the file only contains January 2026, an "average day" is the mean across days of a 6-hour slot (period_start_local.slice(11,16) → 00:00, 06:00, 12:00, 18:00), and "other months" is approximated by other windows within January (week 1–5, weekdays vs weekends). Slots are local wall-clock labels per region (reference_timezone).

  1. Average-Day Stacked Area by Region

    • Question: What does a typical day's fuel mix look like in the selected region?
    • Fields: region_code, fuel, generation_mwh, period_start_local (slot).
    • Encoding: x = 6-hour slot, y = mean MWh per slot, stacked areas colored by fuel (categorical).
    • Interaction: region dropdown; hover shows the fuel's mean MWh and share.
    • Implementation: rollup by region, fuel, date, slot; then mean across dates; d3.stack + d3.area with step curve.
  2. Region A vs Region B Mirror Profile

    • Question: How does the average-day mix differ between two regions?
    • Fields: region_code, fuel, generation_mwh, slot.
    • Encoding: two small-multiple stacked bar sets by slot, mirrored about a center axis, shared fuel colors.
    • Interaction: two region pickers; hover a fuel to highlight it on both sides.
    • Implementation: reuse the idea 1 aggregation per region; draw B with a negated y-scale for display only.
  3. Normalized Share Comparison (100% Stacked Bars)

    • Question: Which regions rely most on which fuels, regardless of size?
    • Fields: region, fuel, generation_mwh.
    • Encoding: one horizontal 100% stacked bar per region, colored by fuel, sorted by a chosen fuel's share.
    • Interaction: click a fuel segment to re-sort regions by that fuel.
    • Implementation: sum positive generation per region/fuel; handle negatives separately (see idea 15).
  4. Slot × Fuel Heatmap for One Region

    • Question: When during the day does each fuel produce most?
    • Fields: fuel, slot, generation_mwh, region_code.
    • Encoding: rows = fuel, columns = slot, color = mean MWh (sequential or diverging because of negatives).
    • Interaction: region selector; tooltip with mean and min–max across days.
    • Implementation: adapts the existing heatmap in viz.js by changing the x key from date to slot.
  5. Difference Heatmap (Region vs Region)

    • Question: In which fuel/slot cells does region A outproduce region B?
    • Fields: region_code, fuel, slot, generation_mwh.
    • Encoding: diverging color on (meanA − meanB) per fuel × slot cell.
    • Interaction: swap A/B button; toggle between absolute MWh and share-of-region difference.
    • Implementation: compute both aggregates, subtract by key; reuse the symmetric RdBu domain.
  6. Week-over-Week Average-Day Lines

    • Question: Does the typical daily shape of a fuel change from week to week (a stand-in for month-to-month)?
    • Fields: period_start_local (date → ISO week, slot), fuel, generation_mwh, region_code.
    • Encoding: x = slot, y = mean MWh, one line per week (sequential hue), faceted by selected fuel.
    • Interaction: fuel dropdown; hover isolates a week.
    • Implementation: derive week from the date string; group by week and slot.
  7. Weekday vs Weekend Profile

    • Question: Does the generation pattern differ on weekends?
    • Fields: date (day-of-week via new Date), slot, generation_mwh, fuel, region_code.
    • Encoding: paired lines (weekday solid, weekend dashed) per fuel in small multiples.
    • Interaction: brush-select fuels; annotate the largest gap.
    • Implementation: classify dates, then mean per class and slot. Parse dates as local strings to avoid timezone shifts.
  8. Fuel Mix Slope Chart: Period vs Period

    • Question: How did each fuel's share change between the first half and the second half of January?
    • Fields: date, fuel, generation_mwh, region_code.
    • Encoding: two vertical axes (period 1, period 2) with lines connecting each fuel's share, colored by direction of change.
    • Interaction: the user sets the split date with a slider; hover shows the delta in percentage points.
    • Implementation: sum by period and fuel, divide by the period total.
  9. Region Small Multiples of Average Day

    • Question: Which regions have similar daily shapes?
    • Fields: region_code, fuel, slot, generation_mwh.
    • Encoding: grid of 13 mini stacked area charts with shared y-scale (toggle to independent).
    • Interaction: click a panel to make it the focus region for the rest of the dashboard.
    • Implementation: one <g> per region from a shared aggregate; d3.group by region.
  10. Solar Diurnal Curve Comparison

    • Question: Which regions have strong solar peaks in the midday slot?
    • Fields: fuel_code = SUN, region_code, slot, generation_mwh.
    • Encoding: line chart, one line per region, highlighted selection with the others in grey.
    • Interaction: hover to highlight a region; legend click to pin lines.
    • Implementation: filter SUN, mean per region × slot. Note that slots are local time per region.
  11. Peak-Slot Radial Chart

    • Question: At what time of day does each fuel peak for a region?
    • Fields: fuel, slot, generation_mwh.
    • Encoding: radial layout, angle = slot (4 wedges), radius = mean MWh, one ring or color per fuel.
    • Interaction: hover a wedge for the value; toggle between region A and region B.
    • Implementation: d3.arc with a band scale on slot; only 4 slots, so it reads as a clock face.
  12. Ranked Bar Chart of Regions by Chosen Fuel

    • Question: Which regions generate the most (or the largest share) from a selected fuel?
    • Fields: region, fuel, generation_mwh.
    • Encoding: sorted horizontal bars, with an MWh/share toggle.
    • Interaction: fuel dropdown with animated re-sorting.
    • Implementation: rollup by region for the selected fuel; transition y positions.
  13. Streamgraph of Daily Mix across January

    • Question: How does the region's mix evolve day by day, relative to its average day?
    • Fields: date, fuel, generation_mwh, region_code.
    • Encoding: stream layers (d3.stackOffsetWiggle) by fuel over date.
    • Interaction: hover a layer to label it; click a date to set the "selected day" and compare it with the average day (idea 1).
    • Implementation: sum per date and fuel; exclude negative fuels or show them separately.
  14. Selected Day vs Average Day Overlay

    • Question: Is a specific day unusual compared with the average day?
    • Fields: date, slot, generation_mwh, fuel, region_code.
    • Encoding: grouped bars per slot for the average (grey) with the chosen day overlaid in color, plus a ±1 SD band.
    • Interaction: a date scrubber or heatmap click selects the day.
    • Implementation: compute the mean and d3.deviation per slot and fuel; filter to the chosen date.
  15. Net-Negative Fuels Diverging Bar

    • Question: Which regions/fuels have net-negative generation (charging or pumping), and when?
    • Fields: fuel (PS, BAT, OTH, SUN), generation_mwh < 0, slot, region_code.
    • Encoding: diverging bars around zero, grouped by slot, colored by fuel.
    • Interaction: region selector; annotation explaining that negatives are real, not missing.
    • Implementation: rollup without clamping; use a symmetric or nice() y-domain including negatives.
  16. Variability Box/Strip Plot per Fuel

    • Question: How much does a fuel's 6-hour output vary across days in a region?
    • Fields: fuel, generation_mwh, region_code, slot.
    • Encoding: box plot (quartiles, whiskers) per fuel with jittered points for individual days, faceted or filtered by slot.
    • Interaction: slot toggle; hover a point for its date.
    • Implementation: group by fuel, slot, date; compute quantiles with d3.quantile.
  17. Region × Fuel Matrix Bubble Chart

    • Question: Where are the largest fuel/region concentrations?
    • Fields: region_code, fuel, generation_mwh.
    • Encoding: circle area = total or average-day MWh, color = fuel share within the region.
    • Interaction: click a bubble to drill into that region's average-day profile.
    • Implementation: aggregate by region and fuel; scaleSqrt for the radius; row and column order by totals.
  18. Parallel Coordinates of Regional Mixes

    • Question: Which regions have similar overall fuel portfolios?
    • Fields: region_code, fuel, generation_mwh (share per fuel).
    • Encoding: one axis per major fuel (share %), one polyline per region.
    • Interaction: brush axes to filter regions; hover to highlight and label.
    • Implementation: pivot to a region × fuel share table; limit to the top 6–8 fuels by total.
  19. Treemap of Selected Region's Mix with Period Toggle

    • Question: What proportion of a region's energy comes from each fuel in a chosen period?
    • Fields: fuel, generation_mwh, date, region_code.
    • Encoding: treemap area = positive MWh, color = fuel; a label shows the percent share.
    • Interaction: toggle for the period (whole month, week N, weekends); animated transition between treemaps.
    • Implementation: d3.hierarchy + d3.treemap on positive sums; list negative-valued fuels in a side note.
  20. Data Quality and Coverage Strip

    • Question: Can I trust the comparisons — are all intervals fully reported?
    • Fields: reported_hours, expected_hours, region_code, period_start_local.
    • Encoding: strip of ticks per region over time, with color flagging rows where reported_hours < expected_hours.
    • Interaction: hover for the affected fuel and interval; a toggle to exclude partial intervals from the averages.
    • Implementation: filter rows where reported_hours != expected_hours; render as a compact dot matrix beneath the main charts.

Files

  • index.html — page shell and import map.
  • index.jsx — mounts <App />.
  • App.jsx — loads data/eia_generation_6hour.csv at runtime, groups rows into (fuel × day) cells, and renders the heatmap.
  • viz.js — D3 render entry point for the heatmap.
  • useContainerDimensions.js — ResizeObserver-based container size.
  • styles.css — page styles.
  • data/eia_generation_6hour.csv — source data (read-only).

Comments

Sign in to join the discussion.