Skip to content

Migrate core reports (Timeseries & Histogram) to Apache ECharts - #1339

Open
max-ostapenko wants to merge 15 commits into
mainfrom
echarts-core
Open

max-ostapenko wants to merge 15 commits into
mainfrom
echarts-core

Conversation

@max-ostapenko

@max-ostapenko max-ostapenko commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates core HTTP Archive reports (timeseries and histogram) 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)

  • Native Zoom & Pan:
    • 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.
  • Range Presets Toolbar: Inline buttons (1m, 3m, 6m, YTD, 1y, 3y, All) with active state tracking and a live date range indicator.
  • IQR Confidence Bands: Stacked area series for Desktop/Mobile interquartile ranges alongside smooth p50 median curves.
  • Changelog Milestones (Option A Pin Design):
    • Interactive flag pins docked to the X-axis for all releases (A–T) with intelligent stem staggering to prevent overlap.
    • On-demand vertical crosshair + milestone details embedded in the tooltip.
  • Synchronized Legend: Toggling Desktop/Mobile also hides/shows the corresponding confidence band.

Dual-Axis Histogram (src/js/histogram.js)

  • Dual Y-Axis: Left = PDF Density (%), Right = CDF Cumulative Density (%) with correct per-axis title orientation matching production.
  • Drag-to-Zoom with Selection Overlay: Semi-transparent selection preview box while dragging; table below auto-filters to zoomed bin range; Reset zoom button appears when zoomed. Mobile pinch-to-zoom also supported.
  • Tooltip Parity: Centered metric title, bold PDF percentages in series colors, distinct uppercase CDF subheader.

Styling (src/styles/report.css, src/styles/styles.css)

  • Scoped .echarts-tooltip-card styles preventing global table striping from bleeding into tooltips.
  • Button scoping ensures zoom range buttons stay compact on mobile.

@max-ostapenko max-ostapenko changed the title Echarts core Migrate core reports (Timeseries & Histogram) to Apache ECharts Sep 20, 2026
- 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
… refined interactions

Signed-off-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 High severity · 7 Medium severity

Open (9)
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.

Comment thread src/js/histogram.js
Comment thread src/js/timeseries.js Outdated
Comment thread src/js/histogram.js Outdated
Comment thread src/js/histogram.js
Comment thread src/js/histogram.js
Comment thread src/js/timeseries.js Outdated
Comment thread src/js/timeseries.js
Comment thread src/js/timeseries.js
Comment thread src/js/timeseries.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread src/js/histogram.js Outdated
Comment thread src/js/histogram.js
Comment thread src/js/timeseries.js
Comment thread src/js/timeseries.js
Comment thread src/js/timeseries.js Outdated
… enable chart ARIA

Signed-off-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 Medium severity

Open (2)
Resolved since last review (5)

Comment thread src/js/histogram.js
minVal = xMin + (span * dz.start) / 100;
maxVal = xMin + (span * dz.end) / 100;
}
drawHistogramTable(rawData, `${options.metric}-table`, options.type, [minVal, maxVal]);
Comment thread src/js/timeseries.js
Comment on lines +769 to +782
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');
}
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.

2 participants