-
Notifications
You must be signed in to change notification settings - Fork 5
feat(plotly): sync numerical x-axis range in URL query params #637
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
feat(plotly): sync numerical x-axis range in URL query params #637
Conversation
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
…s' of https://github.com/ni/systemlink-grafana-plugins into users/ahalya/feat/high-res/plotly-introduce-xaxis-params
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
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.
Pull request overview
This PR adds X-axis range synchronization to URL query parameters for the Plotly panel component. When users zoom or pan a numerical X-axis, the range is synced to the URL, enabling coordinated behavior across multiple panels and dashboard refresh triggers.
Changes:
- Introduced
NIRefreshDashboardEventfor triggering dashboard-wide data refreshes - Added debounced X-axis range synchronization to URL parameters with 6-decimal precision
- Implemented conditional synchronization based on panel IDs specified in
nisl-syncXAxisRangeTargetsURL parameter
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| src/panels/plotly/events.ts | New event class for publishing dashboard refresh events |
| src/panels/plotly/PlotlyPanel.tsx | Core implementation of X-axis range synchronization with URL parameter management and debouncing |
| src/panels/plotly/PlotlyPanel.test.tsx | Comprehensive test suite for X-axis range synchronization feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Please resolve the Copilot comments. |
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
|
As mentioned in the Grafana Discussions channel Grafana Ownership has transitioned to NIR. Just to make sure notifications are properly enabled I'll explicitly mention @kkerezsi and @saradei-ni as the primary owners in the @ni/grafana-codeowners-team. Please give them patience as they ramp up and can give Owners review. |
… into users/ahalya/feat/high-res/plotly-introduce-xaxis-params
|
Hi @kkerezsi @saradei-ni, gentle reminder to review this PR. Happy to provide any context if that would help with the review. Thanks! |
Signed-off-by: Ahalya Radhakrishnan <[email protected]>
## [4.119.0](v4.118.0...v4.119.0) (2026-01-27) ### Features * **plotly:** sync numerical x-axis range in URL query params ([#637](#637)) ([5f251a1](5f251a1))
🤨 Rationale
Task 3654861: Update Plotly component to add query params and refresh the dashboard
To sync x-axis range in the URL query parameters when a user zooms or pans a numerical X-axis.
Please refer to HLD for further details.
👩💻 Implementation
NIRefreshDashboardEventclass.nisl-syncXAxisRangeTargetsURL parameter before applying updates.publishXAxisRangeUpdateusesuseMemobecause it memoizes the debounced function instance across re-renders.useCallbackwould create a new debounced function each render, breaking the debouncing behaviour.NIRefreshDashboardEventto trigger data refresh across all panels, after URL query parameter updates.🧪 Testing
Test coverage is currently scoped to the newly introduced X-axis URL parameter synchronization feature. Additional test cases for existing functionality are tracked under a Technical Debt 3638375: Add unit tests for the Plotly panel component
✅ Checklist