@easyv/charts 1.1.0 → 1.1.1
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/CHANGELOG.md +2 -0
- package/lib/utils/index.js +1 -1
- package/package.json +6 -1
- package/src/utils/index.js +20 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.1](https://gitlab.prod.dtstack.cn:10022/visdev/visApplication/easyv-charts/compare/v1.1.0...v1.1.1) (2022-04-13)
|
|
6
|
+
|
|
5
7
|
## 1.1.0 (2022-04-02)
|
|
6
8
|
|
|
7
9
|
|
package/lib/utils/index.js
CHANGED
|
@@ -73,7 +73,7 @@ var SvgBackground = function SvgBackground(_ref) {
|
|
|
73
73
|
y1: "0%",
|
|
74
74
|
x2: "0%",
|
|
75
75
|
y2: "100%",
|
|
76
|
-
gradientTransform: 'rotate(' + angle + ', 0.5, 0.5)'
|
|
76
|
+
gradientTransform: 'rotate(' + (angle + 180) + ', 0.5, 0.5)'
|
|
77
77
|
}, stops.map(function (_ref2, index) {
|
|
78
78
|
var offset = _ref2.offset,
|
|
79
79
|
color = _ref2.color;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easyv/charts",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -43,5 +43,10 @@
|
|
|
43
43
|
"commitizen": {
|
|
44
44
|
"path": "./node_modules/cz-conventional-changelog"
|
|
45
45
|
}
|
|
46
|
+
},
|
|
47
|
+
"standard-version": {
|
|
48
|
+
"skip": {
|
|
49
|
+
"commit": true
|
|
50
|
+
}
|
|
46
51
|
}
|
|
47
52
|
}
|
package/src/utils/index.js
CHANGED
|
@@ -50,7 +50,7 @@ const SvgBackground = ({
|
|
|
50
50
|
y1='0%'
|
|
51
51
|
x2='0%'
|
|
52
52
|
y2='100%'
|
|
53
|
-
gradientTransform={'rotate(' + angle + ', 0.5, 0.5)'}
|
|
53
|
+
gradientTransform={'rotate(' + (angle + 180) + ', 0.5, 0.5)'}
|
|
54
54
|
>
|
|
55
55
|
{stops.map(({ offset, color }, index) => (
|
|
56
56
|
<stop
|
|
@@ -86,16 +86,16 @@ const getIcon = (type, icon) => {
|
|
|
86
86
|
case 'line':
|
|
87
87
|
return icon
|
|
88
88
|
? {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
...defaultLineIcon,
|
|
90
|
+
...icon,
|
|
91
|
+
}
|
|
92
92
|
: defaultLineIcon;
|
|
93
93
|
default:
|
|
94
94
|
return icon
|
|
95
95
|
? {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
...defaultIcon,
|
|
97
|
+
...icon,
|
|
98
|
+
}
|
|
99
99
|
: defaultIcon;
|
|
100
100
|
}
|
|
101
101
|
};
|
|
@@ -145,7 +145,6 @@ const getBreakWord = (str, breakNumber) => {
|
|
|
145
145
|
//x轴标签逻辑
|
|
146
146
|
|
|
147
147
|
const getTicksOfAxis = (domain, ticksCount, showLast) => {
|
|
148
|
-
|
|
149
148
|
let len = domain.length;
|
|
150
149
|
if (ticksCount < 2 || ticksCount > len) return domain;
|
|
151
150
|
let step = Math.floor((len - ticksCount) / (ticksCount - 1));
|
|
@@ -153,13 +152,15 @@ const getTicksOfAxis = (domain, ticksCount, showLast) => {
|
|
|
153
152
|
return i % (step + 1) === 0;
|
|
154
153
|
});
|
|
155
154
|
let Tlen = ticksArr.length;
|
|
156
|
-
let lastIndex = domain.findIndex(d => d == ticksArr[Tlen - 1])
|
|
155
|
+
let lastIndex = domain.findIndex((d) => d == ticksArr[Tlen - 1]);
|
|
157
156
|
if (showLast) {
|
|
158
|
-
len % ticksCount == 0 ||
|
|
159
|
-
|
|
157
|
+
len % ticksCount == 0 || len - 1 - lastIndex >= Math.round(len / Tlen / 2)
|
|
158
|
+
? null
|
|
159
|
+
: ticksArr.pop();
|
|
160
|
+
ticksArr.push(domain[len - 1]);
|
|
160
161
|
}
|
|
161
|
-
return ticksArr
|
|
162
|
-
}
|
|
162
|
+
return ticksArr;
|
|
163
|
+
};
|
|
163
164
|
|
|
164
165
|
const getTickCoord = ({
|
|
165
166
|
orientation,
|
|
@@ -650,12 +651,15 @@ const getDataWithPercent = (data = [], precision = 0) => {
|
|
|
650
651
|
let obj = {
|
|
651
652
|
...data,
|
|
652
653
|
value,
|
|
653
|
-
percent: toFixed(
|
|
654
|
+
percent: toFixed(
|
|
655
|
+
(vote + (value && value != 0 ? remainder : 0)) / digits,
|
|
656
|
+
precision
|
|
657
|
+
),
|
|
654
658
|
};
|
|
655
659
|
if (value && value != 0) {
|
|
656
|
-
remainder = 0
|
|
660
|
+
remainder = 0;
|
|
657
661
|
}
|
|
658
|
-
return obj
|
|
662
|
+
return obj;
|
|
659
663
|
});
|
|
660
664
|
return tmp;
|
|
661
665
|
};
|