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

Feature/axis name generation handle missing info #681

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dedeibel
Copy link
Contributor

@dedeibel dedeibel commented Dec 6, 2024

I am suggesting this change since I noticed two "problems" with the axis label handling.

  1. If there is no axis name specified there would be a space character before the unit part e.g.: _[V] (Space replaced by _ in the example)
  2. If there was no unit specified an empty set of brackets would be used: []
  • (Often seen when people don't set a unit - not so pretty in IMO)

The change would result in the following behaviour (taken from the tests):

Axis name, unit, scale

"axis name", "axis unit", 1.    → "axis name [axis unit]"
"DeviceA", "V", 1.              → "DeviceA [V]"
"DeviceA", "V", 0.001           → "DeviceA [mV]"
"axis name", null, 1.           → "axis name"
"", "V", 1.                     → "[V]"
null, "V", 1.                   → "[V]"
"", "", 1.                      → ""
null, null, 1.                  → null

In our code we extended DefaultNumericAxis because of this. With the changes this would not be necessary.

Please consider the above suggestion for integration.

- Remove leading white space when a unit was present but no axis name
- Use an empty label if no axis name was specified and the unit was an empty string
- Extracted axis label generator to own method for easier overwrite
- Remove throws exception for quality gate
Copy link

sonarqubecloud bot commented Dec 9, 2024

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

Successfully merging this pull request may close these issues.

1 participant