Skip to content

Conversation

@shefalijoshi
Copy link
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

codecov bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 70.21277% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.67%. Comparing base (16a9ced) to head (9858c07).

Files with missing lines Patch % Lines
src/plugins/plot/chart/MctChart.vue 57.14% 9 Missing ⚠️
src/plugins/plot/MctPlot.vue 25.00% 3 Missing ⚠️
src/plugins/plot/chart/MCTChartAlarmLineSet.js 50.00% 1 Missing ⚠️
src/plugins/plot/chart/MCTChartSeriesElement.js 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8199      +/-   ##
==========================================
- Coverage   57.34%   56.67%   -0.67%     
==========================================
  Files         704      704              
  Lines       28322    28353      +31     
  Branches     2771     2778       +7     
==========================================
- Hits        16240    16069     -171     
- Misses      11740    11940     +200     
- Partials      342      344       +2     
Flag Coverage Δ
e2e-ci 62.92% <86.36%> (-0.30%) ⬇️
e2e-full 23.62% <4.54%> (-18.85%) ⬇️
unit 48.40% <65.95%> (-0.10%) ⬇️
Files with missing lines Coverage Δ
src/plugins/plot/chart/MCTChartAlarmPointSet.js 100.00% <100.00%> (ø)
src/plugins/plot/configuration/PlotSeries.js 87.17% <100.00%> (+0.51%) ⬆️
src/plugins/plot/chart/MCTChartAlarmLineSet.js 77.41% <50.00%> (-2.59%) ⬇️
src/plugins/plot/chart/MCTChartSeriesElement.js 81.53% <93.75%> (+1.87%) ⬆️
src/plugins/plot/MctPlot.vue 37.34% <25.00%> (-0.07%) ⬇️
src/plugins/plot/chart/MctChart.vue 50.10% <57.14%> (-0.12%) ⬇️

... and 18 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 16a9ced...9858c07. 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
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