@easyv/charts 1.0.44 → 1.0.48
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/.babelrc +8 -8
- package/lib/components/AnimateData.js +2 -2
- package/lib/components/Axis.js +12 -12
- package/lib/components/Background.js +2 -2
- package/lib/components/Carousel.js +4 -2
- package/lib/components/Chart.js +2 -2
- package/lib/components/ConicalGradient.js +21 -21
- package/lib/components/Indicator.js +2 -2
- package/lib/components/Label.js +1 -1
- package/lib/components/LinearGradient.js +2 -2
- package/lib/components/PieChart.js +326 -139
- package/lib/css/index.module.css +42 -42
- package/lib/css/piechart.module.css +27 -0
- package/lib/formatter/legend.js +3 -2
- package/lib/hooks/useAnimateData.js +5 -5
- package/lib/hooks/useAxes.js +5 -5
- package/lib/hooks/useCarouselAxisX.js +5 -5
- package/lib/hooks/useExtentData.js +6 -6
- package/lib/hooks/useFilterData.js +5 -5
- package/lib/hooks/useStackData.js +5 -5
- package/lib/hooks/useTooltip.js +10 -10
- package/lib/utils/index.js +1 -1
- package/package.json +34 -34
- package/src/components/AnimateData.tsx +24 -24
- package/src/components/Axis.tsx +333 -333
- package/src/components/Background.tsx +45 -45
- package/src/components/Band.tsx +160 -160
- package/src/components/Brush.js +159 -159
- package/src/components/Carousel.tsx +144 -142
- package/src/components/Chart.js +99 -101
- package/src/components/ChartContainer.tsx +63 -63
- package/src/components/ConicalGradient.js +258 -258
- package/src/components/ExtentData.js +17 -17
- package/src/components/FilterData.js +23 -23
- package/src/components/Indicator.js +13 -13
- package/src/components/Label.js +194 -194
- package/src/components/Legend.js +158 -158
- package/src/components/Lighter.jsx +162 -162
- package/src/components/Line.js +126 -126
- package/src/components/LinearGradient.js +29 -29
- package/src/components/Mapping.js +71 -72
- package/src/components/PieChart.js +876 -709
- package/src/components/StackData.js +20 -20
- package/src/components/StereoBar.tsx +298 -298
- package/src/components/Tooltip.js +116 -116
- package/src/components/index.js +49 -49
- package/src/context/index.js +2 -2
- package/src/css/index.module.css +42 -42
- package/src/css/piechart.module.css +27 -0
- package/src/element/Line.tsx +33 -33
- package/src/element/index.ts +3 -3
- package/src/formatter/index.js +1 -1
- package/src/formatter/legend.js +87 -87
- package/src/hooks/index.js +17 -17
- package/src/hooks/useAnimateData.ts +62 -62
- package/src/hooks/useAxes.js +143 -143
- package/src/hooks/useCarouselAxisX.js +163 -163
- package/src/hooks/useExtentData.js +88 -88
- package/src/hooks/useFilterData.js +65 -65
- package/src/hooks/useStackData.js +100 -100
- package/src/hooks/useTooltip.ts +96 -96
- package/src/index.js +6 -6
- package/src/types/index.d.ts +59 -59
- package/src/utils/index.js +640 -641
- package/tsconfig.json +22 -22
package/.babelrc
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"],
|
|
3
|
-
"plugins": [
|
|
4
|
-
"@babel/plugin-proposal-export-default-from",
|
|
5
|
-
"@babel/plugin-transform-runtime",
|
|
6
|
-
"@babel/plugin-proposal-class-properties"
|
|
7
|
-
]
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"],
|
|
3
|
+
"plugins": [
|
|
4
|
+
"@babel/plugin-proposal-export-default-from",
|
|
5
|
+
"@babel/plugin-transform-runtime",
|
|
6
|
+
"@babel/plugin-proposal-class-properties"
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -17,8 +17,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
|
|
18
18
|
var _hooks = require("../hooks");
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* 用来做图表数据改变(增长)动画(HOC)
|
|
20
|
+
/**
|
|
21
|
+
* 用来做图表数据改变(增长)动画(HOC)
|
|
22
22
|
*/
|
|
23
23
|
var _default = function _default(Component) {
|
|
24
24
|
return /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
package/lib/components/Axis.js
CHANGED
|
@@ -19,8 +19,8 @@ var _context = require("../context");
|
|
|
19
19
|
|
|
20
20
|
var _element = require("../element");
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* x, y, z轴
|
|
22
|
+
/**
|
|
23
|
+
* x, y, z轴
|
|
24
24
|
*/
|
|
25
25
|
var defaultAlign = {
|
|
26
26
|
textAnchor: 'middle',
|
|
@@ -48,16 +48,16 @@ var getAxesPath = function getAxesPath(orientation, _ref2) {
|
|
|
48
48
|
return 'M0, -0.5V' + (height + 0.5);
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
/**
|
|
52
|
-
* 根据坐标轴位置来确定轴标签的垂直对齐方式,水平对齐方式,以及轴标签位于坐标轴的哪个方向
|
|
53
|
-
* @param orientation 坐标轴位置
|
|
54
|
-
* @param rotate 旋转角度
|
|
55
|
-
* @returns {
|
|
56
|
-
* dominantBaseline,
|
|
57
|
-
* textAnchor,
|
|
58
|
-
* directionX,
|
|
59
|
-
* directionY
|
|
60
|
-
* }
|
|
51
|
+
/**
|
|
52
|
+
* 根据坐标轴位置来确定轴标签的垂直对齐方式,水平对齐方式,以及轴标签位于坐标轴的哪个方向
|
|
53
|
+
* @param orientation 坐标轴位置
|
|
54
|
+
* @param rotate 旋转角度
|
|
55
|
+
* @returns {
|
|
56
|
+
* dominantBaseline,
|
|
57
|
+
* textAnchor,
|
|
58
|
+
* directionX,
|
|
59
|
+
* directionY
|
|
60
|
+
* }
|
|
61
61
|
*/
|
|
62
62
|
|
|
63
63
|
|
|
@@ -42,8 +42,8 @@ var defaultAnimation = {
|
|
|
42
42
|
opacity: 100
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
-
/**
|
|
46
|
-
* 饼图类图表轮播逻辑,用来管理currentIndex,及回调逻辑(HOC)
|
|
45
|
+
/**
|
|
46
|
+
* 饼图类图表轮播逻辑,用来管理currentIndex,及回调逻辑(HOC)
|
|
47
47
|
*/
|
|
48
48
|
|
|
49
49
|
var _default = function _default(Component) {
|
|
@@ -100,6 +100,7 @@ var _default = function _default(Component) {
|
|
|
100
100
|
type = _ref3.type;
|
|
101
101
|
|
|
102
102
|
switch (interactive) {
|
|
103
|
+
case true:
|
|
103
104
|
case 'click':
|
|
104
105
|
if (type == 'onClick') {
|
|
105
106
|
timer.current && timer.current.stop();
|
|
@@ -125,6 +126,7 @@ var _default = function _default(Component) {
|
|
|
125
126
|
|
|
126
127
|
break;
|
|
127
128
|
|
|
129
|
+
case false:
|
|
128
130
|
case '':
|
|
129
131
|
break;
|
|
130
132
|
|
package/lib/components/Chart.js
CHANGED
|
@@ -19,8 +19,8 @@ var _context = require("../context");
|
|
|
19
19
|
|
|
20
20
|
var _ = require(".");
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* 总入口,通过外面传进来的type来确定渲染哪种图表,饼环图表为“pie”,否则为轴类图表
|
|
22
|
+
/**
|
|
23
|
+
* 总入口,通过外面传进来的type来确定渲染哪种图表,饼环图表为“pie”,否则为轴类图表
|
|
24
24
|
*/
|
|
25
25
|
var getCallbackData = function getCallbackData(callbacks, data) {
|
|
26
26
|
var callbackData;
|
|
@@ -19,8 +19,8 @@ var _utils = require("@easyv/utils/lib/common/utils");
|
|
|
19
19
|
|
|
20
20
|
var _indexModule = _interopRequireDefault(require("../css/index.module.css"));
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* 饼图装饰内圈
|
|
22
|
+
/**
|
|
23
|
+
* 饼图装饰内圈
|
|
24
24
|
*/
|
|
25
25
|
var _default = function _default(_ref) {
|
|
26
26
|
var width = _ref.width,
|
|
@@ -123,8 +123,8 @@ var _default = function _default(_ref) {
|
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
};
|
|
126
|
-
/**
|
|
127
|
-
* ConicalGradient
|
|
126
|
+
/**
|
|
127
|
+
* ConicalGradient
|
|
128
128
|
*/
|
|
129
129
|
|
|
130
130
|
|
|
@@ -136,11 +136,11 @@ function ConicalGradient() {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
ConicalGradient.prototype = {
|
|
139
|
-
/**
|
|
140
|
-
* addColorStop
|
|
141
|
-
*
|
|
142
|
-
* @param {Number} offset
|
|
143
|
-
* @param {Array} color RGBA值
|
|
139
|
+
/**
|
|
140
|
+
* addColorStop
|
|
141
|
+
*
|
|
142
|
+
* @param {Number} offset
|
|
143
|
+
* @param {Array} color RGBA值
|
|
144
144
|
*/
|
|
145
145
|
addColorStop: function addColorStop(offset, color) {
|
|
146
146
|
this._offsets.push(offset);
|
|
@@ -150,23 +150,23 @@ ConicalGradient.prototype = {
|
|
|
150
150
|
return this;
|
|
151
151
|
},
|
|
152
152
|
|
|
153
|
-
/**
|
|
154
|
-
* _offsetsReverse (array.forEach callback)
|
|
153
|
+
/**
|
|
154
|
+
* _offsetsReverse (array.forEach callback)
|
|
155
155
|
*/
|
|
156
156
|
_offsetsReverse: function _offsetsReverse(offset, index, array) {
|
|
157
157
|
array[index] = 1 - offset;
|
|
158
158
|
},
|
|
159
159
|
|
|
160
|
-
/**
|
|
161
|
-
* fill
|
|
162
|
-
*
|
|
163
|
-
* @param {Number} context
|
|
164
|
-
* @param {Number} x
|
|
165
|
-
* @param {Number} y
|
|
166
|
-
* @param {Number} radius
|
|
167
|
-
* @param {Number} startAngle
|
|
168
|
-
* @param {Number} endAngle
|
|
169
|
-
* @param {Boolean} anticlockwise
|
|
160
|
+
/**
|
|
161
|
+
* fill
|
|
162
|
+
*
|
|
163
|
+
* @param {Number} context
|
|
164
|
+
* @param {Number} x
|
|
165
|
+
* @param {Number} y
|
|
166
|
+
* @param {Number} radius
|
|
167
|
+
* @param {Number} startAngle
|
|
168
|
+
* @param {Number} endAngle
|
|
169
|
+
* @param {Boolean} anticlockwise
|
|
170
170
|
*/
|
|
171
171
|
fill: function fill(context, x, y, radius, startAngle, endAngle, anticlockwise) {
|
|
172
172
|
var offsets = this._offsets;
|
package/lib/components/Label.js
CHANGED
|
@@ -251,7 +251,7 @@ var getHorizontalLabel = function getHorizontalLabel(_ref7) {
|
|
|
251
251
|
case 'outerStart':
|
|
252
252
|
return {
|
|
253
253
|
y: y2,
|
|
254
|
-
dominantBaseline: y
|
|
254
|
+
dominantBaseline: y >= 0 ? 'text-after-edge' : 'text-before-edge'
|
|
255
255
|
};
|
|
256
256
|
|
|
257
257
|
case 'chartStart':
|