[FEATURE] Scope TimeSeriesChart annotations to the panel#754
Draft
nicolastakashi wants to merge 1 commit into
Draft
[FEATURE] Scope TimeSeriesChart annotations to the panel#754nicolastakashi wants to merge 1 commit into
nicolastakashi wants to merge 1 commit into
Conversation
Rewire TimeSeriesChartPanel to consume annotations through the new panel-scoped usePanelAnnotationsWithData hook, fed the panel's annotations config from props.definition.spec.annotations, instead of the global useAnnotationsWithData. This makes the panel honor its dashboard-annotation toggle and render its own panel-local annotation definitions. The conversion and chart rendering are unchanged. Depends on perses/spec#61 (data model) and the usePanelAnnotationsWithData hook in perses/shared. Signed-off-by: Nicolas Takashi <nicolas.takashi@dash0.com>
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.
What this does
This makes TimeSeriesChart honor panel-level annotations.
TimeSeriesChartPanelnow reads annotations through the newusePanelAnnotationsWithDatahook, fed the panel's config fromprops.definition.spec.annotations, instead of the globaluseAnnotationsWithData.The effect: a panel can turn dashboard annotations off for itself, and it renders any annotations defined locally on the panel. The conversion (
convertAnnotationToTimeSeriesAnnotation) and the chart rendering are untouched, so this is a two-line change to the data source feeding them.Dependency
This is stacked on two other PRs:
PanelSpec.Annotationsto the data model.usePanelAnnotationsWithDatahook in perses/shared.It will not compile until both land and
@perses-dev/specand@perses-dev/dashboardsare bumped here.Testing
The behavior of the hook itself is tested in the perses/shared PR. I have not stood up the full plugins build to compile this in isolation, since it needs the spec, dashboards, and plugin-system packages from the two PRs above. The change is a straight swap of the annotations source, with the same shape flowing into the existing conversion.