Skip to content

Add Core Web Vitals distribution histogram to tech report#1241

Open
alonkochba wants to merge 3 commits intoHTTPArchive:mainfrom
alonkochba:feat/dev3-cwv-distribution-histogram
Open

Add Core Web Vitals distribution histogram to tech report#1241
alonkochba wants to merge 3 commits intoHTTPArchive:mainfrom
alonkochba:feat/dev3-cwv-distribution-histogram

Conversation

@alonkochba
Copy link
Copy Markdown
Member

@alonkochba alonkochba commented Apr 7, 2026

Summary

Adds two collapsible panels below the Core Web Vitals timeseries chart:

  • Histogram — distribution of origins across performance buckets for the selected metric, with good/needs-improvement/poor color zones, threshold plotlines, and an overflow bucket for the long tail
  • Geographic breakdown — existing section, moved here as a toggle

Both panels share a single button bar (alongside Show table) with mutual exclusion — opening one closes the other. Content is lazy-loaded on first open.

The metric selector from the pass-rate timeseries now drives all three components (timeseries, geo breakdown, histogram) via a shared cwv-metric-change event and the good-cwv-over-time URL param. Deep-linking with ?good-cwv-over-time=CLS applies to all three. Titles update dynamically (LCP histogram, INP geographic breakdown, etc.). The histogram resolves overall to LCP since it shows one metric at a time.

Also scopes the global .highcharts-point CSS rule to line/spline series only, so column chart bar colors render correctly.

Depends on

Closes #1147

@alonkochba alonkochba force-pushed the feat/dev3-cwv-distribution-histogram branch 11 times, most recently from 8d85b23 to 9d68f1b Compare April 13, 2026 17:35
Adds a collapsible histogram chart to the CWV section showing how origins
are distributed across performance buckets for LCP, CLS, INP, FCP, and TTFB.

Features:
- Column chart with bars color-coded green/orange/red by CWV thresholds
- Dashed plotlines marking good/needs-improvement boundaries
- Tail buckets aggregated into an overflow "X+" bar so all origins are shown
- Metric selector in the collapsed summary bar for quick switching
- Loading spinner while the API call is in progress
- Error message when data is unavailable
- Light and dark mode support with theme-aware colors
- Anchor link (#section-cwv_distribution) with auto-expand on direct navigation
- URL hash updates when the section is expanded

Fetches data from /v1/cwv-distribution (HTTPArchive/tech-report-apis#105)
with technology, date, rank, and geo parameters.

Also scopes the global .highcharts-point CSS rule to line/spline series only,
so column chart bar colors are not overridden.

Closes HTTPArchive#1147
@alonkochba alonkochba force-pushed the feat/dev3-cwv-distribution-histogram branch from 9d68f1b to d6cdb0b Compare April 15, 2026 06:18
@alonkochba alonkochba marked this pull request as ready for review April 16, 2026 07:35
Comment thread config/techreport.json Outdated
Comment thread templates/techreport/components/cwv_distribution.html Outdated
Comment thread templates/techreport/drilldown.html
Comment thread static/css/techreport/techreport.css
Comment thread src/js/techreport/cwvDistribution.js Outdated
- Rename title/description per suggestion ("Core Web Vitals histograms")
- Restructure button bar so all 3 buttons appear first in DOM order,
  followed by content wrappers (fixes tab order)
- Remove per-component metric selectors; the pass-rate timeseries
  selector now drives the geo breakdown and histogram via a shared
  cwv-metric-change event
- Deep-linking works via ?good-cwv-over-time=CLS
- Histogram resolves "overall" to LCP (has no combined view)
- Titles update dynamically ("LCP histogram", "INP geographic breakdown")
- Rename "Show distribution" button to "Show histogram"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tech Report: Histograms per KPI

2 participants