Skip to content

Make graphs scrollable and replayable - #228

Open
vik-j wants to merge 3 commits into
acmerobotics:masterfrom
6165-MSET-Cuttlefish:scrollableGraphs
Open

vik-j wants to merge 3 commits into
acmerobotics:masterfrom
6165-MSET-Cuttlefish:scrollableGraphs

Conversation

@vik-j

@vik-j vik-j commented Sep 13, 2026

Copy link
Copy Markdown

Make graphs scrollable and replayable

Summary

Graphs used to throw away samples once they scrolled off the left edge, so you could only ever see the last windowMs of data, and after an op mode ended the plot just
froze. This keeps the whole run in memory and adds a slider under the graph for panning back through it, a replay button for finished runs, and a fullscreen toggle.

What's included

Scrolling

  • Graph keeps up to 100,000 samples per series instead of pruning on render. That's over an hour at normal telemetry rates.
  • New slider under the plot pans through the history, with a readout like 12.5–17.5s of 48.2s.
  • Live button jumps back to live data (shows End after the op mode stops).
  • Keyboard: arrow keys pan (Shift for a full window), Home/End jump to start/live, Escape returns to live, Space/k play/pause.

Replay

  • Once the op mode has stopped, play replays the recording at 1x from the slider position (or from the start if you're at the end).
  • Samples are recorded while paused, so pausing doesn't leave gaps. Unpausing jumps to the newest data.
  • Starting a new op mode clears the previous run.

Rendering

  • Drawing and y-axis scaling only look at the visible window (binary search over timestamps), so long histories don't slow rendering.
  • The y-axis scales to what's on screen, not the whole run, so an old spike doesn't squash the current view.

Other

  • Fullscreen button in the graph header, with new fullscreen.svg / fullscreen_exit.svg icons.
  • Window size must be > 0 (0 caused a divide by zero).
  • The graph draws once on mount, so opening it after an op mode ended no longer shows a blank canvas.
  • Play/pause click handler moved from the icon to the button.

Files changed

GraphView/Graph.ts, GraphView/GraphCanvas.jsx, GraphView/GraphView.tsx, assets/icons/fullscreen.svg, assets/icons/fullscreen_exit.svg

Testing

Tested against the mock server: scrolling through a finished run, replay, Live/End, keyboard shortcuts, fullscreen, pausing and resuming mid-run, y-axis scaling, and
history clearing on a new op mode.

Not tested on a Control Hub, but that shouldn't matter much since all the changes are in the client graph view. Also haven't run anything long enough to hit the 100k sample cap.

Screen.Recording.2026-09-09.at.6.27.40.PM.1.mp4

mxtmx added a commit to 6165-MSET-Cuttlefish/slothboard that referenced this pull request Sep 30, 2026

This branch has not been deployed

No deployments
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