@easyv/charts 1.1.1 → 1.1.5

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.
Files changed (68) hide show
  1. package/.babelrc +8 -8
  2. package/.husky/commit-msg +3 -3
  3. package/CHANGELOG.md +18 -18
  4. package/commitlint.config.js +1 -1
  5. package/lib/components/AnimateData.js +2 -2
  6. package/lib/components/Axis.js +10 -10
  7. package/lib/components/Background.js +2 -2
  8. package/lib/components/Carousel.js +2 -2
  9. package/lib/components/Chart.js +2 -2
  10. package/lib/components/ConicalGradient.js +21 -21
  11. package/lib/components/Indicator.js +2 -2
  12. package/lib/components/Lighter.js +179 -179
  13. package/lib/components/LinearGradient.js +2 -2
  14. package/lib/components/StereoBar.js +69 -55
  15. package/lib/css/index.module.css +41 -41
  16. package/lib/css/piechart.module.css +26 -26
  17. package/lib/element/ConicGradient.js +72 -72
  18. package/lib/hooks/useAnimateData.js +5 -5
  19. package/lib/hooks/useAxes.js +5 -5
  20. package/lib/hooks/useCarouselAxisX.js +5 -5
  21. package/lib/hooks/useExtentData.js +6 -6
  22. package/lib/hooks/useFilterData.js +5 -5
  23. package/lib/hooks/useStackData.js +5 -5
  24. package/lib/hooks/useTooltip.js +10 -10
  25. package/package.json +52 -52
  26. package/src/components/AnimateData.tsx +24 -24
  27. package/src/components/Axis.tsx +354 -354
  28. package/src/components/Background.tsx +45 -45
  29. package/src/components/Band.tsx +173 -173
  30. package/src/components/Brush.js +159 -159
  31. package/src/components/Carousel.tsx +144 -144
  32. package/src/components/Chart.js +99 -99
  33. package/src/components/ChartContainer.tsx +63 -63
  34. package/src/components/ConicalGradient.js +258 -258
  35. package/src/components/ExtentData.js +17 -17
  36. package/src/components/FilterData.js +23 -23
  37. package/src/components/Indicator.js +13 -13
  38. package/src/components/Label.js +206 -206
  39. package/src/components/Legend.js +158 -158
  40. package/src/components/Lighter.jsx +173 -173
  41. package/src/components/Line.js +144 -144
  42. package/src/components/LinearGradient.js +29 -29
  43. package/src/components/Mapping.js +71 -71
  44. package/src/components/PieChart.js +1097 -1097
  45. package/src/components/StackData.js +20 -20
  46. package/src/components/StereoBar.tsx +311 -299
  47. package/src/components/Tooltip.js +168 -168
  48. package/src/components/index.js +51 -51
  49. package/src/context/index.js +2 -2
  50. package/src/css/index.module.css +41 -41
  51. package/src/css/piechart.module.css +26 -26
  52. package/src/element/ConicGradient.jsx +55 -55
  53. package/src/element/Line.tsx +33 -33
  54. package/src/element/index.ts +3 -3
  55. package/src/formatter/index.js +1 -1
  56. package/src/formatter/legend.js +90 -90
  57. package/src/hooks/index.js +17 -17
  58. package/src/hooks/useAnimateData.ts +62 -62
  59. package/src/hooks/useAxes.js +144 -144
  60. package/src/hooks/useCarouselAxisX.js +163 -163
  61. package/src/hooks/useExtentData.js +88 -88
  62. package/src/hooks/useFilterData.js +72 -72
  63. package/src/hooks/useStackData.js +100 -100
  64. package/src/hooks/useTooltip.ts +96 -96
  65. package/src/index.js +6 -6
  66. package/src/types/index.d.ts +62 -62
  67. package/src/utils/index.js +696 -696
  68. package/tsconfig.json +22 -22
@@ -56,10 +56,10 @@ var getHighlightData = function getHighlightData(data, extent) {
56
56
 
57
57
  var getAttr = function getAttr(_ref) {
58
58
  var isVertical = _ref.isVertical,
59
- seriesWidth = _ref.seriesWidth,
60
- length = _ref.length,
61
- x = _ref.x,
62
- y = _ref.y;
59
+ seriesWidth = _ref.seriesWidth,
60
+ length = _ref.length,
61
+ x = _ref.x,
62
+ y = _ref.y;
63
63
  if (isVertical) return {
64
64
  width: length,
65
65
  height: seriesWidth,
@@ -76,36 +76,36 @@ var getAttr = function getAttr(_ref) {
76
76
 
77
77
  var getBorderRadius = function getBorderRadius(_ref2) {
78
78
  var isVertical = _ref2.isVertical,
79
- positive = _ref2.positive,
80
- seriesWidth = _ref2.seriesWidth;
79
+ positive = _ref2.positive,
80
+ seriesWidth = _ref2.seriesWidth;
81
81
  return isVertical ? positive ? '0px ' + seriesWidth + 'px ' + seriesWidth + 'px 0' : seriesWidth + 'px 0 0 ' + seriesWidth + 'px' : positive ? seriesWidth / 2 + 'px ' + seriesWidth / 2 + 'px 0 0' : '0 0 ' + seriesWidth / 2 + 'px ' + seriesWidth / 2 + 'px';
82
82
  };
83
83
 
84
84
  var _default = /*#__PURE__*/(0, _react.memo)(function (_ref3) {
85
85
  var triggerClick = _ref3.triggerClick,
86
- _ref3$config = _ref3.config,
87
- _ref3$config$pattern = _ref3$config.pattern,
88
- pattern = _ref3$config$pattern === void 0 ? {} : _ref3$config$pattern,
89
- _ref3$config$seriesIn = _ref3$config.seriesIntervalWidth,
90
- paddingInner = _ref3$config$seriesIn === void 0 ? 0 : _ref3$config$seriesIn,
91
- _ref3$config$paddingI = _ref3$config.paddingInner,
92
- paddingOuter = _ref3$config$paddingI === void 0 ? 0 : _ref3$config$paddingI,
93
- style = _ref3$config.style,
94
- fill = _ref3$config.fill,
95
- _ref3$config$highligh = _ref3$config.highlight,
96
- showHighlight = _ref3$config$highligh.show,
97
- extent = _ref3$config$highligh.extent,
98
- highlightFill = _ref3$config$highligh.fill,
99
- id = _ref3$config.id,
100
- _ref3$bandLength = _ref3.bandLength,
101
- bandLength = _ref3$bandLength === void 0 ? 0 : _ref3$bandLength,
102
- data = _ref3.data,
103
- _ref3$xAxis = _ref3.xAxis,
104
- xScaler = _ref3$xAxis.scaler,
105
- step = _ref3$xAxis.step,
106
- direction = _ref3$xAxis.direction,
107
- yScaler = _ref3.yAxis.scaler,
108
- fieldName = _ref3.fieldName;
86
+ _ref3$config = _ref3.config,
87
+ _ref3$config$pattern = _ref3$config.pattern,
88
+ pattern = _ref3$config$pattern === void 0 ? {} : _ref3$config$pattern,
89
+ _ref3$config$seriesIn = _ref3$config.seriesIntervalWidth,
90
+ paddingInner = _ref3$config$seriesIn === void 0 ? 0 : _ref3$config$seriesIn,
91
+ _ref3$config$paddingI = _ref3$config.paddingInner,
92
+ paddingOuter = _ref3$config$paddingI === void 0 ? 0 : _ref3$config$paddingI,
93
+ style = _ref3$config.style,
94
+ fill = _ref3$config.fill,
95
+ _ref3$config$highligh = _ref3$config.highlight,
96
+ showHighlight = _ref3$config$highligh.show,
97
+ extent = _ref3$config$highligh.extent,
98
+ highlightFill = _ref3$config$highligh.fill,
99
+ id = _ref3$config.id,
100
+ _ref3$bandLength = _ref3.bandLength,
101
+ bandLength = _ref3$bandLength === void 0 ? 0 : _ref3$bandLength,
102
+ data = _ref3.data,
103
+ _ref3$xAxis = _ref3.xAxis,
104
+ xScaler = _ref3$xAxis.scaler,
105
+ step = _ref3$xAxis.step,
106
+ direction = _ref3$xAxis.direction,
107
+ yScaler = _ref3.yAxis.scaler,
108
+ fieldName = _ref3.fieldName;
109
109
  if (!data.length) return null;
110
110
  var bandwidth = (0, _utils.getBandwidth)(step, paddingOuter);
111
111
 
@@ -114,8 +114,8 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref3) {
114
114
  paddingInner: paddingInner,
115
115
  bandLength: bandLength
116
116
  }),
117
- seriesStep = _getBandSeriesStepAnd.seriesStep,
118
- seriesWidth = _getBandSeriesStepAnd.seriesWidth;
117
+ seriesStep = _getBandSeriesStepAnd.seriesStep,
118
+ seriesWidth = _getBandSeriesStepAnd.seriesWidth;
119
119
 
120
120
  var _data = showHighlight ? getHighlightData(data, extent) : data;
121
121
 
@@ -149,15 +149,15 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref3) {
149
149
  slope: "0.7"
150
150
  }))), highlightColor.def, color.def), _data.map(function (_ref4, i) {
151
151
  var flag = _ref4.flag,
152
- index = _ref4.index,
153
- _ref4$bound = (0, _slicedToArray2["default"])(_ref4.bound, 2),
154
- start = _ref4$bound[0],
155
- end = _ref4$bound[1],
156
- data = _ref4.data,
157
- _ref4$data = _ref4.data,
158
- x = _ref4$data.x,
159
- y = _ref4$data.y,
160
- s = _ref4$data.s;
152
+ index = _ref4.index,
153
+ _ref4$bound = (0, _slicedToArray2["default"])(_ref4.bound, 2),
154
+ start = _ref4$bound[0],
155
+ end = _ref4$bound[1],
156
+ data = _ref4.data,
157
+ _ref4$data = _ref4.data,
158
+ x = _ref4$data.x,
159
+ y = _ref4$data.y,
160
+ s = _ref4$data.s;
161
161
 
162
162
  var y1 = yScaler(isVertical ? end : start);
163
163
  var y2 = yScaler(isVertical ? start : end);
@@ -185,12 +185,12 @@ exports["default"] = _default;
185
185
 
186
186
  var Column3DSkin = function Column3DSkin(props) {
187
187
  var width = props.width,
188
- height = props.height,
189
- x = props.x,
190
- y = props.y,
191
- color = props.color,
192
- _props$opacity = props.opacity,
193
- opacity = _props$opacity === void 0 ? 1 : _props$opacity;
188
+ height = props.height,
189
+ x = props.x,
190
+ y = props.y,
191
+ color = props.color,
192
+ _props$opacity = props.opacity,
193
+ opacity = _props$opacity === void 0 ? 1 : _props$opacity;
194
194
  return /*#__PURE__*/_react["default"].createElement("g", {
195
195
  style: {
196
196
  transform: "skew(0deg, 23deg)",
@@ -232,11 +232,11 @@ var Column3DSkin = function Column3DSkin(props) {
232
232
 
233
233
  function pointRotate(point, center, angle) {
234
234
  var x = point[0],
235
- y = point[1],
236
- rx = center[0],
237
- ry = center[1],
238
- cos = Math.cos(angle),
239
- sin = Math.sin(angle);
235
+ y = point[1],
236
+ rx = center[0],
237
+ ry = center[1],
238
+ cos = Math.cos(angle),
239
+ sin = Math.sin(angle);
240
240
  var x0 = (x - rx) * cos - (y - ry) * sin + rx;
241
241
  var y0 = (x - rx) * sin + (y - ry) * cos + ry;
242
242
  return [x0, y0];
@@ -276,10 +276,10 @@ function deepCopy(obj) {
276
276
  function parseMultiColorToSVG(config, id) {
277
277
  if (config.type == "linear") {
278
278
  var _config$linear = config.linear,
279
- stops = _config$linear.stops,
280
- opacity = _config$linear.opacity;
279
+ stops = _config$linear.stops,
280
+ opacity = _config$linear.opacity;
281
281
  var start = [0, 0.5],
282
- end = [1, 0.5];
282
+ end = [1, 0.5];
283
283
  var angle = config.linear.angle + 90;
284
284
 
285
285
  if (angle) {
@@ -312,7 +312,7 @@ function parseMultiColorToSVG(config, id) {
312
312
  stopOpacity: opacity
313
313
  });
314
314
  })),
315
- firstColor: _stops[_stops.length - 1].color
315
+ firstColor: getTopColor(_stops, angle)
316
316
  };
317
317
  } else {
318
318
  return {
@@ -320,4 +320,18 @@ function parseMultiColorToSVG(config, id) {
320
320
  firstColor: config.pure
321
321
  };
322
322
  }
323
+ }
324
+
325
+ function getTopColor(stops, angle) {
326
+ var a = angle % 360;
327
+
328
+ if (a < 0) {
329
+ a = 360 + a;
330
+ }
331
+
332
+ if (a >= 90 && a < 270) {
333
+ return stops[stops.length - 1].color;
334
+ } else {
335
+ return stops[0].color;
336
+ }
323
337
  }
@@ -1,42 +1,42 @@
1
- .rotateClockwise {
2
- animation-name: rotateClockwise;
3
- }
4
-
5
- @keyframes rotateClockwise {
6
- 0% {
7
- transform: rotate(0deg);
8
- }
9
- 100% {
10
- transform: rotate(360deg);
11
- }
12
- }
13
-
14
- .rotateCounterClockwise {
15
- animation-name: rotateCounterClockwise;
16
- }
17
-
18
- @keyframes rotateCounterClockwise {
19
- 0% {
20
- transform: rotate(360deg);
21
- }
22
- 100% {
23
- transform: rotate(0deg);
24
- }
25
- }
26
-
27
- .showAllStyle {
28
- display: grid;
29
- width: 100%;
30
- grid-template-columns: 40% 30% 30%;
31
- align-items: center;
32
- flex-direction: row;
33
- justify-content: space-between;
34
- }
35
-
36
- .notShowAllStyle {
37
- display: flex;
38
- width: 100%;
39
- align-items: center;
40
- flex-direction: row;
41
- justify-content: space-between;
1
+ .rotateClockwise {
2
+ animation-name: rotateClockwise;
3
+ }
4
+
5
+ @keyframes rotateClockwise {
6
+ 0% {
7
+ transform: rotate(0deg);
8
+ }
9
+ 100% {
10
+ transform: rotate(360deg);
11
+ }
12
+ }
13
+
14
+ .rotateCounterClockwise {
15
+ animation-name: rotateCounterClockwise;
16
+ }
17
+
18
+ @keyframes rotateCounterClockwise {
19
+ 0% {
20
+ transform: rotate(360deg);
21
+ }
22
+ 100% {
23
+ transform: rotate(0deg);
24
+ }
25
+ }
26
+
27
+ .showAllStyle {
28
+ display: grid;
29
+ width: 100%;
30
+ grid-template-columns: 40% 30% 30%;
31
+ align-items: center;
32
+ flex-direction: row;
33
+ justify-content: space-between;
34
+ }
35
+
36
+ .notShowAllStyle {
37
+ display: flex;
38
+ width: 100%;
39
+ align-items: center;
40
+ flex-direction: row;
41
+ justify-content: space-between;
42
42
  }
@@ -1,27 +1,27 @@
1
- /*甜甜圈图专用css*/
2
- .label-line {
3
- stroke-dasharray: 100;
4
- stroke-dashoffset: 100;
5
- animation: dash 800ms ease forwards;
6
- }
7
-
8
- .label-text {
9
- opacity: 0;
10
- animation: show 800ms ease forwards;
11
- }
12
-
13
- .inner-arc {
14
- animation: dash 2s ease forwards;
15
- }
16
-
17
- @keyframes dash {
18
- 100% {
19
- stroke-dashoffset: 0%;
20
- }
21
- }
22
-
23
- @keyframes show {
24
- 100% {
25
- opacity: 1;
26
- }
1
+ /*甜甜圈图专用css*/
2
+ .label-line {
3
+ stroke-dasharray: 100;
4
+ stroke-dashoffset: 100;
5
+ animation: dash 800ms ease forwards;
6
+ }
7
+
8
+ .label-text {
9
+ opacity: 0;
10
+ animation: show 800ms ease forwards;
11
+ }
12
+
13
+ .inner-arc {
14
+ animation: dash 2s ease forwards;
15
+ }
16
+
17
+ @keyframes dash {
18
+ 100% {
19
+ stroke-dashoffset: 0%;
20
+ }
21
+ }
22
+
23
+ @keyframes show {
24
+ 100% {
25
+ opacity: 1;
26
+ }
27
27
  }
@@ -1,73 +1,73 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = ConicGradient;
9
-
10
- var d3 = _interopRequireWildcard(require("d3"));
11
-
12
- //只支持在svg中使用
13
- //在<clipPath>标签中绘制圆环路径,在<foreignObject>中使用conic-gradient来制作角向渐变
14
- //然后在foreignObject中调用clipPath来剪切dom元素,实现环形渐变效果
15
- function ConicGradient(props) {
16
- var gradientId = props.gradientId,
17
- _props$colorConfig = props.colorConfig,
18
- colorConfig = _props$colorConfig === void 0 ? {} : _props$colorConfig,
19
- _props$circleConfig = props.circleConfig,
20
- circleConfig = _props$circleConfig === void 0 ? {} : _props$circleConfig,
21
- _colorConfig$colorTyp = colorConfig.colorType,
22
- colorType = _colorConfig$colorTyp === void 0 ? "linear" : _colorConfig$colorTyp,
23
- _colorConfig$colors = colorConfig.colors,
24
- colors = _colorConfig$colors === void 0 ? [{
25
- offset: 0,
26
- color: "rgba(255,0,0,0.5)"
27
- }, {
28
- offset: 50,
29
- color: "rgba(0,255,0,0.5)"
30
- }, {
31
- offset: 100,
32
- color: "rgba(0,0,255,0.5)"
33
- }] : _colorConfig$colors,
34
- _circleConfig$innerRa = circleConfig.innerRadius,
35
- innerRadius = _circleConfig$innerRa === void 0 ? 80 : _circleConfig$innerRa,
36
- _circleConfig$outerRa = circleConfig.outerRadius,
37
- outerRadius = _circleConfig$outerRa === void 0 ? 100 : _circleConfig$outerRa,
38
- _circleConfig$startAn = circleConfig.startAngle,
39
- startAngle = _circleConfig$startAn === void 0 ? 0 : _circleConfig$startAn,
40
- _circleConfig$endAngl = circleConfig.endAngle,
41
- endAngle = _circleConfig$endAngl === void 0 ? 360 : _circleConfig$endAngl,
42
- _circleConfig$cornerR = circleConfig.cornerRadius,
43
- cornerRadius = _circleConfig$cornerR === void 0 ? 0 : _circleConfig$cornerR,
44
- _circleConfig$padAngl = circleConfig.padAngle,
45
- padAngle = _circleConfig$padAngl === void 0 ? 0 : _circleConfig$padAngl;
46
- var arc = d3.arc().innerRadius(innerRadius).outerRadius(outerRadius).startAngle(startAngle * Math.PI / 180).endAngle(endAngle * Math.PI / 180).cornerRadius(cornerRadius).padAngle(padAngle);
47
- return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("clipPath", {
48
- id: "" + gradientId,
49
- style: {
50
- transform: "translate(50%,50%)"
51
- }
52
- }, /*#__PURE__*/React.createElement("path", {
53
- d: arc()
54
- })), /*#__PURE__*/React.createElement("foreignObject", {
55
- style: {
56
- width: "100%",
57
- height: "100%",
58
- transform: "translate(-50%,-50%)",
59
- background: colorType === "pure" ? colors : "conic-gradient(".concat(colorsToString(colors), ")"),
60
- clipPath: "url(".concat('#' + gradientId, ")")
61
- }
62
- }));
63
- }
64
-
65
- function colorsToString(colors) {
66
- var s = "";
67
- colors.sort(function (a, b) {
68
- return a.offset - b.offset;
69
- }).map(function (d) {
70
- s = s + d.color + " " + d.offset + "%,";
71
- });
72
- return s.slice(0, -1);
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = ConicGradient;
9
+
10
+ var d3 = _interopRequireWildcard(require("d3"));
11
+
12
+ //只支持在svg中使用
13
+ //在<clipPath>标签中绘制圆环路径,在<foreignObject>中使用conic-gradient来制作角向渐变
14
+ //然后在foreignObject中调用clipPath来剪切dom元素,实现环形渐变效果
15
+ function ConicGradient(props) {
16
+ var gradientId = props.gradientId,
17
+ _props$colorConfig = props.colorConfig,
18
+ colorConfig = _props$colorConfig === void 0 ? {} : _props$colorConfig,
19
+ _props$circleConfig = props.circleConfig,
20
+ circleConfig = _props$circleConfig === void 0 ? {} : _props$circleConfig,
21
+ _colorConfig$colorTyp = colorConfig.colorType,
22
+ colorType = _colorConfig$colorTyp === void 0 ? "linear" : _colorConfig$colorTyp,
23
+ _colorConfig$colors = colorConfig.colors,
24
+ colors = _colorConfig$colors === void 0 ? [{
25
+ offset: 0,
26
+ color: "rgba(255,0,0,0.5)"
27
+ }, {
28
+ offset: 50,
29
+ color: "rgba(0,255,0,0.5)"
30
+ }, {
31
+ offset: 100,
32
+ color: "rgba(0,0,255,0.5)"
33
+ }] : _colorConfig$colors,
34
+ _circleConfig$innerRa = circleConfig.innerRadius,
35
+ innerRadius = _circleConfig$innerRa === void 0 ? 80 : _circleConfig$innerRa,
36
+ _circleConfig$outerRa = circleConfig.outerRadius,
37
+ outerRadius = _circleConfig$outerRa === void 0 ? 100 : _circleConfig$outerRa,
38
+ _circleConfig$startAn = circleConfig.startAngle,
39
+ startAngle = _circleConfig$startAn === void 0 ? 0 : _circleConfig$startAn,
40
+ _circleConfig$endAngl = circleConfig.endAngle,
41
+ endAngle = _circleConfig$endAngl === void 0 ? 360 : _circleConfig$endAngl,
42
+ _circleConfig$cornerR = circleConfig.cornerRadius,
43
+ cornerRadius = _circleConfig$cornerR === void 0 ? 0 : _circleConfig$cornerR,
44
+ _circleConfig$padAngl = circleConfig.padAngle,
45
+ padAngle = _circleConfig$padAngl === void 0 ? 0 : _circleConfig$padAngl;
46
+ var arc = d3.arc().innerRadius(innerRadius).outerRadius(outerRadius).startAngle(startAngle * Math.PI / 180).endAngle(endAngle * Math.PI / 180).cornerRadius(cornerRadius).padAngle(padAngle);
47
+ return /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("clipPath", {
48
+ id: "" + gradientId,
49
+ style: {
50
+ transform: "translate(50%,50%)"
51
+ }
52
+ }, /*#__PURE__*/React.createElement("path", {
53
+ d: arc()
54
+ })), /*#__PURE__*/React.createElement("foreignObject", {
55
+ style: {
56
+ width: "100%",
57
+ height: "100%",
58
+ transform: "translate(-50%,-50%)",
59
+ background: colorType === "pure" ? colors : "conic-gradient(".concat(colorsToString(colors), ")"),
60
+ clipPath: "url(".concat('#' + gradientId, ")")
61
+ }
62
+ }));
63
+ }
64
+
65
+ function colorsToString(colors) {
66
+ var s = "";
67
+ colors.sort(function (a, b) {
68
+ return a.offset - b.offset;
69
+ }).map(function (d) {
70
+ s = s + d.color + " " + d.offset + "%,";
71
+ });
72
+ return s.slice(0, -1);
73
73
  }
@@ -19,11 +19,11 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
19
19
 
20
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21
21
 
22
- /**
23
- * 图表数据动画
24
- * @param {Array} data data列表
25
- * @param {boolean} dataAnimation 是否开启数据增长动画
26
- * @returns 改变后的数据
22
+ /**
23
+ * 图表数据动画
24
+ * @param {Array} data data列表
25
+ * @param {boolean} dataAnimation 是否开启数据增长动画
26
+ * @returns 改变后的数据
27
27
  */
28
28
  var _default = function _default(data, dataAnimation) {
29
29
  var _useState = (0, _react.useState)([]),
@@ -28,11 +28,11 @@ var scales = {
28
28
  utc: _d3Scale.scaleUtc,
29
29
  ordinal: _utils.band
30
30
  };
31
- /**
32
- * x/y/z轴
33
- * @param {Array} axes 轴列表数组
34
- * @param {Object} context 其中需要包括
35
- * @returns {Map} 返回所有轴
31
+ /**
32
+ * x/y/z轴
33
+ * @param {Array} axes 轴列表数组
34
+ * @param {Object} context 其中需要包括
35
+ * @returns {Map} 返回所有轴
36
36
  */
37
37
 
38
38
  var _default = function _default(_ref) {
@@ -25,11 +25,11 @@ var initialState = {
25
25
  currentIndex: null,
26
26
  flag: false
27
27
  };
28
- /**
29
- * x轴滚动逻辑
30
- * @param {Object} axis x轴配置项
31
- * @param {Object} config x轴轮播动画的配置项
32
- * @returns {Map} 返回经过改变后的x轴,主要是ticks和scaler的range发生了改变
28
+ /**
29
+ * x轴滚动逻辑
30
+ * @param {Object} axis x轴配置项
31
+ * @param {Object} config x轴轮播动画的配置项
32
+ * @returns {Map} 返回经过改变后的x轴,主要是ticks和scaler的range发生了改变
33
33
  */
34
34
 
35
35
  var _default = function _default(axis, config) {
@@ -61,12 +61,12 @@ var stackData = function stackData(data, series) {
61
61
  dataMap.clear();
62
62
  return [min, max];
63
63
  };
64
- /**
65
- * 计算轴的domain
66
- * @param {Array} axes x轴列表
67
- * @param {Object} series 图表的系列,主要是为了读取type, stack, yOrZ三个字段
68
- * @param {Object} data 数据列表
69
- * @returns {Array} 返回带domain的轴
64
+ /**
65
+ * 计算轴的domain
66
+ * @param {Array} axes x轴列表
67
+ * @param {Object} series 图表的系列,主要是为了读取type, stack, yOrZ三个字段
68
+ * @param {Object} data 数据列表
69
+ * @returns {Array} 返回带domain的轴
70
70
  */
71
71
 
72
72
 
@@ -56,11 +56,11 @@ var getSelected = function getSelected(selected, name) {
56
56
  });
57
57
  return tmp;
58
58
  };
59
- /**
60
- * 图例点击状态管理
61
- * @param {Array} data 数据
62
- * @param {Map} series 系列
63
- * @returns {Array} 返回筛选后的数据和是否选中状态,及控制选中函数
59
+ /**
60
+ * 图例点击状态管理
61
+ * @param {Array} data 数据
62
+ * @param {Map} series 系列
63
+ * @returns {Array} 返回筛选后的数据和是否选中状态,及控制选中函数
64
64
  */
65
65
 
66
66
 
@@ -89,11 +89,11 @@ var setStackData = function setStackData(data, series, stacks) {
89
89
  dataMap.clear();
90
90
  return series;
91
91
  };
92
- /**
93
- * 计算堆叠数据
94
- * @param {Array} data 数据
95
- * @param {Map} series 系列
96
- * @returns {Array} 返回堆叠后的数据,由一开始的{x, y, s}变成{data: {x, y, s}, bound: [start, end], index}
92
+ /**
93
+ * 计算堆叠数据
94
+ * @param {Array} data 数据
95
+ * @param {Map} series 系列
96
+ * @returns {Array} 返回堆叠后的数据,由一开始的{x, y, s}变成{data: {x, y, s}, bound: [start, end], index}
97
97
  */
98
98
 
99
99
 
@@ -14,16 +14,16 @@ var _react = require("react");
14
14
  var _utils = require("../utils");
15
15
 
16
16
  var callback = function callback() {};
17
- /**
18
- * 主要用于轴类图表,返回当前选中的是哪一个x
19
- * @param {Array} svg svg的dom实例
20
- * @param {Number} marginLeft 左间距
21
- * @param {Number} marginTop 上间距
22
- * @param {Number} width 宽
23
- * @param {Number} height 高
24
- * @param {Number} axisX 类目轴
25
- * @param {Object} config 轮播动画参数
26
- * @returns {Object} 返回被选中的名称,坐标,选中方法
17
+ /**
18
+ * 主要用于轴类图表,返回当前选中的是哪一个x
19
+ * @param {Array} svg svg的dom实例
20
+ * @param {Number} marginLeft 左间距
21
+ * @param {Number} marginTop 上间距
22
+ * @param {Number} width 宽
23
+ * @param {Number} height 高
24
+ * @param {Number} axisX 类目轴
25
+ * @param {Object} config 轮播动画参数
26
+ * @returns {Object} 返回被选中的名称,坐标,选中方法
27
27
  */
28
28
 
29
29