Skip to content

Feature/axis name generation handle missing info#681

Open
dedeibel wants to merge 2 commits intofair-acc:mainfrom
dedeibel:feature/axis-name-generation-handle-missing-info
Open

Feature/axis name generation handle missing info#681
dedeibel wants to merge 2 commits intofair-acc:mainfrom
dedeibel:feature/axis-name-generation-handle-missing-info

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
@sonarqubecloud
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