Skip to content

feat: add geographic CWV breakdown chart to tech report drilldown#1220

Merged
tunetheweb merged 2 commits intoHTTPArchive:mainfrom
alonkochba:feat/geo-cwv-breakdown-chart
Mar 24, 2026
Merged

feat: add geographic CWV breakdown chart to tech report drilldown#1220
tunetheweb merged 2 commits intoHTTPArchive:mainfrom
alonkochba:feat/geo-cwv-breakdown-chart

Conversation

@alonkochba
Copy link
Member

@alonkochba alonkochba commented Mar 11, 2026

Fixes #1146

Summary

Adds a Geographic Breakdown section inside the Core Web Vitals card on the tech report drilldown page, showing top geographies by origin count alongside their Core Web Vitals performance.

  • Table with top 10 geographies (plus ALL) sorted by origins by default; all columns are sortable
  • Progress bar in the Good CWV column, using the same inline gradient pattern as the rest of the tech report
  • Metric selector (styled to match the existing subcategory selector) adapts both the bar label and extra columns:
    • Overall → Good Core Web Vitals bar + LCP, INP, CLS columns
    • LCP / FCP / TTFB → Good <metric> bar + the other two load metrics as columns
    • INP / CLS → Good <metric> bar only (no redundant extra columns)
  • Show all / Show fewer toggle to expand beyond the top 10
  • Respects the end date filter; latest data timestamp reflects the selected date
  • Table wrapped in table-ui-wrapper for mobile horizontal scroll
  • Dark mode hover contrast uses --table-row-hover variable
  • Guards against non-array API responses (e.g. 404 error objects)

Implementation notes

  • New GeoBreakdown JS class (src/js/techreport/geoBreakdown.js)
  • New template component (templates/techreport/components/geo_breakdown.html)
  • New geo_breakdown config block in config/techreport.json (drilldown page)
  • CSS additions in static/css/techreport/techreport.css scoped to .geo-breakdown-*
  • Uses the existing /geo-breakdown API endpoint — no backend changes

@max-ostapenko
Copy link
Contributor

@alonkochba Could we visualize the filter params on the chart too?

Latest data: February 2026
Geo: ALL Rank: ALL Technology: Wix

@max-ostapenko
Copy link
Contributor

There is a similar bar chart on Categories page, just breakdown by technologies.
Let's reuse the styles.
Screenshot 2026-03-24 at 09 55 53

@alonkochba alonkochba changed the title WIP: feat: add geographic CWV breakdown chart to tech report drilldown feat: add geographic CWV breakdown chart to tech report drilldown Mar 24, 2026
@alonkochba alonkochba force-pushed the feat/geo-cwv-breakdown-chart branch 2 times, most recently from 4de86a0 to 05e140a Compare March 24, 2026 12:25
@alonkochba alonkochba marked this pull request as ready for review March 24, 2026 12:26
@alonkochba alonkochba force-pushed the feat/geo-cwv-breakdown-chart branch from f218fba to dbac947 Compare March 24, 2026 13:41
Adds a Geographic Breakdown section inside the Core Web Vitals card on
the tech report drilldown page. Shows top geographies (plus ALL) by
origin count with a Good CWV progress bar and sortable columns.

- Bar label and extra columns adapt to selected metric:
  Overall → Good Core Web Vitals + LCP/INP/CLS columns
  LCP/FCP/TTFB → Good <metric> bar + the other two load metrics
  INP/CLS → Good <metric> bar only
- Metric selector styled to match existing subcategory-selector pattern
- Show all / Show fewer toggle below the table
- Table wrapped in table-ui-wrapper for mobile horizontal scroll
- Dark mode hover contrast fixed using --table-row-hover variable
- Guards against non-array API responses (e.g. 404 error objects)
- Respects end date filter; latest data timestamp reflects selected date
@alonkochba alonkochba force-pushed the feat/geo-cwv-breakdown-chart branch from ca6bb41 to 0846d51 Compare March 24, 2026 14:12
Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to merge to me with some wording tweaks.

Thanks for working on this @alonkochba !!!

Co-authored-by: Barry Pollard <barrypollard@google.com>
@tunetheweb tunetheweb merged commit bfc5c1d into HTTPArchive:main Mar 24, 2026
7 checks passed
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: Breakdown by geography

3 participants