Move the graph page to Chart.js

未关闭
#925 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 2 天内回复

@bracyw 已经在做这个了。

开始于 2026年10月27日。

  • #887 来自 @bracyw —— 未关闭
  • #938 来自 @bracyw —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

by: ai dev work frontend
What

Finish moving the graph page to Chart.js, building on the spike branch 877-try-chartjs-for-the-clients-graph-page (draft PR #887). That branch already draws the page with Chart.js. What's left is CSV export, which ApexCharts' menu gives today, fixing the hover quirks, and checking it stays smooth on long ranges.

Requirements
  • The graph page draws with Chart.js, keeping live, run and historical modes, hover, zoom, pan, pause, Clear Graph, the legend toggle, multiple y-axes and day lines
  • The graph's data can be downloaded as CSV, and the chart saved as an image
  • Hover shows each line's value at the pointer's time, with its dot on the line
  • A historical range near the 7-day cap, and five live topics, stay smooth to hover, zoom and pan
  • verify-graph passes
Notes
  • Spike #877, draft PR #887; decision: https://github.com/Northeastern-Electric-Racing/Argos/issues/865#issuecomment-6430776779
  • Dropped approaches:
    • uPlot (#872, PR #882): just as light, but no export, a small ecosystem and no pie chart; its floating tooltip and wheel zoom are demo code to copy in.
    • webgl-plot (#878, PR #888): nothing is built in; the branch wrote axes, hover and legend itself.
    • dygraphs (#876, PR #886): too little out of the box; see #876.
    • ECharts (#873, PR #883): the most built in, but about 100 MB more memory and the noisiest measurement.
    • lightweight-charts (#875, PR #885): built around finance charts, with no legend.
    • Plotly (#874, PR #884): nearly double the memory of the rest.
  • Open question: whether Chart.js's min-max decimation keeps a 7-day range smooth; the spikes didn't measure frame rate or long ranges.
Context transfer
SUMMARY
The spike branch replaces ApexCharts on the graph page only. It merges cleanly into develop (22 commits behind as of 2026-10-27). 195/195 unit tests pass; verify-graph passed 6/6 (UTC and New York) before the hover change and hasn't been rerun since.

CONTEXT
- Files: angular-client/src/pages/graph-page/graph/graph.component.{ts,html,css,spec.ts}, graph-chart.utils.ts (+ spec), graph-page.component.css, package.json.
- Registers only the line chart's parts in the component's providers (LineController, LineElement, PointElement, LinearScale, Tooltip, Legend, Decimation, zoom and annotation plugins).
- X is a linear epoch-ms scale with our own clock-aligned ticks; no date adapter.
- Values are pushed onto per-series sorted arrays (binary-search insert when out of order), trimmed to the time or point window, and redrawn once per animation frame with update('none').
- Hover (commit d40aaac4): a custom nearest-per-series interaction mode, a cursor tooltip positioner and a crosshair plugin, about 200 lines.
- Hover quirks: dots sit a few pixels off the line; a series with no nearby data shows its first or last sample; the tooltip's edge flip uses the previous frame's size.
- Zoom plugin gives drag zoom, pan, zoom buttons; Save PNG is chart.toBase64Image(). CSV export isn't ported; on develop it comes from ApexCharts' default toolbar menu.
- SERIES_COLORS has 10 colours (ApexCharts' 5 first, violet lightened for contrast), so colours repeat from the 11th series.
主要语言
TypeScript
星标
5
派生
1
平均合并
2 天 13 小时
30 天内合并 PR
48

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Northeastern-Electric-Racing/Argos 的其他 Issue

查看 Northeastern-Electric-Racing/Argos 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。