@easyv/charts 1.10.14 → 1.10.16

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/change.md ADDED
@@ -0,0 +1,26 @@
1
+ ### 1.饼图图例的类目配置项下有一个布局类型配置项,当布局类型=固定宽度时,沿用当前的逻辑,当布局类型=自适应时,需要进行如下调整:
2
+
3
+ - 当图例位置在左侧时或右侧时,调用updateConfig函数修改组件的边距配置项,图例在右侧时,上下左右边距分别为:24,24,0,200,图例在左侧时,上下左右边距分别为,24,24,200,0。图例将纵向排成一列展示,每一行图例总宽度不能超过200px,避免和饼图区域产生重叠,如果文字太长,则默认按溢出省略号展示,文本不得换行。
4
+ - 当图例位置在正上方或正下方时,调用updateConfig函数修改组件的边距配置项,图例在正上方时,上下左右边距分别为:150,24,24,24,图例在正下方时,上下左右边距分别为,24,150,24,24。图例将是横向排列的流式布局,一行满时,图例会自动换行,但是图例文本不换行,最多就是省略号显示。
5
+ - 当图例不显示时,调用updateConfig函数修改组件的边距配置项,上下左右边距分别为:24,24,24,24。
6
+
7
+ ### 2.如果饼图需要显示中间的当前值,当前值的类目名称需要水平居中显示。
8
+
9
+ ### updateConfig函数说明:
10
+
11
+ updateConfig({id?, type, payload}) (需要平台 v3.13.0版本及以上才支持)
12
+ ● id:可不传,默认为当前组件的id,如果是子组件的更新,则必须穿子组件的id,不然会更新失败。
13
+ ● type: 'config' | 'data' | ’actions' | 'camera' | 'triggers'(v5.14.0及以上支持)
14
+ ○ config: 更新组件的configuration属性。
15
+ ■ 在v4.13.0之前,用于更新config,只能是组件进入编辑模式,即edit为true的时候才支持
16
+ ■ v4.13.0及以上,支持组件在非编辑模式下,也可以支持更新config配置,但只在编辑页面才生效。
17
+ ○ data: 更新组件的data静态数据
18
+ ○ actions: 用于动态更新组件的actions配置。使用场景为:自定义动作中可能存在一些动态的数据,需要在其他配置项发生变化的时候,需要动态更新,比如场景的镜头数据等。
19
+ ○ camera: 该类型是在镜头数据保存的时候才需要用到,一般不是三维的镜头数据使用不上。
20
+ ● payload:
21
+ ○ 当type === 'data'时,payload为静态数据数组,
22
+ ○ 当type === 'triggers'时,payload为 { name: string; value: string;}[]
23
+ ○ 否则为{path, field, value} | {path, field, value}[], carema 则为镜头的数据。
24
+ ○ path: string 需要更新的config属性路径 如['chart', 'component', 'color']
25
+ ○ field: string 需要更新的控件属性 默认为value
26
+ ○ value: any 控件属性对应的值
package/config.json ADDED
@@ -0,0 +1,119 @@
1
+ {
2
+ "dimension": {
3
+ "chartPosition": {
4
+ "left": 100,
5
+ "top": 100
6
+ },
7
+ "chartDimension": {
8
+ "width": 420,
9
+ "height": 210
10
+ }
11
+ },
12
+ "margin": {
13
+ "marginTop": 30,
14
+ "marginBottom": 30,
15
+ "marginLeft": 0,
16
+ "marginRight": 120
17
+ },
18
+ "legend": {
19
+ "show": true,
20
+ "order": "",
21
+ "iconSize": {
22
+ "width": 10,
23
+ "height": 10
24
+ },
25
+ "iconGap": 5,
26
+ "layout": {
27
+ "alignment": "center right",
28
+ "gridTemplateColumns": 1,
29
+ "gridGap": {
30
+ "gridRowGap": 20,
31
+ "gridColumnGap": 10
32
+ },
33
+ "translate": {
34
+ "x": 0,
35
+ "y": 0
36
+ }
37
+ },
38
+ "name": {
39
+ "show": true,
40
+ "font": {
41
+ "fontFamily": "SourceHanSansCN-Medium",
42
+ "fontSize": 12,
43
+ "color": "rgba(230, 247, 255, 1)",
44
+ "bold": false,
45
+ "italic": false,
46
+ "letterSpacing": 0
47
+ },
48
+ "layoutMode": "Adaptive",
49
+ "maxWidth": 80,
50
+ "textOverflow": "ellipsis",
51
+ "speed": 5,
52
+ "translate": {
53
+ "x": 0,
54
+ "y": 0
55
+ }
56
+ },
57
+ "percent": {
58
+ "show": true,
59
+ "precision": 0,
60
+ "gap": 15,
61
+ "sameColor": true,
62
+ "align": "left",
63
+ "font": {
64
+ "fontFamily": "SourceHanSansCN-Medium",
65
+ "fontSize": 12,
66
+ "color": "rgba(230, 247, 255, 1)",
67
+ "bold": false,
68
+ "italic": false,
69
+ "letterSpacing": 0
70
+ },
71
+ "translate": {
72
+ "x": 0,
73
+ "y": 0
74
+ }
75
+ },
76
+ "value": {
77
+ "show": false,
78
+ "splitConfig": {
79
+ "show": false,
80
+ "splitCount": 3,
81
+ "style": "default",
82
+ "separator": ",",
83
+ "fontFamily": "SourceHanSansCN-Medium",
84
+ "margin": {
85
+ "left": 0,
86
+ "right": 0
87
+ }
88
+ },
89
+ "suffix": {
90
+ "show": true,
91
+ "text": "",
92
+ "fontSize": 12,
93
+ "translate": {
94
+ "x": 0,
95
+ "y": 0
96
+ }
97
+ },
98
+ "gap": 0,
99
+ "sameColor": false,
100
+ "align": "left",
101
+ "font": {
102
+ "fontFamily": "SourceHanSansCN-Medium",
103
+ "fontSize": 12,
104
+ "color": "rgba(230, 247, 255, 1)",
105
+ "bold": false,
106
+ "italic": false,
107
+ "letterSpacing": 0
108
+ },
109
+ "translate": {
110
+ "x": 0,
111
+ "y": 0
112
+ }
113
+ },
114
+ "loop": {
115
+ "show": false,
116
+ "interval": 3
117
+ }
118
+ }
119
+ }
@@ -13,8 +13,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _context = require("../context");
15
15
  var _ = require(".");
16
- var _d3v = require("d3v7");
17
- var _excluded = ["id", "type", "config", "config", "data", "onRelative", "emit", "emitEvent"];
16
+ var _excluded = ["id", "type", "config", "config", "data", "onRelative", "emit", "emitEvent", "updateConfig"];
18
17
  /**
19
18
  * 总入口,通过外面传进来的type来确定渲染哪种图表,饼环图表为“pie”,否则为轴类图表
20
19
  */
@@ -41,7 +40,6 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
41
40
  type = _ref2.type,
42
41
  config = _ref2.config,
43
42
  _ref2$config = _ref2.config,
44
- axes = _ref2$config.axes,
45
43
  _ref2$config$chart$ma = _ref2$config.chart.margin,
46
44
  marginRight = _ref2$config$chart$ma.marginRight,
47
45
  marginLeft = _ref2$config$chart$ma.marginLeft,
@@ -52,6 +50,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
52
50
  onRelative = _ref2.onRelative,
53
51
  emit = _ref2.emit,
54
52
  emitEvent = _ref2.emitEvent,
53
+ updateConfig = _ref2.updateConfig,
55
54
  props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
56
55
  var width = props.width,
57
56
  height = props.height;
@@ -105,9 +104,10 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
105
104
  height: chartHeight,
106
105
  triggerOnRelative: triggerOnRelative,
107
106
  svg: svg,
108
- onEmit: onEmit
107
+ onEmit: onEmit,
108
+ updateConfig: updateConfig
109
109
  };
110
- }, [id, chartWidth, chartHeight, triggerOnRelative, svg, onEmit]);
110
+ }, [id, chartWidth, chartHeight, triggerOnRelative, svg, onEmit, updateConfig]);
111
111
  (0, _react.useEffect)(function () {
112
112
  var isAnimation = window.screenConfig ? window.screenConfig.isAnimation : true; //大屏的全局设置是否允许开启动画,false为不允许
113
113
  if (!isAnimation) setActive(false);
@@ -12,6 +12,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
12
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _utils = require("../utils");
15
+ var _legendPlacement = require("../utils/legendPlacement");
15
16
  var _TextOverflow = _interopRequireDefault(require("./TextOverflow"));
16
17
  var _excluded = ["italic", "bold"];
17
18
  /**
@@ -26,7 +27,7 @@ var defaultFont = {
26
27
  fontWeight: "normal"
27
28
  };
28
29
  var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref) {
29
- var _config$value, _config$percent, _config$value2, _config$value3, _config$name;
30
+ var _config$value, _config$percent, _config$value2, _config$value3, _config$name, _ref3;
30
31
  var series = _ref.series,
31
32
  height = _ref.height,
32
33
  data = _ref.data,
@@ -53,6 +54,9 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
53
54
  y = _ref$config$layout$tr.y,
54
55
  _ref$config$loop = _ref$config.loop,
55
56
  loop = _ref$config$loop === void 0 ? {} : _ref$config$loop,
57
+ _ref$config$name = _ref$config.name,
58
+ _ref$config$name2 = _ref$config$name === void 0 ? {} : _ref$config$name,
59
+ layoutMode = _ref$config$name2.layoutMode,
56
60
  _ref$config$font = _ref$config.font,
57
61
  _ref$config$font2 = _ref$config$font === void 0 ? defaultFont : _ref$config$font,
58
62
  italic = _ref$config$font2.italic,
@@ -65,7 +69,15 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
65
69
  filterData = _ref.filterData,
66
70
  formatter = _ref.formatter,
67
71
  judge = _ref.judge,
68
- pieClick = _ref.pieClick;
72
+ pieClick = _ref.pieClick,
73
+ _ref$isPieChart = _ref.isPieChart,
74
+ isPieChart = _ref$isPieChart === void 0 ? false : _ref$isPieChart,
75
+ chartWidth = _ref.chartWidth,
76
+ componentWidth = _ref.componentWidth,
77
+ _ref$marginLeft = _ref.marginLeft,
78
+ marginLeft = _ref$marginLeft === void 0 ? 0 : _ref$marginLeft,
79
+ _ref$marginRight = _ref.marginRight,
80
+ marginRight = _ref$marginRight === void 0 ? 0 : _ref$marginRight;
69
81
  if (!show) return null;
70
82
  var ref_container = (0, _react.useRef)(null); // 滚动容器
71
83
  var ref_scrollTop = (0, _react.useRef)(0); // 当前滚动距离
@@ -113,11 +125,12 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
113
125
  });
114
126
  };
115
127
  var _series = (0, _utils.sortPie)(series, order, columnsSeries);
116
- var _alignment$split = alignment.split(" "),
117
- _alignment$split2 = (0, _slicedToArray2["default"])(_alignment$split, 2),
118
- _alignment = _alignment$split2[0],
119
- position = _alignment$split2[1];
120
- var legendMainAlign = alignment.split(" ")[0] == "left" ? "flex-start" : alignment.split(" ")[0] == "center" ? "center" : "flex-end";
128
+ var _parseLegendAlignment = (0, _legendPlacement.parseLegendAlignment)(alignment),
129
+ _alignment = _parseLegendAlignment.alignment,
130
+ position = _parseLegendAlignment.position,
131
+ isCenterTopOrBottom = _parseLegendAlignment.isCenterTopOrBottom,
132
+ isSidePlacement = _parseLegendAlignment.isSidePlacement;
133
+ var legendMainAlign = _alignment == "left" ? "flex-start" : _alignment == "center" ? "center" : "flex-end";
121
134
  var length = _series.length;
122
135
  var onClick = (0, _react.useCallback)(function (fieldName) {
123
136
  return function (e) {
@@ -189,6 +202,76 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
189
202
  });
190
203
  return Math.max(maxMeasured, maxCfg);
191
204
  });
205
+ var isPieAdaptive = isPieChart && layoutMode === "Adaptive";
206
+ var isPieFixedWidthGrid = isPieChart && (layoutMode === "FixedWidth" || (layoutMode == null || layoutMode === "") && LegendType == "FixedWidth");
207
+ var isFixedWidth = isPieChart ? isPieFixedWidthGrid : LegendType == "FixedWidth";
208
+ var isSideLegend = isPieAdaptive && isSidePlacement;
209
+ var isTopBottomAdaptive = isPieAdaptive && isCenterTopOrBottom;
210
+ var fullWidth = (_ref3 = componentWidth !== null && componentWidth !== void 0 ? componentWidth : chartWidth) !== null && _ref3 !== void 0 ? _ref3 : 0;
211
+ var legendAreaWidth = Math.max(0, fullWidth - marginLeft - marginRight);
212
+ var sideLegendMaxWidth = isSideLegend ? Math.max(0, position === "left" || _alignment === "left" ? marginLeft : marginRight) : 0;
213
+ var isSideLegendOnRight = isSideLegend && (position === "right" || _alignment === "right" && position !== "left");
214
+ var fixedColumnsPerRow = Math.min(Math.max(1, Number(gridTemplateColumns) || 1), length);
215
+ var isPieTopBottomFixedMultiCol = isPieChart && isFixedWidth && isCenterTopOrBottom && fixedColumnsPerRow > 1;
216
+ var formatterExtra = _objectSpread(_objectSpread(_objectSpread({}, config), {}, {
217
+ valueMaxWidth: valueMaxWidth,
218
+ percentMaxWidth: percentMaxWidth,
219
+ nameMaxWidth: nameMaxWidth,
220
+ otherData: data,
221
+ columnsSeries: columnsSeries,
222
+ fieldColumnKeys: fieldColumnKeys,
223
+ fieldsColumnWidths: fieldsColumnWidths,
224
+ legendPosition: position,
225
+ isPieAdaptive: true
226
+ }, isSideLegend && sideLegendMaxWidth > 0 ? {
227
+ adaptiveMaxWidth: sideLegendMaxWidth
228
+ } : {}), isTopBottomAdaptive ? {
229
+ chartWidth: legendAreaWidth
230
+ } : {});
231
+ var renderPieSideItem = function renderPieSideItem(series, i) {
232
+ var _series$config;
233
+ var type = series.type,
234
+ name = series.name,
235
+ displayName = series.displayName,
236
+ fieldName = series.fieldName,
237
+ icon = series.icon,
238
+ selected = series.selected,
239
+ index = series.index;
240
+ var _icon = (0, _utils.getIcon)(type, icon, series === null || series === void 0 || (_series$config = series.config) === null || _series$config === void 0 || (_series$config = _series$config.line) === null || _series$config === void 0 ? void 0 : _series$config.type);
241
+ return /*#__PURE__*/_react["default"].createElement("li", {
242
+ key: i,
243
+ onClick: onClick(fieldName),
244
+ "data-name": displayName || name,
245
+ "data-index": index,
246
+ style: {
247
+ display: "flex",
248
+ width: "max-content",
249
+ maxWidth: sideLegendMaxWidth || undefined,
250
+ opacity: selected === false ? opacity / 100 : 1,
251
+ alignItems: "center",
252
+ cursor: "pointer",
253
+ gap: _icon.gap,
254
+ minWidth: 0,
255
+ overflow: "hidden",
256
+ boxSizing: "border-box"
257
+ }
258
+ }, formatter ? formatter(series, formatterExtra) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
259
+ style: _objectSpread(_objectSpread({}, _icon), {}, {
260
+ flexShrink: 0
261
+ })
262
+ }), /*#__PURE__*/_react["default"].createElement(_TextOverflow["default"], {
263
+ type: "ellipsis",
264
+ value: displayName || name,
265
+ style: _objectSpread(_objectSpread({}, font), {}, {
266
+ fontStyle: italic ? "italic" : "normal",
267
+ fontWeight: bold ? "bold" : "normal",
268
+ minWidth: 0,
269
+ flex: "1 1 0%",
270
+ maxWidth: "100%"
271
+ }),
272
+ speed: speed
273
+ })));
274
+ };
192
275
  var stylePieOrAxis = formatter ? _objectSpread(_objectSpread({
193
276
  display: "flex",
194
277
  alignContent: alignment.split(" ")[0] == "center" && (alignment.split(" ")[1] == "left" || alignment.split(" ")[1] == "right") ? alignment.split(" ")[1] == "left" ? "flex-start" : "flex-end" : alignment.split(" ")[0] == "left" ? "flex-start" : alignment.split(" ")[0] == "center" ? "center" : "flex-end",
@@ -206,7 +289,113 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
206
289
  height: loop.show ? height : "auto",
207
290
  overflowY: loop.show ? "scroll" : "auto"
208
291
  });
209
- return LegendType == "FixedWidth" ? /*#__PURE__*/_react["default"].createElement("div", {
292
+ if (isPieAdaptive && isSideLegend) {
293
+ var pieAdaptiveWrapperStyle = _objectSpread(_objectSpread({
294
+ position: "absolute",
295
+ display: "flex",
296
+ flexDirection: "column",
297
+ width: "max-content",
298
+ maxWidth: sideLegendMaxWidth || undefined,
299
+ alignItems: isSideLegendOnRight ? "flex-end" : "flex-start"
300
+ }, getPosition(position, _alignment, x, y)), {}, {
301
+ height: loop.show ? height : "auto",
302
+ overflowY: loop.show ? "scroll" : "auto"
303
+ });
304
+ var pieAdaptiveListStyle = {
305
+ display: "flex",
306
+ flexDirection: "column",
307
+ width: "max-content",
308
+ maxWidth: "100%",
309
+ alignItems: isSideLegendOnRight ? "flex-end" : "flex-start",
310
+ margin: 0,
311
+ padding: 0,
312
+ listStyle: "none",
313
+ gap: "".concat(gridRowGap, "px")
314
+ };
315
+ return /*#__PURE__*/_react["default"].createElement("div", {
316
+ className: "__easyv-legend-wrapper",
317
+ style: pieAdaptiveWrapperStyle,
318
+ ref: ref_container
319
+ }, /*#__PURE__*/_react["default"].createElement("ul", {
320
+ style: pieAdaptiveListStyle
321
+ }, _series.map(function (series, i) {
322
+ return renderPieSideItem(series, i);
323
+ })));
324
+ }
325
+ if (isTopBottomAdaptive) {
326
+ var topBottomWrapperStyle = _objectSpread(_objectSpread({
327
+ position: "absolute",
328
+ width: legendAreaWidth || "100%",
329
+ maxWidth: legendAreaWidth || "100%",
330
+ boxSizing: "border-box"
331
+ }, getPosition(position, _alignment, x, y)), {}, {
332
+ height: loop.show ? height : "auto",
333
+ overflowY: loop.show ? "scroll" : "auto"
334
+ });
335
+ var topBottomListStyle = {
336
+ display: "flex",
337
+ flexDirection: "row",
338
+ flexWrap: "wrap",
339
+ width: "100%",
340
+ maxWidth: "100%",
341
+ boxSizing: "border-box",
342
+ margin: 0,
343
+ padding: 0,
344
+ listStyle: "none",
345
+ justifyContent: legendMainAlign,
346
+ gap: "".concat(gridRowGap, "px ").concat(gridColumnGap, "px")
347
+ };
348
+ return /*#__PURE__*/_react["default"].createElement("div", {
349
+ className: "__easyv-legend-wrapper",
350
+ style: topBottomWrapperStyle,
351
+ ref: ref_container
352
+ }, /*#__PURE__*/_react["default"].createElement("ul", {
353
+ style: topBottomListStyle
354
+ }, _series.map(function (series, i) {
355
+ var _series$config2;
356
+ var type = series.type,
357
+ name = series.name,
358
+ displayName = series.displayName,
359
+ fieldName = series.fieldName,
360
+ icon = series.icon,
361
+ selected = series.selected,
362
+ index = series.index;
363
+ var _icon = (0, _utils.getIcon)(type, icon, series === null || series === void 0 || (_series$config2 = series.config) === null || _series$config2 === void 0 || (_series$config2 = _series$config2.line) === null || _series$config2 === void 0 ? void 0 : _series$config2.type);
364
+ return /*#__PURE__*/_react["default"].createElement("li", {
365
+ key: i,
366
+ onClick: onClick(fieldName),
367
+ "data-name": displayName || name,
368
+ "data-index": index,
369
+ style: {
370
+ display: "inline-flex",
371
+ alignItems: "center",
372
+ width: "max-content",
373
+ maxWidth: "100%",
374
+ minWidth: 0,
375
+ overflow: "hidden",
376
+ boxSizing: "border-box",
377
+ opacity: selected === false ? opacity / 100 : 1,
378
+ cursor: "pointer",
379
+ gap: _icon.gap,
380
+ flexShrink: 0
381
+ }
382
+ }, formatter ? formatter(series, formatterExtra) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
383
+ style: _objectSpread(_objectSpread({}, _icon), {}, {
384
+ flexShrink: 0
385
+ })
386
+ }), /*#__PURE__*/_react["default"].createElement(_TextOverflow["default"], {
387
+ type: "ellipsis",
388
+ value: displayName || name,
389
+ style: _objectSpread(_objectSpread({}, font), {}, {
390
+ fontStyle: italic ? "italic" : "normal",
391
+ fontWeight: bold ? "bold" : "normal",
392
+ minWidth: 0
393
+ }),
394
+ speed: speed
395
+ })));
396
+ })));
397
+ }
398
+ return isFixedWidth ? /*#__PURE__*/_react["default"].createElement("div", {
210
399
  className: "__easyv-legend-wrapper",
211
400
  style: _objectSpread(_objectSpread({
212
401
  position: "absolute",
@@ -219,11 +408,13 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
219
408
  }, /*#__PURE__*/_react["default"].createElement("ul", {
220
409
  style: {
221
410
  display: "grid",
222
- gridGap: gridRowGap + "px " + gridColumnGap + "px",
223
- gridTemplateColumns: formatter ? "".concat(nameMaxWidth, "px ").concat(valueMaxWidth, "px ").concat(percentMaxWidth, "px") : "repeat(" + Math.min(gridTemplateColumns, length) + ", 1fr)" //饼图或者柱状图配合不同的图例显示格式
411
+ rowGap: gridRowGap + "px",
412
+ columnGap: (isPieTopBottomFixedMultiCol ? Math.max(gridColumnGap, 40) : gridColumnGap) + "px",
413
+ justifyContent: isPieTopBottomFixedMultiCol ? legendMainAlign : undefined,
414
+ gridTemplateColumns: isPieTopBottomFixedMultiCol ? "repeat(".concat(fixedColumnsPerRow, ", max-content)") : "repeat(".concat(fixedColumnsPerRow, ", minmax(0, 1fr))")
224
415
  }
225
416
  }, _series.map(function (series, i) {
226
- var _series$config;
417
+ var _series$config3;
227
418
  var type = series.type,
228
419
  name = series.name,
229
420
  displayName = series.displayName,
@@ -231,7 +422,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
231
422
  icon = series.icon,
232
423
  selected = series.selected,
233
424
  index = series.index;
234
- var _icon = (0, _utils.getIcon)(type, icon, series === null || series === void 0 || (_series$config = series.config) === null || _series$config === void 0 || (_series$config = _series$config.line) === null || _series$config === void 0 ? void 0 : _series$config.type);
425
+ var _icon = (0, _utils.getIcon)(type, icon, series === null || series === void 0 || (_series$config3 = series.config) === null || _series$config3 === void 0 || (_series$config3 = _series$config3.line) === null || _series$config3 === void 0 ? void 0 : _series$config3.type);
235
426
  return /*#__PURE__*/_react["default"].createElement("li", {
236
427
  key: i,
237
428
  onClick: onClick(fieldName),
@@ -281,7 +472,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
281
472
  }
282
473
  }, _series.map(function (series, i) {
283
474
  if (Math.floor(i / gridTemplateColumns) == indexs) {
284
- var _series$config2;
475
+ var _series$config4;
285
476
  var type = series.type,
286
477
  name = series.name,
287
478
  displayName = series.displayName,
@@ -289,7 +480,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
289
480
  icon = series.icon,
290
481
  selected = series.selected,
291
482
  index = series.index;
292
- var _icon = (0, _utils.getIcon)(type, icon, series === null || series === void 0 || (_series$config2 = series.config) === null || _series$config2 === void 0 || (_series$config2 = _series$config2.line) === null || _series$config2 === void 0 ? void 0 : _series$config2.type);
483
+ var _icon = (0, _utils.getIcon)(type, icon, series === null || series === void 0 || (_series$config4 = series.config) === null || _series$config4 === void 0 || (_series$config4 = _series$config4.line) === null || _series$config4 === void 0 ? void 0 : _series$config4.type);
293
484
  return /*#__PURE__*/_react["default"].createElement("li", {
294
485
  key: i,
295
486
  onClick: onClick(fieldName),
@@ -329,7 +520,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
329
520
  gap: "".concat(gridRowGap, "px ").concat(gridColumnGap, "px")
330
521
  }
331
522
  }, _series.map(function (series, i) {
332
- var _series$config3;
523
+ var _series$config5;
333
524
  var type = series.type,
334
525
  name = series.name,
335
526
  displayName = series.displayName,
@@ -337,7 +528,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
337
528
  icon = series.icon,
338
529
  selected = series.selected,
339
530
  index = series.index;
340
- var _icon = (0, _utils.getIcon)(type, icon, series === null || series === void 0 || (_series$config3 = series.config) === null || _series$config3 === void 0 || (_series$config3 = _series$config3.line) === null || _series$config3 === void 0 ? void 0 : _series$config3.type);
531
+ var _icon = (0, _utils.getIcon)(type, icon, series === null || series === void 0 || (_series$config5 = series.config) === null || _series$config5 === void 0 || (_series$config5 = _series$config5.line) === null || _series$config5 === void 0 ? void 0 : _series$config5.type);
341
532
  return /*#__PURE__*/_react["default"].createElement("li", {
342
533
  key: i,
343
534
  onClick: onClick(fieldName),
@@ -53,7 +53,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(/*#__PURE__*/(
53
53
  var textWidth = target.current.scrollWidth;
54
54
  var containerWidth = rootRef.current.clientWidth;
55
55
  if (textWidth <= containerWidth) {
56
- console.log("文字全部可视");
56
+ // console.log("文字全部可视");
57
57
  //表示文字全部可视
58
58
  cancelAnimationFrame(timer.current || 0);
59
59
  target.current.style.transform = "translate(0px,0px)"; //重置偏移