victory-core 36.8.4 → 36.8.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 (66) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/victory-core.js +684 -1046
  3. package/dist/victory-core.min.js +1 -1
  4. package/es/victory-clip-container/victory-clip-container.js +3 -6
  5. package/es/victory-container/victory-container.js +5 -13
  6. package/es/victory-label/victory-label.js +6 -7
  7. package/es/victory-primitives/arc.js +2 -4
  8. package/es/victory-primitives/background.js +1 -3
  9. package/es/victory-primitives/border.js +2 -4
  10. package/es/victory-primitives/line-segment.js +2 -4
  11. package/es/victory-primitives/point.js +1 -3
  12. package/es/victory-primitives/whisker.js +3 -5
  13. package/es/victory-theme/grayscale.js +24 -27
  14. package/es/victory-theme/material.js +27 -30
  15. package/es/victory-util/add-events.js +1 -2
  16. package/es/victory-util/axis.js +3 -6
  17. package/es/victory-util/data.js +5 -10
  18. package/es/victory-util/events.js +13 -14
  19. package/es/victory-util/helpers.d.ts +11 -0
  20. package/es/victory-util/helpers.js +34 -5
  21. package/es/victory-util/point-path-helpers.js +3 -3
  22. package/es/victory-util/textsize.js +1 -2
  23. package/es/victory-util/transitions.js +14 -20
  24. package/es/victory-util/wrapper.js +7 -10
  25. package/lib/victory-clip-container/victory-clip-container.js +3 -5
  26. package/lib/victory-container/victory-container.js +5 -7
  27. package/lib/victory-label/victory-label.js +6 -8
  28. package/lib/victory-primitives/arc.js +2 -4
  29. package/lib/victory-primitives/background.js +1 -3
  30. package/lib/victory-primitives/border.js +2 -4
  31. package/lib/victory-primitives/line-segment.js +2 -4
  32. package/lib/victory-primitives/point.js +1 -3
  33. package/lib/victory-primitives/whisker.js +3 -5
  34. package/lib/victory-theme/grayscale.js +24 -29
  35. package/lib/victory-theme/material.js +27 -32
  36. package/lib/victory-util/add-events.js +1 -3
  37. package/lib/victory-util/axis.js +3 -7
  38. package/lib/victory-util/data.js +5 -9
  39. package/lib/victory-util/events.js +13 -15
  40. package/lib/victory-util/helpers.d.ts +11 -0
  41. package/lib/victory-util/helpers.js +36 -4
  42. package/lib/victory-util/point-path-helpers.js +6 -3
  43. package/lib/victory-util/textsize.js +1 -3
  44. package/lib/victory-util/transitions.js +14 -16
  45. package/lib/victory-util/wrapper.js +7 -9
  46. package/package.json +2 -2
  47. package/src/victory-clip-container/victory-clip-container.tsx +4 -4
  48. package/src/victory-container/victory-container.tsx +6 -6
  49. package/src/victory-label/victory-label.tsx +7 -7
  50. package/src/victory-primitives/arc.tsx +2 -3
  51. package/src/victory-primitives/background.tsx +1 -2
  52. package/src/victory-primitives/border.tsx +2 -3
  53. package/src/victory-primitives/line-segment.tsx +2 -3
  54. package/src/victory-primitives/point.tsx +1 -2
  55. package/src/victory-primitives/whisker.tsx +3 -4
  56. package/src/victory-theme/grayscale.tsx +30 -25
  57. package/src/victory-theme/material.tsx +33 -28
  58. package/src/victory-util/add-events.tsx +1 -2
  59. package/src/victory-util/axis.tsx +3 -5
  60. package/src/victory-util/data.ts +7 -7
  61. package/src/victory-util/events.ts +23 -16
  62. package/src/victory-util/helpers.ts +34 -3
  63. package/src/victory-util/point-path-helpers.ts +3 -2
  64. package/src/victory-util/textsize.ts +2 -2
  65. package/src/victory-util/transitions.ts +22 -15
  66. package/src/victory-util/wrapper.tsx +11 -8
@@ -20,13 +20,12 @@ exports.isTooltip = isTooltip;
20
20
  exports.modifyProps = modifyProps;
21
21
  exports.omit = omit;
22
22
  exports.radiansToDegrees = radiansToDegrees;
23
+ exports.range = range;
23
24
  exports.reduceChildren = reduceChildren;
24
25
  exports.scalePoint = scalePoint;
25
26
 
26
27
  var _keys2 = _interopRequireDefault(require("lodash/keys"));
27
28
 
28
- var _assign2 = _interopRequireDefault(require("lodash/assign"));
29
-
30
29
  var _pick2 = _interopRequireDefault(require("lodash/pick"));
31
30
 
32
31
  var _property2 = _interopRequireDefault(require("lodash/property"));
@@ -313,6 +312,39 @@ function getCurrentAxis(axis, horizontal) {
313
312
  var otherAxis = axis === "x" ? "y" : "x";
314
313
  return horizontal ? otherAxis : axis;
315
314
  }
315
+ /**
316
+ * Creates an array of numbers (positive and/or negative) progressing
317
+ * from start up to, but not including, end.
318
+ * A step of -1 is used if a negative start is specified without an end or step.
319
+ * If end is not specified, it's set to start with start then set to 0.
320
+ *
321
+ * @param start The length of the array to create, or the start value
322
+ * @param end [The end value] If this is defined, start is the start value
323
+ * @returns An array of the given length
324
+ */
325
+
326
+
327
+ function range(start, end, increment) {
328
+ // when the end index is not given, start from 0
329
+ var startIndex = end ? start : 0; // when the end index is not given, the end of the range is the start index
330
+
331
+ var endIndex = end ? end : start; // ensure endIndex is not a falsy value
332
+
333
+ if (!endIndex) endIndex = 0;
334
+ var k = endIndex - startIndex; // the value range
335
+
336
+ var length = Math.abs(k); // the length of the range
337
+
338
+ var sign = k / length || 1; // the sign of the range (negative or positive)
339
+
340
+ var inc = increment || 1; // the step size of each increment
341
+ // normalize the array length when dealing with floating point values
342
+
343
+ var arrayLength = Math.max(Math.ceil(length / inc), 0);
344
+ return Array.from(Array(arrayLength), function (_, i) {
345
+ return startIndex + i * sign * inc;
346
+ });
347
+ }
316
348
  /**
317
349
  * @param {Array} children: an array of child components
318
350
  * @param {Function} iteratee: a function with arguments "child", "childName", and "parent"
@@ -343,9 +375,9 @@ function reduceChildren(children, iteratee) {
343
375
  var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
344
376
 
345
377
  if (child.props && child.props.children) {
346
- var childProps = (0, _assign2.default)({}, child.props, (0, _pick2.default)(parentProps, sharedProps));
378
+ var childProps = Object.assign({}, child.props, (0, _pick2.default)(parentProps, sharedProps));
347
379
  var nestedChildren = child.type && child.type.role === "stack" && (0, _isFunction2.default)(child.type.getChildren) ? child.type.getChildren(childProps) : _react.default.Children.toArray(child.props.children).map(function (c) {
348
- var nestedChildProps = (0, _assign2.default)({}, c.props, (0, _pick2.default)(childProps, sharedProps));
380
+ var nestedChildProps = Object.assign({}, c.props, (0, _pick2.default)(childProps, sharedProps));
349
381
  return /*#__PURE__*/_react.default.cloneElement(c, nestedChildProps);
350
382
  });
351
383
 
@@ -13,10 +13,13 @@ exports.star = star;
13
13
  exports.triangleDown = triangleDown;
14
14
  exports.triangleUp = triangleUp;
15
15
 
16
- var _range2 = _interopRequireDefault(require("lodash/range"));
16
+ var Helpers = _interopRequireWildcard(require("./helpers"));
17
17
 
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
19
 
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ /* eslint no-magic-numbers: ["error", { "ignore": [0, 1, 2, 2.5, 3] }]*/
20
23
  function circle(x, y, size) {
21
24
  return "M ".concat(x, ", ").concat(y, "\n m ").concat(-size, ", 0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(size * 2, ",0\n a ").concat(size, ", ").concat(size, " 0 1,0 ").concat(-size * 2, ",0");
22
25
  }
@@ -88,7 +91,7 @@ function star(x, y, size) {
88
91
  var angle = Math.PI / 5; // eslint-disable-line no-magic-numbers
89
92
  // eslint-disable-next-line no-magic-numbers
90
93
 
91
- var starCoords = (0, _range2.default)(10).map(function (index) {
94
+ var starCoords = Helpers.range(10).map(function (index) {
92
95
  var length = index % 2 === 0 ? baseSize : baseSize / 2;
93
96
  return "".concat(length * Math.sin(angle * (index + 1)) + x, ",\n ").concat(length * Math.cos(angle * (index + 1)) + y);
94
97
  });
@@ -9,8 +9,6 @@ var _memoize2 = _interopRequireDefault(require("lodash/memoize"));
9
9
 
10
10
  var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
11
11
 
12
- var _assign2 = _interopRequireDefault(require("lodash/assign"));
13
-
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
13
 
16
14
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -226,7 +224,7 @@ exports.convertLengthToPixels = convertLengthToPixels;
226
224
  var _prepareParams = function (inputStyle, index) {
227
225
  var lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
228
226
  var style = (0, _defaults2.default)({}, lineStyle, defaultStyle);
229
- return (0, _assign2.default)({}, style, {
227
+ return Object.assign({}, style, {
230
228
  fontFamily: style.fontFamily,
231
229
  letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
232
230
  fontSize: typeof style.fontSize === "number" ? style.fontSize : convertLengthToPixels(String(style.fontSize))
@@ -12,8 +12,6 @@ var _identity2 = _interopRequireDefault(require("lodash/identity"));
12
12
 
13
13
  var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
14
14
 
15
- var _assign2 = _interopRequireDefault(require("lodash/assign"));
16
-
17
15
  var _react = _interopRequireDefault(require("react"));
18
16
 
19
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -141,14 +139,14 @@ function getInitialChildProps(animate, data) {
141
139
  var after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : _identity2.default;
142
140
  return {
143
141
  data: data.map(function (datum, idx) {
144
- return (0, _assign2.default)({}, datum, after(datum, idx, data));
142
+ return Object.assign({}, datum, after(datum, idx, data));
145
143
  })
146
144
  };
147
145
  } // eslint-disable-next-line max-params
148
146
 
149
147
 
150
148
  function getChildBeforeLoad(animate, child, data, cb) {
151
- var newAnimate = (0, _assign2.default)({}, animate, {
149
+ var newAnimate = Object.assign({}, animate, {
152
150
  onEnd: cb
153
151
  });
154
152
 
@@ -162,7 +160,7 @@ function getChildBeforeLoad(animate, child, data, cb) {
162
160
  var before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : _identity2.default; // If nodes need to exit, transform them with the provided onLoad.before function.
163
161
 
164
162
  var newData = data.map(function (datum, idx) {
165
- return (0, _assign2.default)({}, datum, before(datum, idx, data));
163
+ return Object.assign({}, datum, before(datum, idx, data));
166
164
  });
167
165
  return {
168
166
  animate: newAnimate,
@@ -173,7 +171,7 @@ function getChildBeforeLoad(animate, child, data, cb) {
173
171
 
174
172
 
175
173
  function getChildOnLoad(animate, data, cb) {
176
- var newAnimate = (0, _assign2.default)({}, animate, {
174
+ var newAnimate = Object.assign({}, animate, {
177
175
  onEnd: cb
178
176
  });
179
177
  var newData = data;
@@ -188,7 +186,7 @@ function getChildOnLoad(animate, data, cb) {
188
186
  var after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : _identity2.default; // If nodes need to exit, transform them with the provided onLoad.after function.
189
187
 
190
188
  newData = data.map(function (datum, idx) {
191
- return (0, _assign2.default)({}, datum, after(datum, idx, data));
189
+ return Object.assign({}, datum, after(datum, idx, data));
192
190
  });
193
191
  return {
194
192
  animate: newAnimate,
@@ -201,7 +199,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
201
199
  // Whether or not _this_ child has exiting nodes, we want the exit-
202
200
  // transition for all children to have the same duration, delay, etc.
203
201
  var onExit = animate && animate.onExit;
204
- var newAnimate = (0, _assign2.default)({}, animate, onExit);
202
+ var newAnimate = Object.assign({}, animate, onExit);
205
203
  var newData = data;
206
204
 
207
205
  if (exitingNodes) {
@@ -212,7 +210,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
212
210
 
213
211
  newData = data.map(function (datum, idx) {
214
212
  var key = (datum.key || idx).toString();
215
- return exitingNodes[key] ? (0, _assign2.default)({}, datum, before(datum, idx, data)) : datum;
213
+ return exitingNodes[key] ? Object.assign({}, datum, before(datum, idx, data)) : datum;
216
214
  });
217
215
  }
218
216
 
@@ -230,7 +228,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
230
228
  if (enteringNodes) {
231
229
  // Perform a normal animation here, except - when it finishes - trigger
232
230
  // the transition for entering nodes.
233
- newAnimate = (0, _assign2.default)({}, animate, {
231
+ newAnimate = Object.assign({}, animate, {
234
232
  onEnd: cb
235
233
  });
236
234
  var before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : _identity2.default; // We want the entering nodes to be included in the transition target
@@ -239,7 +237,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
239
237
 
240
238
  newData = data.map(function (datum, idx) {
241
239
  var key = (datum.key || idx).toString();
242
- return enteringNodes[key] ? (0, _assign2.default)({}, datum, before(datum, idx, data)) : datum;
240
+ return enteringNodes[key] ? Object.assign({}, datum, before(datum, idx, data)) : datum;
243
241
  });
244
242
  }
245
243
 
@@ -254,7 +252,7 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
254
252
  // Whether or not _this_ child has entering nodes, we want the entering-
255
253
  // transition for all children to have the same duration, delay, etc.
256
254
  var onEnter = animate && animate.onEnter;
257
- var newAnimate = (0, _assign2.default)({}, animate, onEnter);
255
+ var newAnimate = Object.assign({}, animate, onEnter);
258
256
  var newData = data;
259
257
 
260
258
  if (enteringNodes) {
@@ -265,7 +263,7 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
265
263
  var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : _identity2.default;
266
264
  newData = data.map(function (datum, idx) {
267
265
  var key = getDatumKey(datum, idx);
268
- return enteringNodes[key] ? (0, _assign2.default)({}, datum, after(datum, idx, data)) : datum;
266
+ return enteringNodes[key] ? Object.assign({}, datum, after(datum, idx, data)) : datum;
269
267
  });
270
268
  }
271
269
 
@@ -384,7 +382,7 @@ function getTransitionPropsFactory(props, state, setState) {
384
382
  var animation = {
385
383
  duration: load
386
384
  };
387
- return onLoad(child, data, (0, _assign2.default)({}, animate, animation));
385
+ return onLoad(child, data, Object.assign({}, animate, animation));
388
386
  } else if (nodesWillExit) {
389
387
  var exitingNodes = childTransitions && childTransitions.exiting;
390
388
  var exit = transitionDurations.exit !== undefined ? transitionDurations.exit : getChildTransitionDuration(child, "onExit"); // if nodesWillExit, but this child has no exiting nodes, set a delay instead of a duration
@@ -395,7 +393,7 @@ function getTransitionPropsFactory(props, state, setState) {
395
393
  delay: exit
396
394
  };
397
395
 
398
- return onExit(exitingNodes, child, data, (0, _assign2.default)({}, animate, _animation));
396
+ return onExit(exitingNodes, child, data, Object.assign({}, animate, _animation));
399
397
  } else if (nodesWillEnter) {
400
398
  var enteringNodes = childTransitions && childTransitions.entering;
401
399
  var enter = transitionDurations.enter !== undefined ? transitionDurations.enter : getChildTransitionDuration(child, "onEnter");
@@ -403,7 +401,7 @@ function getTransitionPropsFactory(props, state, setState) {
403
401
  var _animation2 = {
404
402
  duration: nodesShouldEnter && enteringNodes ? enter : move
405
403
  };
406
- return onEnter(enteringNodes, child, data, (0, _assign2.default)({}, animate, _animation2));
404
+ return onEnter(enteringNodes, child, data, Object.assign({}, animate, _animation2));
407
405
  } else if (!state && animate && animate.onExit) {
408
406
  // This is the initial render, and nodes may enter when props change. Because
409
407
  // animation interpolation is determined by old- and next- props, data may need
@@ -37,8 +37,6 @@ var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
37
37
 
38
38
  var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
39
39
 
40
- var _assign2 = _interopRequireDefault(require("lodash/assign"));
41
-
42
40
  var _react = _interopRequireDefault(require("react"));
43
41
 
44
42
  var Axis = _interopRequireWildcard(require("./axis"));
@@ -159,7 +157,7 @@ function getDataFromChildren(props, childComponents) {
159
157
  });
160
158
 
161
159
  var iteratee = function (child, childName, parent) {
162
- var childProps = (0, _assign2.default)({}, child.props, parentProps);
160
+ var childProps = Object.assign({}, child.props, parentProps);
163
161
  var childData;
164
162
  var childElement = child;
165
163
 
@@ -174,7 +172,7 @@ function getDataFromChildren(props, childComponents) {
174
172
 
175
173
  stack += 1;
176
174
  return childData.map(function (datum, index) {
177
- return (0, _assign2.default)({
175
+ return Object.assign({
178
176
  _stack: stack,
179
177
  _group: index
180
178
  }, datum);
@@ -281,12 +279,12 @@ function getDomainFromChildren(props, axis, childComponents) {
281
279
  maxDomain: maxDomain,
282
280
  categories: categories
283
281
  };
284
- var parentProps = parentData ? (0, _assign2.default)(baseParentProps, {
282
+ var parentProps = parentData ? Object.assign(baseParentProps, {
285
283
  data: parentData
286
284
  }) : baseParentProps;
287
285
 
288
286
  var iteratee = function (child) {
289
- var sharedProps = (0, _assign2.default)({}, child.props, parentProps);
287
+ var sharedProps = Object.assign({}, child.props, parentProps);
290
288
 
291
289
  if (!Domain.isDomainComponent(child)) {
292
290
  return null;
@@ -323,7 +321,7 @@ function getDomain(props, axis, childComponents) {
323
321
  domain = Domain.getDomainFromMinMax(min, max);
324
322
  }
325
323
 
326
- return Domain.formatDomain(domain, (0, _assign2.default)({
324
+ return Domain.formatDomain(domain, Object.assign({
327
325
  domainPadding: domainPadding
328
326
  }, props), axis);
329
327
  }
@@ -336,7 +334,7 @@ function getScale(props, axis, childComponents) {
336
334
  var children = childComponents ? childComponents.slice(0) : _react.default.Children.toArray(props.children);
337
335
 
338
336
  var iteratee = function (child) {
339
- var sharedProps = (0, _assign2.default)({}, child.props, {
337
+ var sharedProps = Object.assign({}, child.props, {
340
338
  horizontal: props.horizontal
341
339
  });
342
340
  return Scale.getScaleType(sharedProps, axis);
@@ -405,7 +403,7 @@ function getChildStyle(child, index, calculatedProps) {
405
403
  var dataWidth = role === "stack" ? {} : {
406
404
  width: getWidth(calculatedProps)
407
405
  };
408
- var dataStyle = (0, _defaults2.default)({}, childStyle.data, (0, _assign2.default)({}, dataWidth, style.data, defaultColor));
406
+ var dataStyle = (0, _defaults2.default)({}, childStyle.data, Object.assign({}, dataWidth, style.data, defaultColor));
409
407
  var labelsStyle = (0, _defaults2.default)({}, childStyle.labels, style.labels);
410
408
  return {
411
409
  parent: style.parent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "victory-core",
3
- "version": "36.8.4",
3
+ "version": "36.8.5",
4
4
  "description": "Victory Core",
5
5
  "keywords": [
6
6
  "data visualization",
@@ -23,7 +23,7 @@
23
23
  "lodash": "^4.17.21",
24
24
  "prop-types": "^15.8.1",
25
25
  "react-fast-compare": "^3.2.0",
26
- "victory-vendor": "^36.8.4"
26
+ "victory-vendor": "^36.8.5"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": ">=16.6.0"
@@ -3,7 +3,7 @@ import PropTypes from "prop-types";
3
3
  import * as CustomPropTypes from "../victory-util/prop-types";
4
4
  import * as Helpers from "../victory-util/helpers";
5
5
  import * as UserProps from "../victory-util/user-props";
6
- import { assign, defaults, isObject, uniqueId } from "lodash";
6
+ import { defaults, isObject, uniqueId } from "lodash";
7
7
  import { ClipPath } from "../victory-primitives/clip-path";
8
8
  import { Circle } from "../victory-primitives/circle";
9
9
  import { Rect } from "../victory-primitives/rect";
@@ -120,7 +120,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
120
120
  tabIndex,
121
121
  } = props;
122
122
  const clipComponent = this.renderClipComponent(props, clipId);
123
- const groupProps = assign(
123
+ const groupProps = Object.assign(
124
124
  {
125
125
  className,
126
126
  style,
@@ -149,7 +149,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
149
149
  } = props;
150
150
  return React.cloneElement(
151
151
  groupComponent,
152
- assign(
152
+ Object.assign(
153
153
  {
154
154
  className,
155
155
  style,
@@ -199,7 +199,7 @@ export class VictoryClipContainer extends React.Component<VictoryClipContainerPr
199
199
 
200
200
  return React.cloneElement(
201
201
  clipPathComponent,
202
- assign({ key: `clip-path-${clipId}` }, props, { clipId }),
202
+ Object.assign({ key: `clip-path-${clipId}` }, props, { clipId }),
203
203
  child,
204
204
  );
205
205
  }
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import * as CustomPropTypes from "../victory-util/prop-types";
4
- import { assign, defaults, uniqueId, isObject, isFunction } from "lodash";
4
+ import { defaults, uniqueId, isObject, isFunction } from "lodash";
5
5
  import { Portal } from "../victory-portal/portal";
6
6
  import { PortalContext } from "../victory-portal/portal-context";
7
7
  import TimerContext from "../victory-util/timer-context";
@@ -170,7 +170,7 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
170
170
  const dimensions = responsive
171
171
  ? { width: "100%", height: "100%" }
172
172
  : { width, height };
173
- const divStyle = assign(
173
+ const divStyle = Object.assign(
174
174
  {
175
175
  pointerEvents: "none",
176
176
  touchAction: "none",
@@ -178,12 +178,12 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
178
178
  } as const,
179
179
  dimensions,
180
180
  );
181
- const portalDivStyle = assign(
181
+ const portalDivStyle = Object.assign(
182
182
  { zIndex: portalZIndex, position: "absolute", top: 0, left: 0 } as const,
183
183
  dimensions,
184
184
  );
185
- const svgStyle = assign({ pointerEvents: "all" }, dimensions);
186
- const portalSvgStyle = assign({ overflow: "visible" }, dimensions);
185
+ const svgStyle = Object.assign({ pointerEvents: "all" }, dimensions);
186
+ const portalSvgStyle = Object.assign({ overflow: "visible" }, dimensions);
187
187
  const portalProps = {
188
188
  width,
189
189
  height,
@@ -244,7 +244,7 @@ export class VictoryContainer extends React.Component<VictoryContainerProps> {
244
244
 
245
245
  const userProps = UserProps.getSafeUserProps(this.props);
246
246
 
247
- const svgProps = assign(
247
+ const svgProps = Object.assign(
248
248
  {
249
249
  width,
250
250
  height,
@@ -1,5 +1,5 @@
1
1
  /* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
2
- import { assign, defaults, isEmpty } from "lodash";
2
+ import { defaults, isEmpty } from "lodash";
3
3
  import PropTypes from "prop-types";
4
4
  import React from "react";
5
5
  import { VictoryPortal } from "../victory-portal/victory-portal";
@@ -125,7 +125,7 @@ const getStyles = (style, props) => {
125
125
  s ? defaults({}, s, defaultStyles) : defaultStyles,
126
126
  props,
127
127
  );
128
- return assign({}, baseStyles, { fontSize: getFontSize(baseStyles) });
128
+ return Object.assign({}, baseStyles, { fontSize: getFontSize(baseStyles) });
129
129
  };
130
130
 
131
131
  return Array.isArray(style) && !isEmpty(style)
@@ -464,16 +464,16 @@ const evaluateProps = (props) => {
464
464
  3) everything else
465
465
  */
466
466
  const text = getContent(props.text, props);
467
- const style = getStyles(props.style, assign({}, props, { text }));
467
+ const style = getStyles(props.style, Object.assign({}, props, { text }));
468
468
  const backgroundStyle = getBackgroundStyles(
469
469
  props.backgroundStyle,
470
- assign({}, props, { text, style }),
470
+ Object.assign({}, props, { text, style }),
471
471
  );
472
472
  const backgroundPadding = getBackgroundPadding(
473
- assign({}, props, { text, style, backgroundStyle }),
473
+ Object.assign({}, props, { text, style, backgroundStyle }),
474
474
  );
475
475
  const id = Helpers.evaluateProp(props.id, props);
476
- return assign({}, props, {
476
+ return Object.assign({}, props, {
477
477
  backgroundStyle,
478
478
  backgroundPadding,
479
479
  style,
@@ -501,7 +501,7 @@ const getCalculatedProps = <T extends VictoryLabelProps>(props: T) => {
501
501
  const y = props.y !== undefined ? props.y : getPosition(props, "y");
502
502
  const transform = getTransform(props, x, y);
503
503
 
504
- return assign({}, props, {
504
+ return Object.assign({}, props, {
505
505
  ariaLabel,
506
506
  lineHeight,
507
507
  direction,
@@ -2,7 +2,6 @@
2
2
  import React from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import * as Helpers from "../victory-util/helpers";
5
- import { assign } from "lodash";
6
5
  import {
7
6
  CommonProps,
8
7
  VictoryCommonPrimitiveProps,
@@ -54,12 +53,12 @@ const evaluateProps = (props) => {
54
53
  const desc = Helpers.evaluateProp(props.desc, props);
55
54
  const id = Helpers.evaluateProp(props.id, props);
56
55
  const style = Helpers.evaluateStyle(
57
- assign({ stroke: "black", fill: "none" }, props.style),
56
+ Object.assign({ stroke: "black", fill: "none" }, props.style),
58
57
  props,
59
58
  );
60
59
  const tabIndex = Helpers.evaluateProp(props.tabIndex, props);
61
60
 
62
- return assign({}, props, { ariaLabel, desc, id, style, tabIndex });
61
+ return Object.assign({}, props, { ariaLabel, desc, id, style, tabIndex });
63
62
  };
64
63
 
65
64
  const defaultProps = {
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
- import { assign } from "lodash";
4
3
  import * as Helpers from "../victory-util/helpers";
5
4
  import {
6
5
  CommonProps,
@@ -27,7 +26,7 @@ const evaluateProps = (props) => {
27
26
  */
28
27
  const id = Helpers.evaluateProp(props.id, props);
29
28
 
30
- return assign({}, props, { id });
29
+ return Object.assign({}, props, { id });
31
30
  };
32
31
 
33
32
  const defaultProps = {
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import * as Helpers from "../victory-util/helpers";
4
- import { assign } from "lodash";
5
4
  import {
6
5
  CommonProps,
7
6
  VictoryCommonPrimitiveProps,
@@ -29,12 +28,12 @@ const evaluateProps = (props) => {
29
28
  const desc = Helpers.evaluateProp(props.desc, props);
30
29
  const id = Helpers.evaluateProp(props.id, props);
31
30
  const style = Helpers.evaluateStyle(
32
- assign({ fill: "none" }, props.style),
31
+ Object.assign({ fill: "none" }, props.style),
33
32
  props,
34
33
  );
35
34
  const tabIndex = Helpers.evaluateProp(props.tabIndex, props);
36
35
 
37
- return assign({}, props, { ariaLabel, desc, id, style, tabIndex });
36
+ return Object.assign({}, props, { ariaLabel, desc, id, style, tabIndex });
38
37
  };
39
38
 
40
39
  const defaultProps = {
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import * as Helpers from "../victory-util/helpers";
4
- import { assign } from "lodash";
5
4
  import {
6
5
  CommonProps,
7
6
  VictoryCommonPrimitiveProps,
@@ -30,12 +29,12 @@ const evaluateProps = (props) => {
30
29
  const desc = Helpers.evaluateProp(props.desc, props);
31
30
  const id = Helpers.evaluateProp(props.id, props);
32
31
  const style = Helpers.evaluateStyle(
33
- assign({ stroke: "black" }, props.style),
32
+ Object.assign({ stroke: "black" }, props.style),
34
33
  props,
35
34
  );
36
35
  const tabIndex = Helpers.evaluateProp(props.tabIndex, props);
37
36
 
38
- return assign({}, props, { ariaLabel, desc, id, style, tabIndex });
37
+ return Object.assign({}, props, { ariaLabel, desc, id, style, tabIndex });
39
38
  };
40
39
 
41
40
  const defaultProps = {
@@ -1,4 +1,3 @@
1
- import { assign } from "lodash";
2
1
  import PropTypes from "prop-types";
3
2
  import React from "react";
4
3
  import * as Helpers from "../victory-util/helpers";
@@ -55,7 +54,7 @@ const evaluateProps = (props) => {
55
54
  const symbol = Helpers.evaluateProp(props.symbol, props);
56
55
  const tabIndex = Helpers.evaluateProp(props.tabIndex, props);
57
56
 
58
- return assign({}, props, {
57
+ return Object.assign({}, props, {
59
58
  ariaLabel,
60
59
  desc,
61
60
  id,
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import { assign } from "lodash";
3
2
  import PropTypes from "prop-types";
4
3
  import * as Helpers from "../victory-util/helpers";
5
4
  import {
@@ -37,7 +36,7 @@ const evaluateProps = (props) => {
37
36
  const style = Helpers.evaluateStyle(props.style, props);
38
37
  const tabIndex = Helpers.evaluateProp(props.tabIndex, props);
39
38
 
40
- return assign({}, props, { ariaLabel, desc, id, style, tabIndex });
39
+ return Object.assign({}, props, { ariaLabel, desc, id, style, tabIndex });
41
40
  };
42
41
 
43
42
  const defaultProps = {
@@ -80,7 +79,7 @@ export const Whisker = (initialProps: WhiskerProps) => {
80
79
  return React.cloneElement(groupComponent, {}, [
81
80
  React.cloneElement(
82
81
  lineComponent,
83
- assign(
82
+ Object.assign(
84
83
  { key: "major-whisker", "aria-label": ariaLabel },
85
84
  baseProps,
86
85
  majorWhisker,
@@ -88,7 +87,7 @@ export const Whisker = (initialProps: WhiskerProps) => {
88
87
  ),
89
88
  React.cloneElement(
90
89
  lineComponent,
91
- assign(
90
+ Object.assign(
92
91
  { key: "minor-whisker", "aria-label": ariaLabel },
93
92
  baseProps,
94
93
  minorWhisker,