Repository navigation
Smoother replay, with step and speed settings - #2882
Merged
Merged
Conversation
The ruler was a markLine in the chart option, so moving it meant re-rendering the chart. As plain zrender elements on their own zlevel, moving it only repaints that layer, which lets the ruler follow a replay on every animation frame. It is redrawn after each render and on zooming, in every time-axis subplot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
The replay used to move belief time in fixed 1-hour steps, waiting 100 ms between them, so drawing time slowed it down and finer belief updates were merged. - A replay clock ties belief time to the wall clock, so it advances at a constant rate however long frames take; the ruler follows it on every animation frame, and the data is redrawn when a step boundary passes and new beliefs became known. - The step defaults to Auto: the most common interval between belief times within each sensor and source, rounded down to a step that fits a whole number of times in an hour or a day. Event timing plays no role. - Step and speed pickers below the play button, with '+' and '-' to change the speed. - The beliefs are sorted by belief time once, and a timeline walks through them with an index, instead of re-partitioning all remaining beliefs and rebuilding the shown data on every step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
…orts The previous commit gave the ruler a canvas layer of its own, which put it above the data. Repainting the main canvas turns out to take only about a millisecond, even for six series of a year of 15-minute data, so the ruler goes back onto the main canvas, between the split lines and the series, as it was as a markLine. Image exports add it back as a markLine, since the on-screen ruler is not part of the chart option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
The label kept naming the step inferred for the previous date range or chart type until the next replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
…lay button They fade in while hovering over the play button, stay while hovering over or using them, and linger briefly so the pointer can move from the button to them. Touch screens, which have no hover, always show them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
The units dropdown of the upload form is only rendered for users who may upload data to the sensor. For other users, filling it threw, which stopped the rest of the script, so the buttons to delete the sensor or its data, and to create a forecast, were never wired up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
The previous commit put the ruler behind the data, claiming that is where the markLine ruler was. It was not: a markLine has z 5, above the series (z 2), and the Vega-Lite chart draws its ruler as the last layer. Above the data is also where a playhead belongs, as behind the data, bars and filled areas hide it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
It was meant to come with the fix in 8c7961b, but did not make it into that commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
4 of 5 tasks
Documentation build overview
12 files changed ·
|
…no visible effect The previous commit's entry, like the commit that guarded the units dropdown, claimed that the script error kept buttons from working for users who may not upload data. But no such user sees those buttons: triggering forecasts takes the same permission as uploading data, and deleting a sensor or its data takes more. The error was only a console error for users who may view the sensor and nothing more. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
Whatever moves along with the clock by itself, such as an animated ruler, needs to hear about the clock only when its anchor changes: when it is started, paused, sought or set to another rate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
…ke it jump On a crowded chart, redrawing the data blocks the main thread for 80 to 150 ms at a time, and the ruler, drawn on the chart's canvas, could only move between those redraws: in jumps of 20 to 30 px, several times a second. The ruler is now an HTML element laid over each subplot, moved by a CSS transform animation at the replay's rate, which the browser runs off the main thread. Recorded on a page with six subplots of forecasts re-formed every 15 minutes, the ruler moved in every displayed frame (17 ms apart), at most 2.5 px at a time, against every 83 to 100 ms (up to 267 ms), in jumps of up to 33 px, before. The replay hands the ruler the clock's motion only when it starts, pauses, seeks or changes speed, and the animation is started from the moment the clock was read, rather than from the next frame, which comes late exactly while the chart is busy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
While playing, the data follows the last step boundary the clock passed, and on a crowded chart it trails the ruler by the time a redraw takes, too. On pausing, the data now catches up with the ruler exactly, rather than staying at the last boundary. On resuming, it stays until the clock passes the next boundary, rather than going back to the previous one; the same goes for switching to a longer step while playing, which used to take the data back. Changing the step while paused no longer redraws anything, so it no longer needs its own listener. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
The ruler moves by itself, so it had already moved on by the time it heard about a pause, all the more as that frame first redrew the data, which can take a hundred milliseconds or more on a crowded chart. It then jumped back to where the pause was clicked. Now the clock pauses 50 ms ahead, the ruler glides on to there and stops, and the data waits a frame whenever the ruler is handed a new motion, so the ruler hears about it in time. While paused, the data is redrawn once the ruler has stopped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
…he ruler A redraw on a crowded chart takes about 100 ms, an hour of belief time at 1×, while the ruler moves on by itself, so the data lagged up to one redraw plus one step behind it. Now the data is drawn for where the clock will be after the shortest of the last five redraws, which brings the median lag on a crowded chart from 0.9 h to 0.2 h at 1×, without the data getting ahead of the ruler, unless a redraw is quicker than all of those. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
…raws Each render was followed by three more passes over the chart, each about as costly as the render itself: one to cap the time between gridlines, one to cut the rounded corners of stepped lines in pixel space, and one to colour the Zoom and Pan buttons. The gridline cap now goes into the option up front, the button colours already did, and the corners are cut up front at the scale the previous render ended up with, taking a second pass only when the new render ends up at another scale. On a crowded asset chart, a replay now redraws every 50 ms instead of every 100 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
At 10 hours per second, a busy day of updates went by too fast to follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
…ta's time range loads When the page opens on a known date range, the chart loads right away, while the time range of the data is still being fetched. Once fetched, the date picker was set to the range it already showed, which counts as selecting it: that reloaded the chart and stopped any replay started in the meantime. The picker is now only set when it shows another range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
Like n steps ahead, b steps back to the previous step boundary, pausing a playing replay first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
r plays the replay backward, at the chosen speed, from wherever it is, or from the end if it was stopped, and pauses it if it is rewinding already; p then plays forward again. Rewinding all the way pauses at the start. The clock and the ruler run in either direction, and the belief timeline walks back belief by belief, restoring the beliefs each one replaced, rather than starting over from the first belief, so rewinding costs as little as playing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
…e last step boundary The fast chart only redraws when new beliefs became known, and merges what became known during a slow redraw, so rounding down to step boundaries no longer saved redraws; it only let the data trail the ruler by up to a step. The step now sets how far 'n' and 'b' move. The Vega chart keeps moving on per step, as it redraws in full to move its ruler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
UI users may not know the belief time concept, and the ruler moves along the chart's time axis anyway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl> # Conflicts: # documentation/changelog.rst
Flix6x
added a commit
that referenced
this pull request
Dec 2, 2026
The tests that main brought in (#2829, #2882) asked the fast chart for the legacy name chart_for_chargepoint_sessions, which it leaves to Vega-Lite since this PR; and main replaced the mouseover hook the mocked hover check relied on, which its real-ECharts hover test now covers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: F.N. Claessen <claessen@seita.nl>
Flix6x
added a commit
that referenced
this pull request
Dec 2, 2026
The replay and one-pass tests main brought in (#2882) render asset charts without opts.chargePointChart, which an asset chart needs since this PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: F.N. Claessen <claessen@seita.nl>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Smoother replay on the asset graph and sensor pages, with step and speed settings.
The replay used to move belief time in fixed 1-hour steps with 100 ms between them,
so drawing time slowed it down and finer belief updates were merged.
+/-change the speed (1× = 6 h/s), the step sets how farnandbmove,bsteps back, asnsteps ahead, andrrewinds (plays backward, pausing at the start), aspplaysdocumentation/changelog.rstLook & Feel
Hover over the play button on a sensor or asset graph page to reveal the Step and Speed pickers.
While playing, the ruler glides over the chart, and the time label below the button shows the belief time the data is drawn for, following the ruler. When paused, the ruler glides to a stop instead of jumping back, the data catches up with it exactly, and the label shows that time.
How to test
pytest flexmeasures/ui/tests/js/test_replay_utils.py flexmeasures/ui/tests/js/test_fast_chart.py(the ruler tests need the vendored ECharts)Further Improvements
Related Items
...
Sign-off
🤖 Generated with Claude Code
https://claude.ai/code/session_01DWv6v5Qh6UFAnmTwZ4qGuM