victory-scatter 37.3.2 → 37.3.4
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-scatter.js +292 -246
- package/dist/victory-scatter.min.js +1 -1
- package/es/helper-methods.js +1 -1
- package/es/victory-scatter.d.ts +7 -7
- package/lib/helper-methods.js +1 -1
- package/lib/victory-scatter.d.ts +7 -7
- package/package.json +2 -30
- package/src/helper-methods.tsx +3 -1
package/dist/victory-scatter.js
CHANGED
|
@@ -48,7 +48,7 @@ const getBubbleSize = (datum, props) => {
|
|
|
48
48
|
const zMin = Math.min(...zData);
|
|
49
49
|
const zMax = Math.max(...zData);
|
|
50
50
|
const getMaxRadius = () => {
|
|
51
|
-
const minPadding = Math.min(...Object.values(victory_core__WEBPACK_IMPORTED_MODULE_0__.getPadding(props)));
|
|
51
|
+
const minPadding = Math.min(...Object.values(victory_core__WEBPACK_IMPORTED_MODULE_0__.getPadding(props.padding)));
|
|
52
52
|
return Math.max(minPadding, 5); // eslint-disable-line no-magic-numbers
|
|
53
53
|
};
|
|
54
54
|
const maxRadius = maxBubbleSize || getMaxRadius();
|
|
@@ -4730,10 +4730,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4730
4730
|
/* harmony export */ "isInterpolatable": function() { return /* binding */ isInterpolatable; },
|
|
4731
4731
|
/* harmony export */ "victoryInterpolator": function() { return /* binding */ victoryInterpolator; }
|
|
4732
4732
|
/* harmony export */ });
|
|
4733
|
-
/* harmony import */ var
|
|
4734
|
-
/* harmony import */ var
|
|
4735
|
-
/* harmony import */ var
|
|
4736
|
-
/* harmony import */ var
|
|
4733
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isPlainObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isPlainObject.js");
|
|
4734
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__);
|
|
4735
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/orderBy */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/orderBy.js");
|
|
4736
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_orderBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
4737
4737
|
/* harmony import */ var victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-vendor/d3-interpolate */ "../../victory-vendor/es/d3-interpolate.js");
|
|
4738
4738
|
|
|
4739
4739
|
|
|
@@ -4759,7 +4759,7 @@ const isInterpolatable = function (obj) {
|
|
|
4759
4759
|
return false;
|
|
4760
4760
|
case "object":
|
|
4761
4761
|
// Don't try to interpolate class instances (except Date or Array).
|
|
4762
|
-
return obj instanceof Date || Array.isArray(obj) ||
|
|
4762
|
+
return obj instanceof Date || Array.isArray(obj) || lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(obj);
|
|
4763
4763
|
case "function":
|
|
4764
4764
|
// Careful! There may be extra properties on function objects that the
|
|
4765
4765
|
// component expects to access - for instance, it may be a `d3.scale()`
|
|
@@ -4845,7 +4845,7 @@ const interpolateObject = function (startValue, endValue) {
|
|
|
4845
4845
|
if (typeof x === "function" || typeof y === "function") {
|
|
4846
4846
|
return interpolateFunction(x, y);
|
|
4847
4847
|
}
|
|
4848
|
-
if (typeof x === "object" &&
|
|
4848
|
+
if (typeof x === "object" && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(x) || typeof y === "object" && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(y)) {
|
|
4849
4849
|
return interpolateObject(x, y);
|
|
4850
4850
|
}
|
|
4851
4851
|
return (0,victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(x, y);
|
|
@@ -4854,7 +4854,7 @@ const interpolateObject = function (startValue, endValue) {
|
|
|
4854
4854
|
// When the value is an array, attempt to sort by "key" so that animating nodes may be identified
|
|
4855
4855
|
// based on "key" instead of index
|
|
4856
4856
|
const keyData = val => {
|
|
4857
|
-
return Array.isArray(val) ?
|
|
4857
|
+
return Array.isArray(val) ? lodash_orderBy__WEBPACK_IMPORTED_MODULE_1___default()(val, "key") : val;
|
|
4858
4858
|
};
|
|
4859
4859
|
const i = {};
|
|
4860
4860
|
const c = {};
|
|
@@ -4921,7 +4921,7 @@ const victoryInterpolator = function (a, b) {
|
|
|
4921
4921
|
if (typeof a === "function" || typeof b === "function") {
|
|
4922
4922
|
return interpolateFunction(a, b);
|
|
4923
4923
|
}
|
|
4924
|
-
if (
|
|
4924
|
+
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(a) || lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(b)) {
|
|
4925
4925
|
// @ts-expect-error These generics are tough, but they work :)
|
|
4926
4926
|
return interpolateObject(a, b);
|
|
4927
4927
|
}
|
|
@@ -5097,16 +5097,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5097
5097
|
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; },
|
|
5098
5098
|
/* harmony export */ "useVictoryContainer": function() { return /* binding */ useVictoryContainer; }
|
|
5099
5099
|
/* harmony export */ });
|
|
5100
|
-
/* harmony import */ var
|
|
5101
|
-
/* harmony import */ var
|
|
5102
|
-
/* harmony import */ var
|
|
5103
|
-
/* harmony import */ var
|
|
5100
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5101
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5102
|
+
/* 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");
|
|
5103
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1__);
|
|
5104
5104
|
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
5105
5105
|
/* 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");
|
|
5106
5106
|
/* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
|
|
5107
5107
|
/* 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");
|
|
5108
5108
|
/* 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");
|
|
5109
|
-
|
|
5110
5109
|
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); }
|
|
5111
5110
|
|
|
5112
5111
|
|
|
@@ -5114,9 +5113,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
5114
5113
|
|
|
5115
5114
|
|
|
5116
5115
|
|
|
5116
|
+
|
|
5117
5117
|
const defaultProps = {
|
|
5118
5118
|
className: "VictoryContainer",
|
|
5119
|
-
portalComponent: /*#__PURE__*/
|
|
5119
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
5120
5120
|
portalZIndex: 99,
|
|
5121
5121
|
responsive: true,
|
|
5122
5122
|
role: "img"
|
|
@@ -5133,10 +5133,10 @@ function useVictoryContainer(initialProps) {
|
|
|
5133
5133
|
height,
|
|
5134
5134
|
responsive
|
|
5135
5135
|
} = props;
|
|
5136
|
-
const localContainerRef = (0,
|
|
5136
|
+
const localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
5137
5137
|
|
|
5138
5138
|
// Generated ID stored in ref because it needs to persist across renders
|
|
5139
|
-
const generatedId = (0,
|
|
5139
|
+
const generatedId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default()("victory-container-"));
|
|
5140
5140
|
const containerId = props.containerId ?? generatedId.current;
|
|
5141
5141
|
const getIdForElement = elName => `${containerId}-${elName}`;
|
|
5142
5142
|
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props);
|
|
@@ -5195,7 +5195,7 @@ const VictoryContainer = initialProps => {
|
|
|
5195
5195
|
containerRef,
|
|
5196
5196
|
localContainerRef
|
|
5197
5197
|
} = useVictoryContainer(initialProps);
|
|
5198
|
-
|
|
5198
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
5199
5199
|
if (!events?.onWheel) return;
|
|
5200
5200
|
const handleWheel = e => e.preventDefault();
|
|
5201
5201
|
const container = localContainerRef?.current;
|
|
@@ -5205,7 +5205,7 @@ const VictoryContainer = initialProps => {
|
|
|
5205
5205
|
};
|
|
5206
5206
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5207
5207
|
}, []);
|
|
5208
|
-
return /*#__PURE__*/
|
|
5208
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
5209
5209
|
className: className,
|
|
5210
5210
|
style: {
|
|
5211
5211
|
...style,
|
|
@@ -5219,7 +5219,7 @@ const VictoryContainer = initialProps => {
|
|
|
5219
5219
|
"data-ouia-component-type": ouiaType,
|
|
5220
5220
|
"data-ouia-safe": ouiaSafe,
|
|
5221
5221
|
ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
|
|
5222
|
-
}, /*#__PURE__*/
|
|
5222
|
+
}, /*#__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({
|
|
5223
5223
|
width: width,
|
|
5224
5224
|
height: height,
|
|
5225
5225
|
tabIndex: tabIndex,
|
|
@@ -5232,11 +5232,11 @@ const VictoryContainer = initialProps => {
|
|
|
5232
5232
|
...dimensions,
|
|
5233
5233
|
pointerEvents: "all"
|
|
5234
5234
|
}
|
|
5235
|
-
}, userProps, events), title ? /*#__PURE__*/
|
|
5235
|
+
}, userProps, events), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("title", {
|
|
5236
5236
|
id: titleId
|
|
5237
|
-
}, title) : null, desc ? /*#__PURE__*/
|
|
5237
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("desc", {
|
|
5238
5238
|
id: descId
|
|
5239
|
-
}, desc) : null, children), /*#__PURE__*/
|
|
5239
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
5240
5240
|
style: {
|
|
5241
5241
|
...dimensions,
|
|
5242
5242
|
zIndex: portalZIndex,
|
|
@@ -5244,7 +5244,7 @@ const VictoryContainer = initialProps => {
|
|
|
5244
5244
|
top: 0,
|
|
5245
5245
|
left: 0
|
|
5246
5246
|
}
|
|
5247
|
-
}, /*#__PURE__*/
|
|
5247
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__.PortalOutlet, {
|
|
5248
5248
|
as: portalComponent,
|
|
5249
5249
|
width: width,
|
|
5250
5250
|
height: height,
|
|
@@ -5271,12 +5271,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5271
5271
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5272
5272
|
/* harmony export */ "VictoryLabel": function() { return /* binding */ VictoryLabel; }
|
|
5273
5273
|
/* harmony export */ });
|
|
5274
|
-
/* harmony import */ var
|
|
5275
|
-
/* harmony import */ var
|
|
5274
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5275
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5276
5276
|
/* 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");
|
|
5277
5277
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
5278
|
-
/* harmony import */ var
|
|
5279
|
-
/* harmony import */ var
|
|
5278
|
+
/* 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");
|
|
5279
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
5280
5280
|
/* harmony import */ var _victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../victory-portal/victory-portal */ "../../victory-core/es/victory-portal/victory-portal.js");
|
|
5281
5281
|
/* harmony import */ var _victory_primitives_rect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-primitives/rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
5282
5282
|
/* harmony import */ var _victory_primitives_text__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../victory-primitives/text */ "../../victory-core/es/victory-primitives/text.js");
|
|
@@ -5287,9 +5287,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5287
5287
|
/* harmony import */ var _victory_util_style__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/style */ "../../victory-core/es/victory-util/style.js");
|
|
5288
5288
|
/* harmony import */ var _victory_util_textsize__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../victory-util/textsize */ "../../victory-core/es/victory-util/textsize.js");
|
|
5289
5289
|
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
5290
|
+
/* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
|
|
5290
5291
|
|
|
5291
5292
|
|
|
5292
|
-
/* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
|
|
5293
5293
|
|
|
5294
5294
|
|
|
5295
5295
|
|
|
@@ -5341,7 +5341,7 @@ const shouldUseMultilineBackgrounds = props => {
|
|
|
5341
5341
|
backgroundStyle,
|
|
5342
5342
|
backgroundPadding
|
|
5343
5343
|
} = props;
|
|
5344
|
-
return Array.isArray(backgroundStyle) && !
|
|
5344
|
+
return Array.isArray(backgroundStyle) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(backgroundStyle) || Array.isArray(backgroundPadding) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(backgroundPadding);
|
|
5345
5345
|
};
|
|
5346
5346
|
const getStyles = (style, props) => {
|
|
5347
5347
|
if (props.disableInlineStyles) {
|
|
@@ -5357,32 +5357,28 @@ const getStyles = (style, props) => {
|
|
|
5357
5357
|
fontSize: getFontSize(baseStyles)
|
|
5358
5358
|
});
|
|
5359
5359
|
};
|
|
5360
|
-
return Array.isArray(style) && !
|
|
5360
|
+
return Array.isArray(style) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(style) ? style.map(s => getSingleStyle(s)) : getSingleStyle(style);
|
|
5361
5361
|
};
|
|
5362
5362
|
const getBackgroundStyles = (style, props) => {
|
|
5363
5363
|
if (!style) {
|
|
5364
5364
|
return undefined;
|
|
5365
5365
|
}
|
|
5366
|
-
return Array.isArray(style) && !
|
|
5366
|
+
return Array.isArray(style) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(style) ? style.map(s => _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateStyle(s, props)) : _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateStyle(style, props);
|
|
5367
5367
|
};
|
|
5368
5368
|
const getBackgroundPadding = props => {
|
|
5369
5369
|
if (props.backgroundPadding && Array.isArray(props.backgroundPadding)) {
|
|
5370
5370
|
return props.backgroundPadding.map(backgroundPadding => {
|
|
5371
5371
|
const padding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(backgroundPadding, props);
|
|
5372
|
-
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(
|
|
5373
|
-
padding
|
|
5374
|
-
});
|
|
5372
|
+
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(padding);
|
|
5375
5373
|
});
|
|
5376
5374
|
}
|
|
5377
5375
|
const padding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.backgroundPadding, props);
|
|
5378
|
-
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(
|
|
5379
|
-
padding
|
|
5380
|
-
});
|
|
5376
|
+
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(padding);
|
|
5381
5377
|
};
|
|
5382
5378
|
const getLineHeight = props => {
|
|
5383
5379
|
const lineHeight = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.lineHeight, props);
|
|
5384
5380
|
if (Array.isArray(lineHeight)) {
|
|
5385
|
-
return
|
|
5381
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(lineHeight) ? [1] : lineHeight;
|
|
5386
5382
|
}
|
|
5387
5383
|
return lineHeight;
|
|
5388
5384
|
};
|
|
@@ -5502,7 +5498,7 @@ const getFullBackground = (calculatedProps, tspanValues) => {
|
|
|
5502
5498
|
x: inline ? xCoordinate - backgroundPadding.left : xCoordinate + dx - backgroundPadding.left,
|
|
5503
5499
|
y: yCoordinate
|
|
5504
5500
|
};
|
|
5505
|
-
return /*#__PURE__*/
|
|
5501
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(backgroundComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, backgroundComponent.props, backgroundProps));
|
|
5506
5502
|
};
|
|
5507
5503
|
const getInlineXOffset = (calculatedProps, textElements, index) => {
|
|
5508
5504
|
const {
|
|
@@ -5572,7 +5568,7 @@ const getChildBackgrounds = (calculatedProps, tspanValues) => {
|
|
|
5572
5568
|
x: xCoord - padding.left,
|
|
5573
5569
|
y: yCoord
|
|
5574
5570
|
};
|
|
5575
|
-
return /*#__PURE__*/
|
|
5571
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(backgroundComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, backgroundComponent.props, backgroundProps));
|
|
5576
5572
|
});
|
|
5577
5573
|
};
|
|
5578
5574
|
const getBackgroundElement = (calculatedProps, tspanValues) => {
|
|
@@ -5703,16 +5699,16 @@ const renderLabel = (calculatedProps, tspanValues) => {
|
|
|
5703
5699
|
style: currentStyle,
|
|
5704
5700
|
children: line
|
|
5705
5701
|
};
|
|
5706
|
-
return /*#__PURE__*/
|
|
5702
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(tspanComponent, tspanProps);
|
|
5707
5703
|
});
|
|
5708
|
-
return /*#__PURE__*/
|
|
5704
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(textComponent, textProps, tspans);
|
|
5709
5705
|
};
|
|
5710
5706
|
const defaultProps = {
|
|
5711
|
-
backgroundComponent: /*#__PURE__*/
|
|
5712
|
-
groupComponent: /*#__PURE__*/
|
|
5707
|
+
backgroundComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_rect__WEBPACK_IMPORTED_MODULE_8__.Rect, null),
|
|
5708
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null),
|
|
5713
5709
|
direction: "inherit",
|
|
5714
|
-
textComponent: /*#__PURE__*/
|
|
5715
|
-
tspanComponent: /*#__PURE__*/
|
|
5710
|
+
textComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_text__WEBPACK_IMPORTED_MODULE_9__.Text, null),
|
|
5711
|
+
tspanComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_tspan__WEBPACK_IMPORTED_MODULE_10__.TSpan, null),
|
|
5716
5712
|
capHeight: 0.71,
|
|
5717
5713
|
// Magic number from d3.
|
|
5718
5714
|
lineHeight: 1
|
|
@@ -5749,10 +5745,10 @@ const VictoryLabel = initialProps => {
|
|
|
5749
5745
|
if (props.backgroundStyle) {
|
|
5750
5746
|
const backgroundElement = getBackgroundElement(calculatedProps, tspanValues);
|
|
5751
5747
|
const children = [backgroundElement, label];
|
|
5752
|
-
const backgroundWithLabel = /*#__PURE__*/
|
|
5753
|
-
return props.renderInPortal ? /*#__PURE__*/
|
|
5748
|
+
const backgroundWithLabel = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.groupComponent, {}, children);
|
|
5749
|
+
return props.renderInPortal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__.VictoryPortal, null, backgroundWithLabel) : backgroundWithLabel;
|
|
5754
5750
|
}
|
|
5755
|
-
return props.renderInPortal ? /*#__PURE__*/
|
|
5751
|
+
return props.renderInPortal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__.VictoryPortal, null, label) : label;
|
|
5756
5752
|
};
|
|
5757
5753
|
VictoryLabel.displayName = "VictoryLabel";
|
|
5758
5754
|
VictoryLabel.role = "label";
|
|
@@ -5878,12 +5874,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5878
5874
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5879
5875
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
5880
5876
|
/* harmony export */ });
|
|
5881
|
-
/* harmony import */ var
|
|
5882
|
-
/* harmony import */ var
|
|
5877
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5878
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5883
5879
|
/* 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");
|
|
5884
5880
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
5885
|
-
/* harmony import */ var
|
|
5886
|
-
/* harmony import */ var
|
|
5881
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/uniqueId */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/uniqueId.js");
|
|
5882
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2__);
|
|
5887
5883
|
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
5888
5884
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
5889
5885
|
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
@@ -5894,14 +5890,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5894
5890
|
|
|
5895
5891
|
|
|
5896
5892
|
const defaultProps = {
|
|
5897
|
-
groupComponent: /*#__PURE__*/
|
|
5893
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null)
|
|
5898
5894
|
};
|
|
5899
5895
|
const VictoryPortal = initialProps => {
|
|
5900
5896
|
const props = {
|
|
5901
5897
|
...defaultProps,
|
|
5902
5898
|
...initialProps
|
|
5903
5899
|
};
|
|
5904
|
-
const [id] = (0,
|
|
5900
|
+
const [id] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default()());
|
|
5905
5901
|
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
5906
5902
|
if (!portalContext) {
|
|
5907
5903
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
@@ -5919,12 +5915,12 @@ const VictoryPortal = initialProps => {
|
|
|
5919
5915
|
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
5920
5916
|
key: childProps.key ?? id
|
|
5921
5917
|
});
|
|
5922
|
-
const child = children && /*#__PURE__*/
|
|
5923
|
-
|
|
5918
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(children, newProps);
|
|
5919
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
5924
5920
|
portalContext?.addChild(id, child);
|
|
5925
5921
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5926
5922
|
}, [props.children]);
|
|
5927
|
-
|
|
5923
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
5928
5924
|
return () => portalContext?.removeChild(id);
|
|
5929
5925
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5930
5926
|
}, []);
|
|
@@ -5987,10 +5983,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5987
5983
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5988
5984
|
/* harmony export */ "Point": function() { return /* binding */ Point; }
|
|
5989
5985
|
/* harmony export */ });
|
|
5990
|
-
/* harmony import */ var
|
|
5991
|
-
/* harmony import */ var
|
|
5992
|
-
/* harmony import */ var
|
|
5993
|
-
/* harmony import */ var
|
|
5986
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5987
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5988
|
+
/* 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");
|
|
5989
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
5994
5990
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
5995
5991
|
/* harmony import */ var _victory_util_point_path_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-util/point-path-helpers */ "../../victory-core/es/victory-util/point-path-helpers.js");
|
|
5996
5992
|
/* harmony import */ var _victory_util_user_props__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/user-props */ "../../victory-core/es/victory-util/user-props.js");
|
|
@@ -6044,14 +6040,14 @@ const evaluateProps = props => {
|
|
|
6044
6040
|
});
|
|
6045
6041
|
};
|
|
6046
6042
|
const defaultProps = {
|
|
6047
|
-
pathComponent: /*#__PURE__*/
|
|
6043
|
+
pathComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_path__WEBPACK_IMPORTED_MODULE_4__.Path, null),
|
|
6048
6044
|
role: "presentation",
|
|
6049
6045
|
shapeRendering: "auto"
|
|
6050
6046
|
};
|
|
6051
6047
|
const Point = initialProps => {
|
|
6052
|
-
const props = evaluateProps(
|
|
6048
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps));
|
|
6053
6049
|
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_5__.getSafeUserProps(props);
|
|
6054
|
-
return /*#__PURE__*/
|
|
6050
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.pathComponent, {
|
|
6055
6051
|
...props.events,
|
|
6056
6052
|
"aria-label": props.ariaLabel,
|
|
6057
6053
|
d: getPath(props),
|
|
@@ -7321,22 +7317,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7321
7317
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7322
7318
|
/* harmony export */ "VictoryTransition": function() { return /* binding */ VictoryTransition; }
|
|
7323
7319
|
/* harmony export */ });
|
|
7324
|
-
/* harmony import */ var
|
|
7325
|
-
/* harmony import */ var
|
|
7320
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7321
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7326
7322
|
/* 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");
|
|
7327
7323
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
7328
|
-
/* harmony import */ var
|
|
7329
|
-
/* harmony import */ var
|
|
7324
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/pick */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/pick.js");
|
|
7325
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_2__);
|
|
7326
|
+
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-fast-compare */ "../../../node_modules/.pnpm/react-fast-compare@3.2.0/node_modules/react-fast-compare/index.js");
|
|
7327
|
+
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_3__);
|
|
7330
7328
|
/* harmony import */ var _victory_animation_victory_animation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-animation/victory-animation */ "../../victory-core/es/victory-animation/victory-animation.js");
|
|
7331
7329
|
/* harmony import */ var _victory_util_collection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../victory-util/collection */ "../../victory-core/es/victory-util/collection.js");
|
|
7332
7330
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7333
7331
|
/* harmony import */ var _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/timer-context */ "../../victory-core/es/victory-util/timer-context.js");
|
|
7334
7332
|
/* harmony import */ var _victory_util_transitions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/transitions */ "../../victory-core/es/victory-util/transitions.js");
|
|
7335
|
-
|
|
7336
|
-
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_3__);
|
|
7333
|
+
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); }
|
|
7337
7334
|
|
|
7338
7335
|
|
|
7339
|
-
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); }
|
|
7340
7336
|
|
|
7341
7337
|
|
|
7342
7338
|
|
|
@@ -7344,7 +7340,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
7344
7340
|
|
|
7345
7341
|
|
|
7346
7342
|
|
|
7347
|
-
class VictoryTransition extends (
|
|
7343
|
+
class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
|
7348
7344
|
static displayName = "VictoryTransition";
|
|
7349
7345
|
static contextType = _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_4__["default"];
|
|
7350
7346
|
constructor(props, context) {
|
|
@@ -7387,8 +7383,8 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7387
7383
|
nextProps
|
|
7388
7384
|
};
|
|
7389
7385
|
}
|
|
7390
|
-
const oldChildren =
|
|
7391
|
-
const nextChildren =
|
|
7386
|
+
const oldChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
7387
|
+
const nextChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(nextProps.children);
|
|
7392
7388
|
const {
|
|
7393
7389
|
nodesWillExit,
|
|
7394
7390
|
nodesWillEnter,
|
|
@@ -7411,12 +7407,12 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7411
7407
|
const childDomain = child.props && child.type.getDomain(child.props, axis);
|
|
7412
7408
|
return childDomain ? memo.concat(childDomain) : memo;
|
|
7413
7409
|
} else if (child.props && child.props.children) {
|
|
7414
|
-
return memo.concat(getChildDomains(
|
|
7410
|
+
return memo.concat(getChildDomains(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children)));
|
|
7415
7411
|
}
|
|
7416
7412
|
return memo;
|
|
7417
7413
|
}, []);
|
|
7418
7414
|
};
|
|
7419
|
-
const child =
|
|
7415
|
+
const child = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children)[0];
|
|
7420
7416
|
const childProps = child.props || {};
|
|
7421
7417
|
const domain = Array.isArray(childProps.domain) ? childProps.domain : childProps.domain && childProps.domain[axis];
|
|
7422
7418
|
if (!childProps.children && domain) {
|
|
@@ -7449,7 +7445,7 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7449
7445
|
render() {
|
|
7450
7446
|
const props = this.pickProps();
|
|
7451
7447
|
const getTransitionProps = this.props.animate?.getTransitions ? this.props.animate.getTransitions : _victory_util_transitions__WEBPACK_IMPORTED_MODULE_5__.getTransitionPropsFactory(props, this.state, newState => this.setState(newState));
|
|
7452
|
-
const child =
|
|
7448
|
+
const child = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children)[0];
|
|
7453
7449
|
const transitionProps = getTransitionProps(child);
|
|
7454
7450
|
this.transitionProps = transitionProps;
|
|
7455
7451
|
const domain = {
|
|
@@ -7463,21 +7459,21 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7463
7459
|
}, transitionProps, child.props);
|
|
7464
7460
|
const animationWhitelist = props.animationWhitelist || [];
|
|
7465
7461
|
const whitelist = animationWhitelist.concat(["clipWidth"]);
|
|
7466
|
-
const propsToAnimate = whitelist.length ?
|
|
7467
|
-
return /*#__PURE__*/
|
|
7462
|
+
const propsToAnimate = whitelist.length ? lodash_pick__WEBPACK_IMPORTED_MODULE_2___default()(combinedProps, whitelist) : combinedProps;
|
|
7463
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_animation_victory_animation__WEBPACK_IMPORTED_MODULE_8__.VictoryAnimation, _extends({}, combinedProps.animate, {
|
|
7468
7464
|
data: propsToAnimate
|
|
7469
7465
|
}), newProps => {
|
|
7470
7466
|
if (child.props.groupComponent) {
|
|
7471
|
-
const groupComponent = this.continuous ? /*#__PURE__*/
|
|
7467
|
+
const groupComponent = this.continuous ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child.props.groupComponent, {
|
|
7472
7468
|
clipWidth: newProps.clipWidth || 0
|
|
7473
7469
|
}) : child.props.groupComponent;
|
|
7474
|
-
return /*#__PURE__*/
|
|
7470
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
7475
7471
|
animate: null,
|
|
7476
7472
|
animating: true,
|
|
7477
7473
|
groupComponent
|
|
7478
7474
|
}, newProps, combinedProps));
|
|
7479
7475
|
}
|
|
7480
|
-
return /*#__PURE__*/
|
|
7476
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
7481
7477
|
animate: null,
|
|
7482
7478
|
animating: true
|
|
7483
7479
|
}, newProps, combinedProps));
|
|
@@ -7498,14 +7494,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7498
7494
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7499
7495
|
/* harmony export */ "addEvents": function() { return /* binding */ addEvents; }
|
|
7500
7496
|
/* harmony export */ });
|
|
7501
|
-
/* harmony import */ var
|
|
7502
|
-
/* harmony import */ var
|
|
7503
|
-
/* harmony import */ var
|
|
7504
|
-
/* harmony import */ var
|
|
7505
|
-
/* harmony import */ var
|
|
7506
|
-
/* harmony import */ var
|
|
7507
|
-
/* harmony import */ var
|
|
7508
|
-
/* harmony import */ var
|
|
7497
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7498
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7499
|
+
/* 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");
|
|
7500
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
7501
|
+
/* 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");
|
|
7502
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
7503
|
+
/* 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");
|
|
7504
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
|
7509
7505
|
/* 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");
|
|
7510
7506
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_4__);
|
|
7511
7507
|
/* harmony import */ var _victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-transition/victory-transition */ "../../victory-core/es/victory-transition/victory-transition.js");
|
|
@@ -7652,8 +7648,8 @@ function addEvents(WrappedComponent, options) {
|
|
|
7652
7648
|
return {};
|
|
7653
7649
|
}
|
|
7654
7650
|
const getState = (key, type) => {
|
|
7655
|
-
const result =
|
|
7656
|
-
return
|
|
7651
|
+
const result = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, this.getEventState(key, type), this.getSharedEventState(key, type));
|
|
7652
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
|
|
7657
7653
|
};
|
|
7658
7654
|
const components = options.components || defaultComponents;
|
|
7659
7655
|
const stateChanges = components.map(component => {
|
|
@@ -7666,7 +7662,7 @@ function addEvents(WrappedComponent, options) {
|
|
|
7666
7662
|
return stateChanges;
|
|
7667
7663
|
}
|
|
7668
7664
|
applyExternalMutations(props, externalMutations) {
|
|
7669
|
-
if (!
|
|
7665
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
7670
7666
|
const callbacks = props.externalEventMutations.reduce((memo, mutation) => (0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(mutation.callback) ? memo.concat(mutation.callback) : memo, []);
|
|
7671
7667
|
const compiledCallbacks = callbacks.length ? () => {
|
|
7672
7668
|
callbacks.forEach(c => c());
|
|
@@ -7699,7 +7695,7 @@ function addEvents(WrappedComponent, options) {
|
|
|
7699
7695
|
sharedEvents,
|
|
7700
7696
|
externalEventMutations
|
|
7701
7697
|
} = props;
|
|
7702
|
-
return
|
|
7698
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_6__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
|
|
7703
7699
|
}
|
|
7704
7700
|
cacheValues(obj) {
|
|
7705
7701
|
Object.keys(obj).forEach(key => {
|
|
@@ -7710,10 +7706,10 @@ function addEvents(WrappedComponent, options) {
|
|
|
7710
7706
|
const getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
|
|
7711
7707
|
const sharedParentState = getSharedEventStateFunction("parent", "parent");
|
|
7712
7708
|
const parentState = this.getEventState("parent", "parent");
|
|
7713
|
-
const baseParentProps =
|
|
7709
|
+
const baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parentState, sharedParentState);
|
|
7714
7710
|
const parentPropsList = baseParentProps.parentControlledProps;
|
|
7715
|
-
const parentProps = parentPropsList ?
|
|
7716
|
-
const modifiedProps =
|
|
7711
|
+
const parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(baseParentProps, parentPropsList) : {};
|
|
7712
|
+
const modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parentProps, props);
|
|
7717
7713
|
return typeof WrappedComponent.getBaseProps === "function" ? WrappedComponent.getBaseProps(modifiedProps) : {};
|
|
7718
7714
|
}
|
|
7719
7715
|
getAllEvents(props) {
|
|
@@ -7733,18 +7729,18 @@ function addEvents(WrappedComponent, options) {
|
|
|
7733
7729
|
const currentProps = component && typeof component === "object" && "props" in component ? component.props : undefined;
|
|
7734
7730
|
if (this.hasEvents) {
|
|
7735
7731
|
const baseEvents = this.getEvents(this.props, type, key);
|
|
7736
|
-
const componentProps =
|
|
7732
|
+
const componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
7737
7733
|
index,
|
|
7738
7734
|
key: id
|
|
7739
7735
|
}, this.getEventState(key, type), this.getSharedEventState(key, type), currentProps, baseProps, {
|
|
7740
7736
|
id
|
|
7741
7737
|
});
|
|
7742
|
-
const events =
|
|
7738
|
+
const events = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, _events__WEBPACK_IMPORTED_MODULE_6__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
|
|
7743
7739
|
return Object.assign({}, componentProps, {
|
|
7744
7740
|
events
|
|
7745
7741
|
});
|
|
7746
7742
|
}
|
|
7747
|
-
return
|
|
7743
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
7748
7744
|
index,
|
|
7749
7745
|
key: id
|
|
7750
7746
|
}, currentProps, baseProps, {
|
|
@@ -7758,15 +7754,15 @@ function addEvents(WrappedComponent, options) {
|
|
|
7758
7754
|
this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_6__.getGlobalEvents(parentProps.events);
|
|
7759
7755
|
parentProps.events = _events__WEBPACK_IMPORTED_MODULE_6__.omitGlobalEvents(parentProps.events);
|
|
7760
7756
|
}
|
|
7761
|
-
return /*#__PURE__*/
|
|
7757
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(component, parentProps, children);
|
|
7762
7758
|
}
|
|
7763
7759
|
animateComponent(props, defaultAnimationWhitelist) {
|
|
7764
7760
|
const animationWhitelist = typeof props.animate === "object" && props.animate?.animationWhitelist || defaultAnimationWhitelist;
|
|
7765
7761
|
const Comp = this.constructor;
|
|
7766
|
-
return /*#__PURE__*/
|
|
7762
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_8__.VictoryTransition, {
|
|
7767
7763
|
animate: props.animate,
|
|
7768
7764
|
animationWhitelist: animationWhitelist
|
|
7769
|
-
}, /*#__PURE__*/
|
|
7765
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Comp, props));
|
|
7770
7766
|
}
|
|
7771
7767
|
|
|
7772
7768
|
// Used by `VictoryLine` and `VictoryArea`
|
|
@@ -7781,12 +7777,12 @@ function addEvents(WrappedComponent, options) {
|
|
|
7781
7777
|
let newMemo = memo;
|
|
7782
7778
|
const labelProps = this.getComponentProps(labelComponent, "labels", key);
|
|
7783
7779
|
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
7784
|
-
newMemo = newMemo.concat( /*#__PURE__*/
|
|
7780
|
+
newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps));
|
|
7785
7781
|
}
|
|
7786
7782
|
return newMemo;
|
|
7787
7783
|
}, []);
|
|
7788
7784
|
const dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
7789
|
-
const children = [/*#__PURE__*/
|
|
7785
|
+
const children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(dataComponent, dataProps), ...labelComponents];
|
|
7790
7786
|
return this.renderContainer(groupComponent, children);
|
|
7791
7787
|
}
|
|
7792
7788
|
renderData(props, shouldRenderDatum) {
|
|
@@ -7801,14 +7797,14 @@ function addEvents(WrappedComponent, options) {
|
|
|
7801
7797
|
const dataComponents = this.dataKeys.reduce((validDataComponents, _dataKey, index) => {
|
|
7802
7798
|
const dataProps = this.getComponentProps(dataComponent, "data", index);
|
|
7803
7799
|
if (shouldRenderDatum(dataProps.datum)) {
|
|
7804
|
-
validDataComponents.push( /*#__PURE__*/
|
|
7800
|
+
validDataComponents.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(dataComponent, dataProps));
|
|
7805
7801
|
}
|
|
7806
7802
|
return validDataComponents;
|
|
7807
7803
|
}, []);
|
|
7808
7804
|
const labelComponents = this.dataKeys.map((_dataKey, index) => {
|
|
7809
7805
|
const labelProps = this.getComponentProps(labelComponent, "labels", index);
|
|
7810
7806
|
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
7811
|
-
return /*#__PURE__*/
|
|
7807
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps);
|
|
7812
7808
|
}
|
|
7813
7809
|
return undefined;
|
|
7814
7810
|
}).filter(Boolean);
|
|
@@ -7914,24 +7910,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7914
7910
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
7915
7911
|
/* harmony export */ "isDataComponent": function() { return /* binding */ isDataComponent; }
|
|
7916
7912
|
/* harmony export */ });
|
|
7917
|
-
/* harmony import */ var
|
|
7918
|
-
/* harmony import */ var
|
|
7919
|
-
/* harmony import */ var
|
|
7920
|
-
/* harmony import */ var
|
|
7913
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7914
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7915
|
+
/* 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");
|
|
7916
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1__);
|
|
7921
7917
|
/* 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");
|
|
7922
7918
|
/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEqual__WEBPACK_IMPORTED_MODULE_2__);
|
|
7923
|
-
/* harmony import */ var
|
|
7924
|
-
/* harmony import */ var
|
|
7925
|
-
/* harmony import */ var
|
|
7926
|
-
/* harmony import */ var
|
|
7927
|
-
/* harmony import */ var
|
|
7928
|
-
/* harmony import */ var
|
|
7929
|
-
/* harmony import */ var
|
|
7930
|
-
/* harmony import */ var
|
|
7931
|
-
/* harmony import */ var
|
|
7932
|
-
/* harmony import */ var
|
|
7933
|
-
/* harmony import */ var
|
|
7934
|
-
/* harmony import */ var
|
|
7919
|
+
/* 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");
|
|
7920
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3__);
|
|
7921
|
+
/* 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");
|
|
7922
|
+
/* harmony import */ var lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4__);
|
|
7923
|
+
/* 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");
|
|
7924
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_omitBy__WEBPACK_IMPORTED_MODULE_5__);
|
|
7925
|
+
/* 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");
|
|
7926
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_orderBy__WEBPACK_IMPORTED_MODULE_6__);
|
|
7927
|
+
/* 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");
|
|
7928
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_7__);
|
|
7929
|
+
/* 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");
|
|
7930
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_8__);
|
|
7935
7931
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7936
7932
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
7937
7933
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
@@ -7965,7 +7961,7 @@ function getLength(data) {
|
|
|
7965
7961
|
|
|
7966
7962
|
// Returns generated data for a given axis based on domain and sample from props
|
|
7967
7963
|
function generateDataArray(props, axis) {
|
|
7968
|
-
const propsDomain =
|
|
7964
|
+
const propsDomain = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default()(props.domain) ? props.domain[axis] : props.domain;
|
|
7969
7965
|
const domain = propsDomain || _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis).domain();
|
|
7970
7966
|
const samples = props.samples || 1;
|
|
7971
7967
|
const domainMax = Math.max(...domain);
|
|
@@ -7990,7 +7986,7 @@ function sortData(dataset, sortKey, sortOrder) {
|
|
|
7990
7986
|
formattedSortKey = `_${sortKey}`;
|
|
7991
7987
|
}
|
|
7992
7988
|
const order = sortOrder === "ascending" ? "asc" : "desc";
|
|
7993
|
-
return
|
|
7989
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default()(dataset, formattedSortKey, order);
|
|
7994
7990
|
}
|
|
7995
7991
|
|
|
7996
7992
|
// This method will remove data points that break certain scales. (log scale only)
|
|
@@ -8034,7 +8030,7 @@ function getEventKey(key) {
|
|
|
8034
8030
|
return () => undefined;
|
|
8035
8031
|
}
|
|
8036
8032
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
8037
|
-
return
|
|
8033
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_7___default()(key);
|
|
8038
8034
|
}
|
|
8039
8035
|
|
|
8040
8036
|
// Returns data with an eventKey prop added to each datum
|
|
@@ -8093,12 +8089,12 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
8093
8089
|
if (isUnderMinY(baseline) && !isUnderMinY(value)) _y0 = minDomainY;
|
|
8094
8090
|
// baseline and value with only baseline above max, set baseline to maxDomainY
|
|
8095
8091
|
if (isOverMaxY(baseline) && !isOverMaxY(value)) _y0 = maxDomainY;
|
|
8096
|
-
return Object.assign({}, datum,
|
|
8092
|
+
return Object.assign({}, datum, lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default()({
|
|
8097
8093
|
_x,
|
|
8098
8094
|
_y,
|
|
8099
8095
|
_y0,
|
|
8100
8096
|
_y1
|
|
8101
|
-
}, (
|
|
8097
|
+
}, (lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default())));
|
|
8102
8098
|
});
|
|
8103
8099
|
}
|
|
8104
8100
|
|
|
@@ -8112,7 +8108,7 @@ function createStringMap(props, axis) {
|
|
|
8112
8108
|
const stringsFromAxes = getStringsFromAxes(props, axis);
|
|
8113
8109
|
const stringsFromCategories = getStringsFromCategories(props, axis);
|
|
8114
8110
|
const stringsFromData = getStringsFromData(props, axis);
|
|
8115
|
-
const allStrings =
|
|
8111
|
+
const allStrings = lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default()([...stringsFromAxes, ...stringsFromCategories, ...stringsFromData]);
|
|
8116
8112
|
return allStrings.length === 0 ? null : allStrings.reduce((memo, string, index) => {
|
|
8117
8113
|
memo[string] = index + 1;
|
|
8118
8114
|
return memo;
|
|
@@ -8198,7 +8194,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
8198
8194
|
return memo;
|
|
8199
8195
|
}, {});
|
|
8200
8196
|
const formattedDatum = Object.assign({}, processedValues, parsedDatum);
|
|
8201
|
-
if (!
|
|
8197
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(formattedDatum)) {
|
|
8202
8198
|
dataArr.push(formattedDatum);
|
|
8203
8199
|
}
|
|
8204
8200
|
return dataArr;
|
|
@@ -8325,7 +8321,7 @@ function isDataComponent(component) {
|
|
|
8325
8321
|
};
|
|
8326
8322
|
let role = getRole(component);
|
|
8327
8323
|
if (role === "portal") {
|
|
8328
|
-
const children =
|
|
8324
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
8329
8325
|
role = children.length ? getRole(children[0]) : "";
|
|
8330
8326
|
}
|
|
8331
8327
|
const whitelist = ["area", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -8460,14 +8456,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8460
8456
|
/* harmony export */ "getSymmetricDomain": function() { return /* binding */ getSymmetricDomain; },
|
|
8461
8457
|
/* harmony export */ "isDomainComponent": function() { return /* binding */ isDomainComponent; }
|
|
8462
8458
|
/* harmony export */ });
|
|
8463
|
-
/* harmony import */ var
|
|
8464
|
-
/* harmony import */ var
|
|
8465
|
-
/* harmony import */ var
|
|
8466
|
-
/* harmony import */ var
|
|
8459
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8460
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8461
|
+
/* 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");
|
|
8462
|
+
/* harmony import */ var lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isDate__WEBPACK_IMPORTED_MODULE_1__);
|
|
8467
8463
|
/* 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");
|
|
8468
8464
|
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__);
|
|
8469
|
-
/* harmony import */ var
|
|
8470
|
-
/* harmony import */ var
|
|
8465
|
+
/* 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");
|
|
8466
|
+
/* harmony import */ var lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3__);
|
|
8471
8467
|
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
8472
8468
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
8473
8469
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
@@ -8556,9 +8552,9 @@ function padDomain(domain, props, axis) {
|
|
|
8556
8552
|
max: max.valueOf() + simplePadding.right
|
|
8557
8553
|
};
|
|
8558
8554
|
const singleQuadrantDomainPadding = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.singleQuadrantDomainPadding) ? props.singleQuadrantDomainPadding[axis] : props.singleQuadrantDomainPadding;
|
|
8559
|
-
const addsQuadrants = min >= 0 && paddedDomain.min <= 0 || max <= 0 && paddedDomain.max >= 0;
|
|
8555
|
+
const addsQuadrants = min.valueOf() >= 0 && paddedDomain.min <= 0 || max.valueOf() <= 0 && paddedDomain.max >= 0;
|
|
8560
8556
|
const adjust = (val, type) => {
|
|
8561
|
-
const coerce = type === "min" && min >= 0 && val <= 0 || type === "max" && max <= 0 && val >= 0;
|
|
8557
|
+
const coerce = type === "min" && min.valueOf() >= 0 && val <= 0 || type === "max" && max.valueOf() <= 0 && val >= 0;
|
|
8562
8558
|
return coerce ? 0 : val;
|
|
8563
8559
|
};
|
|
8564
8560
|
if (addsQuadrants && singleQuadrantDomainPadding !== false) {
|
|
@@ -8781,7 +8777,7 @@ function getMaxFromProps(props, axis) {
|
|
|
8781
8777
|
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.maxDomain) && props.maxDomain[axis] !== undefined) {
|
|
8782
8778
|
return props.maxDomain[axis];
|
|
8783
8779
|
}
|
|
8784
|
-
return typeof props.maxDomain === "number" ||
|
|
8780
|
+
return typeof props.maxDomain === "number" || lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default()(props.maxDomain) ? props.maxDomain : undefined;
|
|
8785
8781
|
}
|
|
8786
8782
|
|
|
8787
8783
|
/**
|
|
@@ -8794,7 +8790,7 @@ function getMinFromProps(props, axis) {
|
|
|
8794
8790
|
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.minDomain) && props.minDomain[axis] !== undefined) {
|
|
8795
8791
|
return props.minDomain[axis];
|
|
8796
8792
|
}
|
|
8797
|
-
return typeof props.minDomain === "number" ||
|
|
8793
|
+
return typeof props.minDomain === "number" || lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default()(props.minDomain) ? props.minDomain : undefined;
|
|
8798
8794
|
}
|
|
8799
8795
|
|
|
8800
8796
|
/**
|
|
@@ -8805,7 +8801,7 @@ function getMinFromProps(props, axis) {
|
|
|
8805
8801
|
* @returns {Array} the symmetric domain
|
|
8806
8802
|
*/
|
|
8807
8803
|
function getSymmetricDomain(domain, values) {
|
|
8808
|
-
const processedData =
|
|
8804
|
+
const processedData = lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3___default()(values.sort((a, b) => a - b));
|
|
8809
8805
|
const step = processedData[1] - processedData[0];
|
|
8810
8806
|
return [domain[0], domain[1] + step];
|
|
8811
8807
|
}
|
|
@@ -8821,7 +8817,7 @@ function isDomainComponent(component) {
|
|
|
8821
8817
|
};
|
|
8822
8818
|
let role = getRole(component);
|
|
8823
8819
|
if (role === "portal") {
|
|
8824
|
-
const children =
|
|
8820
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
8825
8821
|
role = children.length ? getRole(children[0]) : "";
|
|
8826
8822
|
}
|
|
8827
8823
|
const whitelist = ["area", "axis", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -8852,14 +8848,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8852
8848
|
/* harmony export */ "getScopedEvents": function() { return /* binding */ getScopedEvents; },
|
|
8853
8849
|
/* harmony export */ "omitGlobalEvents": function() { return /* binding */ omitGlobalEvents; }
|
|
8854
8850
|
/* harmony export */ });
|
|
8855
|
-
/* harmony import */ var
|
|
8856
|
-
/* harmony import */ var
|
|
8857
|
-
/* harmony import */ var
|
|
8858
|
-
/* harmony import */ var
|
|
8859
|
-
/* harmony import */ var
|
|
8860
|
-
/* harmony import */ var
|
|
8861
|
-
/* harmony import */ var
|
|
8862
|
-
/* harmony import */ var
|
|
8851
|
+
/* 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");
|
|
8852
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0__);
|
|
8853
|
+
/* 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");
|
|
8854
|
+
/* harmony import */ var lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_pickBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
8855
|
+
/* 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");
|
|
8856
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_omitBy__WEBPACK_IMPORTED_MODULE_2__);
|
|
8857
|
+
/* 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");
|
|
8858
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_3__);
|
|
8863
8859
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
8864
8860
|
|
|
8865
8861
|
|
|
@@ -8935,7 +8931,7 @@ getScopedEvents) {
|
|
|
8935
8931
|
*/
|
|
8936
8932
|
// eslint-disable-next-line max-params
|
|
8937
8933
|
function getScopedEvents(events, namespace, childType, baseProps) {
|
|
8938
|
-
if (
|
|
8934
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
8939
8935
|
return {};
|
|
8940
8936
|
}
|
|
8941
8937
|
|
|
@@ -9048,7 +9044,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
9048
9044
|
// eslint-disable-next-line max-params
|
|
9049
9045
|
const onEvent = (evt, childProps, eventKey, eventName) => {
|
|
9050
9046
|
const eventReturn = events[eventName](evt, childProps, eventKey, this);
|
|
9051
|
-
if (!
|
|
9047
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(eventReturn)) {
|
|
9052
9048
|
const callbacks = compileCallbacks(eventReturn);
|
|
9053
9049
|
this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
|
|
9054
9050
|
}
|
|
@@ -9109,7 +9105,7 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
9109
9105
|
const childState = baseState[childName];
|
|
9110
9106
|
const mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
9111
9107
|
memo[childName] = mutation ? mutation : childState;
|
|
9112
|
-
return
|
|
9108
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
9113
9109
|
}, {});
|
|
9114
9110
|
}
|
|
9115
9111
|
|
|
@@ -9145,7 +9141,7 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
9145
9141
|
} else {
|
|
9146
9142
|
// use keys from both state and props so that elements not intially included in baseProps
|
|
9147
9143
|
// will be used. (i.e. labels)
|
|
9148
|
-
const targets =
|
|
9144
|
+
const targets = lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default()(Object.keys(keyProps).concat(Object.keys(keyState)));
|
|
9149
9145
|
memo[eventKey] = targets.reduce((m, target) => {
|
|
9150
9146
|
const identifier = {
|
|
9151
9147
|
eventKey,
|
|
@@ -9154,10 +9150,10 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
9154
9150
|
};
|
|
9155
9151
|
const mutation = getExternalMutation(mutations, keyProps[target], keyState[target], identifier);
|
|
9156
9152
|
m[target] = mutation !== undefined ? Object.assign({}, keyState[target], mutation) : keyState[target];
|
|
9157
|
-
return
|
|
9153
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(m, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
9158
9154
|
}, {});
|
|
9159
9155
|
}
|
|
9160
|
-
return
|
|
9156
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
9161
9157
|
}, {});
|
|
9162
9158
|
}
|
|
9163
9159
|
|
|
@@ -9189,11 +9185,11 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
9189
9185
|
}
|
|
9190
9186
|
// find any mutation objects that match the target
|
|
9191
9187
|
const targetMutations = scopedMutations.filter(m => filterMutations(m, "target"));
|
|
9192
|
-
if (
|
|
9188
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(targetMutations)) {
|
|
9193
9189
|
return undefined;
|
|
9194
9190
|
}
|
|
9195
9191
|
const keyMutations = targetMutations.filter(m => filterMutations(m, "eventKey"));
|
|
9196
|
-
if (
|
|
9192
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(keyMutations)) {
|
|
9197
9193
|
return undefined;
|
|
9198
9194
|
}
|
|
9199
9195
|
return keyMutations.reduce((memo, curr) => {
|
|
@@ -9219,8 +9215,8 @@ function getGlobalEventNameFromKey(key) {
|
|
|
9219
9215
|
const match = key.match(GLOBAL_EVENT_REGEX);
|
|
9220
9216
|
return match && match[1] && match[1].toLowerCase();
|
|
9221
9217
|
}
|
|
9222
|
-
const getGlobalEvents = events =>
|
|
9223
|
-
const omitGlobalEvents = events =>
|
|
9218
|
+
const getGlobalEvents = events => lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(events, (_, key) => GLOBAL_EVENT_REGEX.test(key));
|
|
9219
|
+
const omitGlobalEvents = events => lodash_omitBy__WEBPACK_IMPORTED_MODULE_2___default()(events, (_, key) => GLOBAL_EVENT_REGEX.test(key));
|
|
9224
9220
|
const emulateReactEvent = event => Object.assign(event, {
|
|
9225
9221
|
nativeEvent: event
|
|
9226
9222
|
});
|
|
@@ -9261,40 +9257,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9261
9257
|
/* harmony export */ "reduceChildren": function() { return /* binding */ reduceChildren; },
|
|
9262
9258
|
/* harmony export */ "scalePoint": function() { return /* binding */ scalePoint; }
|
|
9263
9259
|
/* harmony export */ });
|
|
9264
|
-
/* harmony import */ var
|
|
9265
|
-
/* harmony import */ var
|
|
9266
|
-
/* harmony import */ var
|
|
9267
|
-
/* harmony import */ var
|
|
9268
|
-
/* harmony import */ var
|
|
9269
|
-
/* harmony import */ var
|
|
9270
|
-
/* harmony import */ var
|
|
9271
|
-
/* harmony import */ var
|
|
9272
|
-
|
|
9260
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
9261
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
9262
|
+
/* 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");
|
|
9263
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
9264
|
+
/* 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");
|
|
9265
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_2__);
|
|
9266
|
+
/* 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");
|
|
9267
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
|
9273
9268
|
|
|
9274
9269
|
|
|
9275
9270
|
|
|
9276
|
-
// Private Functions
|
|
9277
9271
|
|
|
9278
|
-
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9272
|
+
/**
|
|
9273
|
+
* Determine the range of a cartesian axis
|
|
9274
|
+
*/
|
|
9275
|
+
function getCartesianRange(options) {
|
|
9276
|
+
const vertical = options.axis !== "x";
|
|
9282
9277
|
if (vertical) {
|
|
9283
|
-
return [
|
|
9278
|
+
return [options.height - options.padding.bottom, options.padding.top];
|
|
9284
9279
|
}
|
|
9285
|
-
return [padding.left,
|
|
9280
|
+
return [options.padding.left, options.width - options.padding.right];
|
|
9286
9281
|
}
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9282
|
+
|
|
9283
|
+
/**
|
|
9284
|
+
* Determine the range of a polar axis in radians
|
|
9285
|
+
*/
|
|
9286
|
+
function getPolarRange(options) {
|
|
9287
|
+
if (options.axis === "x") {
|
|
9288
|
+
const startAngle = degreesToRadians(options.startAngle || 0);
|
|
9289
|
+
const endAngle = degreesToRadians(options.endAngle || 360);
|
|
9291
9290
|
return [startAngle, endAngle];
|
|
9292
9291
|
}
|
|
9293
|
-
return [
|
|
9292
|
+
return [options.innerRadius || 0, getRadius({
|
|
9293
|
+
height: options.height,
|
|
9294
|
+
width: options.width,
|
|
9295
|
+
padding: options.padding
|
|
9296
|
+
})];
|
|
9294
9297
|
}
|
|
9295
9298
|
|
|
9296
|
-
// Exported Functions
|
|
9297
|
-
|
|
9298
9299
|
/**
|
|
9299
9300
|
* Creates an object composed of the inverted keys and values of object.
|
|
9300
9301
|
* If object contains duplicate values, subsequent values overwrite property assignments of previous values.
|
|
@@ -9331,8 +9332,11 @@ function omit(originalObject, ks) {
|
|
|
9331
9332
|
}
|
|
9332
9333
|
return newObject;
|
|
9333
9334
|
}
|
|
9335
|
+
|
|
9336
|
+
/**
|
|
9337
|
+
* Coalesce the x and y values from a data point
|
|
9338
|
+
*/
|
|
9334
9339
|
function getPoint(datum) {
|
|
9335
|
-
const exists = val => val !== undefined;
|
|
9336
9340
|
const {
|
|
9337
9341
|
_x,
|
|
9338
9342
|
_x1,
|
|
@@ -9343,16 +9347,20 @@ function getPoint(datum) {
|
|
|
9343
9347
|
_y0,
|
|
9344
9348
|
_voronoiY
|
|
9345
9349
|
} = datum;
|
|
9346
|
-
const defaultX =
|
|
9347
|
-
const defaultY =
|
|
9350
|
+
const defaultX = _x1 ?? _x;
|
|
9351
|
+
const defaultY = _y1 ?? _y;
|
|
9348
9352
|
const point = {
|
|
9349
|
-
x:
|
|
9350
|
-
x0:
|
|
9351
|
-
y:
|
|
9352
|
-
y0:
|
|
9353
|
+
x: _voronoiX ?? defaultX,
|
|
9354
|
+
x0: _x0 ?? _x,
|
|
9355
|
+
y: _voronoiY ?? defaultY,
|
|
9356
|
+
y0: _y0 ?? _y
|
|
9353
9357
|
};
|
|
9354
|
-
return
|
|
9358
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, point, datum);
|
|
9355
9359
|
}
|
|
9360
|
+
|
|
9361
|
+
/**
|
|
9362
|
+
* Scale a point based on the origin, direction, and given scale function
|
|
9363
|
+
*/
|
|
9356
9364
|
function scalePoint(props, datum) {
|
|
9357
9365
|
const {
|
|
9358
9366
|
scale,
|
|
@@ -9375,11 +9383,11 @@ function scalePoint(props, datum) {
|
|
|
9375
9383
|
y0: polar ? -y0 * Math.sin(x0) + origin.x : y0
|
|
9376
9384
|
};
|
|
9377
9385
|
}
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9386
|
+
|
|
9387
|
+
/**
|
|
9388
|
+
* Returns a padding value from a number or partial padding values
|
|
9389
|
+
*/
|
|
9390
|
+
function getPadding(padding) {
|
|
9383
9391
|
const paddingVal = typeof padding === "number" ? padding : 0;
|
|
9384
9392
|
const paddingObj = typeof padding === "object" ? padding : {};
|
|
9385
9393
|
return {
|
|
@@ -9389,6 +9397,10 @@ function getPadding(props, name) {
|
|
|
9389
9397
|
right: paddingObj.right || paddingVal
|
|
9390
9398
|
};
|
|
9391
9399
|
}
|
|
9400
|
+
|
|
9401
|
+
/**
|
|
9402
|
+
* Returns true if the component is defined as a tooltip
|
|
9403
|
+
*/
|
|
9392
9404
|
function isTooltip(component) {
|
|
9393
9405
|
const labelRole = component && component.type && component.type.role;
|
|
9394
9406
|
return labelRole === "tooltip";
|
|
@@ -9403,8 +9415,8 @@ function getDefaultStyles(props, role) {
|
|
|
9403
9415
|
return defaultStyles;
|
|
9404
9416
|
}
|
|
9405
9417
|
const tooltipStyle = theme.tooltip && theme.tooltip.style || {};
|
|
9406
|
-
const labelStyle =
|
|
9407
|
-
return
|
|
9418
|
+
const labelStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, tooltipStyle, defaultStyles.labels);
|
|
9419
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, {
|
|
9408
9420
|
labels: labelStyle
|
|
9409
9421
|
}, defaultStyles);
|
|
9410
9422
|
}
|
|
@@ -9412,7 +9424,7 @@ function getStyles(style, defaultStyles) {
|
|
|
9412
9424
|
const width = "100%";
|
|
9413
9425
|
const height = "100%";
|
|
9414
9426
|
if (!style) {
|
|
9415
|
-
return
|
|
9427
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
9416
9428
|
parent: {
|
|
9417
9429
|
height,
|
|
9418
9430
|
width
|
|
@@ -9428,14 +9440,18 @@ function getStyles(style, defaultStyles) {
|
|
|
9428
9440
|
const defaultLabels = defaultStyles && defaultStyles.labels || {};
|
|
9429
9441
|
const defaultData = defaultStyles && defaultStyles.data || {};
|
|
9430
9442
|
return {
|
|
9431
|
-
parent:
|
|
9443
|
+
parent: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parent, defaultParent, {
|
|
9432
9444
|
width,
|
|
9433
9445
|
height
|
|
9434
9446
|
}),
|
|
9435
|
-
labels:
|
|
9436
|
-
data:
|
|
9447
|
+
labels: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labels, defaultLabels),
|
|
9448
|
+
data: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, data, defaultData)
|
|
9437
9449
|
};
|
|
9438
9450
|
}
|
|
9451
|
+
|
|
9452
|
+
/**
|
|
9453
|
+
* Returns the value of a prop or accessor function with the given props
|
|
9454
|
+
*/
|
|
9439
9455
|
function evaluateProp(prop, props) {
|
|
9440
9456
|
return isFunction(prop) ? prop(props) : prop;
|
|
9441
9457
|
}
|
|
@@ -9457,19 +9473,28 @@ function degreesToRadians(degrees) {
|
|
|
9457
9473
|
function radiansToDegrees(radians) {
|
|
9458
9474
|
return typeof radians === "number" ? radians / (Math.PI / 180) : radians;
|
|
9459
9475
|
}
|
|
9460
|
-
|
|
9476
|
+
|
|
9477
|
+
/**
|
|
9478
|
+
* Get the maximum radius that will fit in the container
|
|
9479
|
+
*/
|
|
9480
|
+
function getRadius(options) {
|
|
9481
|
+
const {
|
|
9482
|
+
width,
|
|
9483
|
+
height,
|
|
9484
|
+
padding
|
|
9485
|
+
} = options;
|
|
9461
9486
|
const {
|
|
9462
9487
|
left,
|
|
9463
9488
|
right,
|
|
9464
9489
|
top,
|
|
9465
9490
|
bottom
|
|
9466
|
-
} =
|
|
9467
|
-
const {
|
|
9468
|
-
width,
|
|
9469
|
-
height
|
|
9470
|
-
} = props;
|
|
9491
|
+
} = padding;
|
|
9471
9492
|
return Math.min(width - left - right, height - top - bottom) / 2;
|
|
9472
9493
|
}
|
|
9494
|
+
|
|
9495
|
+
/**
|
|
9496
|
+
* Returns the origin for a polar chart within the padded area
|
|
9497
|
+
*/
|
|
9473
9498
|
function getPolarOrigin(props) {
|
|
9474
9499
|
const {
|
|
9475
9500
|
width,
|
|
@@ -9480,7 +9505,7 @@ function getPolarOrigin(props) {
|
|
|
9480
9505
|
bottom,
|
|
9481
9506
|
left,
|
|
9482
9507
|
right
|
|
9483
|
-
} = getPadding(props);
|
|
9508
|
+
} = getPadding(props.padding);
|
|
9484
9509
|
const radius = Math.min(width - left - right, height - top - bottom) / 2;
|
|
9485
9510
|
const offsetWidth = width / 2 + left - right;
|
|
9486
9511
|
const offsetHeight = height / 2 + top - bottom;
|
|
@@ -9489,13 +9514,30 @@ function getPolarOrigin(props) {
|
|
|
9489
9514
|
y: offsetHeight + radius > height ? radius + top - bottom : offsetHeight
|
|
9490
9515
|
};
|
|
9491
9516
|
}
|
|
9517
|
+
|
|
9518
|
+
/**
|
|
9519
|
+
* Determine the range of an axis based on the given props
|
|
9520
|
+
*/
|
|
9492
9521
|
function getRange(props, axis) {
|
|
9493
9522
|
if (props.range && props.range[axis]) {
|
|
9494
9523
|
return props.range[axis];
|
|
9495
9524
|
} else if (props.range && Array.isArray(props.range)) {
|
|
9496
9525
|
return props.range;
|
|
9497
9526
|
}
|
|
9498
|
-
return props.polar ? getPolarRange(
|
|
9527
|
+
return props.polar ? getPolarRange({
|
|
9528
|
+
axis,
|
|
9529
|
+
innerRadius: props.innerRadius,
|
|
9530
|
+
startAngle: props.startAngle,
|
|
9531
|
+
endAngle: props.endAngle,
|
|
9532
|
+
height: props.height,
|
|
9533
|
+
width: props.width,
|
|
9534
|
+
padding: getPadding(props.padding)
|
|
9535
|
+
}) : getCartesianRange({
|
|
9536
|
+
axis,
|
|
9537
|
+
height: props.height,
|
|
9538
|
+
width: props.width,
|
|
9539
|
+
padding: getPadding(props.padding)
|
|
9540
|
+
});
|
|
9499
9541
|
}
|
|
9500
9542
|
|
|
9501
9543
|
/**
|
|
@@ -9527,7 +9569,7 @@ function createAccessor(key) {
|
|
|
9527
9569
|
return x => x;
|
|
9528
9570
|
}
|
|
9529
9571
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
9530
|
-
return
|
|
9572
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_2___default()(key);
|
|
9531
9573
|
}
|
|
9532
9574
|
function modifyProps(props, fallbackProps, role) {
|
|
9533
9575
|
const theme = props.theme && props.theme[role] ? props.theme[role] : {};
|
|
@@ -9536,7 +9578,7 @@ function modifyProps(props, fallbackProps, role) {
|
|
|
9536
9578
|
const defaultObject = horizontal === undefined ? {} : {
|
|
9537
9579
|
horizontal
|
|
9538
9580
|
};
|
|
9539
|
-
return
|
|
9581
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(defaultObject, props, themeProps, fallbackProps);
|
|
9540
9582
|
}
|
|
9541
9583
|
|
|
9542
9584
|
/**
|
|
@@ -9623,10 +9665,10 @@ initialMemo, combine) {
|
|
|
9623
9665
|
const childRole = child.type && child.type.role;
|
|
9624
9666
|
const childName = child.props.name || `${childRole}-${names[index]}`;
|
|
9625
9667
|
if (child.props && child.props.children) {
|
|
9626
|
-
const childProps = Object.assign({}, child.props,
|
|
9627
|
-
const nestedChildren = child.type && child.type.role === "stack" && isFunction(child.type.getChildren) ? child.type.getChildren(childProps) :
|
|
9628
|
-
const nestedChildProps = Object.assign({}, c.props,
|
|
9629
|
-
return /*#__PURE__*/
|
|
9668
|
+
const childProps = Object.assign({}, child.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(parentProps, sharedProps));
|
|
9669
|
+
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 => {
|
|
9670
|
+
const nestedChildProps = Object.assign({}, c.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(childProps, sharedProps));
|
|
9671
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(c, nestedChildProps);
|
|
9630
9672
|
});
|
|
9631
9673
|
const childNames = nestedChildren.map((c, i) => `${childName}-${i}`);
|
|
9632
9674
|
const nestedResults = traverseChildren(nestedChildren, childNames, child);
|
|
@@ -9640,7 +9682,7 @@ initialMemo, combine) {
|
|
|
9640
9682
|
return newMemo;
|
|
9641
9683
|
}, initialMemo);
|
|
9642
9684
|
};
|
|
9643
|
-
const validChildren = children.filter(
|
|
9685
|
+
const validChildren = children.filter(react__WEBPACK_IMPORTED_MODULE_0__.isValidElement);
|
|
9644
9686
|
const childNames = validChildren.map((c, i) => i);
|
|
9645
9687
|
return traverseChildren(validChildren, childNames);
|
|
9646
9688
|
}
|
|
@@ -9660,10 +9702,10 @@ function isHorizontal(props) {
|
|
|
9660
9702
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
9661
9703
|
return memo || childProps.horizontal;
|
|
9662
9704
|
}
|
|
9663
|
-
return traverseChildren(
|
|
9705
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(childProps.children));
|
|
9664
9706
|
}, false);
|
|
9665
9707
|
};
|
|
9666
|
-
return traverseChildren(
|
|
9708
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children));
|
|
9667
9709
|
}
|
|
9668
9710
|
|
|
9669
9711
|
/***/ }),
|
|
@@ -9736,9 +9778,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9736
9778
|
/* harmony export */ "getProps": function() { return /* binding */ getProps; },
|
|
9737
9779
|
/* harmony export */ "getText": function() { return /* binding */ getText; }
|
|
9738
9780
|
/* harmony export */ });
|
|
9781
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
9739
9782
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
9740
9783
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
9741
|
-
|
|
9784
|
+
|
|
9742
9785
|
|
|
9743
9786
|
|
|
9744
9787
|
// Private Functions
|
|
@@ -9984,11 +10027,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9984
10027
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9985
10028
|
/* harmony export */ "warn": function() { return /* binding */ warn; }
|
|
9986
10029
|
/* harmony export */ });
|
|
9987
|
-
/* global console */
|
|
10030
|
+
/* global console process */
|
|
9988
10031
|
/* eslint-disable no-console */
|
|
9989
10032
|
|
|
9990
|
-
// TODO: Use "warning" npm module like React is switching to.
|
|
9991
10033
|
function warn(message) {
|
|
10034
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10035
|
+
// @ts-ignore - Webpack DefinePlugin will replace process.env.NODE_ENV
|
|
9992
10036
|
if (true) {
|
|
9993
10037
|
if (console && console.warn) {
|
|
9994
10038
|
console.warn(message);
|
|
@@ -10415,13 +10459,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10415
10459
|
/* harmony export */ "approximateTextSize": function() { return /* binding */ approximateTextSize; },
|
|
10416
10460
|
/* harmony export */ "convertLengthToPixels": function() { return /* binding */ convertLengthToPixels; }
|
|
10417
10461
|
/* harmony export */ });
|
|
10418
|
-
/* harmony import */ var
|
|
10419
|
-
/* harmony import */ var
|
|
10420
|
-
/* harmony import */ var
|
|
10421
|
-
/* harmony import */ var
|
|
10422
|
-
|
|
10423
|
-
// http://www.pearsonified.com/2012/01/characters-per-line.php
|
|
10462
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
10463
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
10464
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/memoize */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js");
|
|
10465
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_1__);
|
|
10466
|
+
// http://www.pearsonified.com/2012/01/characters-per-line.php
|
|
10424
10467
|
/* eslint-disable no-magic-numbers */
|
|
10468
|
+
|
|
10469
|
+
|
|
10470
|
+
|
|
10425
10471
|
// Based on measuring specific character widths
|
|
10426
10472
|
// as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
|
|
10427
10473
|
// For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
|
|
@@ -10600,7 +10646,7 @@ const convertLengthToPixels = (length, fontSize) => {
|
|
|
10600
10646
|
};
|
|
10601
10647
|
const _prepareParams = (inputStyle, index) => {
|
|
10602
10648
|
const lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
|
|
10603
|
-
const style =
|
|
10649
|
+
const style = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, lineStyle, defaultStyle);
|
|
10604
10650
|
return Object.assign({}, style, {
|
|
10605
10651
|
fontFamily: style.fontFamily,
|
|
10606
10652
|
letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
|
|
@@ -10648,7 +10694,7 @@ const _approximateDimensionsInternal = (text, style) => {
|
|
|
10648
10694
|
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
10649
10695
|
};
|
|
10650
10696
|
};
|
|
10651
|
-
const _getMeasurementContainer =
|
|
10697
|
+
const _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()(() => {
|
|
10652
10698
|
const element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
10653
10699
|
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
10654
10700
|
element.setAttribute("width", "300");
|
|
@@ -10669,7 +10715,7 @@ const styleToKeyComponent = style => {
|
|
|
10669
10715
|
}
|
|
10670
10716
|
return `${style.angle}:${style.fontFamily}:${style.fontSize}:${style.letterSpacing}:${style.lineHeight}`;
|
|
10671
10717
|
};
|
|
10672
|
-
const _measureDimensionsInternal =
|
|
10718
|
+
const _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()((text, style) => {
|
|
10673
10719
|
let containerElement = _getMeasurementContainer();
|
|
10674
10720
|
if (!containerElement.isConnected) {
|
|
10675
10721
|
_getMeasurementContainer.cache.clear?.();
|
|
@@ -10839,12 +10885,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10839
10885
|
/* harmony export */ "getInitialTransitionState": function() { return /* binding */ getInitialTransitionState; },
|
|
10840
10886
|
/* harmony export */ "getTransitionPropsFactory": function() { return /* binding */ getTransitionPropsFactory; }
|
|
10841
10887
|
/* harmony export */ });
|
|
10842
|
-
/* harmony import */ var
|
|
10843
|
-
/* harmony import */ var
|
|
10888
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
10889
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
10844
10890
|
/* 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");
|
|
10845
10891
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
10846
|
-
/* harmony import */ var
|
|
10847
|
-
/* harmony import */ var
|
|
10892
|
+
/* 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");
|
|
10893
|
+
/* harmony import */ var lodash_identity__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_identity__WEBPACK_IMPORTED_MODULE_2__);
|
|
10848
10894
|
|
|
10849
10895
|
|
|
10850
10896
|
|
|
@@ -10935,13 +10981,13 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
10935
10981
|
const getTransitionsFromChildren = (old, next) => {
|
|
10936
10982
|
return old.map((child, idx) => {
|
|
10937
10983
|
if (child && child.props && child.props.children && next[idx]) {
|
|
10938
|
-
return getTransitionsFromChildren(
|
|
10984
|
+
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));
|
|
10939
10985
|
}
|
|
10940
10986
|
// get Transition entering and exiting nodes
|
|
10941
10987
|
return getTransition(child, next[idx]);
|
|
10942
10988
|
});
|
|
10943
10989
|
};
|
|
10944
|
-
const childrenTransitions = getTransitionsFromChildren(
|
|
10990
|
+
const childrenTransitions = getTransitionsFromChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(oldChildren), react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(nextChildren));
|
|
10945
10991
|
return {
|
|
10946
10992
|
nodesWillExit,
|
|
10947
10993
|
nodesWillEnter,
|
|
@@ -10955,7 +11001,7 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
10955
11001
|
};
|
|
10956
11002
|
}
|
|
10957
11003
|
function getInitialChildProps(animate, data) {
|
|
10958
|
-
const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (
|
|
11004
|
+
const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
10959
11005
|
return {
|
|
10960
11006
|
data: data.map((datum, idx) => Object.assign({}, datum, after(datum, idx, data)))
|
|
10961
11007
|
};
|
|
@@ -10972,7 +11018,7 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
10972
11018
|
data
|
|
10973
11019
|
};
|
|
10974
11020
|
}
|
|
10975
|
-
const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (
|
|
11021
|
+
const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
10976
11022
|
// If nodes need to exit, transform them with the provided onLoad.before function.
|
|
10977
11023
|
const newData = data.map((datum, idx) => {
|
|
10978
11024
|
return Object.assign({}, datum, before(datum, idx, data));
|
|
@@ -10994,7 +11040,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
10994
11040
|
data
|
|
10995
11041
|
};
|
|
10996
11042
|
}
|
|
10997
|
-
const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (
|
|
11043
|
+
const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
10998
11044
|
// If nodes need to exit, transform them with the provided onLoad.after function.
|
|
10999
11045
|
newData = data.map((datum, idx) => {
|
|
11000
11046
|
return Object.assign({}, datum, after(datum, idx, data));
|
|
@@ -11016,7 +11062,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
11016
11062
|
// After the exit transition occurs, trigger the animations for
|
|
11017
11063
|
// nodes that are neither exiting nor entering.
|
|
11018
11064
|
animate.onEnd = cb;
|
|
11019
|
-
const before = animate.onExit && animate.onExit.before ? animate.onExit.before : (
|
|
11065
|
+
const before = animate.onExit && animate.onExit.before ? animate.onExit.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11020
11066
|
// If nodes need to exit, transform them with the provided onExit.before function.
|
|
11021
11067
|
newData = data.map((datum, idx) => {
|
|
11022
11068
|
const key = (datum.key || idx).toString();
|
|
@@ -11039,7 +11085,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
11039
11085
|
newAnimate = Object.assign({}, animate, {
|
|
11040
11086
|
onEnd: cb
|
|
11041
11087
|
});
|
|
11042
|
-
const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (
|
|
11088
|
+
const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11043
11089
|
// We want the entering nodes to be included in the transition target
|
|
11044
11090
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
11045
11091
|
// so perform the `onEnter.before` transformation on each node.
|
|
@@ -11066,7 +11112,7 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
11066
11112
|
// domain should encompass the nodes that will now enter. So perform
|
|
11067
11113
|
// the `onEnter.after` transformation on each node.
|
|
11068
11114
|
newAnimate.onEnd = cb;
|
|
11069
|
-
const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (
|
|
11115
|
+
const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11070
11116
|
newData = data.map((datum, idx) => {
|
|
11071
11117
|
const key = getDatumKey(datum, idx);
|
|
11072
11118
|
return enteringNodes[key] ? Object.assign({}, datum, after(datum, idx, data)) : datum;
|