Skip to content

Fix zoom in/out display issues in plots for high precision (especially timestamps) x axis data.#8332

Open
shefalijoshi wants to merge 6 commits into
masterfrom
fix-plots-dynamic-anchoring
Open

Fix zoom in/out display issues in plots for high precision (especially timestamps) x axis data.#8332
shefalijoshi wants to merge 6 commits into
masterfrom
fix-plots-dynamic-anchoring

Conversation

@shefalijoshi

@shefalijoshi shefalijoshi commented May 29, 2026

Copy link
Copy Markdown
Contributor

Closes #7926

Describe your changes:

WebGL's graphics buffers are limited to single-precision floating-point numbers (Float32Array), which lose numerical accuracy when dealing with large absolute timestamps.
Previously, we used the first point of the telemetry endpoint as the initial data ‘anchor’ point. This caused the offsets to be very large that did not fit into a 32-bit float.
We now use the minimum x value of the current viewport as the ‘anchor’ point. This remains static across frames and only steps forward in clean blocks if the user scrolls an entire page width away, or zooms significantly in or out.
This is agnostic to the type of x-axis data - time series or non-time series.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

…’ point. This remains static across frames and only steps forward in clean blocks if the user scrolls an entire page width away, or zooms significantly in or out.
@codecov

codecov Bot commented May 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.22%. Comparing base (7347afd) to head (b01ae62).

Files with missing lines Patch % Lines
src/plugins/plot/chart/MctChart.vue 46.42% 14 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8332      +/-   ##
==========================================
+ Coverage   56.14%   57.22%   +1.08%     
==========================================
  Files         728      728              
  Lines       29728    29755      +27     
  Branches     2812     2820       +8     
==========================================
+ Hits        16690    17027     +337     
+ Misses      12698    12387     -311     
- Partials      340      341       +1     
Flag Coverage Δ
e2e-ci 64.61% <100.00%> (+3.14%) ⬆️
e2e-full 39.46% <50.00%> (-0.02%) ⬇️
unit 46.32% <46.66%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
src/plugins/plot/chart/MCTChartAlarmPointSet.js 100.00% <100.00%> (ø)
src/plugins/plot/chart/MCTChartSeriesElement.js 94.91% <ø> (ø)
src/plugins/plot/chart/MctChart.vue 48.28% <46.42%> (-0.45%) ⬇️

... and 38 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7347afd...b01ae62. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread e2e/tests/functional/plugins/plot/plotRendering.e2e.spec.js
Comment thread e2e/tests/functional/plugins/plot/plotRendering.e2e.spec.js
Comment thread src/plugins/plot/chart/MctChart.vue

@jvigliotta jvigliotta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one change request about the order we call drawAPI.setDimensions and checkAndApplyReanchor in updateViewport. If it's called after a threshold breach, setDimensions would be using a stale anchorX value.

@shefalijoshi shefalijoshi requested a review from jvigliotta June 17, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Plots] Zooming out and in can cause the plot to display incorrectly

2 participants