Skip to content

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

Closed
max-ostapenko wants to merge 6 commits into
mainfrom
echarts-core-main
Closed

max-ostapenko wants to merge 6 commits into
mainfrom
echarts-core-main

Conversation

@max-ostapenko

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.


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 pan 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.

Verification

  • ✅ Build passes: npm run build (21 pages)
  • npm test — 30/30 tests pass

- 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>
Comment thread src/js/histogram.js
import { el, prettyDate, drawMetricSummary, callOnceWhenVisible } from './utils';
import { Constants } from './techreport/utils/constants.js';

const [COLOR_DESKTOP, COLOR_MOBILE, COLOR_DESKTOP_ALT, COLOR_MOBILE_ALT] = Colors.getAll({ rgba: true });
Comment thread src/js/histogram.js
import { el, prettyDate, drawMetricSummary, callOnceWhenVisible } from './utils';
import { Constants } from './techreport/utils/constants.js';

const [COLOR_DESKTOP, COLOR_MOBILE, COLOR_DESKTOP_ALT, COLOR_MOBILE_ALT] = Colors.getAll({ rgba: true });
Comment thread src/js/timeseries.js
const zoomBtns = navBar.querySelectorAll('.zoom-btn');

function updateRangeDisplay(minT, maxT) {
const d1 = new Date(minT);
Comment thread src/js/timeseries.js

function updateRangeDisplay(minT, maxT) {
const d1 = new Date(minT);
const d2 = new Date(maxT);
@max-ostapenko
max-ostapenko deleted the echarts-core-main branch September 20, 2026 17:53
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