Skip to content

A few zooming in/out with plots display issue fixes.#8199

Open
shefalijoshi wants to merge 20 commits intomasterfrom
fix-plots-zoom
Open

A few zooming in/out with plots display issue fixes.#8199
shefalijoshi wants to merge 20 commits intomasterfrom
fix-plots-zoom

Conversation

@shefalijoshi
Copy link
Copy Markdown
Contributor

@shefalijoshi shefalijoshi commented Nov 7, 2025

Closes #7926 #6433 #7928

Describe your changes:

Plots use WebGL to display data points. WebGL (1.0 and 2.0) only work with 32-bit data.
Plots use the 'relative coordinate' strategy to reduce the size of data points (like timestamps in milliseconds) from 64-bit to 32-bit numbers.
This is done by:

  1. Transforming the data points to plot from absolute (possibly 64-bit numbers) into a more manageable or relevant scale. See: https://github.com/nasa/openmct/pull/8199/files#diff-7c3ec4bd0896cb2329c7321b5030a74b132137427243dfc7d20b80e7bfa3715cR513
  2. Considering only the points that are visible in the current viewport.
  3. Resetting the 'offset origin' when plot data is reset.
  • Optimize relative time offsets so that they get reset every time plot data is reset. This reduces the chances of WebGL points from being too large (more than 32-bit numbers).
  • Don't add points to plots that are not in the time range. This means the origin (start time) for offsets is within the time range being displayed, which also reduces the chances of WebGL points from being too large (more than 32-bit numbers).
  • Fix incorrect usage of lodash.uniq - which doesn't use a compare function. Switching to uniqBy - which does use a compare function. This ensures that duplicate points are removed from the data set.
  • While getting the time range from screen position to x-axis min/max range, if the position is a float, the range also ends up getting a decimal point. This is odd for timestamps. Round off ranges here.

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?

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 64.51613% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.93%. Comparing base (9a855cf) to head (2c8a059).

Files with missing lines Patch % Lines
src/plugins/plot/chart/MctChart.vue 38.09% 13 Missing ⚠️
src/plugins/plot/chart/MCTChartSeriesElement.js 81.81% 6 Missing ⚠️
src/plugins/plot/MctPlot.vue 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8199      +/-   ##
==========================================
- Coverage   57.21%   55.93%   -1.28%     
==========================================
  Files         728      728              
  Lines       29676    29719      +43     
  Branches     2804     2811       +7     
==========================================
- Hits        16978    16624     -354     
- Misses      12358    12755     +397     
  Partials      340      340              
Flag Coverage Δ
e2e-ci 60.00% <81.08%> (-4.44%) ⬇️
e2e-full 39.53% <81.08%> (+0.04%) ⬆️
unit 46.39% <48.38%> (-0.03%) ⬇️
Files with missing lines Coverage Δ
src/plugins/plot/chart/MCTChartAlarmLineSet.js 76.66% <100.00%> (-3.34%) ⬇️
src/plugins/plot/chart/MCTChartAlarmPointSet.js 94.73% <100.00%> (-5.27%) ⬇️
src/plugins/plot/configuration/PlotSeries.js 84.42% <100.00%> (-1.51%) ⬇️
src/plugins/plot/MctPlot.vue 36.76% <25.00%> (-0.07%) ⬇️
src/plugins/plot/chart/MCTChartSeriesElement.js 77.21% <81.81%> (-17.71%) ⬇️
src/plugins/plot/chart/MctChart.vue 47.84% <38.09%> (-0.88%) ⬇️

... and 35 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 9a855cf...2c8a059. 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.

@shefalijoshi shefalijoshi changed the title Plots A few zooming in/out with plots display issue fixes. Nov 7, 2025
jvigliotta added a commit that referenced this pull request Nov 10, 2025
}, this);

const data = this.series.getSeriesData();
if (!data || data.length === 0) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍

@akhenry
Copy link
Copy Markdown
Contributor

akhenry commented Mar 16, 2026

NOTE

Merge this before #8274

@akhenry akhenry added this to the VIPER GDS 9.1 RC5 milestone Mar 18, 2026
@akhenry akhenry self-requested a review March 19, 2026 18:26
Copy link
Copy Markdown
Contributor

@akhenry akhenry left a comment

Choose a reason for hiding this comment

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

I want to discuss this before it goes in.

@akhenry akhenry removed this from the VIPER GDS 9.1 RC5 milestone Mar 19, 2026
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

3 participants