-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
demo: alternative time range selection on timeseries panel #744
base: main
Are you sure you want to change the base?
Conversation
@@ -152,7 +152,7 @@ export function SceneRefreshPickerRenderer({ model }: SceneComponentProps<SceneR | |||
const { refresh, intervals, autoEnabled, autoValue, isOnCanvas, primary, withText } = model.useState(); | |||
const isRunning = useQueryControllerState(model); | |||
|
|||
let text = refresh === RefreshPicker.autoOption.value ? autoValue : withText ? 'Refresh' : undefined; | |||
let text = refresh === RefreshPicker.autoOption?.value ? autoValue : withText ? 'Refresh' : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that autoOption
was undefined, causing a few demos to fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps loosely related: grafana/grafana#88107 considering adding feels like we maybe should introduce some kind of point annotations (besides exemplars), and x+y rectangular annotations? 🤔 |
Yes, quite related. If panels could all generally have alternative behaviors for range selection, I think that could simplify this greatly. For this specific implementation, it would also be really interesting to be able to modify the range of the annotation by dragging the left or right edges. Can that be achieved simply by manipulating the panel context? |
that would be super expensive to do on mousemove, since requires redraw. but maybe via eventBus/signals or smth. but in general allowing selections to be resized should be built into the panels. if you need to custom set it once via props/fieldConfig, then that should be fast enough, too. cc @dprokop |
[ | ||
(vizPanel: VizPanel) => { | ||
patchPanelContext(vizPanel); | ||
const altTimeRangeScene = sceneGraph.findObject(vizPanel, (scene) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be nice to have a sceneGraph.findKey(s: string) function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c49f8e9
to
fed4429
Compare
fed4429
to
9a19743
Compare
@darrenjaneczek grafana/grafana#88107 was merged, it uses |
9a19743
to
cfb9307
Compare
This demo uses a custom implementation of
SceneTimeRangeLike
to overrides the default time range selection behavior to capture the selection, store it in a different time range, and display it on the panel as an annotation.override-scenes-timerange-behavior-to-set-annotation-for-alt-timerange.webm