victory-stack 37.3.2 → 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 +8 -0
- package/dist/victory-stack.js +285 -238
- package/dist/victory-stack.min.js +1 -1
- package/es/helper-methods.d.ts +2 -6
- package/es/helper-methods.js +3 -3
- 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 -3
- package/lib/victory-stack.d.ts +1 -1
- package/lib/victory-stack.js +5 -5
- package/package.json +3 -31
- package/src/helper-methods.tsx +2 -2
- package/src/victory-stack.tsx +3 -1
package/dist/victory-stack.js
CHANGED
|
@@ -225,7 +225,7 @@ function getChildProps(props, calculatedProps) {
|
|
|
225
225
|
return {
|
|
226
226
|
height: props.height,
|
|
227
227
|
width: props.width,
|
|
228
|
-
padding: victory_core__WEBPACK_IMPORTED_MODULE_4__.getPadding(props),
|
|
228
|
+
padding: victory_core__WEBPACK_IMPORTED_MODULE_4__.getPadding(props.padding),
|
|
229
229
|
standalone: false,
|
|
230
230
|
theme: props.theme,
|
|
231
231
|
categories,
|
|
@@ -289,12 +289,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
289
289
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
290
290
|
/* harmony export */ "VictoryStack": function() { return /* binding */ VictoryStack; }
|
|
291
291
|
/* harmony export */ });
|
|
292
|
-
/* harmony import */ var
|
|
293
|
-
/* 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__);
|
|
294
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");
|
|
295
295
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
296
|
-
/* harmony import */ var
|
|
297
|
-
/* 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__);
|
|
298
298
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
299
299
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js");
|
|
300
300
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/hooks/use-animation-state.js");
|
|
@@ -319,8 +319,8 @@ const fallbackProps = {
|
|
|
319
319
|
padding: 50
|
|
320
320
|
};
|
|
321
321
|
const defaultProps = {
|
|
322
|
-
containerComponent: /*#__PURE__*/
|
|
323
|
-
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),
|
|
324
324
|
standalone: true,
|
|
325
325
|
theme: victory_core__WEBPACK_IMPORTED_MODULE_5__.VictoryTheme.grayscale,
|
|
326
326
|
fillInMissingData: true
|
|
@@ -329,7 +329,7 @@ const VictoryStackBase = initialProps => {
|
|
|
329
329
|
const {
|
|
330
330
|
role
|
|
331
331
|
} = VictoryStack;
|
|
332
|
-
const propsWithDefaults =
|
|
332
|
+
const propsWithDefaults = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps), [initialProps]);
|
|
333
333
|
const {
|
|
334
334
|
setAnimationState,
|
|
335
335
|
getAnimationProps,
|
|
@@ -350,20 +350,20 @@ const VictoryStackBase = initialProps => {
|
|
|
350
350
|
horizontal,
|
|
351
351
|
name
|
|
352
352
|
} = modifiedProps;
|
|
353
|
-
const childComponents =
|
|
353
|
+
const childComponents = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(modifiedProps.children);
|
|
354
354
|
const calculatedProps = (0,_helper_methods__WEBPACK_IMPORTED_MODULE_8__.useMemoizedProps)(modifiedProps);
|
|
355
355
|
const {
|
|
356
356
|
domain,
|
|
357
357
|
scale,
|
|
358
358
|
style
|
|
359
359
|
} = calculatedProps;
|
|
360
|
-
const newChildren =
|
|
360
|
+
const newChildren = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => {
|
|
361
361
|
const children = (0,_helper_methods__WEBPACK_IMPORTED_MODULE_8__.getChildren)(props, childComponents, calculatedProps);
|
|
362
362
|
const orderedChildren = children.map((child, index) => {
|
|
363
363
|
const childProps = Object.assign({
|
|
364
364
|
animate: getAnimationProps(props, child, index)
|
|
365
365
|
}, child.props);
|
|
366
|
-
return /*#__PURE__*/
|
|
366
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, childProps);
|
|
367
367
|
});
|
|
368
368
|
/*
|
|
369
369
|
reverse render order for children of `VictoryStack` so that higher children in the stack
|
|
@@ -372,7 +372,7 @@ const VictoryStackBase = initialProps => {
|
|
|
372
372
|
*/
|
|
373
373
|
return orderedChildren.reverse();
|
|
374
374
|
}, [props, childComponents, calculatedProps, getAnimationProps]);
|
|
375
|
-
const containerProps =
|
|
375
|
+
const containerProps = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => {
|
|
376
376
|
if (standalone) {
|
|
377
377
|
return {
|
|
378
378
|
domain,
|
|
@@ -389,19 +389,19 @@ const VictoryStackBase = initialProps => {
|
|
|
389
389
|
}
|
|
390
390
|
return {};
|
|
391
391
|
}, [standalone, domain, scale, width, height, theme, style, horizontal, polar, name]);
|
|
392
|
-
const userProps =
|
|
393
|
-
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(() => {
|
|
394
394
|
if (standalone) {
|
|
395
395
|
const defaultContainerProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, containerComponent.props, containerProps, userProps);
|
|
396
|
-
return /*#__PURE__*/
|
|
396
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(containerComponent, defaultContainerProps);
|
|
397
397
|
}
|
|
398
|
-
return /*#__PURE__*/
|
|
398
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(groupComponent, userProps);
|
|
399
399
|
}, [groupComponent, standalone, containerComponent, containerProps, userProps]);
|
|
400
|
-
const events =
|
|
400
|
+
const events = react__WEBPACK_IMPORTED_MODULE_0___default().useMemo(() => {
|
|
401
401
|
return victory_core__WEBPACK_IMPORTED_MODULE_10__.getAllEvents(props);
|
|
402
402
|
}, [props]);
|
|
403
403
|
const previousProps = victory_core__WEBPACK_IMPORTED_MODULE_11__.usePreviousProps(propsWithDefaults);
|
|
404
|
-
|
|
404
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
405
405
|
// This is called before dismount to keep state in sync
|
|
406
406
|
return () => {
|
|
407
407
|
if (propsWithDefaults.animate) {
|
|
@@ -409,22 +409,22 @@ const VictoryStackBase = initialProps => {
|
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
411
|
}, [setAnimationState, previousProps, propsWithDefaults]);
|
|
412
|
-
if (!
|
|
413
|
-
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, {
|
|
414
414
|
container: container,
|
|
415
415
|
eventKey: eventKey,
|
|
416
416
|
events: events,
|
|
417
417
|
externalEventMutations: externalEventMutations
|
|
418
418
|
}, newChildren);
|
|
419
419
|
}
|
|
420
|
-
return /*#__PURE__*/
|
|
420
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(container, container.props, newChildren);
|
|
421
421
|
};
|
|
422
422
|
const componentConfig = {
|
|
423
423
|
role: "stack",
|
|
424
424
|
expectedComponents: ["groupComponent", "containerComponent", "labelComponent"],
|
|
425
425
|
getChildren: _helper_methods__WEBPACK_IMPORTED_MODULE_8__.getChildren
|
|
426
426
|
};
|
|
427
|
-
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);
|
|
428
428
|
VictoryStack.displayName = "VictoryStack";
|
|
429
429
|
|
|
430
430
|
/***/ }),
|
|
@@ -5031,16 +5031,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5031
5031
|
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; },
|
|
5032
5032
|
/* harmony export */ "useVictoryContainer": function() { return /* binding */ useVictoryContainer; }
|
|
5033
5033
|
/* harmony export */ });
|
|
5034
|
-
/* harmony import */ var
|
|
5035
|
-
/* harmony import */ var
|
|
5036
|
-
/* harmony import */ var
|
|
5037
|
-
/* 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__);
|
|
5038
5038
|
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
5039
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");
|
|
5040
5040
|
/* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
|
|
5041
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");
|
|
5042
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");
|
|
5043
|
-
|
|
5044
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); }
|
|
5045
5044
|
|
|
5046
5045
|
|
|
@@ -5048,9 +5047,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
5048
5047
|
|
|
5049
5048
|
|
|
5050
5049
|
|
|
5050
|
+
|
|
5051
5051
|
const defaultProps = {
|
|
5052
5052
|
className: "VictoryContainer",
|
|
5053
|
-
portalComponent: /*#__PURE__*/
|
|
5053
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
5054
5054
|
portalZIndex: 99,
|
|
5055
5055
|
responsive: true,
|
|
5056
5056
|
role: "img"
|
|
@@ -5067,10 +5067,10 @@ function useVictoryContainer(initialProps) {
|
|
|
5067
5067
|
height,
|
|
5068
5068
|
responsive
|
|
5069
5069
|
} = props;
|
|
5070
|
-
const localContainerRef = (0,
|
|
5070
|
+
const localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
5071
5071
|
|
|
5072
5072
|
// Generated ID stored in ref because it needs to persist across renders
|
|
5073
|
-
const generatedId = (0,
|
|
5073
|
+
const generatedId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default()("victory-container-"));
|
|
5074
5074
|
const containerId = props.containerId ?? generatedId.current;
|
|
5075
5075
|
const getIdForElement = elName => `${containerId}-${elName}`;
|
|
5076
5076
|
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props);
|
|
@@ -5129,7 +5129,7 @@ const VictoryContainer = initialProps => {
|
|
|
5129
5129
|
containerRef,
|
|
5130
5130
|
localContainerRef
|
|
5131
5131
|
} = useVictoryContainer(initialProps);
|
|
5132
|
-
|
|
5132
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
5133
5133
|
if (!events?.onWheel) return;
|
|
5134
5134
|
const handleWheel = e => e.preventDefault();
|
|
5135
5135
|
const container = localContainerRef?.current;
|
|
@@ -5139,7 +5139,7 @@ const VictoryContainer = initialProps => {
|
|
|
5139
5139
|
};
|
|
5140
5140
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5141
5141
|
}, []);
|
|
5142
|
-
return /*#__PURE__*/
|
|
5142
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
5143
5143
|
className: className,
|
|
5144
5144
|
style: {
|
|
5145
5145
|
...style,
|
|
@@ -5153,7 +5153,7 @@ const VictoryContainer = initialProps => {
|
|
|
5153
5153
|
"data-ouia-component-type": ouiaType,
|
|
5154
5154
|
"data-ouia-safe": ouiaSafe,
|
|
5155
5155
|
ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
|
|
5156
|
-
}, /*#__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({
|
|
5157
5157
|
width: width,
|
|
5158
5158
|
height: height,
|
|
5159
5159
|
tabIndex: tabIndex,
|
|
@@ -5166,11 +5166,11 @@ const VictoryContainer = initialProps => {
|
|
|
5166
5166
|
...dimensions,
|
|
5167
5167
|
pointerEvents: "all"
|
|
5168
5168
|
}
|
|
5169
|
-
}, userProps, events), title ? /*#__PURE__*/
|
|
5169
|
+
}, userProps, events), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("title", {
|
|
5170
5170
|
id: titleId
|
|
5171
|
-
}, title) : null, desc ? /*#__PURE__*/
|
|
5171
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("desc", {
|
|
5172
5172
|
id: descId
|
|
5173
|
-
}, desc) : null, children), /*#__PURE__*/
|
|
5173
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
5174
5174
|
style: {
|
|
5175
5175
|
...dimensions,
|
|
5176
5176
|
zIndex: portalZIndex,
|
|
@@ -5178,7 +5178,7 @@ const VictoryContainer = initialProps => {
|
|
|
5178
5178
|
top: 0,
|
|
5179
5179
|
left: 0
|
|
5180
5180
|
}
|
|
5181
|
-
}, /*#__PURE__*/
|
|
5181
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__.PortalOutlet, {
|
|
5182
5182
|
as: portalComponent,
|
|
5183
5183
|
width: width,
|
|
5184
5184
|
height: height,
|
|
@@ -6446,16 +6446,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6446
6446
|
/* harmony export */ "modifyProps": function() { return /* binding */ modifyProps; },
|
|
6447
6447
|
/* harmony export */ "stringTicks": function() { return /* binding */ stringTicks; }
|
|
6448
6448
|
/* harmony export */ });
|
|
6449
|
-
/* harmony import */ var
|
|
6450
|
-
/* harmony import */ var
|
|
6451
|
-
/* harmony import */ var
|
|
6452
|
-
/* 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__);
|
|
6453
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");
|
|
6454
6454
|
/* harmony import */ var lodash_isObject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isObject__WEBPACK_IMPORTED_MODULE_2__);
|
|
6455
|
-
/* harmony import */ var
|
|
6456
|
-
/* harmony import */ var
|
|
6457
|
-
/* harmony import */ var
|
|
6458
|
-
/* 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__);
|
|
6459
6459
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
6460
6460
|
/* harmony import */ var _domain__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./domain */ "../../victory-core/es/victory-util/domain.js");
|
|
6461
6461
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
@@ -6502,7 +6502,7 @@ function findAxisComponents(childComponents, predicate) {
|
|
|
6502
6502
|
if (child.type && child.type.role === "axis" && predicateFunction(child)) {
|
|
6503
6503
|
return memo.concat(child);
|
|
6504
6504
|
} else if (child.props && child.props.children) {
|
|
6505
|
-
return memo.concat(findAxes(
|
|
6505
|
+
return memo.concat(findAxes(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children)));
|
|
6506
6506
|
}
|
|
6507
6507
|
return memo;
|
|
6508
6508
|
}, []);
|
|
@@ -6540,7 +6540,7 @@ function getAxisComponentsWithParent(childComponents, type) {
|
|
|
6540
6540
|
if (child.type && child.type.role === "axis" && matchesType(child)) {
|
|
6541
6541
|
return memo.concat(child);
|
|
6542
6542
|
} else if (child.props && child.props.children) {
|
|
6543
|
-
const childAxis = findComponents(
|
|
6543
|
+
const childAxis = findComponents(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children));
|
|
6544
6544
|
return childAxis.length > 0 ? memo.concat(child) : memo;
|
|
6545
6545
|
}
|
|
6546
6546
|
return memo;
|
|
@@ -6599,7 +6599,7 @@ function getDefaultTickFormat(props) {
|
|
|
6599
6599
|
return stringTicks(props) ? (x, index) => tickValues[index] : fallbackFormat;
|
|
6600
6600
|
}
|
|
6601
6601
|
const invertedStringMap = stringMap && _helpers__WEBPACK_IMPORTED_MODULE_6__.invert(stringMap);
|
|
6602
|
-
const tickValueArray =
|
|
6602
|
+
const tickValueArray = lodash_orderBy__WEBPACK_IMPORTED_MODULE_4___default()(Object.values(stringMap), n => n);
|
|
6603
6603
|
const dataNames = tickValueArray.map(tick => invertedStringMap[tick]);
|
|
6604
6604
|
// string ticks should have one tick of padding at the beginning
|
|
6605
6605
|
const dataTicks = ["", ...dataNames, ""];
|
|
@@ -6636,14 +6636,14 @@ function getTickArray(props) {
|
|
|
6636
6636
|
if (tickValues && _collection__WEBPACK_IMPORTED_MODULE_5__.containsStrings(tickValues)) {
|
|
6637
6637
|
ticks = stringMap ? tickValues.map(tick => stringMap[tick]) : _helpers__WEBPACK_IMPORTED_MODULE_6__.range(1, tickValues.length + 1);
|
|
6638
6638
|
}
|
|
6639
|
-
const tickArray = ticks ?
|
|
6639
|
+
const tickArray = ticks ? lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default()(ticks) : getTicksFromFormat();
|
|
6640
6640
|
const buildTickArray = arr => {
|
|
6641
6641
|
const newTickArray = [];
|
|
6642
6642
|
const domain = props.domain && props.domain[axis] || props.domain;
|
|
6643
6643
|
if (arr) {
|
|
6644
6644
|
arr.forEach((t, index) => {
|
|
6645
6645
|
if (Array.isArray(domain)) {
|
|
6646
|
-
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()) {
|
|
6647
6647
|
newTickArray.push({
|
|
6648
6648
|
value: t,
|
|
6649
6649
|
index
|
|
@@ -6795,7 +6795,7 @@ function modifyProps(props, fallbackProps) {
|
|
|
6795
6795
|
if (role === "axis") {
|
|
6796
6796
|
return _helpers__WEBPACK_IMPORTED_MODULE_6__.modifyProps(props, fallbackProps, "axis");
|
|
6797
6797
|
}
|
|
6798
|
-
const axisTheme =
|
|
6798
|
+
const axisTheme = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, props.theme[role], props.theme.axis);
|
|
6799
6799
|
const theme = Object.assign({}, props.theme, {
|
|
6800
6800
|
axis: axisTheme
|
|
6801
6801
|
});
|
|
@@ -6899,24 +6899,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6899
6899
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
6900
6900
|
/* harmony export */ "isDataComponent": function() { return /* binding */ isDataComponent; }
|
|
6901
6901
|
/* harmony export */ });
|
|
6902
|
-
/* harmony import */ var
|
|
6903
|
-
/* harmony import */ var
|
|
6904
|
-
/* harmony import */ var
|
|
6905
|
-
/* 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__);
|
|
6906
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");
|
|
6907
6907
|
/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEqual__WEBPACK_IMPORTED_MODULE_2__);
|
|
6908
|
-
/* harmony import */ var
|
|
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
|
|
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__);
|
|
6920
6920
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6921
6921
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
6922
6922
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
@@ -6950,7 +6950,7 @@ function getLength(data) {
|
|
|
6950
6950
|
|
|
6951
6951
|
// Returns generated data for a given axis based on domain and sample from props
|
|
6952
6952
|
function generateDataArray(props, axis) {
|
|
6953
|
-
const propsDomain =
|
|
6953
|
+
const propsDomain = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default()(props.domain) ? props.domain[axis] : props.domain;
|
|
6954
6954
|
const domain = propsDomain || _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis).domain();
|
|
6955
6955
|
const samples = props.samples || 1;
|
|
6956
6956
|
const domainMax = Math.max(...domain);
|
|
@@ -6975,7 +6975,7 @@ function sortData(dataset, sortKey, sortOrder) {
|
|
|
6975
6975
|
formattedSortKey = `_${sortKey}`;
|
|
6976
6976
|
}
|
|
6977
6977
|
const order = sortOrder === "ascending" ? "asc" : "desc";
|
|
6978
|
-
return
|
|
6978
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default()(dataset, formattedSortKey, order);
|
|
6979
6979
|
}
|
|
6980
6980
|
|
|
6981
6981
|
// This method will remove data points that break certain scales. (log scale only)
|
|
@@ -7019,7 +7019,7 @@ function getEventKey(key) {
|
|
|
7019
7019
|
return () => undefined;
|
|
7020
7020
|
}
|
|
7021
7021
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
7022
|
-
return
|
|
7022
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_7___default()(key);
|
|
7023
7023
|
}
|
|
7024
7024
|
|
|
7025
7025
|
// Returns data with an eventKey prop added to each datum
|
|
@@ -7078,12 +7078,12 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
7078
7078
|
if (isUnderMinY(baseline) && !isUnderMinY(value)) _y0 = minDomainY;
|
|
7079
7079
|
// baseline and value with only baseline above max, set baseline to maxDomainY
|
|
7080
7080
|
if (isOverMaxY(baseline) && !isOverMaxY(value)) _y0 = maxDomainY;
|
|
7081
|
-
return Object.assign({}, datum,
|
|
7081
|
+
return Object.assign({}, datum, lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default()({
|
|
7082
7082
|
_x,
|
|
7083
7083
|
_y,
|
|
7084
7084
|
_y0,
|
|
7085
7085
|
_y1
|
|
7086
|
-
}, (
|
|
7086
|
+
}, (lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default())));
|
|
7087
7087
|
});
|
|
7088
7088
|
}
|
|
7089
7089
|
|
|
@@ -7097,7 +7097,7 @@ function createStringMap(props, axis) {
|
|
|
7097
7097
|
const stringsFromAxes = getStringsFromAxes(props, axis);
|
|
7098
7098
|
const stringsFromCategories = getStringsFromCategories(props, axis);
|
|
7099
7099
|
const stringsFromData = getStringsFromData(props, axis);
|
|
7100
|
-
const allStrings =
|
|
7100
|
+
const allStrings = lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default()([...stringsFromAxes, ...stringsFromCategories, ...stringsFromData]);
|
|
7101
7101
|
return allStrings.length === 0 ? null : allStrings.reduce((memo, string, index) => {
|
|
7102
7102
|
memo[string] = index + 1;
|
|
7103
7103
|
return memo;
|
|
@@ -7183,7 +7183,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
7183
7183
|
return memo;
|
|
7184
7184
|
}, {});
|
|
7185
7185
|
const formattedDatum = Object.assign({}, processedValues, parsedDatum);
|
|
7186
|
-
if (!
|
|
7186
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(formattedDatum)) {
|
|
7187
7187
|
dataArr.push(formattedDatum);
|
|
7188
7188
|
}
|
|
7189
7189
|
return dataArr;
|
|
@@ -7310,7 +7310,7 @@ function isDataComponent(component) {
|
|
|
7310
7310
|
};
|
|
7311
7311
|
let role = getRole(component);
|
|
7312
7312
|
if (role === "portal") {
|
|
7313
|
-
const children =
|
|
7313
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
7314
7314
|
role = children.length ? getRole(children[0]) : "";
|
|
7315
7315
|
}
|
|
7316
7316
|
const whitelist = ["area", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -7341,14 +7341,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7341
7341
|
/* harmony export */ "getSymmetricDomain": function() { return /* binding */ getSymmetricDomain; },
|
|
7342
7342
|
/* harmony export */ "isDomainComponent": function() { return /* binding */ isDomainComponent; }
|
|
7343
7343
|
/* harmony export */ });
|
|
7344
|
-
/* harmony import */ var
|
|
7345
|
-
/* harmony import */ var
|
|
7346
|
-
/* harmony import */ var
|
|
7347
|
-
/* 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__);
|
|
7348
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");
|
|
7349
7349
|
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__);
|
|
7350
|
-
/* harmony import */ var
|
|
7351
|
-
/* 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__);
|
|
7352
7352
|
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
7353
7353
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
7354
7354
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
@@ -7437,9 +7437,9 @@ function padDomain(domain, props, axis) {
|
|
|
7437
7437
|
max: max.valueOf() + simplePadding.right
|
|
7438
7438
|
};
|
|
7439
7439
|
const singleQuadrantDomainPadding = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.singleQuadrantDomainPadding) ? props.singleQuadrantDomainPadding[axis] : props.singleQuadrantDomainPadding;
|
|
7440
|
-
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;
|
|
7441
7441
|
const adjust = (val, type) => {
|
|
7442
|
-
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;
|
|
7443
7443
|
return coerce ? 0 : val;
|
|
7444
7444
|
};
|
|
7445
7445
|
if (addsQuadrants && singleQuadrantDomainPadding !== false) {
|
|
@@ -7662,7 +7662,7 @@ function getMaxFromProps(props, axis) {
|
|
|
7662
7662
|
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.maxDomain) && props.maxDomain[axis] !== undefined) {
|
|
7663
7663
|
return props.maxDomain[axis];
|
|
7664
7664
|
}
|
|
7665
|
-
return typeof props.maxDomain === "number" ||
|
|
7665
|
+
return typeof props.maxDomain === "number" || lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default()(props.maxDomain) ? props.maxDomain : undefined;
|
|
7666
7666
|
}
|
|
7667
7667
|
|
|
7668
7668
|
/**
|
|
@@ -7675,7 +7675,7 @@ function getMinFromProps(props, axis) {
|
|
|
7675
7675
|
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.minDomain) && props.minDomain[axis] !== undefined) {
|
|
7676
7676
|
return props.minDomain[axis];
|
|
7677
7677
|
}
|
|
7678
|
-
return typeof props.minDomain === "number" ||
|
|
7678
|
+
return typeof props.minDomain === "number" || lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default()(props.minDomain) ? props.minDomain : undefined;
|
|
7679
7679
|
}
|
|
7680
7680
|
|
|
7681
7681
|
/**
|
|
@@ -7686,7 +7686,7 @@ function getMinFromProps(props, axis) {
|
|
|
7686
7686
|
* @returns {Array} the symmetric domain
|
|
7687
7687
|
*/
|
|
7688
7688
|
function getSymmetricDomain(domain, values) {
|
|
7689
|
-
const processedData =
|
|
7689
|
+
const processedData = lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3___default()(values.sort((a, b) => a - b));
|
|
7690
7690
|
const step = processedData[1] - processedData[0];
|
|
7691
7691
|
return [domain[0], domain[1] + step];
|
|
7692
7692
|
}
|
|
@@ -7702,7 +7702,7 @@ function isDomainComponent(component) {
|
|
|
7702
7702
|
};
|
|
7703
7703
|
let role = getRole(component);
|
|
7704
7704
|
if (role === "portal") {
|
|
7705
|
-
const children =
|
|
7705
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
7706
7706
|
role = children.length ? getRole(children[0]) : "";
|
|
7707
7707
|
}
|
|
7708
7708
|
const whitelist = ["area", "axis", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -7733,14 +7733,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7733
7733
|
/* harmony export */ "getScopedEvents": function() { return /* binding */ getScopedEvents; },
|
|
7734
7734
|
/* harmony export */ "omitGlobalEvents": function() { return /* binding */ omitGlobalEvents; }
|
|
7735
7735
|
/* harmony export */ });
|
|
7736
|
-
/* harmony import */ var
|
|
7737
|
-
/* harmony import */ var
|
|
7738
|
-
/* harmony import */ var
|
|
7739
|
-
/* harmony import */ var
|
|
7740
|
-
/* harmony import */ var
|
|
7741
|
-
/* harmony import */ var
|
|
7742
|
-
/* harmony import */ var
|
|
7743
|
-
/* 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__);
|
|
7744
7744
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7745
7745
|
|
|
7746
7746
|
|
|
@@ -7816,7 +7816,7 @@ getScopedEvents) {
|
|
|
7816
7816
|
*/
|
|
7817
7817
|
// eslint-disable-next-line max-params
|
|
7818
7818
|
function getScopedEvents(events, namespace, childType, baseProps) {
|
|
7819
|
-
if (
|
|
7819
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
7820
7820
|
return {};
|
|
7821
7821
|
}
|
|
7822
7822
|
|
|
@@ -7929,7 +7929,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
7929
7929
|
// eslint-disable-next-line max-params
|
|
7930
7930
|
const onEvent = (evt, childProps, eventKey, eventName) => {
|
|
7931
7931
|
const eventReturn = events[eventName](evt, childProps, eventKey, this);
|
|
7932
|
-
if (!
|
|
7932
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(eventReturn)) {
|
|
7933
7933
|
const callbacks = compileCallbacks(eventReturn);
|
|
7934
7934
|
this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
|
|
7935
7935
|
}
|
|
@@ -7990,7 +7990,7 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
7990
7990
|
const childState = baseState[childName];
|
|
7991
7991
|
const mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
7992
7992
|
memo[childName] = mutation ? mutation : childState;
|
|
7993
|
-
return
|
|
7993
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
7994
7994
|
}, {});
|
|
7995
7995
|
}
|
|
7996
7996
|
|
|
@@ -8026,7 +8026,7 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
8026
8026
|
} else {
|
|
8027
8027
|
// use keys from both state and props so that elements not intially included in baseProps
|
|
8028
8028
|
// will be used. (i.e. labels)
|
|
8029
|
-
const targets =
|
|
8029
|
+
const targets = lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default()(Object.keys(keyProps).concat(Object.keys(keyState)));
|
|
8030
8030
|
memo[eventKey] = targets.reduce((m, target) => {
|
|
8031
8031
|
const identifier = {
|
|
8032
8032
|
eventKey,
|
|
@@ -8035,10 +8035,10 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
8035
8035
|
};
|
|
8036
8036
|
const mutation = getExternalMutation(mutations, keyProps[target], keyState[target], identifier);
|
|
8037
8037
|
m[target] = mutation !== undefined ? Object.assign({}, keyState[target], mutation) : keyState[target];
|
|
8038
|
-
return
|
|
8038
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(m, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
8039
8039
|
}, {});
|
|
8040
8040
|
}
|
|
8041
|
-
return
|
|
8041
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
8042
8042
|
}, {});
|
|
8043
8043
|
}
|
|
8044
8044
|
|
|
@@ -8070,11 +8070,11 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
8070
8070
|
}
|
|
8071
8071
|
// find any mutation objects that match the target
|
|
8072
8072
|
const targetMutations = scopedMutations.filter(m => filterMutations(m, "target"));
|
|
8073
|
-
if (
|
|
8073
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(targetMutations)) {
|
|
8074
8074
|
return undefined;
|
|
8075
8075
|
}
|
|
8076
8076
|
const keyMutations = targetMutations.filter(m => filterMutations(m, "eventKey"));
|
|
8077
|
-
if (
|
|
8077
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(keyMutations)) {
|
|
8078
8078
|
return undefined;
|
|
8079
8079
|
}
|
|
8080
8080
|
return keyMutations.reduce((memo, curr) => {
|
|
@@ -8100,8 +8100,8 @@ function getGlobalEventNameFromKey(key) {
|
|
|
8100
8100
|
const match = key.match(GLOBAL_EVENT_REGEX);
|
|
8101
8101
|
return match && match[1] && match[1].toLowerCase();
|
|
8102
8102
|
}
|
|
8103
|
-
const getGlobalEvents = events =>
|
|
8104
|
-
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));
|
|
8105
8105
|
const emulateReactEvent = event => Object.assign(event, {
|
|
8106
8106
|
nativeEvent: event
|
|
8107
8107
|
});
|
|
@@ -8142,40 +8142,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8142
8142
|
/* harmony export */ "reduceChildren": function() { return /* binding */ reduceChildren; },
|
|
8143
8143
|
/* harmony export */ "scalePoint": function() { return /* binding */ scalePoint; }
|
|
8144
8144
|
/* harmony export */ });
|
|
8145
|
-
/* harmony import */ var
|
|
8146
|
-
/* harmony import */ var
|
|
8147
|
-
/* harmony import */ var
|
|
8148
|
-
/* harmony import */ var
|
|
8149
|
-
/* harmony import */ var
|
|
8150
|
-
/* harmony import */ var
|
|
8151
|
-
/* harmony import */ var
|
|
8152
|
-
/* harmony import */ var
|
|
8153
|
-
|
|
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__);
|
|
8154
8153
|
|
|
8155
8154
|
|
|
8156
8155
|
|
|
8157
|
-
// Private Functions
|
|
8158
8156
|
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
8157
|
+
/**
|
|
8158
|
+
* Determine the range of a cartesian axis
|
|
8159
|
+
*/
|
|
8160
|
+
function getCartesianRange(options) {
|
|
8161
|
+
const vertical = options.axis !== "x";
|
|
8163
8162
|
if (vertical) {
|
|
8164
|
-
return [
|
|
8163
|
+
return [options.height - options.padding.bottom, options.padding.top];
|
|
8165
8164
|
}
|
|
8166
|
-
return [padding.left,
|
|
8165
|
+
return [options.padding.left, options.width - options.padding.right];
|
|
8167
8166
|
}
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
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);
|
|
8172
8175
|
return [startAngle, endAngle];
|
|
8173
8176
|
}
|
|
8174
|
-
return [
|
|
8177
|
+
return [options.innerRadius || 0, getRadius({
|
|
8178
|
+
height: options.height,
|
|
8179
|
+
width: options.width,
|
|
8180
|
+
padding: options.padding
|
|
8181
|
+
})];
|
|
8175
8182
|
}
|
|
8176
8183
|
|
|
8177
|
-
// Exported Functions
|
|
8178
|
-
|
|
8179
8184
|
/**
|
|
8180
8185
|
* Creates an object composed of the inverted keys and values of object.
|
|
8181
8186
|
* If object contains duplicate values, subsequent values overwrite property assignments of previous values.
|
|
@@ -8212,8 +8217,11 @@ function omit(originalObject, ks) {
|
|
|
8212
8217
|
}
|
|
8213
8218
|
return newObject;
|
|
8214
8219
|
}
|
|
8220
|
+
|
|
8221
|
+
/**
|
|
8222
|
+
* Coalesce the x and y values from a data point
|
|
8223
|
+
*/
|
|
8215
8224
|
function getPoint(datum) {
|
|
8216
|
-
const exists = val => val !== undefined;
|
|
8217
8225
|
const {
|
|
8218
8226
|
_x,
|
|
8219
8227
|
_x1,
|
|
@@ -8224,16 +8232,20 @@ function getPoint(datum) {
|
|
|
8224
8232
|
_y0,
|
|
8225
8233
|
_voronoiY
|
|
8226
8234
|
} = datum;
|
|
8227
|
-
const defaultX =
|
|
8228
|
-
const defaultY =
|
|
8235
|
+
const defaultX = _x1 ?? _x;
|
|
8236
|
+
const defaultY = _y1 ?? _y;
|
|
8229
8237
|
const point = {
|
|
8230
|
-
x:
|
|
8231
|
-
x0:
|
|
8232
|
-
y:
|
|
8233
|
-
y0:
|
|
8238
|
+
x: _voronoiX ?? defaultX,
|
|
8239
|
+
x0: _x0 ?? _x,
|
|
8240
|
+
y: _voronoiY ?? defaultY,
|
|
8241
|
+
y0: _y0 ?? _y
|
|
8234
8242
|
};
|
|
8235
|
-
return
|
|
8243
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, point, datum);
|
|
8236
8244
|
}
|
|
8245
|
+
|
|
8246
|
+
/**
|
|
8247
|
+
* Scale a point based on the origin, direction, and given scale function
|
|
8248
|
+
*/
|
|
8237
8249
|
function scalePoint(props, datum) {
|
|
8238
8250
|
const {
|
|
8239
8251
|
scale,
|
|
@@ -8256,11 +8268,11 @@ function scalePoint(props, datum) {
|
|
|
8256
8268
|
y0: polar ? -y0 * Math.sin(x0) + origin.x : y0
|
|
8257
8269
|
};
|
|
8258
8270
|
}
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8271
|
+
|
|
8272
|
+
/**
|
|
8273
|
+
* Returns a padding value from a number or partial padding values
|
|
8274
|
+
*/
|
|
8275
|
+
function getPadding(padding) {
|
|
8264
8276
|
const paddingVal = typeof padding === "number" ? padding : 0;
|
|
8265
8277
|
const paddingObj = typeof padding === "object" ? padding : {};
|
|
8266
8278
|
return {
|
|
@@ -8270,6 +8282,10 @@ function getPadding(props, name) {
|
|
|
8270
8282
|
right: paddingObj.right || paddingVal
|
|
8271
8283
|
};
|
|
8272
8284
|
}
|
|
8285
|
+
|
|
8286
|
+
/**
|
|
8287
|
+
* Returns true if the component is defined as a tooltip
|
|
8288
|
+
*/
|
|
8273
8289
|
function isTooltip(component) {
|
|
8274
8290
|
const labelRole = component && component.type && component.type.role;
|
|
8275
8291
|
return labelRole === "tooltip";
|
|
@@ -8284,8 +8300,8 @@ function getDefaultStyles(props, role) {
|
|
|
8284
8300
|
return defaultStyles;
|
|
8285
8301
|
}
|
|
8286
8302
|
const tooltipStyle = theme.tooltip && theme.tooltip.style || {};
|
|
8287
|
-
const labelStyle =
|
|
8288
|
-
return
|
|
8303
|
+
const labelStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, tooltipStyle, defaultStyles.labels);
|
|
8304
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, {
|
|
8289
8305
|
labels: labelStyle
|
|
8290
8306
|
}, defaultStyles);
|
|
8291
8307
|
}
|
|
@@ -8293,7 +8309,7 @@ function getStyles(style, defaultStyles) {
|
|
|
8293
8309
|
const width = "100%";
|
|
8294
8310
|
const height = "100%";
|
|
8295
8311
|
if (!style) {
|
|
8296
|
-
return
|
|
8312
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8297
8313
|
parent: {
|
|
8298
8314
|
height,
|
|
8299
8315
|
width
|
|
@@ -8309,14 +8325,18 @@ function getStyles(style, defaultStyles) {
|
|
|
8309
8325
|
const defaultLabels = defaultStyles && defaultStyles.labels || {};
|
|
8310
8326
|
const defaultData = defaultStyles && defaultStyles.data || {};
|
|
8311
8327
|
return {
|
|
8312
|
-
parent:
|
|
8328
|
+
parent: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parent, defaultParent, {
|
|
8313
8329
|
width,
|
|
8314
8330
|
height
|
|
8315
8331
|
}),
|
|
8316
|
-
labels:
|
|
8317
|
-
data:
|
|
8332
|
+
labels: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labels, defaultLabels),
|
|
8333
|
+
data: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, data, defaultData)
|
|
8318
8334
|
};
|
|
8319
8335
|
}
|
|
8336
|
+
|
|
8337
|
+
/**
|
|
8338
|
+
* Returns the value of a prop or accessor function with the given props
|
|
8339
|
+
*/
|
|
8320
8340
|
function evaluateProp(prop, props) {
|
|
8321
8341
|
return isFunction(prop) ? prop(props) : prop;
|
|
8322
8342
|
}
|
|
@@ -8338,19 +8358,28 @@ function degreesToRadians(degrees) {
|
|
|
8338
8358
|
function radiansToDegrees(radians) {
|
|
8339
8359
|
return typeof radians === "number" ? radians / (Math.PI / 180) : radians;
|
|
8340
8360
|
}
|
|
8341
|
-
|
|
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;
|
|
8342
8371
|
const {
|
|
8343
8372
|
left,
|
|
8344
8373
|
right,
|
|
8345
8374
|
top,
|
|
8346
8375
|
bottom
|
|
8347
|
-
} =
|
|
8348
|
-
const {
|
|
8349
|
-
width,
|
|
8350
|
-
height
|
|
8351
|
-
} = props;
|
|
8376
|
+
} = padding;
|
|
8352
8377
|
return Math.min(width - left - right, height - top - bottom) / 2;
|
|
8353
8378
|
}
|
|
8379
|
+
|
|
8380
|
+
/**
|
|
8381
|
+
* Returns the origin for a polar chart within the padded area
|
|
8382
|
+
*/
|
|
8354
8383
|
function getPolarOrigin(props) {
|
|
8355
8384
|
const {
|
|
8356
8385
|
width,
|
|
@@ -8361,7 +8390,7 @@ function getPolarOrigin(props) {
|
|
|
8361
8390
|
bottom,
|
|
8362
8391
|
left,
|
|
8363
8392
|
right
|
|
8364
|
-
} = getPadding(props);
|
|
8393
|
+
} = getPadding(props.padding);
|
|
8365
8394
|
const radius = Math.min(width - left - right, height - top - bottom) / 2;
|
|
8366
8395
|
const offsetWidth = width / 2 + left - right;
|
|
8367
8396
|
const offsetHeight = height / 2 + top - bottom;
|
|
@@ -8370,13 +8399,30 @@ function getPolarOrigin(props) {
|
|
|
8370
8399
|
y: offsetHeight + radius > height ? radius + top - bottom : offsetHeight
|
|
8371
8400
|
};
|
|
8372
8401
|
}
|
|
8402
|
+
|
|
8403
|
+
/**
|
|
8404
|
+
* Determine the range of an axis based on the given props
|
|
8405
|
+
*/
|
|
8373
8406
|
function getRange(props, axis) {
|
|
8374
8407
|
if (props.range && props.range[axis]) {
|
|
8375
8408
|
return props.range[axis];
|
|
8376
8409
|
} else if (props.range && Array.isArray(props.range)) {
|
|
8377
8410
|
return props.range;
|
|
8378
8411
|
}
|
|
8379
|
-
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
|
+
});
|
|
8380
8426
|
}
|
|
8381
8427
|
|
|
8382
8428
|
/**
|
|
@@ -8408,7 +8454,7 @@ function createAccessor(key) {
|
|
|
8408
8454
|
return x => x;
|
|
8409
8455
|
}
|
|
8410
8456
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
8411
|
-
return
|
|
8457
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_2___default()(key);
|
|
8412
8458
|
}
|
|
8413
8459
|
function modifyProps(props, fallbackProps, role) {
|
|
8414
8460
|
const theme = props.theme && props.theme[role] ? props.theme[role] : {};
|
|
@@ -8417,7 +8463,7 @@ function modifyProps(props, fallbackProps, role) {
|
|
|
8417
8463
|
const defaultObject = horizontal === undefined ? {} : {
|
|
8418
8464
|
horizontal
|
|
8419
8465
|
};
|
|
8420
|
-
return
|
|
8466
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(defaultObject, props, themeProps, fallbackProps);
|
|
8421
8467
|
}
|
|
8422
8468
|
|
|
8423
8469
|
/**
|
|
@@ -8504,10 +8550,10 @@ initialMemo, combine) {
|
|
|
8504
8550
|
const childRole = child.type && child.type.role;
|
|
8505
8551
|
const childName = child.props.name || `${childRole}-${names[index]}`;
|
|
8506
8552
|
if (child.props && child.props.children) {
|
|
8507
|
-
const childProps = Object.assign({}, child.props,
|
|
8508
|
-
const nestedChildren = child.type && child.type.role === "stack" && isFunction(child.type.getChildren) ? child.type.getChildren(childProps) :
|
|
8509
|
-
const nestedChildProps = Object.assign({}, c.props,
|
|
8510
|
-
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);
|
|
8511
8557
|
});
|
|
8512
8558
|
const childNames = nestedChildren.map((c, i) => `${childName}-${i}`);
|
|
8513
8559
|
const nestedResults = traverseChildren(nestedChildren, childNames, child);
|
|
@@ -8521,7 +8567,7 @@ initialMemo, combine) {
|
|
|
8521
8567
|
return newMemo;
|
|
8522
8568
|
}, initialMemo);
|
|
8523
8569
|
};
|
|
8524
|
-
const validChildren = children.filter(
|
|
8570
|
+
const validChildren = children.filter(react__WEBPACK_IMPORTED_MODULE_0__.isValidElement);
|
|
8525
8571
|
const childNames = validChildren.map((c, i) => i);
|
|
8526
8572
|
return traverseChildren(validChildren, childNames);
|
|
8527
8573
|
}
|
|
@@ -8541,10 +8587,10 @@ function isHorizontal(props) {
|
|
|
8541
8587
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
8542
8588
|
return memo || childProps.horizontal;
|
|
8543
8589
|
}
|
|
8544
|
-
return traverseChildren(
|
|
8590
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(childProps.children));
|
|
8545
8591
|
}, false);
|
|
8546
8592
|
};
|
|
8547
|
-
return traverseChildren(
|
|
8593
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children));
|
|
8548
8594
|
}
|
|
8549
8595
|
|
|
8550
8596
|
/***/ }),
|
|
@@ -8560,10 +8606,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8560
8606
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8561
8607
|
/* harmony export */ "useAnimationState": function() { return /* binding */ useAnimationState; }
|
|
8562
8608
|
/* harmony export */ });
|
|
8563
|
-
/* harmony import */ var
|
|
8564
|
-
/* harmony import */ var
|
|
8565
|
-
/* harmony import */ var
|
|
8566
|
-
/* 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__);
|
|
8567
8613
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../collection */ "../../victory-core/es/victory-util/collection.js");
|
|
8568
8614
|
/* harmony import */ var _transitions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../transitions */ "../../victory-core/es/victory-util/transitions.js");
|
|
8569
8615
|
|
|
@@ -8579,10 +8625,10 @@ const useAnimationState = function (initialState) {
|
|
|
8579
8625
|
if (initialState === void 0) {
|
|
8580
8626
|
initialState = INITIAL_STATE;
|
|
8581
8627
|
}
|
|
8582
|
-
const [state, _setState] =
|
|
8628
|
+
const [state, _setState] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(initialState);
|
|
8583
8629
|
|
|
8584
8630
|
// This allows us to use a state object and maintain the same API as this.setState
|
|
8585
|
-
const setState =
|
|
8631
|
+
const setState = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback(newState => {
|
|
8586
8632
|
_setState(oldState => ({
|
|
8587
8633
|
...oldState,
|
|
8588
8634
|
...newState
|
|
@@ -8590,14 +8636,14 @@ const useAnimationState = function (initialState) {
|
|
|
8590
8636
|
}, [_setState]);
|
|
8591
8637
|
|
|
8592
8638
|
// This is a copy of Wrapper.getAnimationProps
|
|
8593
|
-
const getAnimationProps =
|
|
8639
|
+
const getAnimationProps = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback((props, child, index) => {
|
|
8594
8640
|
if (!props?.animate) {
|
|
8595
8641
|
return child.props.animate;
|
|
8596
8642
|
}
|
|
8597
8643
|
const getFilteredState = () => {
|
|
8598
8644
|
let childrenTransitions = state && state.childrenTransitions;
|
|
8599
8645
|
childrenTransitions = _collection__WEBPACK_IMPORTED_MODULE_2__.isArrayOfArrays(childrenTransitions) ? childrenTransitions[index] : childrenTransitions;
|
|
8600
|
-
return
|
|
8646
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8601
8647
|
childrenTransitions
|
|
8602
8648
|
}, state);
|
|
8603
8649
|
};
|
|
@@ -8608,28 +8654,28 @@ const useAnimationState = function (initialState) {
|
|
|
8608
8654
|
const getTransitionProps = _transitions__WEBPACK_IMPORTED_MODULE_3__.getTransitionPropsFactory(props, filteredState, newState => setState(newState));
|
|
8609
8655
|
getTransitions = childComponent => getTransitionProps(childComponent, index);
|
|
8610
8656
|
}
|
|
8611
|
-
return
|
|
8657
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8612
8658
|
getTransitions,
|
|
8613
8659
|
parentState
|
|
8614
8660
|
}, props.animate, child.props.animate);
|
|
8615
8661
|
}, [state, setState]);
|
|
8616
8662
|
|
|
8617
8663
|
// This is a copy of Wrapper.setAnimationState
|
|
8618
|
-
const setAnimationState =
|
|
8664
|
+
const setAnimationState = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback((props, nextProps) => {
|
|
8619
8665
|
if (!props?.animate) {
|
|
8620
8666
|
return;
|
|
8621
8667
|
}
|
|
8622
8668
|
if (props.animate.parentState) {
|
|
8623
8669
|
const nodesWillExit = props.animate.parentState.nodesWillExit;
|
|
8624
8670
|
const oldProps = nodesWillExit ? props : null;
|
|
8625
|
-
const newState =
|
|
8671
|
+
const newState = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8626
8672
|
oldProps,
|
|
8627
8673
|
nextProps
|
|
8628
8674
|
}, props.animate.parentState);
|
|
8629
8675
|
setState(newState);
|
|
8630
8676
|
} else {
|
|
8631
|
-
const oldChildren =
|
|
8632
|
-
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);
|
|
8633
8679
|
const isContinuous = child => {
|
|
8634
8680
|
const check = c => c.type && c.type.continuous;
|
|
8635
8681
|
return Array.isArray(child) ? child.some(check) : check(child);
|
|
@@ -8654,7 +8700,7 @@ const useAnimationState = function (initialState) {
|
|
|
8654
8700
|
});
|
|
8655
8701
|
}
|
|
8656
8702
|
}, [setState]);
|
|
8657
|
-
const getProps =
|
|
8703
|
+
const getProps = react__WEBPACK_IMPORTED_MODULE_0___default().useCallback(initialProps => {
|
|
8658
8704
|
return state && state.nodesWillExit ? state.oldProps || initialProps : initialProps;
|
|
8659
8705
|
}, [state]);
|
|
8660
8706
|
return {
|
|
@@ -8755,11 +8801,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8755
8801
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8756
8802
|
/* harmony export */ "warn": function() { return /* binding */ warn; }
|
|
8757
8803
|
/* harmony export */ });
|
|
8758
|
-
/* global console */
|
|
8804
|
+
/* global console process */
|
|
8759
8805
|
/* eslint-disable no-console */
|
|
8760
8806
|
|
|
8761
|
-
// TODO: Use "warning" npm module like React is switching to.
|
|
8762
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
|
|
8763
8810
|
if (true) {
|
|
8764
8811
|
if (console && console.warn) {
|
|
8765
8812
|
console.warn(message);
|
|
@@ -9143,12 +9190,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9143
9190
|
/* harmony export */ "getInitialTransitionState": function() { return /* binding */ getInitialTransitionState; },
|
|
9144
9191
|
/* harmony export */ "getTransitionPropsFactory": function() { return /* binding */ getTransitionPropsFactory; }
|
|
9145
9192
|
/* harmony export */ });
|
|
9146
|
-
/* harmony import */ var
|
|
9147
|
-
/* 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__);
|
|
9148
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");
|
|
9149
9196
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
9150
|
-
/* harmony import */ var
|
|
9151
|
-
/* 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__);
|
|
9152
9199
|
|
|
9153
9200
|
|
|
9154
9201
|
|
|
@@ -9239,13 +9286,13 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
9239
9286
|
const getTransitionsFromChildren = (old, next) => {
|
|
9240
9287
|
return old.map((child, idx) => {
|
|
9241
9288
|
if (child && child.props && child.props.children && next[idx]) {
|
|
9242
|
-
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));
|
|
9243
9290
|
}
|
|
9244
9291
|
// get Transition entering and exiting nodes
|
|
9245
9292
|
return getTransition(child, next[idx]);
|
|
9246
9293
|
});
|
|
9247
9294
|
};
|
|
9248
|
-
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));
|
|
9249
9296
|
return {
|
|
9250
9297
|
nodesWillExit,
|
|
9251
9298
|
nodesWillEnter,
|
|
@@ -9259,7 +9306,7 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
9259
9306
|
};
|
|
9260
9307
|
}
|
|
9261
9308
|
function getInitialChildProps(animate, data) {
|
|
9262
|
-
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());
|
|
9263
9310
|
return {
|
|
9264
9311
|
data: data.map((datum, idx) => Object.assign({}, datum, after(datum, idx, data)))
|
|
9265
9312
|
};
|
|
@@ -9276,7 +9323,7 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
9276
9323
|
data
|
|
9277
9324
|
};
|
|
9278
9325
|
}
|
|
9279
|
-
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());
|
|
9280
9327
|
// If nodes need to exit, transform them with the provided onLoad.before function.
|
|
9281
9328
|
const newData = data.map((datum, idx) => {
|
|
9282
9329
|
return Object.assign({}, datum, before(datum, idx, data));
|
|
@@ -9298,7 +9345,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
9298
9345
|
data
|
|
9299
9346
|
};
|
|
9300
9347
|
}
|
|
9301
|
-
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());
|
|
9302
9349
|
// If nodes need to exit, transform them with the provided onLoad.after function.
|
|
9303
9350
|
newData = data.map((datum, idx) => {
|
|
9304
9351
|
return Object.assign({}, datum, after(datum, idx, data));
|
|
@@ -9320,7 +9367,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
9320
9367
|
// After the exit transition occurs, trigger the animations for
|
|
9321
9368
|
// nodes that are neither exiting nor entering.
|
|
9322
9369
|
animate.onEnd = cb;
|
|
9323
|
-
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());
|
|
9324
9371
|
// If nodes need to exit, transform them with the provided onExit.before function.
|
|
9325
9372
|
newData = data.map((datum, idx) => {
|
|
9326
9373
|
const key = (datum.key || idx).toString();
|
|
@@ -9343,7 +9390,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
9343
9390
|
newAnimate = Object.assign({}, animate, {
|
|
9344
9391
|
onEnd: cb
|
|
9345
9392
|
});
|
|
9346
|
-
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());
|
|
9347
9394
|
// We want the entering nodes to be included in the transition target
|
|
9348
9395
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
9349
9396
|
// so perform the `onEnter.before` transformation on each node.
|
|
@@ -9370,7 +9417,7 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
9370
9417
|
// domain should encompass the nodes that will now enter. So perform
|
|
9371
9418
|
// the `onEnter.after` transformation on each node.
|
|
9372
9419
|
newAnimate.onEnd = cb;
|
|
9373
|
-
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());
|
|
9374
9421
|
newData = data.map((datum, idx) => {
|
|
9375
9422
|
const key = getDatumKey(datum, idx);
|
|
9376
9423
|
return enteringNodes[key] ? Object.assign({}, datum, after(datum, idx, data)) : datum;
|
|
@@ -9662,16 +9709,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9662
9709
|
/* harmony export */ "getStyle": function() { return /* binding */ getStyle; },
|
|
9663
9710
|
/* harmony export */ "getWidth": function() { return /* binding */ getWidth; }
|
|
9664
9711
|
/* harmony export */ });
|
|
9665
|
-
/* harmony import */ var
|
|
9666
|
-
/* harmony import */ var
|
|
9667
|
-
/* harmony import */ var
|
|
9668
|
-
/* 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__);
|
|
9669
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");
|
|
9670
9717
|
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_2__);
|
|
9671
|
-
/* harmony import */ var
|
|
9672
|
-
/* harmony import */ var
|
|
9673
|
-
/* harmony import */ var
|
|
9674
|
-
/* 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__);
|
|
9675
9722
|
/* harmony import */ var _axis__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./axis */ "../../victory-core/es/victory-util/axis.js");
|
|
9676
9723
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./style */ "../../victory-core/es/victory-util/style.js");
|
|
9677
9724
|
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
@@ -9765,7 +9812,7 @@ function getDataFromChildren(props, childComponents) {
|
|
|
9765
9812
|
maxDomain
|
|
9766
9813
|
};
|
|
9767
9814
|
let stack = 0;
|
|
9768
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
9815
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
9769
9816
|
parentProps = addBinsToParentPropsIfHistogram({
|
|
9770
9817
|
children,
|
|
9771
9818
|
props,
|
|
@@ -9779,7 +9826,7 @@ function getDataFromChildren(props, childComponents) {
|
|
|
9779
9826
|
if (!_data__WEBPACK_IMPORTED_MODULE_7__.isDataComponent(child)) {
|
|
9780
9827
|
return null;
|
|
9781
9828
|
} else if (child.type && _helpers__WEBPACK_IMPORTED_MODULE_6__.isFunction(child.type.getData)) {
|
|
9782
|
-
childElement = parent ? /*#__PURE__*/
|
|
9829
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, parent.props) : child;
|
|
9783
9830
|
childData = childElement.type.getData(childProps);
|
|
9784
9831
|
} else {
|
|
9785
9832
|
childData = _data__WEBPACK_IMPORTED_MODULE_7__.getData(childProps);
|
|
@@ -9791,16 +9838,16 @@ function getDataFromChildren(props, childComponents) {
|
|
|
9791
9838
|
}, datum));
|
|
9792
9839
|
};
|
|
9793
9840
|
const stacked = children.filter(c => c.type && c.type.role === "stack").length;
|
|
9794
|
-
const combine = (memo, val) => memo.concat(
|
|
9841
|
+
const combine = (memo, val) => memo.concat(lodash_uniqBy__WEBPACK_IMPORTED_MODULE_4___default()(val, "_group"));
|
|
9795
9842
|
const datasets = _helpers__WEBPACK_IMPORTED_MODULE_6__.reduceChildren(children, iteratee, props, [], combine);
|
|
9796
9843
|
const group = stacked ? "_group" : "_stack";
|
|
9797
|
-
return Object.values(
|
|
9844
|
+
return Object.values(lodash_groupBy__WEBPACK_IMPORTED_MODULE_3___default()(datasets, group));
|
|
9798
9845
|
}
|
|
9799
9846
|
function getData(props, childComponents) {
|
|
9800
9847
|
if (props.data) {
|
|
9801
9848
|
return _data__WEBPACK_IMPORTED_MODULE_7__.getData(props);
|
|
9802
9849
|
}
|
|
9803
|
-
return getDataFromChildren(props, childComponents ||
|
|
9850
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children));
|
|
9804
9851
|
}
|
|
9805
9852
|
function getWidth(props, groupLength, seriesLength) {
|
|
9806
9853
|
const {
|
|
@@ -9852,7 +9899,7 @@ function getDefaultDomainPadding(props, axis, childComponents) {
|
|
|
9852
9899
|
};
|
|
9853
9900
|
}
|
|
9854
9901
|
function getDomainFromChildren(props, axis, childComponents) {
|
|
9855
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
9902
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
9856
9903
|
const parentData = props.data ? _data__WEBPACK_IMPORTED_MODULE_7__.getData(props) : undefined;
|
|
9857
9904
|
const {
|
|
9858
9905
|
polar,
|
|
@@ -9890,7 +9937,7 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
9890
9937
|
return [min, max];
|
|
9891
9938
|
}
|
|
9892
9939
|
function getDomain(props, axis, childComponents) {
|
|
9893
|
-
const children = childComponents ||
|
|
9940
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
9894
9941
|
const propsDomain = _domain__WEBPACK_IMPORTED_MODULE_8__.getDomainFromProps(props, axis);
|
|
9895
9942
|
const domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
9896
9943
|
let domain;
|
|
@@ -9914,7 +9961,7 @@ function getScale(props, axis, childComponents) {
|
|
|
9914
9961
|
if (props.data) {
|
|
9915
9962
|
return _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis);
|
|
9916
9963
|
}
|
|
9917
|
-
const children = childComponents ? childComponents.slice(0) :
|
|
9964
|
+
const children = childComponents ? childComponents.slice(0) : react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
9918
9965
|
const iteratee = child => {
|
|
9919
9966
|
const sharedProps = Object.assign({}, child.props, {
|
|
9920
9967
|
horizontal: props.horizontal
|
|
@@ -9983,8 +10030,8 @@ function getChildStyle(child, index, calculatedProps, theme) {
|
|
|
9983
10030
|
const dataWidth = role === "stack" ? {} : {
|
|
9984
10031
|
width: getWidth(calculatedProps)
|
|
9985
10032
|
};
|
|
9986
|
-
const dataStyle =
|
|
9987
|
-
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);
|
|
9988
10035
|
return {
|
|
9989
10036
|
...childStyle,
|
|
9990
10037
|
parent: style.parent,
|
|
@@ -10040,7 +10087,7 @@ function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
|
10040
10087
|
return lodash_uniq__WEBPACK_IMPORTED_MODULE_2___default()([...categoryStrings, ...axisStrings].flat());
|
|
10041
10088
|
}
|
|
10042
10089
|
function getStringsFromChildren(props, childComponents) {
|
|
10043
|
-
const children = childComponents ||
|
|
10090
|
+
const children = childComponents || react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
10044
10091
|
const xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
10045
10092
|
const yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
10046
10093
|
const dataStrings = getStringsFromData(children);
|
|
@@ -10075,22 +10122,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10075
10122
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10076
10123
|
/* harmony export */ "VictorySharedEvents": function() { return /* binding */ VictorySharedEvents; }
|
|
10077
10124
|
/* harmony export */ });
|
|
10078
|
-
/* harmony import */ var
|
|
10079
|
-
/* harmony import */ var
|
|
10080
|
-
/* harmony import */ var
|
|
10081
|
-
/* harmony import */ var
|
|
10082
|
-
/* harmony import */ var
|
|
10083
|
-
/* harmony import */ var
|
|
10084
|
-
/* harmony import */ var
|
|
10085
|
-
/* harmony import */ var
|
|
10086
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
10087
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/events.js");
|
|
10088
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/collection.js");
|
|
10089
|
-
/* 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__);
|
|
10090
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");
|
|
10091
10134
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_4__);
|
|
10092
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");
|
|
10093
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");
|
|
10094
10141
|
|
|
10095
10142
|
|
|
10096
10143
|
|
|
@@ -10106,12 +10153,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10106
10153
|
|
|
10107
10154
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
10108
10155
|
|
|
10109
|
-
class VictorySharedEvents extends (
|
|
10156
|
+
class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
|
10110
10157
|
static displayName = "VictorySharedEvents";
|
|
10111
10158
|
static role = "shared-event-wrapper";
|
|
10112
10159
|
static contextType = victory_core__WEBPACK_IMPORTED_MODULE_6__["default"];
|
|
10113
10160
|
static defaultProps = {
|
|
10114
|
-
groupComponent: /*#__PURE__*/
|
|
10161
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null)
|
|
10115
10162
|
};
|
|
10116
10163
|
constructor(props) {
|
|
10117
10164
|
super(props);
|
|
@@ -10168,7 +10215,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10168
10215
|
return props.events;
|
|
10169
10216
|
}
|
|
10170
10217
|
applyExternalMutations(props, externalMutations) {
|
|
10171
|
-
if (!
|
|
10218
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
10172
10219
|
const callbacks = props.externalEventMutations.reduce((memo, mutation) => victory_core__WEBPACK_IMPORTED_MODULE_9__.isFunction(mutation.callback) ? memo.concat(mutation.callback) : memo, []);
|
|
10173
10220
|
const compiledCallbacks = callbacks.length ? () => {
|
|
10174
10221
|
callbacks.forEach(c => c());
|
|
@@ -10177,7 +10224,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10177
10224
|
}
|
|
10178
10225
|
}
|
|
10179
10226
|
getExternalMutations(props, baseProps) {
|
|
10180
|
-
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;
|
|
10181
10228
|
}
|
|
10182
10229
|
cacheSharedEvents(name, sharedEvents, cacheValues) {
|
|
10183
10230
|
this.sharedEventsCache[name] = [sharedEvents, cacheValues];
|
|
@@ -10193,7 +10240,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10193
10240
|
const {
|
|
10194
10241
|
container
|
|
10195
10242
|
} = props;
|
|
10196
|
-
const children =
|
|
10243
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(this.props.children);
|
|
10197
10244
|
const childBaseProps = this.getBasePropsFromChildren(children);
|
|
10198
10245
|
const parentBaseProps = container ? container.props : {};
|
|
10199
10246
|
return Object.assign({}, childBaseProps, {
|
|
@@ -10209,7 +10256,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10209
10256
|
return null;
|
|
10210
10257
|
};
|
|
10211
10258
|
const baseProps = victory_core__WEBPACK_IMPORTED_MODULE_9__.reduceChildren(childComponents, iteratee);
|
|
10212
|
-
return
|
|
10259
|
+
return lodash_fromPairs__WEBPACK_IMPORTED_MODULE_3___default()(baseProps);
|
|
10213
10260
|
}
|
|
10214
10261
|
getNewChildren(props, baseProps) {
|
|
10215
10262
|
const {
|
|
@@ -10219,9 +10266,9 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10219
10266
|
const alterChildren = (children, childNames) => {
|
|
10220
10267
|
return children.reduce((memo, child, index) => {
|
|
10221
10268
|
if (child.props.children) {
|
|
10222
|
-
const newChildren =
|
|
10269
|
+
const newChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children);
|
|
10223
10270
|
const names = childNames.slice(index, index + newChildren.length);
|
|
10224
|
-
const results = /*#__PURE__*/
|
|
10271
|
+
const results = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, child.props, alterChildren(newChildren, names));
|
|
10225
10272
|
return memo.concat(results);
|
|
10226
10273
|
} else if (childNames[index] !== "parent" && child.type && victory_core__WEBPACK_IMPORTED_MODULE_9__.isFunction(child.type.getBaseProps)) {
|
|
10227
10274
|
const name = child.props.name || childNames[index];
|
|
@@ -10240,7 +10287,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10240
10287
|
getEventState: (key, target) => this.getEventState(key, target, name)
|
|
10241
10288
|
};
|
|
10242
10289
|
this.cacheSharedEvents(name, sharedEvents, sharedEventsCacheValues);
|
|
10243
|
-
return memo.concat( /*#__PURE__*/
|
|
10290
|
+
return memo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, Object.assign({
|
|
10244
10291
|
key: `events-${name}`,
|
|
10245
10292
|
sharedEvents,
|
|
10246
10293
|
eventKey,
|
|
@@ -10251,7 +10298,7 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10251
10298
|
}, []);
|
|
10252
10299
|
};
|
|
10253
10300
|
const childNames = Object.keys(baseProps);
|
|
10254
|
-
const childComponents =
|
|
10301
|
+
const childComponents = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
10255
10302
|
return alterChildren(childComponents, childNames);
|
|
10256
10303
|
}
|
|
10257
10304
|
getContainer(props, baseProps, events) {
|
|
@@ -10270,22 +10317,22 @@ class VictorySharedEvents extends (react__WEBPACK_IMPORTED_MODULE_3___default().
|
|
|
10270
10317
|
const parentEvents = sharedEvents && boundGetEvents({
|
|
10271
10318
|
sharedEvents
|
|
10272
10319
|
}, "parent");
|
|
10273
|
-
const parentProps =
|
|
10320
|
+
const parentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, this.getEventState("parent", "parent"), containerProps, baseProps.parent, {
|
|
10274
10321
|
children
|
|
10275
10322
|
});
|
|
10276
|
-
const containerEvents =
|
|
10323
|
+
const containerEvents = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, victory_core__WEBPACK_IMPORTED_MODULE_7__.getPartialEvents(parentEvents, "parent", parentProps), containerProps.events);
|
|
10277
10324
|
this.globalEvents = victory_core__WEBPACK_IMPORTED_MODULE_7__.getGlobalEvents(containerEvents);
|
|
10278
10325
|
const localEvents = victory_core__WEBPACK_IMPORTED_MODULE_7__.omitGlobalEvents(containerEvents);
|
|
10279
|
-
return role === "container" ? /*#__PURE__*/
|
|
10326
|
+
return role === "container" ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(container, Object.assign({}, parentProps, {
|
|
10280
10327
|
events: localEvents
|
|
10281
|
-
})) : /*#__PURE__*/
|
|
10328
|
+
})) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(container, localEvents, children);
|
|
10282
10329
|
}
|
|
10283
10330
|
render() {
|
|
10284
10331
|
const events = this.getAllEvents(this.props);
|
|
10285
10332
|
if (events) {
|
|
10286
10333
|
return this.getContainer(this.props, this.baseProps, events);
|
|
10287
10334
|
}
|
|
10288
|
-
return /*#__PURE__*/
|
|
10335
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(this.props.container, {
|
|
10289
10336
|
children: this.props.children
|
|
10290
10337
|
});
|
|
10291
10338
|
}
|