Migrate core reports (Timeseries & Histogram) to Apache ECharts - #1339
max-ostapenko wants to merge 15 commits into
Conversation
- Migrate Timeseries and Histogram reports from Highcharts to Apache ECharts - Implement native dataZoom slider (mini-map with data preview, handles, ticks) and inside zoom/pan - Support IQR confidence bands via stacked area series and median line series - Add inline range presets (1m, 3m, 6m, YTD, 1y, 3y, All) with active button styling and live date range indicators - Implement dual Y-axis histogram with PDF density bars on left and CDF cumulative curve on right - Add interactive crosshair tooltips with formatted date, Desktop/Mobile comparative metrics, and Changelog badges - Add custom card header with source link and export context menu (PNG, SVG, SQL query) - Scope section buttons in styles.css to ensure responsive mobile layout - Pass all 30 automated integration and runtime error tests
… slider year labels
…ert custom xAxis formatting
…ine rendering, and enable zoom
… refined interactions Signed-off-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
36a8033 to
8e477f8
Compare
|
Visit the preview URL for this PR (updated for commit 85f584a): https://httparchive--pr1339-echarts-core-e889rv1t.web.app (expires Sun, 27 Sep 2026 21:29:45 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 1069cba7974889c25bacf4f0a19ddb6735592729 |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Table rendering, benchmark integration, query links, and zoom synchronization contain functional regressions.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (9)
Histogram table IDs do not match rendered markup · New Default table keys do not match timeseries row fields · New Histogram BigQuery links use a nonexistent path · New Pinch zoom does not synchronize table filtering · New Benchmark chart controller is discarded · New Timeseries BigQuery links point to nonexistent legacy path · New Timeseries tooltips omit metric units · New Chart controller is not registered globally · New Date grouping breaks table filtering and ordering · New
What changed in this PR
Migrates core timeseries and histogram reports from Highcharts to Apache ECharts.
Changes:
- Adds ECharts charts with zooming, tooltips, exports, legends, and milestones.
- Introduces responsive chart styling and report-page integration.
- Adds ECharts dependencies and adjusts Lighthouse URL handling.
| File | Description |
|---|---|
src/js/timeseries.js |
Implements ECharts timeseries reports. |
src/js/histogram.js |
Implements ECharts histogram reports. |
src/styles/report.css |
Adds chart component styling. |
src/styles/styles.css |
Excludes chart buttons from global mobile styling. |
src/pages/reports/[report_id].astro |
Integrates visualization rendering. |
tools/scripts/set_lighthouse_urls.sh |
Excludes dynamic route filenames. |
package.json |
Adds ECharts dependency. |
package-lock.json |
Locks ECharts dependencies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…p units, and query URLs
…ore standard table row layout
Signed-off-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Zoom synchronization, CDF rendering, interaction parity, and chart accessibility have unresolved regressions.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 5
Open (5)
Avoid zero-filling missing desktop CDF bins · New Restore accessibility and keyboard interaction for histogram chart · New Restore accessibility and keyboard interaction for timeseries chart · New Enable desktop drag-to-pan without consuming selection drags · New Listen for lowercase ECharts datazoom events · New
Resolved since last review (9)
Default table keys do not match timeseries row fields Histogram table IDs do not match rendered markup Date grouping breaks table filtering and ordering Chart controller is not registered globally Timeseries tooltips omit metric units Timeseries BigQuery links point to nonexistent legacy path Benchmark chart controller is discarded Pinch zoom does not synchronize table filtering Histogram BigQuery links use a nonexistent path
… enable chart ARIA Signed-off-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Keyboard accessibility regressions, continuous table rebuilding during zoom, and incorrect YTD state tracking remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
Resolved since last review (5)
| minVal = xMin + (span * dz.start) / 100; | ||
| maxVal = xMin + (span * dz.end) / 100; | ||
| } | ||
| drawHistogramTable(rawData, `${options.metric}-table`, options.type, [minVal, maxVal]); |
| const tolerance = 0.15; | ||
| if (span >= totalSpan * (1 - tolerance)) { | ||
| navBar.querySelector('[data-range="All"]')?.classList.add('active'); | ||
| } else if (Math.abs(span - 3 * yearMs) / (3 * yearMs) < tolerance) { | ||
| navBar.querySelector('[data-range="3y"]')?.classList.add('active'); | ||
| } else if (Math.abs(span - yearMs) / yearMs < tolerance) { | ||
| navBar.querySelector('[data-range="1y"]')?.classList.add('active'); | ||
| } else if (Math.abs(span - 6 * monthMs) / (6 * monthMs) < tolerance) { | ||
| navBar.querySelector('[data-range="6m"]')?.classList.add('active'); | ||
| } else if (Math.abs(span - 3 * monthMs) / (3 * monthMs) < tolerance) { | ||
| navBar.querySelector('[data-range="3m"]')?.classList.add('active'); | ||
| } else if (Math.abs(span - monthMs) / monthMs < tolerance) { | ||
| navBar.querySelector('[data-range="1m"]')?.classList.add('active'); | ||
| } |


Summary
Migrates core HTTP Archive reports (
timeseriesandhistogram) from Highcharts to Apache ECharts (~62k GitHub stars), a modern high-performance charting library with GPU-accelerated rendering, native mobile touch gestures, and rich interactivity out of the box.An alternative library to #963
Key Features
Timeseries Reports (
src/js/timeseries.js)dataZoom: 'slider'mini-map with data preview, draggable dual-handles, and custom year labels (2014,2018,2022) injected over the slider track.dataZoom: 'inside'— mouse wheel zoom + drag selection zoom with visual overlay, while the slider mini-map handles panning on desktop; pinch-to-zoom on mobile.1m,3m,6m,YTD,1y,3y,All) with active state tracking and a live date range indicator.p50median curves.Dual-Axis Histogram (
src/js/histogram.js)%), Right = CDF Cumulative Density (%) with correct per-axis title orientation matching production.Reset zoombutton appears when zoomed. Mobile pinch-to-zoom also supported.Styling (
src/styles/report.css,src/styles/styles.css).echarts-tooltip-cardstyles preventing global table striping from bleeding into tooltips.