@easyv/charts 1.8.10 → 1.8.11

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.
@@ -13,8 +13,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _d3v = require("d3v7");
15
15
  var _utils = require("../utils");
16
- var _excluded = ["pattern", "seriesIntervalWidth", "paddingInner", "highlight"],
17
- _excluded2 = ["bgAttr"];
16
+ var _excluded = ["show", "extent"],
17
+ _excluded2 = ["pattern", "seriesIntervalWidth", "paddingInner", "highlight"],
18
+ _excluded3 = ["bgAttr"];
18
19
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
19
20
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
20
21
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -103,8 +104,8 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
103
104
  _ref3$config$highligh = _ref3$config.highlight,
104
105
  showHighlight = _ref3$config$highligh.show,
105
106
  extent = _ref3$config$highligh.extent,
106
- highlightFill = _ref3$config$highligh.fill,
107
- other = (0, _objectWithoutProperties2["default"])(_ref3$config, _excluded),
107
+ highlightStyle = (0, _objectWithoutProperties2["default"])(_ref3$config$highligh, _excluded),
108
+ other = (0, _objectWithoutProperties2["default"])(_ref3$config, _excluded2),
108
109
  curXLabel = _ref3.curXLabel,
109
110
  selectStyle = _ref3.selectStyle,
110
111
  _ref3$bandLength = _ref3.bandLength,
@@ -136,6 +137,10 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
136
137
  });
137
138
  }
138
139
  }
140
+ var highlightConfig = other;
141
+ if (highlightStyle) {
142
+ highlightConfig = _objectSpread(_objectSpread({}, other), highlightStyle);
143
+ }
139
144
  var step = isControlChart ? controlStep : normalStep;
140
145
  var xScaler = isControlChart ? controlDragScaler : normalScaler;
141
146
  var _getSeriesInfo = (0, _utils.getSeriesInfo)({
@@ -176,7 +181,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
176
181
  y1 = yScaler(isVertical ? end : start);
177
182
  y2 = yScaler(isVertical ? start : end);
178
183
  }
179
- var _ref5 = x == curXLabel ? selectConfig : other,
184
+ var _ref5 = x == curXLabel ? selectConfig : flag ? highlightConfig : other,
180
185
  style = _ref5.style,
181
186
  fillType = _ref5.fillType,
182
187
  _ref5$fillMode = _ref5.fillMode,
@@ -227,7 +232,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
227
232
  seriesWidth: seriesWidth
228
233
  }),
229
234
  bgAttr = _getAttr.bgAttr,
230
- attr = (0, _objectWithoutProperties2["default"])(_getAttr, _excluded2);
235
+ attr = (0, _objectWithoutProperties2["default"])(_getAttr, _excluded3);
231
236
  return /*#__PURE__*/_react["default"].createElement(_react.Fragment, {
232
237
  key: i
233
238
  }, /*#__PURE__*/_react["default"].createElement("foreignObject", (0, _extends2["default"])({
@@ -328,7 +333,7 @@ var _default = exports["default"] = /*#__PURE__*/(0, _react.memo)(function (_ref
328
333
  opacity: fillType == "pattern" ? opacity : 1,
329
334
  background: fillType == "pattern" ? "".concat(isVertical ? y < 0 ? "100%" : "0%" : "50%", " ").concat(isVertical ? "50%" : y < 0 ? "0%" : "100%", " / ").concat(fillMode == "tile" ? size.width + "px " + size.height + "px" : "100% 100%", " repeat ") + "url(" +
330
335
  //@ts-ignore
331
- window.appConfig.ASSETS_URL + url + ")" : (0, _utils.getBandBackground)(pattern, extent === flag ? highlightFill : fill, y //是否小于0
336
+ window.appConfig.ASSETS_URL + url + ")" : (0, _utils.getBandBackground)(pattern, fill, y //是否小于0
332
337
  ),
333
338
  borderRadius: style == "square" ? "0 0 0 0" : getBorderRadius({
334
339
  isVertical: isVertical,
@@ -65,7 +65,6 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
65
65
  brush = _ref$config.brush,
66
66
  _ref$config$control = _ref$config.control,
67
67
  control = _ref$config$control === void 0 ? null : _ref$config$control,
68
- isTransverse = _ref.isTransverse,
69
68
  active = _ref.active,
70
69
  style = _ref.style,
71
70
  originData = _ref.originData,
@@ -593,8 +592,7 @@ var Chart = /*#__PURE__*/(0, _react.memo)(function (_ref) {
593
592
  indicatorWidth: indicatorWidth,
594
593
  triggerClick: onInteraction,
595
594
  setCtlTip: setCtlTip,
596
- isXRepeat: isXRepeat,
597
- isTransverse: isTransverse
595
+ isXRepeat: isXRepeat
598
596
  }));
599
597
  }), series.map(function (_ref3, index) {
600
598
  var Component = _ref3.Component,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.8.10",
3
+ "version": "1.8.11",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -92,7 +92,7 @@ export default memo(
92
92
  pattern = {},
93
93
  seriesIntervalWidth: paddingInner = 0,
94
94
  paddingInner: paddingOuter = 0,
95
- highlight: { show: showHighlight, extent, fill: highlightFill },
95
+ highlight: { show: showHighlight, extent, ...highlightStyle },
96
96
  ...other
97
97
  },
98
98
  curXLabel,
@@ -111,6 +111,10 @@ export default memo(
111
111
  selectConfig = { ...barStyle, headDecorate };
112
112
  }
113
113
  }
114
+ let highlightConfig = other;
115
+ if(highlightStyle){
116
+ highlightConfig = { ...other, ...highlightStyle };
117
+ }
114
118
  const step = isControlChart?controlStep:normalStep;
115
119
  const xScaler = isControlChart?controlDragScaler:normalScaler;
116
120
  const { seriesWidth, seriesStep, seriesStart } = getSeriesInfo({
@@ -159,7 +163,7 @@ export default memo(
159
163
  border,
160
164
  opacity,
161
165
  headDecorate
162
- } = x==curXLabel?selectConfig:other;
166
+ } = x==curXLabel?selectConfig:flag?highlightConfig:other;
163
167
  const { borderColor:{
164
168
  type="pure", pure="transparent", linear
165
169
  }, borderWidth=0 } = border || {};
@@ -293,7 +297,7 @@ export default memo(
293
297
  ")"
294
298
  : getBandBackground(
295
299
  pattern,
296
- extent === flag ? highlightFill : fill,
300
+ fill,
297
301
  y//是否小于0
298
302
  ),
299
303
  borderRadius:
@@ -59,7 +59,6 @@ const Chart = memo(
59
59
  brush,
60
60
  control = null,
61
61
  },
62
- isTransverse,
63
62
  active,
64
63
  style,
65
64
  originData,
@@ -568,7 +567,6 @@ const Chart = memo(
568
567
  triggerClick={onInteraction}
569
568
  setCtlTip={setCtlTip}
570
569
  isXRepeat={isXRepeat}
571
- isTransverse={isTransverse}
572
570
  />
573
571
  )
574
572
  );