evui 3.4.139 → 3.4.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evui.common.js +9 -37
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +9 -37
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chart/scale/scale.linear.js +6 -14
- package/src/components/chart/scale/scale.step.js +0 -10
- package/src/components/chart/scale/scale.time.category.js +0 -9
- package/src/components/chart/scale/scale.time.js +0 -10
package/package.json
CHANGED
|
@@ -10,14 +10,16 @@ class LinearScale extends Scale {
|
|
|
10
10
|
*
|
|
11
11
|
* @returns {string} formatted label
|
|
12
12
|
*/
|
|
13
|
+
getTruthyValue(value) {
|
|
14
|
+
return truthyNumber(value) ? Number(value.toFixed(this.decimalPoint)) : value;
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
getLabelFormat(value, data = {}) {
|
|
14
18
|
if (this.formatter) {
|
|
15
|
-
const formattedLabel = this.formatter(
|
|
19
|
+
const formattedLabel = this.formatter(this.getTruthyValue(value), {
|
|
16
20
|
...data,
|
|
17
21
|
prevOriginalValue: data?.prev,
|
|
18
|
-
prevDecimalPointValue:
|
|
19
|
-
? Number(data?.prev.toFixed(this.decimalPoint))
|
|
20
|
-
: null,
|
|
22
|
+
prevDecimalPointValue: this.getTruthyValue(data?.prev),
|
|
21
23
|
currentOriginalValue: value,
|
|
22
24
|
currentDecimalPointValue: Number(value.toFixed(this.decimalPoint)),
|
|
23
25
|
});
|
|
@@ -27,16 +29,6 @@ class LinearScale extends Scale {
|
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
const { fixWidth, fitDir } = this.labelStyle;
|
|
31
|
-
|
|
32
|
-
if (fixWidth > 0) {
|
|
33
|
-
return Util.truncateLabelWithEllipsis(
|
|
34
|
-
Util.labelSignFormat(value, this.decimalPoint),
|
|
35
|
-
fixWidth,
|
|
36
|
-
this.ctx,
|
|
37
|
-
fitDir,
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
32
|
|
|
41
33
|
return Util.labelSignFormat(value, this.decimalPoint);
|
|
42
34
|
}
|
|
@@ -406,16 +406,6 @@ class StepScale extends Scale {
|
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
const { fixWidth, fitDir } = this.labelStyle;
|
|
410
|
-
|
|
411
|
-
if (fixWidth > 0) {
|
|
412
|
-
return Util.truncateLabelWithEllipsis(
|
|
413
|
-
Util.labelSignFormat(value, this.decimalPoint),
|
|
414
|
-
fixWidth,
|
|
415
|
-
this.ctx,
|
|
416
|
-
fitDir,
|
|
417
|
-
);
|
|
418
|
-
}
|
|
419
409
|
|
|
420
410
|
return this.labelStyle.fitWidth ? this.fittingString(value, maxWidth) : value;
|
|
421
411
|
}
|
|
@@ -26,15 +26,6 @@ class TimeCategoryScale extends Scale {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const { fixWidth, fitDir } = this.labelStyle;
|
|
30
|
-
if (fixWidth > 0) {
|
|
31
|
-
return Util.truncateLabelWithEllipsis(
|
|
32
|
-
dayjs(value).format(this.timeFormat),
|
|
33
|
-
fixWidth,
|
|
34
|
-
this.ctx,
|
|
35
|
-
fitDir,
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
29
|
|
|
39
30
|
return dayjs(value).format(this.timeFormat);
|
|
40
31
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
2
|
import { TIME_INTERVALS } from '../helpers/helpers.constant';
|
|
3
3
|
import Scale from './scale';
|
|
4
|
-
import Util from '../helpers/helpers.util';
|
|
5
4
|
|
|
6
5
|
class TimeScale extends Scale {
|
|
7
6
|
/**
|
|
@@ -19,15 +18,6 @@ class TimeScale extends Scale {
|
|
|
19
18
|
return formattedLabel;
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
|
-
const { fixWidth, fitDir } = this.labelStyle;
|
|
23
|
-
if (fixWidth > 0) {
|
|
24
|
-
return Util.truncateLabelWithEllipsis(
|
|
25
|
-
dayjs(value).format(this.timeFormat),
|
|
26
|
-
fixWidth,
|
|
27
|
-
this.ctx,
|
|
28
|
-
fitDir,
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
21
|
|
|
32
22
|
return dayjs(value).format(this.timeFormat);
|
|
33
23
|
}
|