victory-stack 37.3.1 → 37.3.3
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/CHANGELOG.md +10 -0
- package/dist/victory-stack.js +296 -270
- package/dist/victory-stack.min.js +1 -1
- package/es/helper-methods.d.ts +2 -6
- package/es/helper-methods.js +3 -4
- package/es/victory-stack.d.ts +1 -1
- package/es/victory-stack.js +5 -5
- package/lib/helper-methods.d.ts +2 -6
- package/lib/helper-methods.js +3 -5
- package/lib/victory-stack.d.ts +1 -1
- package/lib/victory-stack.js +5 -5
- package/package.json +7 -39
- package/src/helper-methods.tsx +8 -9
- package/src/victory-stack.tsx +3 -3
package/dist/victory-stack.js
CHANGED
|
@@ -35,7 +35,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
35
35
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-fast-compare */ "../../../node_modules/.pnpm/react-fast-compare@3.2.0/node_modules/react-fast-compare/index.js");
|
|
36
36
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_2__);
|
|
37
37
|
|
|
38
|
-
/* eslint-disable no-use-before-define */
|
|
39
38
|
|
|
40
39
|
|
|
41
40
|
|
|
@@ -226,7 +225,7 @@ function getChildProps(props, calculatedProps) {
|
|
|
226
225
|
return {
|
|
227
226
|
height: props.height,
|
|
228
227
|
width: props.width,
|
|
229
|
-
padding: victory_core__WEBPACK_IMPORTED_MODULE_4__.getPadding(props),
|
|
228
|
+
padding: victory_core__WEBPACK_IMPORTED_MODULE_4__.getPadding(props.padding),
|
|
230
229
|
standalone: false,
|
|
231
230
|
theme: props.theme,
|
|
232
231
|
categories,
|
|
@@ -290,12 +289,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
290
289
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
291
290
|
/* harmony export */ "VictoryStack": function() { return /* binding */ VictoryStack; }
|
|
292
291
|
/* harmony export */ });
|
|
293
|
-
/* harmony import */ var
|
|
294
|
-
/* harmony import */ var
|
|
292
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
293
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
295
294
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
296
295
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
297
|
-
/* harmony import */ var
|
|
298
|
-
/* harmony import */ var
|
|
296
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/isEmpty */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isEmpty.js");
|
|
297
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
299
298
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
300
299
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js");
|
|
301
300
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/hooks/use-animation-state.js");
|
|
@@ -320,8 +319,8 @@ const fallbackProps = {
|
|
|
320
319
|
padding: 50
|
|
321
320
|
};
|
|
322
321
|
const defaultProps = {
|
|
323
|
-
containerComponent: /*#__PURE__*/
|
|
324
|
-
groupComponent: /*#__PURE__*/
|
|
322
|
+
containerComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.VictoryContainer, null),
|
|
323
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null),
|
|
325
324
|
standalone: true,
|
|
326
325
|
theme: victory_core__WEBPACK_IMPORTED_MODULE_5__.VictoryTheme.grayscale,
|
|
327
326
|
fillInMissingData: true
|
|
@@ -330,7 +329,7 @@ const VictoryStackBase = initialProps => {
|
|
|
330
329
|
const {
|
|
331
330
|
role
|
|
332
331
|
} = VictoryStack;
|
|
333
|
-
const propsWithDefaults =
|
|
332
|
+
const propsWithDefaults = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps), [initialProps]);
|
|
334
333
|
const {
|
|
335
334
|
setAnimationState,
|
|
336
335
|
getAnimationProps,
|
|
@@ -351,20 +350,20 @@ const VictoryStackBase = initialProps => {
|
|
|
351
350
|
horizontal,
|
|
352
351
|
name
|
|
353
352
|
} = modifiedProps;
|
|
354
|
-
const childComponents =
|
|
353
|
+
const childComponents = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(modifiedProps.children);
|
|
355
354
|
const calculatedProps = (0,_helper_methods__WEBPACK_IMPORTED_MODULE_8__.useMemoizedProps)(modifiedProps);
|
|
356
355
|
const {
|
|
357
356
|
domain,
|
|
358
357
|
scale,
|
|
359
358
|
style
|
|
360
359
|
} = calculatedProps;
|
|
361
|
-
const newChildren =
|
|
360
|
+
const newChildren = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => {
|
|
362
361
|
const children = (0,_helper_methods__WEBPACK_IMPORTED_MODULE_8__.getChildren)(props, childComponents, calculatedProps);
|
|
363
362
|
const orderedChildren = children.map((child, index) => {
|
|
364
363
|
const childProps = Object.assign({
|
|
365
364
|
animate: getAnimationProps(props, child, index)
|
|
366
365
|
}, child.props);
|
|
367
|
-
return /*#__PURE__*/
|
|
366
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, childProps);
|
|
368
367
|
});
|
|
369
368
|
/*
|
|
370
369
|
reverse render order for children of `VictoryStack` so that higher children in the stack
|
|
@@ -373,7 +372,7 @@ const VictoryStackBase = initialProps => {
|
|
|
373
372
|
*/
|
|
374
373
|
return orderedChildren.reverse();
|
|
375
374
|
}, [props, childComponents, calculatedProps, getAnimationProps]);
|
|
376
|
-
const containerProps =
|
|
375
|
+
const containerProps = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => {
|
|
377
376
|
if (standalone) {
|
|
378
377
|
return {
|
|
379
378
|
domain,
|
|
@@ -390,19 +389,19 @@ const VictoryStackBase = initialProps => {
|
|
|
390
389
|
}
|
|
391
390
|
return {};
|
|
392
391
|
}, [standalone, domain, scale, width, height, theme, style, horizontal, polar, name]);
|
|
393
|
-
const userProps =
|
|
394
|
-
const container =
|
|
392
|
+
const userProps = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => victory_core__WEBPACK_IMPORTED_MODULE_9__.getSafeUserProps(propsWithDefaults), [propsWithDefaults]);
|
|
393
|
+
const container = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => {
|
|
395
394
|
if (standalone) {
|
|
396
395
|
const defaultContainerProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, containerComponent.props, containerProps, userProps);
|
|
397
|
-
return /*#__PURE__*/
|
|
396
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(containerComponent, defaultContainerProps);
|
|
398
397
|
}
|
|
399
|
-
return /*#__PURE__*/
|
|
398
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(groupComponent, userProps);
|
|
400
399
|
}, [groupComponent, standalone, containerComponent, containerProps, userProps]);
|
|
401
|
-
const events =
|
|
400
|
+
const events = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => {
|
|
402
401
|
return victory_core__WEBPACK_IMPORTED_MODULE_10__.getAllEvents(props);
|
|
403
402
|
}, [props]);
|
|
404
403
|
const previousProps = victory_core__WEBPACK_IMPORTED_MODULE_11__.usePreviousProps(propsWithDefaults);
|
|
405
|
-
|
|
404
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
406
405
|
// This is called before dismount to keep state in sync
|
|
407
406
|
return () => {
|
|
408
407
|
if (propsWithDefaults.animate) {
|
|
@@ -410,22 +409,22 @@ const VictoryStackBase = initialProps => {
|
|
|
410
409
|
}
|
|
411
410
|
};
|
|
412
411
|
}, [setAnimationState, previousProps, propsWithDefaults]);
|
|
413
|
-
if (!
|
|
414
|
-
return /*#__PURE__*/
|
|
412
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(events)) {
|
|
413
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_12__.VictorySharedEvents, {
|
|
415
414
|
container: container,
|
|
416
415
|
eventKey: eventKey,
|
|
417
416
|
events: events,
|
|
418
417
|
externalEventMutations: externalEventMutations
|
|
419
418
|
}, newChildren);
|
|
420
419
|
}
|
|
421
|
-
return /*#__PURE__*/
|
|
420
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(container, container.props, newChildren);
|
|
422
421
|
};
|
|
423
422
|
const componentConfig = {
|
|
424
423
|
role: "stack",
|
|
425
424
|
expectedComponents: ["groupComponent", "containerComponent", "labelComponent"],
|
|
426
425
|
getChildren: _helper_methods__WEBPACK_IMPORTED_MODULE_8__.getChildren
|
|
427
426
|
};
|
|
428
|
-
const VictoryStack = Object.assign( /*#__PURE__*/
|
|
427
|
+
const VictoryStack = Object.assign( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(VictoryStackBase, (react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default())), componentConfig);
|
|
429
428
|
VictoryStack.displayName = "VictoryStack";
|
|
430
429
|
|
|
431
430
|
/***/ }),
|
|
@@ -5032,16 +5031,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5032
5031
|
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; },
|
|
5033
5032
|
/* harmony export */ "useVictoryContainer": function() { return /* binding */ useVictoryContainer; }
|
|
5034
5033
|
/* harmony export */ });
|
|
5035
|
-
/* harmony import */ var
|
|
5036
|
-
/* harmony import */ var
|
|
5037
|
-
/* harmony import */ var
|
|
5038
|
-
/* harmony import */ var
|
|
5034
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5035
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5036
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
|
|
5037
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1__);
|
|
5039
5038
|
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
5040
5039
|
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
5041
5040
|
/* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
|
|
5042
5041
|
/* harmony import */ var _victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-portal/portal-outlet */ "../../victory-core/es/victory-portal/portal-outlet.js");
|
|
5043
5042
|
/* harmony import */ var _victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-portal/portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
5044
|
-
|
|
5045
5043
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5046
5044
|
|
|
5047
5045
|
|
|
@@ -5049,9 +5047,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
5049
5047
|
|
|
5050
5048
|
|
|
5051
5049
|
|
|
5050
|
+
|
|
5052
5051
|
const defaultProps = {
|
|
5053
5052
|
className: "VictoryContainer",
|
|
5054
|
-
portalComponent: /*#__PURE__*/
|
|
5053
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
5055
5054
|
portalZIndex: 99,
|
|
5056
5055
|
responsive: true,
|
|
5057
5056
|
role: "img"
|
|
@@ -5068,10 +5067,10 @@ function useVictoryContainer(initialProps) {
|
|
|
5068
5067
|
height,
|
|
5069
5068
|
responsive
|
|
5070
5069
|
} = props;
|
|
5071
|
-
const localContainerRef = (0,
|
|
5070
|
+
const localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
5072
5071
|
|
|
5073
5072
|
// Generated ID stored in ref because it needs to persist across renders
|
|
5074
|
-
const generatedId = (0,
|
|
5073
|
+
const generatedId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default()("victory-container-"));
|
|
5075
5074
|
const containerId = props.containerId ?? generatedId.current;
|
|
5076
5075
|
const getIdForElement = elName => `${containerId}-${elName}`;
|
|
5077
5076
|
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props);
|
|
@@ -5130,7 +5129,7 @@ const VictoryContainer = initialProps => {
|
|
|
5130
5129
|
containerRef,
|
|
5131
5130
|
localContainerRef
|
|
5132
5131
|
} = useVictoryContainer(initialProps);
|
|
5133
|
-
|
|
5132
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
5134
5133
|
if (!events?.onWheel) return;
|
|
5135
5134
|
const handleWheel = e => e.preventDefault();
|
|
5136
5135
|
const container = localContainerRef?.current;
|
|
@@ -5140,21 +5139,21 @@ const VictoryContainer = initialProps => {
|
|
|
5140
5139
|
};
|
|
5141
5140
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5142
5141
|
}, []);
|
|
5143
|
-
return /*#__PURE__*/
|
|
5142
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
5144
5143
|
className: className,
|
|
5145
5144
|
style: {
|
|
5146
5145
|
...style,
|
|
5147
5146
|
width: responsive ? style?.width : dimensions.width,
|
|
5148
5147
|
height: responsive ? style?.height : dimensions.height,
|
|
5149
|
-
pointerEvents: "none",
|
|
5150
|
-
touchAction: "none",
|
|
5151
|
-
position: "relative"
|
|
5148
|
+
pointerEvents: style?.pointerEvents ?? "none",
|
|
5149
|
+
touchAction: style?.touchAction ?? "none",
|
|
5150
|
+
position: style?.position ?? "relative"
|
|
5152
5151
|
},
|
|
5153
5152
|
"data-ouia-component-id": ouiaId,
|
|
5154
5153
|
"data-ouia-component-type": ouiaType,
|
|
5155
5154
|
"data-ouia-safe": ouiaSafe,
|
|
5156
5155
|
ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
|
|
5157
|
-
}, /*#__PURE__*/
|
|
5156
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal_context__WEBPACK_IMPORTED_MODULE_5__.PortalProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", _extends({
|
|
5158
5157
|
width: width,
|
|
5159
5158
|
height: height,
|
|
5160
5159
|
tabIndex: tabIndex,
|
|
@@ -5167,11 +5166,11 @@ const VictoryContainer = initialProps => {
|
|
|
5167
5166
|
...dimensions,
|
|
5168
5167
|
pointerEvents: "all"
|
|
5169
5168
|
}
|
|
5170
|
-
}, userProps, events), title ? /*#__PURE__*/
|
|
5169
|
+
}, userProps, events), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("title", {
|
|
5171
5170
|
id: titleId
|
|
5172
|
-
}, title) : null, desc ? /*#__PURE__*/
|
|
5171
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("desc", {
|
|
5173
5172
|
id: descId
|
|
5174
|
-
}, desc) : null, children), /*#__PURE__*/
|
|
5173
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
5175
5174
|
style: {
|
|
5176
5175
|
...dimensions,
|
|
5177
5176
|
zIndex: portalZIndex,
|
|
@@ -5179,7 +5178,7 @@ const VictoryContainer = initialProps => {
|
|
|
5179
5178
|
top: 0,
|
|
5180
5179
|
left: 0
|
|
5181
5180
|
}
|
|
5182
|
-
}, /*#__PURE__*/
|
|
5181
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__.PortalOutlet, {
|
|
5183
5182
|
as: portalComponent,
|
|
5184
5183
|
width: width,
|
|
5185
5184
|
height: height,
|
|
@@ -6447,16 +6446,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6447
6446
|
/* harmony export */ "modifyProps": function() { return /* binding */ modifyProps; },
|
|
6448
6447
|
/* harmony export */ "stringTicks": function() { return /* binding */ stringTicks; }
|
|
6449
6448
|
/* harmony export */ });
|
|
6450
|
-
/* harmony import */ var
|
|
6451
|
-
/* harmony import */ var
|
|
6452
|
-
/* harmony import */ var
|
|
6453
|
-
/* harmony import */ var
|
|
6449
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6450
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6451
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
6452
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6454
6453
|
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/isObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js");
|
|
6455
6454
|
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isObject__WEBPACK_IMPORTED_MODULE_2__);
|
|
6456
|
-
/* harmony import */ var
|
|
6457
|
-
/* harmony import */ var
|
|
6458
|
-
/* harmony import */ var
|
|
6459
|
-
/* harmony import */ var
|
|
6455
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniq.js");
|
|
6456
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_3__);
|
|
6457
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash/orderBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/orderBy.js");
|
|
6458
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_orderBy__WEBPACK_IMPORTED_MODULE_4__);
|
|
6460
6459
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
6461
6460
|
/* harmony import */ var _domain__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./domain */ "../../victory-core/es/victory-util/domain.js");
|
|
6462
6461
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
@@ -6503,7 +6502,7 @@ function findAxisComponents(childComponents, predicate) {
|
|
|
6503
6502
|
if (child.type && child.type.role === "axis" && predicateFunction(child)) {
|
|
6504
6503
|
return memo.concat(child);
|
|
6505
6504
|
} else if (child.props && child.props.children) {
|
|
6506
|
-
return memo.concat(findAxes(
|
|
6505
|
+
return memo.concat(findAxes(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children)));
|
|
6507
6506
|
}
|
|
6508
6507
|
return memo;
|
|
6509
6508
|
}, []);
|
|
@@ -6541,7 +6540,7 @@ function getAxisComponentsWithParent(childComponents, type) {
|
|
|
6541
6540
|
if (child.type && child.type.role === "axis" && matchesType(child)) {
|
|
6542
6541
|
return memo.concat(child);
|
|
6543
6542
|
} else if (child.props && child.props.children) {
|
|
6544
|
-
const childAxis = findComponents(
|
|
6543
|
+
const childAxis = findComponents(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children));
|
|
6545
6544
|
return childAxis.length > 0 ? memo.concat(child) : memo;
|
|
6546
6545
|
}
|
|
6547
6546
|
return memo;
|
|
@@ -6600,7 +6599,7 @@ function getDefaultTickFormat(props) {
|
|
|
6600
6599
|
return stringTicks(props) ? (x, index) => tickValues[index] : fallbackFormat;
|
|
6601
6600
|
}
|
|
6602
6601
|
const invertedStringMap = stringMap && _helpers__WEBPACK_IMPORTED_MODULE_6__.invert(stringMap);
|
|
6603
|
-
const tickValueArray =
|
|
6602
|
+
const tickValueArray = lodash_orderBy__WEBPACK_IMPORTED_MODULE_4___default()(Object.values(stringMap), n => n);
|
|
6604
6603
|
const dataNames = tickValueArray.map(tick => invertedStringMap[tick]);
|
|
6605
6604
|
// string ticks should have one tick of padding at the beginning
|
|
6606
6605
|
const dataTicks = ["", ...dataNames, ""];
|
|
@@ -6637,14 +6636,14 @@ function getTickArray(props) {
|
|
|
6637
6636
|
if (tickValues && _collection__WEBPACK_IMPORTED_MODULE_5__.containsStrings(tickValues)) {
|
|
6638
6637
|
ticks = stringMap ? tickValues.map(tick => stringMap[tick]) : _helpers__WEBPACK_IMPORTED_MODULE_6__.range(1, tickValues.length + 1);
|
|
6639
6638
|
}
|
|
6640
|
-
const tickArray = ticks ?
|
|
6639
|
+
const tickArray = ticks ? lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default()(ticks) : getTicksFromFormat();
|
|
6641
6640
|
const buildTickArray = arr => {
|
|
6642
6641
|
const newTickArray = [];
|
|
6643
6642
|
const domain = props.domain && props.domain[axis] || props.domain;
|
|
6644
6643
|
if (arr) {
|
|
6645
6644
|
arr.forEach((t, index) => {
|
|
6646
6645
|
if (Array.isArray(domain)) {
|
|
6647
|
-
if (t >= _collection__WEBPACK_IMPORTED_MODULE_5__.getMinValue(domain) && t <= _collection__WEBPACK_IMPORTED_MODULE_5__.getMaxValue(domain)) {
|
|
6646
|
+
if (t >= _collection__WEBPACK_IMPORTED_MODULE_5__.getMinValue(domain).valueOf() && t <= _collection__WEBPACK_IMPORTED_MODULE_5__.getMaxValue(domain).valueOf()) {
|
|
6648
6647
|
newTickArray.push({
|
|
6649
6648
|
value: t,
|
|
6650
6649
|
index
|
|
@@ -6733,7 +6732,7 @@ function getTicks(props, scale, filterZero) {
|
|
|
6733
6732
|
* @param {String} axis: either x or y
|
|
6734
6733
|
* @returns {Array} returns a domain from tickValues
|
|
6735
6734
|
*/
|
|
6736
|
-
|
|
6735
|
+
|
|
6737
6736
|
function getDomainFromData(props, axis) {
|
|
6738
6737
|
const {
|
|
6739
6738
|
polar,
|
|
@@ -6796,7 +6795,7 @@ function modifyProps(props, fallbackProps) {
|
|
|
6796
6795
|
if (role === "axis") {
|
|
6797
6796
|
return _helpers__WEBPACK_IMPORTED_MODULE_6__.modifyProps(props, fallbackProps, "axis");
|
|
6798
6797
|
}
|
|
6799
|
-
const axisTheme =
|
|
6798
|
+
const axisTheme = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, props.theme[role], props.theme.axis);
|
|
6800
6799
|
const theme = Object.assign({}, props.theme, {
|
|
6801
6800
|
axis: axisTheme
|
|
6802
6801
|
});
|
|
@@ -6900,24 +6899,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6900
6899
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
6901
6900
|
/* harmony export */ "isDataComponent": function() { return /* binding */ isDataComponent; }
|
|
6902
6901
|
/* harmony export */ });
|
|
6903
|
-
/* harmony import */ var
|
|
6904
|
-
/* harmony import */ var
|
|
6905
|
-
/* harmony import */ var
|
|
6906
|
-
/* harmony import */ var
|
|
6902
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6903
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6904
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/isEmpty */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isEmpty.js");
|
|
6905
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1__);
|
|
6907
6906
|
/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/isEqual */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isEqual.js");
|
|
6908
6907
|
/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEqual__WEBPACK_IMPORTED_MODULE_2__);
|
|
6909
|
-
/* harmony import */ var
|
|
6910
|
-
/* harmony import */ var
|
|
6911
|
-
/* harmony import */ var
|
|
6912
|
-
/* harmony import */ var
|
|
6913
|
-
/* harmony import */ var
|
|
6914
|
-
/* harmony import */ var
|
|
6915
|
-
/* harmony import */ var
|
|
6916
|
-
/* harmony import */ var
|
|
6917
|
-
/* harmony import */ var
|
|
6918
|
-
/* harmony import */ var
|
|
6919
|
-
/* harmony import */ var
|
|
6920
|
-
/* harmony import */ var
|
|
6908
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/isPlainObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isPlainObject.js");
|
|
6909
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3__);
|
|
6910
|
+
/* harmony import */ var lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash/isUndefined */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isUndefined.js");
|
|
6911
|
+
/* harmony import */ var lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4__);
|
|
6912
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash/omitBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/omitBy.js");
|
|
6913
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_omitBy__WEBPACK_IMPORTED_MODULE_5__);
|
|
6914
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash/orderBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/orderBy.js");
|
|
6915
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_orderBy__WEBPACK_IMPORTED_MODULE_6__);
|
|
6916
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash/property */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/property.js");
|
|
6917
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_7__);
|
|
6918
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniq.js");
|
|
6919
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_8__);
|
|
6921
6920
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6922
6921
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
6923
6922
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
@@ -6930,7 +6929,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6930
6929
|
|
|
6931
6930
|
|
|
6932
6931
|
|
|
6933
|
-
/* eslint-disable no-use-before-define */
|
|
6934
6932
|
|
|
6935
6933
|
|
|
6936
6934
|
|
|
@@ -6952,7 +6950,7 @@ function getLength(data) {
|
|
|
6952
6950
|
|
|
6953
6951
|
// Returns generated data for a given axis based on domain and sample from props
|
|
6954
6952
|
function generateDataArray(props, axis) {
|
|
6955
|
-
const propsDomain =
|
|
6953
|
+
const propsDomain = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default()(props.domain) ? props.domain[axis] : props.domain;
|
|
6956
6954
|
const domain = propsDomain || _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis).domain();
|
|
6957
6955
|
const samples = props.samples || 1;
|
|
6958
6956
|
const domainMax = Math.max(...domain);
|
|
@@ -6977,7 +6975,7 @@ function sortData(dataset, sortKey, sortOrder) {
|
|
|
6977
6975
|
formattedSortKey = `_${sortKey}`;
|
|
6978
6976
|
}
|
|
6979
6977
|
const order = sortOrder === "ascending" ? "asc" : "desc";
|
|
6980
|
-
return
|
|
6978
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default()(dataset, formattedSortKey, order);
|
|
6981
6979
|
}
|
|
6982
6980
|
|
|
6983
6981
|
// This method will remove data points that break certain scales. (log scale only)
|
|
@@ -7021,7 +7019,7 @@ function getEventKey(key) {
|
|
|
7021
7019
|
return () => undefined;
|
|
7022
7020
|
}
|
|
7023
7021
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
7024
|
-
return
|
|
7022
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_7___default()(key);
|
|
7025
7023
|
}
|
|
7026
7024
|
|
|
7027
7025
|
// Returns data with an eventKey prop added to each datum
|
|
@@ -7056,8 +7054,6 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
7056
7054
|
const isUnderMinY = underMin(minDomainY);
|
|
7057
7055
|
const isOverMaxX = overMax(maxDomainX);
|
|
7058
7056
|
const isOverMaxY = overMax(maxDomainY);
|
|
7059
|
-
|
|
7060
|
-
// eslint-disable-next-line complexity
|
|
7061
7057
|
return dataset.map(datum => {
|
|
7062
7058
|
let {
|
|
7063
7059
|
_x,
|
|
@@ -7082,12 +7078,12 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
7082
7078
|
if (isUnderMinY(baseline) && !isUnderMinY(value)) _y0 = minDomainY;
|
|
7083
7079
|
// baseline and value with only baseline above max, set baseline to maxDomainY
|
|
7084
7080
|
if (isOverMaxY(baseline) && !isOverMaxY(value)) _y0 = maxDomainY;
|
|
7085
|
-
return Object.assign({}, datum,
|
|
7081
|
+
return Object.assign({}, datum, lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default()({
|
|
7086
7082
|
_x,
|
|
7087
7083
|
_y,
|
|
7088
7084
|
_y0,
|
|
7089
7085
|
_y1
|
|
7090
|
-
}, (
|
|
7086
|
+
}, (lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default())));
|
|
7091
7087
|
});
|
|
7092
7088
|
}
|
|
7093
7089
|
|
|
@@ -7101,7 +7097,7 @@ function createStringMap(props, axis) {
|
|
|
7101
7097
|
const stringsFromAxes = getStringsFromAxes(props, axis);
|
|
7102
7098
|
const stringsFromCategories = getStringsFromCategories(props, axis);
|
|
7103
7099
|
const stringsFromData = getStringsFromData(props, axis);
|
|
7104
|
-
const allStrings =
|
|
7100
|
+
const allStrings = lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default()([...stringsFromAxes, ...stringsFromCategories, ...stringsFromData]);
|
|
7105
7101
|
return allStrings.length === 0 ? null : allStrings.reduce((memo, string, index) => {
|
|
7106
7102
|
memo[string] = index + 1;
|
|
7107
7103
|
return memo;
|
|
@@ -7168,7 +7164,6 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
7168
7164
|
};
|
|
7169
7165
|
}
|
|
7170
7166
|
const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
|
|
7171
|
-
// eslint-disable-line complexity
|
|
7172
7167
|
const parsedDatum = parseDatum(datum);
|
|
7173
7168
|
const fallbackValues = {
|
|
7174
7169
|
x: index,
|
|
@@ -7188,7 +7183,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
7188
7183
|
return memo;
|
|
7189
7184
|
}, {});
|
|
7190
7185
|
const formattedDatum = Object.assign({}, processedValues, parsedDatum);
|
|
7191
|
-
if (!
|
|
7186
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(formattedDatum)) {
|
|
7192
7187
|
dataArr.push(formattedDatum);
|
|
7193
7188
|
}
|
|
7194
7189
|
return dataArr;
|
|
@@ -7315,7 +7310,7 @@ function isDataComponent(component) {
|
|
|
7315
7310
|
};
|
|
7316
7311
|
let role = getRole(component);
|
|
7317
7312
|
if (role === "portal") {
|
|
7318
|
-
const children =
|
|
7313
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
7319
7314
|
role = children.length ? getRole(children[0]) : "";
|
|
7320
7315
|
}
|
|
7321
7316
|
const whitelist = ["area", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -7346,14 +7341,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7346
7341
|
/* harmony export */ "getSymmetricDomain": function() { return /* binding */ getSymmetricDomain; },
|
|
7347
7342
|
/* harmony export */ "isDomainComponent": function() { return /* binding */ isDomainComponent; }
|
|
7348
7343
|
/* harmony export */ });
|
|
7349
|
-
/* harmony import */ var
|
|
7350
|
-
/* harmony import */ var
|
|
7351
|
-
/* harmony import */ var
|
|
7352
|
-
/* harmony import */ var
|
|
7344
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7345
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7346
|
+
/* harmony import */ var lodash_isDate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/isDate */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isDate.js");
|
|
7347
|
+
/* harmony import */ var lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isDate__WEBPACK_IMPORTED_MODULE_1__);
|
|
7353
7348
|
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/isPlainObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isPlainObject.js");
|
|
7354
7349
|
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__);
|
|
7355
|
-
/* harmony import */ var
|
|
7356
|
-
/* harmony import */ var
|
|
7350
|
+
/* harmony import */ var lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/sortedUniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/sortedUniq.js");
|
|
7351
|
+
/* harmony import */ var lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3__);
|
|
7357
7352
|
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
7358
7353
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
7359
7354
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
@@ -7361,7 +7356,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7361
7356
|
|
|
7362
7357
|
|
|
7363
7358
|
|
|
7364
|
-
/* eslint-disable no-use-before-define */
|
|
7365
7359
|
|
|
7366
7360
|
|
|
7367
7361
|
|
|
@@ -7417,8 +7411,6 @@ function getExtremeFromData(dataset, axis, type) {
|
|
|
7417
7411
|
}, initialValue);
|
|
7418
7412
|
return containsDate ? new Date(result) : result;
|
|
7419
7413
|
}
|
|
7420
|
-
|
|
7421
|
-
// eslint-disable-next-line max-statements
|
|
7422
7414
|
function padDomain(domain, props, axis) {
|
|
7423
7415
|
if (!props.domainPadding) {
|
|
7424
7416
|
return domain;
|
|
@@ -7445,9 +7437,9 @@ function padDomain(domain, props, axis) {
|
|
|
7445
7437
|
max: max.valueOf() + simplePadding.right
|
|
7446
7438
|
};
|
|
7447
7439
|
const singleQuadrantDomainPadding = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.singleQuadrantDomainPadding) ? props.singleQuadrantDomainPadding[axis] : props.singleQuadrantDomainPadding;
|
|
7448
|
-
const addsQuadrants = min >= 0 && paddedDomain.min <= 0 || max <= 0 && paddedDomain.max >= 0;
|
|
7440
|
+
const addsQuadrants = min.valueOf() >= 0 && paddedDomain.min <= 0 || max.valueOf() <= 0 && paddedDomain.max >= 0;
|
|
7449
7441
|
const adjust = (val, type) => {
|
|
7450
|
-
const coerce = type === "min" && min >= 0 && val <= 0 || type === "max" && max <= 0 && val >= 0;
|
|
7442
|
+
const coerce = type === "min" && min.valueOf() >= 0 && val <= 0 || type === "max" && max.valueOf() <= 0 && val >= 0;
|
|
7451
7443
|
return coerce ? 0 : val;
|
|
7452
7444
|
};
|
|
7453
7445
|
if (addsQuadrants && singleQuadrantDomainPadding !== false) {
|
|
@@ -7670,7 +7662,7 @@ function getMaxFromProps(props, axis) {
|
|
|
7670
7662
|
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.maxDomain) && props.maxDomain[axis] !== undefined) {
|
|
7671
7663
|
return props.maxDomain[axis];
|
|
7672
7664
|
}
|
|
7673
|
-
return typeof props.maxDomain === "number" ||
|
|
7665
|
+
return typeof props.maxDomain === "number" || lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default()(props.maxDomain) ? props.maxDomain : undefined;
|
|
7674
7666
|
}
|
|
7675
7667
|
|
|
7676
7668
|
/**
|
|
@@ -7683,7 +7675,7 @@ function getMinFromProps(props, axis) {
|
|
|
7683
7675
|
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.minDomain) && props.minDomain[axis] !== undefined) {
|
|
7684
7676
|
return props.minDomain[axis];
|
|
7685
7677
|
}
|
|
7686
|
-
return typeof props.minDomain === "number" ||
|
|
7678
|
+
return typeof props.minDomain === "number" || lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default()(props.minDomain) ? props.minDomain : undefined;
|
|
7687
7679
|
}
|
|
7688
7680
|
|
|
7689
7681
|
/**
|
|
@@ -7694,7 +7686,7 @@ function getMinFromProps(props, axis) {
|
|
|
7694
7686
|
* @returns {Array} the symmetric domain
|
|
7695
7687
|
*/
|
|
7696
7688
|
function getSymmetricDomain(domain, values) {
|
|
7697
|
-
const processedData =
|
|
7689
|
+
const processedData = lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3___default()(values.sort((a, b) => a - b));
|
|
7698
7690
|
const step = processedData[1] - processedData[0];
|
|
7699
7691
|
return [domain[0], domain[1] + step];
|
|
7700
7692
|
}
|
|
@@ -7710,7 +7702,7 @@ function isDomainComponent(component) {
|
|
|
7710
7702
|
};
|
|
7711
7703
|
let role = getRole(component);
|
|
7712
7704
|
if (role === "portal") {
|
|
7713
|
-
const children =
|
|
7705
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
7714
7706
|
role = children.length ? getRole(children[0]) : "";
|
|
7715
7707
|
}
|
|
7716
7708
|
const whitelist = ["area", "axis", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -7741,20 +7733,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7741
7733
|
/* harmony export */ "getScopedEvents": function() { return /* binding */ getScopedEvents; },
|
|
7742
7734
|
/* harmony export */ "omitGlobalEvents": function() { return /* binding */ omitGlobalEvents; }
|
|
7743
7735
|
/* harmony export */ });
|
|
7744
|
-
/* harmony import */ var
|
|
7745
|
-
/* harmony import */ var
|
|
7746
|
-
/* harmony import */ var
|
|
7747
|
-
/* harmony import */ var
|
|
7748
|
-
/* harmony import */ var
|
|
7749
|
-
/* harmony import */ var
|
|
7750
|
-
/* harmony import */ var
|
|
7751
|
-
/* harmony import */ var
|
|
7736
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isEmpty */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isEmpty.js");
|
|
7737
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0__);
|
|
7738
|
+
/* harmony import */ var lodash_pickBy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/pickBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/pickBy.js");
|
|
7739
|
+
/* harmony import */ var lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_pickBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
7740
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/omitBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/omitBy.js");
|
|
7741
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_omitBy__WEBPACK_IMPORTED_MODULE_2__);
|
|
7742
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniq.js");
|
|
7743
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_3__);
|
|
7752
7744
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7753
7745
|
|
|
7754
7746
|
|
|
7755
7747
|
|
|
7756
7748
|
|
|
7757
|
-
/* eslint-disable no-use-before-define */
|
|
7758
7749
|
|
|
7759
7750
|
const GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
|
|
7760
7751
|
|
|
@@ -7802,11 +7793,10 @@ getScopedEvents) {
|
|
|
7802
7793
|
*/
|
|
7803
7794
|
const getAllEvents = () => {
|
|
7804
7795
|
// Mandatory usage: `getEvents.bind(this)`
|
|
7805
|
-
|
|
7796
|
+
|
|
7806
7797
|
if (Array.isArray(this.componentEvents)) {
|
|
7807
7798
|
return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
|
|
7808
7799
|
}
|
|
7809
|
-
/* eslint-enable no-invalid-this */
|
|
7810
7800
|
return props.events;
|
|
7811
7801
|
};
|
|
7812
7802
|
const allEvents = getAllEvents();
|
|
@@ -7826,12 +7816,12 @@ getScopedEvents) {
|
|
|
7826
7816
|
*/
|
|
7827
7817
|
// eslint-disable-next-line max-params
|
|
7828
7818
|
function getScopedEvents(events, namespace, childType, baseProps) {
|
|
7829
|
-
if (
|
|
7819
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
7830
7820
|
return {};
|
|
7831
7821
|
}
|
|
7832
7822
|
|
|
7833
7823
|
// Mandatory usage: `getScopedEvents.bind(this)`
|
|
7834
|
-
|
|
7824
|
+
|
|
7835
7825
|
const newBaseProps = baseProps || this.baseProps;
|
|
7836
7826
|
// returns the original base props or base state of a given target element
|
|
7837
7827
|
const getTargetProps = (identifier, type) => {
|
|
@@ -7840,7 +7830,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
7840
7830
|
target,
|
|
7841
7831
|
key
|
|
7842
7832
|
} = identifier;
|
|
7843
|
-
// eslint-disable-next-line no-invalid-this
|
|
7844
7833
|
const baseType = type === "props" ? newBaseProps : this.state || {};
|
|
7845
7834
|
const base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
7846
7835
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
@@ -7867,7 +7856,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
7867
7856
|
|
|
7868
7857
|
// returns the state object with mutated props applied for a single key
|
|
7869
7858
|
const getMutationObject = (key, childName) => {
|
|
7870
|
-
// eslint-disable-next-line no-invalid-this
|
|
7871
7859
|
const baseState = this.state || {};
|
|
7872
7860
|
if (!(0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(eventReturn.mutation)) {
|
|
7873
7861
|
return baseState;
|
|
@@ -7940,11 +7928,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
7940
7928
|
// into a state mutation, and calls setState
|
|
7941
7929
|
// eslint-disable-next-line max-params
|
|
7942
7930
|
const onEvent = (evt, childProps, eventKey, eventName) => {
|
|
7943
|
-
// eslint-disable-next-line no-invalid-this
|
|
7944
7931
|
const eventReturn = events[eventName](evt, childProps, eventKey, this);
|
|
7945
|
-
if (!
|
|
7932
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(eventReturn)) {
|
|
7946
7933
|
const callbacks = compileCallbacks(eventReturn);
|
|
7947
|
-
// eslint-disable-next-line no-invalid-this
|
|
7948
7934
|
this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
|
|
7949
7935
|
}
|
|
7950
7936
|
};
|
|
@@ -7974,7 +7960,7 @@ function getPartialEvents(events, eventKey, childProps) {
|
|
|
7974
7960
|
// eslint-disable-next-line max-params
|
|
7975
7961
|
function getEventState(eventKey, namespace, childType) {
|
|
7976
7962
|
// Mandatory usage: `getEventState.bind(this)`
|
|
7977
|
-
|
|
7963
|
+
|
|
7978
7964
|
const state = this.state || {};
|
|
7979
7965
|
if (!childType) {
|
|
7980
7966
|
return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
|
|
@@ -8004,7 +7990,7 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
8004
7990
|
const childState = baseState[childName];
|
|
8005
7991
|
const mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
8006
7992
|
memo[childName] = mutation ? mutation : childState;
|
|
8007
|
-
return
|
|
7993
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
8008
7994
|
}, {});
|
|
8009
7995
|
}
|
|
8010
7996
|
|
|
@@ -8040,7 +8026,7 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
8040
8026
|
} else {
|
|
8041
8027
|
// use keys from both state and props so that elements not intially included in baseProps
|
|
8042
8028
|
// will be used. (i.e. labels)
|
|
8043
|
-
const targets =
|
|
8029
|
+
const targets = lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default()(Object.keys(keyProps).concat(Object.keys(keyState)));
|
|
8044
8030
|
memo[eventKey] = targets.reduce((m, target) => {
|
|
8045
8031
|
const identifier = {
|
|
8046
8032
|
eventKey,
|
|
@@ -8049,10 +8035,10 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
8049
8035
|
};
|
|
8050
8036
|
const mutation = getExternalMutation(mutations, keyProps[target], keyState[target], identifier);
|
|
8051
8037
|
m[target] = mutation !== undefined ? Object.assign({}, keyState[target], mutation) : keyState[target];
|
|
8052
|
-
return
|
|
8038
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(m, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
8053
8039
|
}, {});
|
|
8054
8040
|
}
|
|
8055
|
-
return
|
|
8041
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
8056
8042
|
}, {});
|
|
8057
8043
|
}
|
|
8058
8044
|
|
|
@@ -8084,11 +8070,11 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
8084
8070
|
}
|
|
8085
8071
|
// find any mutation objects that match the target
|
|
8086
8072
|
const targetMutations = scopedMutations.filter(m => filterMutations(m, "target"));
|
|
8087
|
-
if (
|
|
8073
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(targetMutations)) {
|
|
8088
8074
|
return undefined;
|
|
8089
8075
|
}
|
|
8090
8076
|
const keyMutations = targetMutations.filter(m => filterMutations(m, "eventKey"));
|
|
8091
|
-
if (
|
|
8077
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(keyMutations)) {
|
|
8092
8078
|
return undefined;
|
|
8093
8079
|
}
|
|
8094
8080
|
return keyMutations.reduce((memo, curr) => {
|
|
@@ -8114,8 +8100,8 @@ function getGlobalEventNameFromKey(key) {
|
|
|
8114
8100
|
const match = key.match(GLOBAL_EVENT_REGEX);
|
|
8115
8101
|
return match && match[1] && match[1].toLowerCase();
|
|
8116
8102
|
}
|
|
8117
|
-
const getGlobalEvents = events =>
|
|
8118
|
-
const omitGlobalEvents = events =>
|
|
8103
|
+
const getGlobalEvents = events => lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(events, (_, key) => GLOBAL_EVENT_REGEX.test(key));
|
|
8104
|
+
const omitGlobalEvents = events => lodash_omitBy__WEBPACK_IMPORTED_MODULE_2___default()(events, (_, key) => GLOBAL_EVENT_REGEX.test(key));
|
|
8119
8105
|
const emulateReactEvent = event => Object.assign(event, {
|
|
8120
8106
|
nativeEvent: event
|
|
8121
8107
|
});
|
|
@@ -8156,41 +8142,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8156
8142
|
/* harmony export */ "reduceChildren": function() { return /* binding */ reduceChildren; },
|
|
8157
8143
|
/* harmony export */ "scalePoint": function() { return /* binding */ scalePoint; }
|
|
8158
8144
|
/* harmony export */ });
|
|
8159
|
-
/* harmony import */ var
|
|
8160
|
-
/* harmony import */ var
|
|
8161
|
-
/* harmony import */ var
|
|
8162
|
-
/* harmony import */ var
|
|
8163
|
-
/* harmony import */ var
|
|
8164
|
-
/* harmony import */ var
|
|
8165
|
-
/* harmony import */ var
|
|
8166
|
-
/* harmony import */ var
|
|
8167
|
-
|
|
8145
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8146
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8147
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
8148
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
8149
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/property */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/property.js");
|
|
8150
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_2__);
|
|
8151
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/pick */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/pick.js");
|
|
8152
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
|
8168
8153
|
|
|
8169
8154
|
|
|
8170
|
-
/* eslint-disable no-use-before-define */
|
|
8171
8155
|
|
|
8172
|
-
// Private Functions
|
|
8173
8156
|
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8157
|
+
/**
|
|
8158
|
+
* Determine the range of a cartesian axis
|
|
8159
|
+
*/
|
|
8160
|
+
function getCartesianRange(options) {
|
|
8161
|
+
const vertical = options.axis !== "x";
|
|
8178
8162
|
if (vertical) {
|
|
8179
|
-
return [
|
|
8163
|
+
return [options.height - options.padding.bottom, options.padding.top];
|
|
8180
8164
|
}
|
|
8181
|
-
return [padding.left,
|
|
8165
|
+
return [options.padding.left, options.width - options.padding.right];
|
|
8182
8166
|
}
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8167
|
+
|
|
8168
|
+
/**
|
|
8169
|
+
* Determine the range of a polar axis in radians
|
|
8170
|
+
*/
|
|
8171
|
+
function getPolarRange(options) {
|
|
8172
|
+
if (options.axis === "x") {
|
|
8173
|
+
const startAngle = degreesToRadians(options.startAngle || 0);
|
|
8174
|
+
const endAngle = degreesToRadians(options.endAngle || 360);
|
|
8187
8175
|
return [startAngle, endAngle];
|
|
8188
8176
|
}
|
|
8189
|
-
return [
|
|
8177
|
+
return [options.innerRadius || 0, getRadius({
|
|
8178
|
+
height: options.height,
|
|
8179
|
+
width: options.width,
|
|
8180
|
+
padding: options.padding
|
|
8181
|
+
})];
|
|
8190
8182
|
}
|
|
8191
8183
|
|
|
8192
|
-
// Exported Functions
|
|
8193
|
-
|
|
8194
8184
|
/**
|
|
8195
8185
|
* Creates an object composed of the inverted keys and values of object.
|
|
8196
8186
|
* If object contains duplicate values, subsequent values overwrite property assignments of previous values.
|
|
@@ -8227,8 +8217,11 @@ function omit(originalObject, ks) {
|
|
|
8227
8217
|
}
|
|
8228
8218
|
return newObject;
|
|
8229
8219
|
}
|
|
8220
|
+
|
|
8221
|
+
/**
|
|
8222
|
+
* Coalesce the x and y values from a data point
|
|
8223
|
+
*/
|
|
8230
8224
|
function getPoint(datum) {
|
|
8231
|
-
const exists = val => val !== undefined;
|
|
8232
8225
|
const {
|
|
8233
8226
|
_x,
|
|
8234
8227
|
_x1,
|
|
@@ -8239,16 +8232,20 @@ function getPoint(datum) {
|
|
|
8239
8232
|
_y0,
|
|
8240
8233
|
_voronoiY
|
|
8241
8234
|
} = datum;
|
|
8242
|
-
const defaultX =
|
|
8243
|
-
const defaultY =
|
|
8235
|
+
const defaultX = _x1 ?? _x;
|
|
8236
|
+
const defaultY = _y1 ?? _y;
|
|
8244
8237
|
const point = {
|
|
8245
|
-
x:
|
|
8246
|
-
x0:
|
|
8247
|
-
y:
|
|
8248
|
-
y0:
|
|
8238
|
+
x: _voronoiX ?? defaultX,
|
|
8239
|
+
x0: _x0 ?? _x,
|
|
8240
|
+
y: _voronoiY ?? defaultY,
|
|
8241
|
+
y0: _y0 ?? _y
|
|
8249
8242
|
};
|
|
8250
|
-
return
|
|
8243
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, point, datum);
|
|
8251
8244
|
}
|
|
8245
|
+
|
|
8246
|
+
/**
|
|
8247
|
+
* Scale a point based on the origin, direction, and given scale function
|
|
8248
|
+
*/
|
|
8252
8249
|
function scalePoint(props, datum) {
|
|
8253
8250
|
const {
|
|
8254
8251
|
scale,
|
|
@@ -8271,11 +8268,11 @@ function scalePoint(props, datum) {
|
|
|
8271
8268
|
y0: polar ? -y0 * Math.sin(x0) + origin.x : y0
|
|
8272
8269
|
};
|
|
8273
8270
|
}
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8271
|
+
|
|
8272
|
+
/**
|
|
8273
|
+
* Returns a padding value from a number or partial padding values
|
|
8274
|
+
*/
|
|
8275
|
+
function getPadding(padding) {
|
|
8279
8276
|
const paddingVal = typeof padding === "number" ? padding : 0;
|
|
8280
8277
|
const paddingObj = typeof padding === "object" ? padding : {};
|
|
8281
8278
|
return {
|
|
@@ -8285,6 +8282,10 @@ function getPadding(props, name) {
|
|
|
8285
8282
|
right: paddingObj.right || paddingVal
|
|
8286
8283
|
};
|
|
8287
8284
|
}
|
|
8285
|
+
|
|
8286
|
+
/**
|
|
8287
|
+
* Returns true if the component is defined as a tooltip
|
|
8288
|
+
*/
|
|
8288
8289
|
function isTooltip(component) {
|
|
8289
8290
|
const labelRole = component && component.type && component.type.role;
|
|
8290
8291
|
return labelRole === "tooltip";
|
|
@@ -8299,8 +8300,8 @@ function getDefaultStyles(props, role) {
|
|
|
8299
8300
|
return defaultStyles;
|
|
8300
8301
|
}
|
|
8301
8302
|
const tooltipStyle = theme.tooltip && theme.tooltip.style || {};
|
|
8302
|
-
const labelStyle =
|
|
8303
|
-
return
|
|
8303
|
+
const labelStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, tooltipStyle, defaultStyles.labels);
|
|
8304
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, {
|
|
8304
8305
|
labels: labelStyle
|
|
8305
8306
|
}, defaultStyles);
|
|
8306
8307
|
}
|
|
@@ -8308,7 +8309,7 @@ function getStyles(style, defaultStyles) {
|
|
|
8308
8309
|
const width = "100%";
|
|
8309
8310
|
const height = "100%";
|
|
8310
8311
|
if (!style) {
|
|
8311
|
-
return
|
|
8312
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8312
8313
|
parent: {
|
|
8313
8314
|
height,
|
|
8314
8315
|
width
|
|
@@ -8324,14 +8325,18 @@ function getStyles(style, defaultStyles) {
|
|
|
8324
8325
|
const defaultLabels = defaultStyles && defaultStyles.labels || {};
|
|
8325
8326
|
const defaultData = defaultStyles && defaultStyles.data || {};
|
|
8326
8327
|
return {
|
|
8327
|
-
parent:
|
|
8328
|
+
parent: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parent, defaultParent, {
|
|
8328
8329
|
width,
|
|
8329
8330
|
height
|
|
8330
8331
|
}),
|
|
8331
|
-
labels:
|
|
8332
|
-
data:
|
|
8332
|
+
labels: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labels, defaultLabels),
|
|
8333
|
+
data: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, data, defaultData)
|
|
8333
8334
|
};
|
|
8334
8335
|
}
|
|
8336
|
+
|
|
8337
|
+
/**
|
|
8338
|
+
* Returns the value of a prop or accessor function with the given props
|
|
8339
|
+
*/
|
|
8335
8340
|
function evaluateProp(prop, props) {
|
|
8336
8341
|
return isFunction(prop) ? prop(props) : prop;
|
|
8337
8342
|
}
|
|
@@ -8353,19 +8358,28 @@ function degreesToRadians(degrees) {
|
|
|
8353
8358
|
function radiansToDegrees(radians) {
|
|
8354
8359
|
return typeof radians === "number" ? radians / (Math.PI / 180) : radians;
|
|
8355
8360
|
}
|
|
8356
|
-
|
|
8361
|
+
|
|
8362
|
+
/**
|
|
8363
|
+
* Get the maximum radius that will fit in the container
|
|
8364
|
+
*/
|
|
8365
|
+
function getRadius(options) {
|
|
8366
|
+
const {
|
|
8367
|
+
width,
|
|
8368
|
+
height,
|
|
8369
|
+
padding
|
|
8370
|
+
} = options;
|
|
8357
8371
|
const {
|
|
8358
8372
|
left,
|
|
8359
8373
|
right,
|
|
8360
8374
|
top,
|
|
8361
8375
|
bottom
|
|
8362
|
-
} =
|
|
8363
|
-
const {
|
|
8364
|
-
width,
|
|
8365
|
-
height
|
|
8366
|
-
} = props;
|
|
8376
|
+
} = padding;
|
|
8367
8377
|
return Math.min(width - left - right, height - top - bottom) / 2;
|
|
8368
8378
|
}
|
|
8379
|
+
|
|
8380
|
+
/**
|
|
8381
|
+
* Returns the origin for a polar chart within the padded area
|
|
8382
|
+
*/
|
|
8369
8383
|
function getPolarOrigin(props) {
|
|
8370
8384
|
const {
|
|
8371
8385
|
width,
|
|
@@ -8376,7 +8390,7 @@ function getPolarOrigin(props) {
|
|
|
8376
8390
|
bottom,
|
|
8377
8391
|
left,
|
|
8378
8392
|
right
|
|
8379
|
-
} = getPadding(props);
|
|
8393
|
+
} = getPadding(props.padding);
|
|
8380
8394
|
const radius = Math.min(width - left - right, height - top - bottom) / 2;
|
|
8381
8395
|
const offsetWidth = width / 2 + left - right;
|
|
8382
8396
|
const offsetHeight = height / 2 + top - bottom;
|
|
@@ -8385,13 +8399,30 @@ function getPolarOrigin(props) {
|
|
|
8385
8399
|
y: offsetHeight + radius > height ? radius + top - bottom : offsetHeight
|
|
8386
8400
|
};
|
|
8387
8401
|
}
|
|
8402
|
+
|
|
8403
|
+
/**
|
|
8404
|
+
* Determine the range of an axis based on the given props
|
|
8405
|
+
*/
|
|
8388
8406
|
function getRange(props, axis) {
|
|
8389
8407
|
if (props.range && props.range[axis]) {
|
|
8390
8408
|
return props.range[axis];
|
|
8391
8409
|
} else if (props.range && Array.isArray(props.range)) {
|
|
8392
8410
|
return props.range;
|
|
8393
8411
|
}
|
|
8394
|
-
return props.polar ? getPolarRange(
|
|
8412
|
+
return props.polar ? getPolarRange({
|
|
8413
|
+
axis,
|
|
8414
|
+
innerRadius: props.innerRadius,
|
|
8415
|
+
startAngle: props.startAngle,
|
|
8416
|
+
endAngle: props.endAngle,
|
|
8417
|
+
height: props.height,
|
|
8418
|
+
width: props.width,
|
|
8419
|
+
padding: getPadding(props.padding)
|
|
8420
|
+
}) : getCartesianRange({
|
|
8421
|
+
axis,
|
|
8422
|
+
height: props.height,
|
|
8423
|
+
width: props.width,
|
|
8424
|
+
padding: getPadding(props.padding)
|
|
8425
|
+
});
|
|
8395
8426
|
}
|
|
8396
8427
|
|
|
8397
8428
|
/**
|
|
@@ -8423,7 +8454,7 @@ function createAccessor(key) {
|
|
|
8423
8454
|
return x => x;
|
|
8424
8455
|
}
|
|
8425
8456
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
8426
|
-
return
|
|
8457
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_2___default()(key);
|
|
8427
8458
|
}
|
|
8428
8459
|
function modifyProps(props, fallbackProps, role) {
|
|
8429
8460
|
const theme = props.theme && props.theme[role] ? props.theme[role] : {};
|
|
@@ -8432,7 +8463,7 @@ function modifyProps(props, fallbackProps, role) {
|
|
|
8432
8463
|
const defaultObject = horizontal === undefined ? {} : {
|
|
8433
8464
|
horizontal
|
|
8434
8465
|
};
|
|
8435
|
-
return
|
|
8466
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(defaultObject, props, themeProps, fallbackProps);
|
|
8436
8467
|
}
|
|
8437
8468
|
|
|
8438
8469
|
/**
|
|
@@ -8519,10 +8550,10 @@ initialMemo, combine) {
|
|
|
8519
8550
|
const childRole = child.type && child.type.role;
|
|
8520
8551
|
const childName = child.props.name || `${childRole}-${names[index]}`;
|
|
8521
8552
|
if (child.props && child.props.children) {
|
|
8522
|
-
const childProps = Object.assign({}, child.props,
|
|
8523
|
-
const nestedChildren = child.type && child.type.role === "stack" && isFunction(child.type.getChildren) ? child.type.getChildren(childProps) :
|
|
8524
|
-
const nestedChildProps = Object.assign({}, c.props,
|
|
8525
|
-
return /*#__PURE__*/
|
|
8553
|
+
const childProps = Object.assign({}, child.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(parentProps, sharedProps));
|
|
8554
|
+
const nestedChildren = child.type && child.type.role === "stack" && isFunction(child.type.getChildren) ? child.type.getChildren(childProps) : react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children).map(c => {
|
|
8555
|
+
const nestedChildProps = Object.assign({}, c.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(childProps, sharedProps));
|
|
8556
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(c, nestedChildProps);
|
|
8526
8557
|
});
|
|
8527
8558
|
const childNames = nestedChildren.map((c, i) => `${childName}-${i}`);
|
|
8528
8559
|
const nestedResults = traverseChildren(nestedChildren, childNames, child);
|
|
@@ -8536,7 +8567,7 @@ initialMemo, combine) {
|
|
|
8536
8567
|
return newMemo;
|
|
8537
8568
|
}, initialMemo);
|
|
8538
8569
|
};
|
|
8539
|
-
const validChildren = children.filter(
|
|
8570
|
+
const validChildren = children.filter(react__WEBPACK_IMPORTED_MODULE_0__.isValidElement);
|
|
8540
8571
|
const childNames = validChildren.map((c, i) => i);
|
|
8541
8572
|
return traverseChildren(validChildren, childNames);
|
|
8542
8573
|
}
|
|
@@ -8556,10 +8587,10 @@ function isHorizontal(props) {
|
|
|
8556
8587
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
8557
8588
|
return memo || childProps.horizontal;
|
|
8558
8589
|
}
|
|
8559
|
-
return traverseChildren(
|
|
8590
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(childProps.children));
|
|
8560
8591
|
}, false);
|
|
8561
8592
|
};
|
|
8562
|
-
return traverseChildren(
|
|
8593
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children));
|
|
8563
8594
|
}
|
|
8564
8595
|
|
|
8565
8596
|
/***/ }),
|
|
@@ -8575,10 +8606,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8575
8606
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8576
8607
|
/* harmony export */ "useAnimationState": function() { return /* binding */ useAnimationState; }
|
|
8577
8608
|
/* harmony export */ });
|
|
8578
|
-
/* harmony import */ var
|
|
8579
|
-
/* harmony import */ var
|
|
8580
|
-
/* harmony import */ var
|
|
8581
|
-
/* harmony import */ var
|
|
8609
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8610
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8611
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
8612
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
8582
8613
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../collection */ "../../victory-core/es/victory-util/collection.js");
|
|
8583
8614
|
/* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../transitions */ "../../victory-core/es/victory-util/transitions.js");
|
|
8584
8615
|
|
|
@@ -8594,10 +8625,10 @@ const useAnimationState = function (initialState) {
|
|
|
8594
8625
|
if (initialState === void 0) {
|
|
8595
8626
|
initialState = INITIAL_STATE;
|
|
8596
8627
|
}
|
|
8597
|
-
const [state, _setState] =
|
|
8628
|
+
const [state, _setState] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(initialState);
|
|
8598
8629
|
|
|
8599
8630
|
// This allows us to use a state object and maintain the same API as this.setState
|
|
8600
|
-
const setState =
|
|
8631
|
+
const setState = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback(newState => {
|
|
8601
8632
|
_setState(oldState => ({
|
|
8602
8633
|
...oldState,
|
|
8603
8634
|
...newState
|
|
@@ -8605,14 +8636,14 @@ const useAnimationState = function (initialState) {
|
|
|
8605
8636
|
}, [_setState]);
|
|
8606
8637
|
|
|
8607
8638
|
// This is a copy of Wrapper.getAnimationProps
|
|
8608
|
-
const getAnimationProps =
|
|
8639
|
+
const getAnimationProps = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback((props, child, index) => {
|
|
8609
8640
|
if (!props?.animate) {
|
|
8610
8641
|
return child.props.animate;
|
|
8611
8642
|
}
|
|
8612
8643
|
const getFilteredState = () => {
|
|
8613
8644
|
let childrenTransitions = state && state.childrenTransitions;
|
|
8614
8645
|
childrenTransitions = _collection__WEBPACK_IMPORTED_MODULE_2__.isArrayOfArrays(childrenTransitions) ? childrenTransitions[index] : childrenTransitions;
|
|
8615
|
-
return
|
|
8646
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8616
8647
|
childrenTransitions
|
|
8617
8648
|
}, state);
|
|
8618
8649
|
};
|
|
@@ -8623,28 +8654,28 @@ const useAnimationState = function (initialState) {
|
|
|
8623
8654
|
const getTransitionProps = _transitions__WEBPACK_IMPORTED_MODULE_3__.getTransitionPropsFactory(props, filteredState, newState => setState(newState));
|
|
8624
8655
|
getTransitions = childComponent => getTransitionProps(childComponent, index);
|
|
8625
8656
|
}
|
|
8626
|
-
return
|
|
8657
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8627
8658
|
getTransitions,
|
|
8628
8659
|
parentState
|
|
8629
8660
|
}, props.animate, child.props.animate);
|
|
8630
8661
|
}, [state, setState]);
|
|
8631
8662
|
|
|
8632
8663
|
// This is a copy of Wrapper.setAnimationState
|
|
8633
|
-
const setAnimationState =
|
|
8664
|
+
const setAnimationState = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback((props, nextProps) => {
|
|
8634
8665
|
if (!props?.animate) {
|
|
8635
8666
|
return;
|
|
8636
8667
|
}
|
|
8637
8668
|
if (props.animate.parentState) {
|
|
8638
8669
|
const nodesWillExit = props.animate.parentState.nodesWillExit;
|
|
8639
8670
|
const oldProps = nodesWillExit ? props : null;
|
|
8640
|
-
const newState =
|
|
8671
|
+
const newState = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8641
8672
|
oldProps,
|
|
8642
8673
|
nextProps
|
|
8643
8674
|
}, props.animate.parentState);
|
|
8644
8675
|
setState(newState);
|
|
8645
8676
|
} else {
|
|
8646
|
-
const oldChildren =
|
|
8647
|
-
const nextChildren =
|
|
8677
|
+
const oldChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
8678
|
+
const nextChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(nextProps.children);
|
|
8648
8679
|
const isContinuous = child => {
|
|
8649
8680
|
const check = c => c.type && c.type.continuous;
|
|
8650
8681
|
return Array.isArray(child) ? child.some(check) : check(child);
|
|
@@ -8669,7 +8700,7 @@ const useAnimationState = function (initialState) {
|
|
|
8669
8700
|
});
|
|
8670
8701
|
}
|
|
8671
8702
|
}, [setState]);
|
|
8672
|
-
const getProps =
|
|
8703
|
+
const getProps = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback(initialProps => {
|
|
8673
8704
|
return state && state.nodesWillExit ? state.oldProps || initialProps : initialProps;
|
|
8674
8705
|
}, [state]);
|
|
8675
8706
|
return {
|
|
@@ -8770,11 +8801,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8770
8801
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8771
8802
|
/* harmony export */ "warn": function() { return /* binding */ warn; }
|
|
8772
8803
|
/* harmony export */ });
|
|
8773
|
-
/* global console */
|
|
8804
|
+
/* global console process */
|
|
8774
8805
|
/* eslint-disable no-console */
|
|
8775
8806
|
|
|
8776
|
-
// TODO: Use "warning" npm module like React is switching to.
|
|
8777
8807
|
function warn(message) {
|
|
8808
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8809
|
+
// @ts-ignore - Webpack DefinePlugin will replace process.env.NODE_ENV
|
|
8778
8810
|
if (true) {
|
|
8779
8811
|
if (console && console.warn) {
|
|
8780
8812
|
console.warn(message);
|
|
@@ -8845,7 +8877,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8845
8877
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
8846
8878
|
/* harmony import */ var victory_vendor_d3_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-vendor/d3-scale */ "../../victory-vendor/es/d3-scale.js");
|
|
8847
8879
|
|
|
8848
|
-
/* eslint-disable no-use-before-define */
|
|
8849
8880
|
|
|
8850
8881
|
|
|
8851
8882
|
|
|
@@ -9159,12 +9190,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9159
9190
|
/* harmony export */ "getInitialTransitionState": function() { return /* binding */ getInitialTransitionState; },
|
|
9160
9191
|
/* harmony export */ "getTransitionPropsFactory": function() { return /* binding */ getTransitionPropsFactory; }
|
|
9161
9192
|
/* harmony export */ });
|
|
9162
|
-
/* harmony import */ var
|
|
9163
|
-
/* harmony import */ var
|
|
9193
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
9194
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
9164
9195
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
9165
9196
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
9166
|
-
/* harmony import */ var
|
|
9167
|
-
/* harmony import */ var
|
|
9197
|
+
/* harmony import */ var lodash_identity__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/identity */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/identity.js");
|
|
9198
|
+
/* harmony import */ var lodash_identity__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_identity__WEBPACK_IMPORTED_MODULE_2__);
|
|
9168
9199
|
|
|
9169
9200
|
|
|
9170
9201
|
|
|
@@ -9255,13 +9286,13 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
9255
9286
|
const getTransitionsFromChildren = (old, next) => {
|
|
9256
9287
|
return old.map((child, idx) => {
|
|
9257
9288
|
if (child && child.props && child.props.children && next[idx]) {
|
|
9258
|
-
return getTransitionsFromChildren(
|
|
9289
|
+
return getTransitionsFromChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(old[idx].props.children), react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(next[idx].props.children));
|
|
9259
9290
|
}
|
|
9260
9291
|
// get Transition entering and exiting nodes
|
|
9261
9292
|
return getTransition(child, next[idx]);
|
|
9262
9293
|
});
|
|
9263
9294
|
};
|
|
9264
|
-
const childrenTransitions = getTransitionsFromChildren(
|
|
9295
|
+
const childrenTransitions = getTransitionsFromChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(oldChildren), react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(nextChildren));
|
|
9265
9296
|
return {
|
|
9266
9297
|
nodesWillExit,
|
|
9267
9298
|
nodesWillEnter,
|
|
@@ -9275,7 +9306,7 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
9275
9306
|
};
|
|
9276
9307
|
}
|
|
9277
9308
|
function getInitialChildProps(animate, data) {
|
|
9278
|
-
const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (
|
|
9309
|
+
const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
9279
9310
|
return {
|
|
9280
9311
|
data: data.map((datum, idx) => Object.assign({}, datum, after(datum, idx, data)))
|
|
9281
9312
|
};
|
|
@@ -9292,7 +9323,7 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
9292
9323
|
data
|
|
9293
9324
|
};
|
|
9294
9325
|
}
|
|
9295
|
-
const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (
|
|
9326
|
+
const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
9296
9327
|
// If nodes need to exit, transform them with the provided onLoad.before function.
|
|
9297
9328
|
const newData = data.map((datum, idx) => {
|
|
9298
9329
|
return Object.assign({}, datum, before(datum, idx, data));
|
|
@@ -9303,8 +9334,6 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
9303
9334
|
clipWidth: 0
|
|
9304
9335
|
};
|
|
9305
9336
|
}
|
|
9306
|
-
|
|
9307
|
-
// eslint-disable-next-line max-params
|
|
9308
9337
|
function getChildOnLoad(animate, data, cb) {
|
|
9309
9338
|
const newAnimate = Object.assign({}, animate, {
|
|
9310
9339
|
onEnd: cb
|
|
@@ -9316,7 +9345,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
9316
9345
|
data
|
|
9317
9346
|
};
|
|
9318
9347
|
}
|
|
9319
|
-
const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (
|
|
9348
|
+
const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
9320
9349
|
// If nodes need to exit, transform them with the provided onLoad.after function.
|
|
9321
9350
|
newData = data.map((datum, idx) => {
|
|
9322
9351
|
return Object.assign({}, datum, after(datum, idx, data));
|
|
@@ -9327,7 +9356,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
9327
9356
|
};
|
|
9328
9357
|
}
|
|
9329
9358
|
|
|
9330
|
-
// eslint-disable-next-line max-params
|
|
9359
|
+
// eslint-disable-next-line max-params
|
|
9331
9360
|
function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
9332
9361
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
9333
9362
|
// transition for all children to have the same duration, delay, etc.
|
|
@@ -9338,7 +9367,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
9338
9367
|
// After the exit transition occurs, trigger the animations for
|
|
9339
9368
|
// nodes that are neither exiting nor entering.
|
|
9340
9369
|
animate.onEnd = cb;
|
|
9341
|
-
const before = animate.onExit && animate.onExit.before ? animate.onExit.before : (
|
|
9370
|
+
const before = animate.onExit && animate.onExit.before ? animate.onExit.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
9342
9371
|
// If nodes need to exit, transform them with the provided onExit.before function.
|
|
9343
9372
|
newData = data.map((datum, idx) => {
|
|
9344
9373
|
const key = (datum.key || idx).toString();
|
|
@@ -9351,7 +9380,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
9351
9380
|
};
|
|
9352
9381
|
}
|
|
9353
9382
|
|
|
9354
|
-
// eslint-disable-next-line max-params
|
|
9383
|
+
// eslint-disable-next-line max-params
|
|
9355
9384
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
9356
9385
|
let newAnimate = animate;
|
|
9357
9386
|
let newData = data;
|
|
@@ -9361,7 +9390,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
9361
9390
|
newAnimate = Object.assign({}, animate, {
|
|
9362
9391
|
onEnd: cb
|
|
9363
9392
|
});
|
|
9364
|
-
const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (
|
|
9393
|
+
const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
9365
9394
|
// We want the entering nodes to be included in the transition target
|
|
9366
9395
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
9367
9396
|
// so perform the `onEnter.before` transformation on each node.
|
|
@@ -9376,7 +9405,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
9376
9405
|
};
|
|
9377
9406
|
}
|
|
9378
9407
|
|
|
9379
|
-
// eslint-disable-next-line max-params
|
|
9408
|
+
// eslint-disable-next-line max-params
|
|
9380
9409
|
function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
9381
9410
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
9382
9411
|
// transition for all children to have the same duration, delay, etc.
|
|
@@ -9388,7 +9417,7 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
9388
9417
|
// domain should encompass the nodes that will now enter. So perform
|
|
9389
9418
|
// the `onEnter.after` transformation on each node.
|
|
9390
9419
|
newAnimate.onEnd = cb;
|
|
9391
|
-
const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (
|
|
9420
|
+
const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
9392
9421
|
newData = data.map((datum, idx) => {
|
|
9393
9422
|
const key = getDatumKey(datum, idx);
|
|
9394
9423
|
return enteringNodes[key] ? Object.assign({}, datum, after(datum, idx, data)) : datum;
|
|
@@ -9483,8 +9512,6 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
9483
9512
|
}
|
|
9484
9513
|
return {};
|
|
9485
9514
|
};
|
|
9486
|
-
|
|
9487
|
-
// eslint-disable-next-line max-statements, complexity, max-len
|
|
9488
9515
|
return function getTransitionProps(child, index) {
|
|
9489
9516
|
const data = getChildData(child) || [];
|
|
9490
9517
|
const animate = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, props.animate, child.props.animate);
|
|
@@ -9682,16 +9709,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9682
9709
|
/* harmony export */ "getStyle": function() { return /* binding */ getStyle; },
|
|
9683
9710
|
/* harmony export */ "getWidth": function() { return /* binding */ getWidth; }
|
|
9684
9711
|
/* harmony export */ });
|
|
9685
|
-
/* harmony import */ var
|
|
9686
|
-
/* harmony import */ var
|
|
9687
|
-
/* harmony import */ var
|
|
9688
|
-
/* harmony import */ var
|
|
9712
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
9713
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
9714
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
9715
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
9689
9716
|
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/uniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniq.js");
|
|
9690
9717
|
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_2__);
|
|
9691
|
-
/* harmony import */ var
|
|
9692
|
-
/* harmony import */ var
|
|
9693
|
-
/* harmony import */ var
|
|
9694
|
-
/* harmony import */ var
|
|
9718
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/groupBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/groupBy.js");
|
|
9719
|
+
/* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_3__);
|
|
9720
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash/uniqBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqBy.js");
|
|
9721
|
+
/* harmony import */ var lodash_uniqBy__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_4__);
|
|
9695
9722
|
/* harmony import */ var _axis__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./axis */ "../../victory-core/es/victory-util/axis.js");
|
|
9696
9723
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./style */ "../../victory-core/es/victory-util/style.js");
|
|
9697
9724
|
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
@@ -9785,7 +9812,7 @@ function getDataFromChildren(props, childComponents) {
|
|
|
9785
9812
|
maxDomain
|
|
9786
9813
|
};
|
|
9787
9814
|
let stack = 0;
|
|
9788
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
9815
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
9789
9816
|
parentProps = addBinsToParentPropsIfHistogram({
|
|
9790
9817
|
children,
|
|
9791
9818
|
props,
|
|
@@ -9799,7 +9826,7 @@ function getDataFromChildren(props, childComponents) {
|
|
|
9799
9826
|
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
9800
9827
|
return null;
|
|
9801
9828
|
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
9802
|
-
childElement = parent ? /*#__PURE__*/
|
|
9829
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, parent.props) : child;
|
|
9803
9830
|
childData = childElement.type.getData(childProps);
|
|
9804
9831
|
} else {
|
|
9805
9832
|
childData = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
@@ -9811,16 +9838,16 @@ function getDataFromChildren(props, childComponents) {
|
|
|
9811
9838
|
}, datum));
|
|
9812
9839
|
};
|
|
9813
9840
|
const stacked = children.filter(c => c.type && c.type.role === "stack").length;
|
|
9814
|
-
const combine = (memo, val) => memo.concat(
|
|
9841
|
+
const combine = (memo, val) => memo.concat(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_4___default()(val, "_group"));
|
|
9815
9842
|
const datasets = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props, [], combine);
|
|
9816
9843
|
const group = stacked ? "_group" : "_stack";
|
|
9817
|
-
return Object.values(
|
|
9844
|
+
return Object.values(lodash_groupBy__WEBPACK_IMPORTED_MODULE_3___default()(datasets, group));
|
|
9818
9845
|
}
|
|
9819
9846
|
function getData(props, childComponents) {
|
|
9820
9847
|
if (props.data) {
|
|
9821
9848
|
return _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
9822
9849
|
}
|
|
9823
|
-
return getDataFromChildren(props, childComponents ||
|
|
9850
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children));
|
|
9824
9851
|
}
|
|
9825
9852
|
function getWidth(props, groupLength, seriesLength) {
|
|
9826
9853
|
const {
|
|
@@ -9872,8 +9899,7 @@ function getDefaultDomainPadding(props, axis, childComponents) {
|
|
|
9872
9899
|
};
|
|
9873
9900
|
}
|
|
9874
9901
|
function getDomainFromChildren(props, axis, childComponents) {
|
|
9875
|
-
|
|
9876
|
-
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_4___default().Children.toArray(props.children);
|
|
9902
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
9877
9903
|
const parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_7__.getData(props) : undefined;
|
|
9878
9904
|
const {
|
|
9879
9905
|
polar,
|
|
@@ -9911,7 +9937,7 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
9911
9937
|
return [min, max];
|
|
9912
9938
|
}
|
|
9913
9939
|
function getDomain(props, axis, childComponents) {
|
|
9914
|
-
const children = childComponents ||
|
|
9940
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
9915
9941
|
const propsDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromProps(props, axis);
|
|
9916
9942
|
const domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
9917
9943
|
let domain;
|
|
@@ -9935,7 +9961,7 @@ function getScale(props, axis, childComponents) {
|
|
|
9935
9961
|
if (props.data) {
|
|
9936
9962
|
return _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis);
|
|
9937
9963
|
}
|
|
9938
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
9964
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
9939
9965
|
const iteratee = child => {
|
|
9940
9966
|
const sharedProps = Object.assign({}, child.props, {
|
|
9941
9967
|
horizontal: props.horizontal
|
|
@@ -10004,8 +10030,8 @@ function getChildStyle(child, index, calculatedProps, theme) {
|
|
|
10004
10030
|
const dataWidth = role === "stack" ? {} : {
|
|
10005
10031
|
width: getWidth(calculatedProps)
|
|
10006
10032
|
};
|
|
10007
|
-
const dataStyle =
|
|
10008
|
-
const labelsStyle =
|
|
10033
|
+
const dataStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, childStyle.data, Object.assign({}, dataWidth, style.data, defaultColor));
|
|
10034
|
+
const labelsStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, childStyle.labels, style.labels);
|
|
10009
10035
|
return {
|
|
10010
10036
|
...childStyle,
|
|
10011
10037
|
parent: style.parent,
|
|
@@ -10061,7 +10087,7 @@ function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
|
10061
10087
|
return lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...categoryStrings, ...axisStrings].flat());
|
|
10062
10088
|
}
|
|
10063
10089
|
function getStringsFromChildren(props, childComponents) {
|
|
10064
|
-
const children = childComponents ||
|
|
10090
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
10065
10091
|
const xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
10066
10092
|
const yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
10067
10093
|
const dataStrings = getStringsFromData(children);
|
|
@@ -10096,22 +10122,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10096
10122
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10097
10123
|
/* harmony export */ "VictorySharedEvents": function() { return /* binding */ VictorySharedEvents; }
|
|
10098
10124
|
/* harmony export */ });
|
|
10099
|
-
/* harmony import */ var
|
|
10100
|
-
/* harmony import */ var
|
|
10101
|
-
/* harmony import */ var
|
|
10102
|
-
/* harmony import */ var
|
|
10103
|
-
/* harmony import */ var
|
|
10104
|
-
/* harmony import */ var
|
|
10105
|
-
/* harmony import */ var
|
|
10106
|
-
/* harmony import */ var
|
|
10107
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
10108
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/events.js");
|
|
10109
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/collection.js");
|
|
10110
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
10125
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
10126
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
10127
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
10128
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
10129
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/isEmpty */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isEmpty.js");
|
|
10130
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
10131
|
+
/* harmony import */ var lodash_fromPairs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/fromPairs */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/fromPairs.js");
|
|
10132
|
+
/* harmony import */ var lodash_fromPairs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_fromPairs__WEBPACK_IMPORTED_MODULE_3__);
|
|
10111
10133
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-fast-compare */ "../../../node_modules/.pnpm/react-fast-compare@3.2.0/node_modules/react-fast-compare/index.js");
|
|
10112
10134
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_4__);
|
|
10113
10135
|
/* harmony import */ var json_stringify_safe__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! json-stringify-safe */ "../../../node_modules/.pnpm/json-stringify-safe@5.0.1/node_modules/json-stringify-safe/stringify.js");
|
|
10114
10136
|
/* harmony import */ var json_stringify_safe__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(json_stringify_safe__WEBPACK_IMPORTED_MODULE_5__);
|
|
10137
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
10138
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/events.js");
|
|
10139
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/collection.js");
|
|
10140
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
10115
10141
|
|
|
10116
10142
|
|
|
10117
10143
|
|
|
@@ -10125,14 +10151,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10125
10151
|
// to refactor in our current refactoring effort. Please do not make changes
|
|
10126
10152
|
// to this file without manual testing and/or refactoring and adding tests.
|
|
10127
10153
|
|
|
10128
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
10154
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
10129
10155
|
|
|
10130
|
-
class VictorySharedEvents extends (
|
|
10156
|
+
class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
|
10131
10157
|
static displayName = "VictorySharedEvents";
|
|
10132
10158
|
static role = "shared-event-wrapper";
|
|
10133
10159
|
static contextType = victory_core__WEBPACK_IMPORTED_MODULE_6__["default"];
|
|
10134
10160
|
static defaultProps = {
|
|
10135
|
-
groupComponent: /*#__PURE__*/
|
|
10161
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null)
|
|
10136
10162
|
};
|
|
10137
10163
|
constructor(props) {
|
|
10138
10164
|
super(props);
|
|
@@ -10189,7 +10215,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10189
10215
|
return props.events;
|
|
10190
10216
|
}
|
|
10191
10217
|
applyExternalMutations(props, externalMutations) {
|
|
10192
|
-
if (!
|
|
10218
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
10193
10219
|
const callbacks = props.externalEventMutations.reduce((memo, mutation) => victory_core__WEBPACK_IMPORTED_MODULE_9__.isFunction(mutation.callback) ? memo.concat(mutation.callback) : memo, []);
|
|
10194
10220
|
const compiledCallbacks = callbacks.length ? () => {
|
|
10195
10221
|
callbacks.forEach(c => c());
|
|
@@ -10198,7 +10224,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10198
10224
|
}
|
|
10199
10225
|
}
|
|
10200
10226
|
getExternalMutations(props, baseProps) {
|
|
10201
|
-
return !
|
|
10227
|
+
return !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(props.externalEventMutations) ? victory_core__WEBPACK_IMPORTED_MODULE_7__.getExternalMutationsWithChildren(props.externalEventMutations, baseProps, this.state, Object.keys(baseProps)) : undefined;
|
|
10202
10228
|
}
|
|
10203
10229
|
cacheSharedEvents(name, sharedEvents, cacheValues) {
|
|
10204
10230
|
this.sharedEventsCache[name] = [sharedEvents, cacheValues];
|
|
@@ -10214,7 +10240,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10214
10240
|
const {
|
|
10215
10241
|
container
|
|
10216
10242
|
} = props;
|
|
10217
|
-
const children =
|
|
10243
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(this.props.children);
|
|
10218
10244
|
const childBaseProps = this.getBasePropsFromChildren(children);
|
|
10219
10245
|
const parentBaseProps = container ? container.props : {};
|
|
10220
10246
|
return Object.assign({}, childBaseProps, {
|
|
@@ -10230,7 +10256,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10230
10256
|
return null;
|
|
10231
10257
|
};
|
|
10232
10258
|
const baseProps = victory_core__WEBPACK_IMPORTED_MODULE_9__.reduceChildren(childComponents, iteratee);
|
|
10233
|
-
return
|
|
10259
|
+
return lodash_fromPairs__WEBPACK_IMPORTED_MODULE_3___default()(baseProps);
|
|
10234
10260
|
}
|
|
10235
10261
|
getNewChildren(props, baseProps) {
|
|
10236
10262
|
const {
|
|
@@ -10240,9 +10266,9 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10240
10266
|
const alterChildren = (children, childNames) => {
|
|
10241
10267
|
return children.reduce((memo, child, index) => {
|
|
10242
10268
|
if (child.props.children) {
|
|
10243
|
-
const newChildren =
|
|
10269
|
+
const newChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children);
|
|
10244
10270
|
const names = childNames.slice(index, index + newChildren.length);
|
|
10245
|
-
const results = /*#__PURE__*/
|
|
10271
|
+
const results = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, child.props, alterChildren(newChildren, names));
|
|
10246
10272
|
return memo.concat(results);
|
|
10247
10273
|
} else if (childNames[index] !== "parent" && child.type && victory_core__WEBPACK_IMPORTED_MODULE_9__.isFunction(child.type.getBaseProps)) {
|
|
10248
10274
|
const name = child.props.name || childNames[index];
|
|
@@ -10261,7 +10287,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10261
10287
|
getEventState: (key, target) => this.getEventState(key, target, name)
|
|
10262
10288
|
};
|
|
10263
10289
|
this.cacheSharedEvents(name, sharedEvents, sharedEventsCacheValues);
|
|
10264
|
-
return memo.concat( /*#__PURE__*/
|
|
10290
|
+
return memo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, Object.assign({
|
|
10265
10291
|
key: `events-${name}`,
|
|
10266
10292
|
sharedEvents,
|
|
10267
10293
|
eventKey,
|
|
@@ -10272,7 +10298,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10272
10298
|
}, []);
|
|
10273
10299
|
};
|
|
10274
10300
|
const childNames = Object.keys(baseProps);
|
|
10275
|
-
const childComponents =
|
|
10301
|
+
const childComponents = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
10276
10302
|
return alterChildren(childComponents, childNames);
|
|
10277
10303
|
}
|
|
10278
10304
|
getContainer(props, baseProps, events) {
|
|
@@ -10291,22 +10317,22 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10291
10317
|
const parentEvents = sharedEvents && boundGetEvents({
|
|
10292
10318
|
sharedEvents
|
|
10293
10319
|
}, "parent");
|
|
10294
|
-
const parentProps =
|
|
10320
|
+
const parentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, this.getEventState("parent", "parent"), containerProps, baseProps.parent, {
|
|
10295
10321
|
children
|
|
10296
10322
|
});
|
|
10297
|
-
const containerEvents =
|
|
10323
|
+
const containerEvents = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, victory_core__WEBPACK_IMPORTED_MODULE_7__.getPartialEvents(parentEvents, "parent", parentProps), containerProps.events);
|
|
10298
10324
|
this.globalEvents = victory_core__WEBPACK_IMPORTED_MODULE_7__.getGlobalEvents(containerEvents);
|
|
10299
10325
|
const localEvents = victory_core__WEBPACK_IMPORTED_MODULE_7__.omitGlobalEvents(containerEvents);
|
|
10300
|
-
return role === "container" ? /*#__PURE__*/
|
|
10326
|
+
return role === "container" ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(container, Object.assign({}, parentProps, {
|
|
10301
10327
|
events: localEvents
|
|
10302
|
-
})) : /*#__PURE__*/
|
|
10328
|
+
})) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(container, localEvents, children);
|
|
10303
10329
|
}
|
|
10304
10330
|
render() {
|
|
10305
10331
|
const events = this.getAllEvents(this.props);
|
|
10306
10332
|
if (events) {
|
|
10307
10333
|
return this.getContainer(this.props, this.baseProps, events);
|
|
10308
10334
|
}
|
|
10309
|
-
return /*#__PURE__*/
|
|
10335
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(this.props.container, {
|
|
10310
10336
|
children: this.props.children
|
|
10311
10337
|
});
|
|
10312
10338
|
}
|