Repository navigation
feat(pulse): add a value cursor and history scrolling - #40
Merged
Merged
Conversation
SetCursor and SetOffset move a vertical cursor and scroll the view back through the history. CursorValues and CursorBox show the values under the cursor. Events and X axis labels follow the offset. The time step now advances once per sample: on a push to the default series, or to the first named series while the default has none. Before, a chart that pushed both moved its events two columns per sample. Closes #11
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
Adds a value cursor and history scrolling, so you can step back through a live chart and read exact values.
SetCursor(age)/Cursor()show a vertical cursor at a pointagesteps before the newest one;-1hides it.SetOffset(n)/Offset()scroll the viewnpoints back into the history. The offset is clamped so the oldest point can reach the left edge and no further. While the view is scrolled, each new sample moves the offset and the cursor by one, so the view stays on the same points.CursorValues()returns the value of each series at the cursor;CursorBox()renders them as a card in the style ofLegendBox, with the X axis label at the cursor.[/]to scrolling; Esc resets both and no longer quits (q and Ctrl+C quit).docs/cursor-and-scrolling.mdand screenshotassets/cursor.png; the Bubble Tea, getting started, axes, thresholds and timeline guides link to it.Behavior change users can see: the time step now advances once per sample, on a push to the default series, or to the first named series while the default has none. Before, a chart that pushed both the default and a named series moved its events two columns per sample. An app that pushes the default series once and then only named series no longer advances the step.
Left for later: custom renderers get no documented way to draw the cursor (
RenderContext.CursorColis there, but no helper).Issues
Closes #11
Type of Change
Checklist
gofmt,go vet).go test -race ./...) and everything builds (go build ./...andgo -C examples build ./...).