Commit ab8a033
Add Core Web Vitals distribution histogram to tech report (#1241)
* Add Core Web Vitals distribution histogram to tech report drilldown
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 #1147
* Address PR review feedback
- 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"
* Security errors
* More fixes
* Move config to JSON
* Keep CodeQL happy
* Hide hash
---------
Co-authored-by: Barry Pollard <barrypollard@google.com>1 parent a15d0cc commit ab8a033
File tree
12 files changed
+635
-54
lines changed- config
- src/js/techreport
- static/css/techreport
- templates/techreport
- components
12 files changed
+635
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
172 | 177 | | |
173 | 178 | | |
174 | | - | |
175 | | - | |
| 179 | + | |
| 180 | + | |
176 | 181 | | |
177 | 182 | | |
178 | 183 | | |
179 | | - | |
180 | | - | |
| 184 | + | |
| 185 | + | |
181 | 186 | | |
182 | 187 | | |
183 | 188 | | |
| |||
191 | 196 | | |
192 | 197 | | |
193 | 198 | | |
194 | | - | |
195 | | - | |
| 199 | + | |
| 200 | + | |
196 | 201 | | |
197 | 202 | | |
198 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
| |||
726 | 733 | | |
727 | 734 | | |
728 | 735 | | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
737 | 806 | | |
738 | 807 | | |
739 | 808 | | |
| |||
0 commit comments