Skip to content
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

[Bar Graph Plugin] Accepts types that it should not #4400

Closed
1 of 5 tasks
jvigliotta opened this issue Oct 29, 2021 · 10 comments · Fixed by #4434
Closed
1 of 5 tasks

[Bar Graph Plugin] Accepts types that it should not #4400

jvigliotta opened this issue Oct 29, 2021 · 10 comments · Fixed by #4434

Comments

@jvigliotta
Copy link
Contributor

jvigliotta commented Oct 29, 2021

Summary

I had accidentally created a condition set inside of a bar graph. Tried creating some other types, but looks like only condition set is the issue.

Expected vs Current Behavior

Impact Check List

  • Data loss or misrepresented data?
  • Regression? Did this used to work or has it always been broken?
  • Is there a workaround available?
  • Does this impact a critical component?
  • Is this just a visual bug?

Steps to Reproduce

  1. Have a bar graph selected
  2. Create Menu -> Condition Set
  3. Oh noes!
@akhenry
Copy link
Contributor

akhenry commented Nov 1, 2021

Bar charts are probably accepting objects that produce telemetry, which condition sets do, but without considering whether the telemetry is actually plottable in a bar chart (ie. does it produce numbers?).

@scottbell
Copy link
Contributor

I can take this one

@scottbell
Copy link
Contributor

We are checking range values:
https://github.com/nasa/openmct/blob/master/src/plugins/charts/BarGraphCompositionPolicy.js#L27

const rangeValues = metadata.valuesForHints(['range']);
return rangeValues.length > 0;

but this isn't enough clearly. Should I be checking for a formatString too within the rangeValues?

@akhenry
Copy link
Contributor

akhenry commented Nov 2, 2021

Good question. I think we want to use similar logic to regular plots? Of course I'm assuming they are working correctly in this scenario :)

@scottbell
Copy link
Contributor

Regular plots behave the same in that you can drop condition sets upon them. E.g.:
Screen Shot 2021-11-02 at 5 04 17 PM
In fact, the composition policy is mostly just a copy/paste from OverlayPlots, except we loosened it a bit to only check the range for values so we can accept state generators (string/numbers).

@scottbell
Copy link
Contributor

Though after talking about this at the tagup, should we trying to plot ConditionSets in BarGraphs, or forbidding them? One can plot them in Overlay plots:
Screen Shot 2021-11-02 at 10 33 06 PM
Though in BarGraphs, they look rather screwy with the current value being assigned to the y-axis:
Screen Shot 2021-11-02 at 10 34 06 PM
What do you think @shefalijoshi @akhenry @charlesh88?

@scottbell
Copy link
Contributor

As I'm not sure there's a good way to look for numbers per se, and if we don't want to modify BarCharts to support enums, we could just block telemetry of the format that is equal to enum in the composition policy.

@scottbell
Copy link
Contributor

Per discussion in tagup, I'm going to check if the metadata is an enum, and block objects in the composition policy that have it.

@scottbell
Copy link
Contributor

Fixed in:
#4434

@jvigliotta
Copy link
Contributor Author

Testathon 12/7/2021 - Verified Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants