Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nasa/openmct.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Henry <akhenry@gmail.com>2022-05-01 00:40:32 +0300
committerAndrew Henry <akhenry@gmail.com>2022-05-01 00:40:32 +0300
commit1ac15cda14580206201172e21a4d79a9068db560 (patch)
treecc3a3ba3ff2cd5098922519f2d386291366a345a
parenta94ec344eae9704e9b66028fc4d594335b9072c1 (diff)
Reverts forced precision for log plots axis labelsrevert-log-fix
-rw-r--r--src/plugins/plot/MctTicks.vue4
-rw-r--r--src/plugins/plot/tickUtils.js14
2 files changed, 3 insertions, 15 deletions
diff --git a/src/plugins/plot/MctTicks.vue b/src/plugins/plot/MctTicks.vue
index 56ac65b2c..ab09cb6d1 100644
--- a/src/plugins/plot/MctTicks.vue
+++ b/src/plugins/plot/MctTicks.vue
@@ -192,7 +192,6 @@ export default {
if (this.axisType === 'yAxis' && this.axis.get('logMode')) {
return getLogTicks(range.min, range.max, number, 4);
- // return getLogTicks2(range.min, range.max, number);
} else {
return ticks(range.min, range.max, number);
}
@@ -204,7 +203,6 @@ export default {
updateTicks(forceRegeneration = false) {
const range = this.axis.get('displayRange');
- const logMode = this.axis.get('logMode');
if (!range) {
delete this.min;
@@ -233,7 +231,7 @@ export default {
step: newTicks[1] - newTicks[0]
};
- newTicks = getFormattedTicks(newTicks, format, logMode);
+ newTicks = getFormattedTicks(newTicks, format);
this.ticks = newTicks;
this.shouldCheckWidth = true;
diff --git a/src/plugins/plot/tickUtils.js b/src/plugins/plot/tickUtils.js
index e9d472ce4..a83a77989 100644
--- a/src/plugins/plot/tickUtils.js
+++ b/src/plugins/plot/tickUtils.js
@@ -78,11 +78,6 @@ export function getLogTicks(start, stop, mainTickCount = 8, secondaryTickCount =
return result;
}
-export function getLogTicks2(start, stop, count = 8) {
- return ticks(antisymlog(start, 10), antisymlog(stop, 10), count)
- .map(n => symlog(n, 10));
-}
-
/**
* Linear tick generation from d3-array.
*/
@@ -131,17 +126,12 @@ export function commonSuffix(a, b) {
return a.slice(a.length - breakpoint);
}
-export function getFormattedTicks(newTicks, format, formatFloat) {
+export function getFormattedTicks(newTicks, format) {
newTicks = newTicks
.map(function (tickValue) {
- let formattedValue = format(tickValue);
- if (formatFloat === true && typeof formattedValue === 'number' && !Number.isInteger(formattedValue)) {
- formattedValue = parseFloat(formattedValue).toFixed(2);
- }
-
return {
value: tickValue,
- text: formattedValue
+ text: format(tickValue)
};
});