nasa / openmct

A web based mission control framework.
https://nasa.github.io/openmct/
Other
12.09k stars 1.26k forks source link

[Plot] Logarithmic axis, log plots #2297

Closed tadmorgan closed 2 years ago

tadmorgan commented 5 years ago

Is it possible to set a plot axis to logarithmic scale?

trusktr commented 2 years ago

Not yet. In progress in https://github.com/nasa/openmct/pull/4710

trusktr commented 2 years ago

We have an initial version in the log-plots and experimental-plotly-log-plots branches. But some more work needs to be done. A few things we are thinking about:

trusktr commented 2 years ago

Updated playground. All plots toggled off except symmetrical log functions: https://www.desmos.com/calculator/htkxrlto3a

trusktr commented 2 years ago

A better one showing symlog, scaled symlog, and scaled antisymlog, with a slider to adjust the scale value: https://www.desmos.com/calculator/2pcxvmsd6y

charlesh88 commented 2 years ago

Good chat with @trusktr today:

trusktr commented 2 years ago

4931 is in. When editing an Overlay Plot, there is now a "Log mode" checkbox that can be enabled in the right sidebar.

Testing:

khalidadil commented 2 years ago

I'm seeing an issue in an overlay plot when using a sine wave generator with log mode turned on. If I turn on log mode, save, and refresh, the plot isn't displaying correctly.

Screen Shot 2022-04-25 at 4 47 57 PM

I'm seeing this error:

Screen Shot 2022-04-25 at 4 47 42 PM Screen Shot 2022-04-25 at 4 49 13 PM
akhenry commented 2 years ago

We could be doing a better job of formatting y-axis values in log mode. Instead of showing something like this: Screen Shot 2022-04-25 at 3 02 23 PM

We should be rounding the y-axis values to the nearest whole number in this case.

akhenry commented 2 years ago

@khalidadil Sounds like maybe a version of this issue - https://github.com/nasa/openmct/issues/5039?

I am also seeing this issue for what it's worth, with non-SWG telemetry points as well.

khalidadil commented 2 years ago

@akhenry I just checked, and autoscale was turned on for me.

charlesh88 commented 2 years ago

Verified not fixed Testathon 04-25-22:

  1. Log scale should not change tick values from fairly compact integers to long floats: Log scale off image

Log scale on image

  1. Also seeing the same problem seen by others in #5039.
akhenry commented 2 years ago

@shefalijoshi to investigate https://github.com/nasa/openmct/issues/2297#issuecomment-1109075202

shefalijoshi commented 2 years ago

I think maybe we could use toFixed(2) instead of whole numbers to solve the long ticks issue? Otherwise if the range of values is small (0-1 for instance) then all the ticks would be either all 0 or all 1 which would be odd.

akhenry commented 2 years ago

Verified fixed, y-axis labels look awesome now!

charlesh88 commented 2 years ago

NOT fixed Testathon 4-28-22. Ticks end up being duplicated when the plotted value is < 1.

image

After no incoming data for a period:

image
akhenry commented 2 years ago

Testing Instructions

This intentionally restores the behavior seen in https://github.com/nasa/openmct/issues/2297#issuecomment-1109114296 which will need to be fixed in a separate issue, but does not block release.

  1. Create an overlay plot
  2. Enable log scale
  3. Verify that the scale is not causing a loss of precision resulting in repeating scale values as seen in https://github.com/nasa/openmct/issues/2297#issuecomment-1112724445

Important note This cannot be verified with sine wave generators. SWGs have a custom formatter which will round all values to 2 decimal places. In this case the precision is already lost before the log plots format the values.

michaelrogers commented 2 years ago

This change appears to be fixed in testathon 05/02. On inspecting an overlay plot with log scale enabled, the scale values do not repeat and instead show values without clipping the # of decimal places (increasing precision).

akhenry commented 2 years ago

Verified fixed.

rukmini-bose commented 2 years ago

Confirmed Fixed 05/02. Seeing the same behavior as Michael.