victory-pie 37.3.1 → 37.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/victory-pie.js +310 -281
- package/dist/victory-pie.min.js +1 -1
- package/es/helper-methods.js +7 -7
- package/es/slice.d.ts +3 -3
- package/es/slice.js +3 -3
- package/es/victory-pie.d.ts +6 -6
- package/es/victory-pie.js +1 -1
- package/lib/helper-methods.js +7 -7
- package/lib/slice.d.ts +3 -3
- package/lib/slice.js +3 -3
- package/lib/victory-pie.d.ts +6 -6
- package/lib/victory-pie.js +1 -1
- package/package.json +7 -39
- package/src/helper-methods.ts +4 -4
- package/src/slice.tsx +1 -1
- package/src/victory-pie.tsx +1 -4
package/dist/victory-pie.js
CHANGED
|
@@ -28,17 +28,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
28
28
|
/* harmony export */ "getYOffset": function() { return /* binding */ getYOffset; },
|
|
29
29
|
/* harmony export */ "getYOffsetMultiplayerByAngle": function() { return /* binding */ getYOffsetMultiplayerByAngle; }
|
|
30
30
|
/* harmony export */ });
|
|
31
|
-
/* harmony import */ var
|
|
32
|
-
/* harmony import */ var
|
|
33
|
-
/* harmony import */ var
|
|
34
|
-
/* harmony import */ var
|
|
31
|
+
/* 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");
|
|
32
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
33
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/isPlainObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isPlainObject.js");
|
|
34
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1__);
|
|
35
35
|
/* harmony import */ var victory_vendor_d3_shape__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-vendor/d3-shape */ "../../victory-vendor/es/d3-shape.js");
|
|
36
36
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
37
37
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/style.js");
|
|
38
38
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/data.js");
|
|
39
|
+
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 45, 90, 135, 180, 225, 270, 315, 360] }]*/
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 45, 90, 135, 180, 225, 270, 315, 360] }]*/
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
const checkForValidText = text => {
|
|
@@ -64,7 +64,7 @@ const getOrigin = (props, padding) => {
|
|
|
64
64
|
width,
|
|
65
65
|
height
|
|
66
66
|
} = props;
|
|
67
|
-
const origin =
|
|
67
|
+
const origin = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1___default()(props.origin) ? props.origin : {};
|
|
68
68
|
return {
|
|
69
69
|
x: origin.x !== undefined ? origin.x : (padding.left - padding.right + width) / 2,
|
|
70
70
|
y: origin.y !== undefined ? origin.y : (padding.top - padding.bottom + height) / 2
|
|
@@ -109,7 +109,7 @@ const getCalculatedValues = props => {
|
|
|
109
109
|
const styleObject = victory_core__WEBPACK_IMPORTED_MODULE_3__.getDefaultStyles(props, "pie");
|
|
110
110
|
const style = victory_core__WEBPACK_IMPORTED_MODULE_3__.getStyles(props.style, styleObject);
|
|
111
111
|
const colors = Array.isArray(colorScale) ? colorScale : victory_core__WEBPACK_IMPORTED_MODULE_4__.getColorScale(colorScale, theme);
|
|
112
|
-
const padding = victory_core__WEBPACK_IMPORTED_MODULE_3__.getPadding(props);
|
|
112
|
+
const padding = victory_core__WEBPACK_IMPORTED_MODULE_3__.getPadding(props.padding);
|
|
113
113
|
const defaultRadius = getRadius(props, padding);
|
|
114
114
|
const origin = getOrigin(props, padding);
|
|
115
115
|
const data = getDataSortedByCategories(props, victory_core__WEBPACK_IMPORTED_MODULE_5__.getData(props));
|
|
@@ -269,7 +269,7 @@ const getLabelProps = (text, dataProps, calculatedValues) => {
|
|
|
269
269
|
return labelProps;
|
|
270
270
|
}
|
|
271
271
|
const tooltipTheme = theme && theme.tooltip || {};
|
|
272
|
-
return
|
|
272
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, labelProps, victory_core__WEBPACK_IMPORTED_MODULE_3__.omit(tooltipTheme, ["style"]));
|
|
273
273
|
};
|
|
274
274
|
const getXOffsetMultiplayerByAngle = angle => Math.cos(angle - victory_core__WEBPACK_IMPORTED_MODULE_3__.degreesToRadians(90));
|
|
275
275
|
const getYOffsetMultiplayerByAngle = angle => Math.sin(angle - victory_core__WEBPACK_IMPORTED_MODULE_3__.degreesToRadians(90));
|
|
@@ -313,7 +313,7 @@ const getLabelIndicatorPropsForLineSegment = (props, calculatedValues, labelProp
|
|
|
313
313
|
y2,
|
|
314
314
|
index
|
|
315
315
|
};
|
|
316
|
-
return
|
|
316
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, labelIndicatorProps);
|
|
317
317
|
};
|
|
318
318
|
const getBaseProps = (initialProps, fallbackProps) => {
|
|
319
319
|
const props = victory_core__WEBPACK_IMPORTED_MODULE_3__.modifyProps(initialProps, fallbackProps, "pie");
|
|
@@ -349,7 +349,7 @@ const getBaseProps = (initialProps, fallbackProps) => {
|
|
|
349
349
|
}
|
|
350
350
|
};
|
|
351
351
|
return slices.reduce((childProps, slice, index) => {
|
|
352
|
-
const datum =
|
|
352
|
+
const datum = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, data[index], {
|
|
353
353
|
startAngle: victory_core__WEBPACK_IMPORTED_MODULE_3__.radiansToDegrees(slice.startAngle),
|
|
354
354
|
endAngle: victory_core__WEBPACK_IMPORTED_MODULE_3__.radiansToDegrees(slice.endAngle),
|
|
355
355
|
padAngle: victory_core__WEBPACK_IMPORTED_MODULE_3__.radiansToDegrees(slice.padAngle)
|
|
@@ -399,12 +399,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
399
399
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
400
400
|
/* harmony export */ "Slice": function() { return /* binding */ Slice; }
|
|
401
401
|
/* harmony export */ });
|
|
402
|
-
/* harmony import */ var
|
|
403
|
-
/* harmony import */ var
|
|
404
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
405
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
402
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
403
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
406
404
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
407
405
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/path.js");
|
|
406
|
+
/* 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");
|
|
407
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
408
408
|
/* harmony import */ var victory_vendor_d3_shape__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-vendor/d3-shape */ "../../victory-vendor/es/d3-shape.js");
|
|
409
409
|
|
|
410
410
|
|
|
@@ -424,7 +424,7 @@ const getPath = props => {
|
|
|
424
424
|
const startAngle = victory_core__WEBPACK_IMPORTED_MODULE_3__.degreesToRadians(props.sliceStartAngle);
|
|
425
425
|
const endAngle = victory_core__WEBPACK_IMPORTED_MODULE_3__.degreesToRadians(props.sliceEndAngle);
|
|
426
426
|
const pathFunction = victory_vendor_d3_shape__WEBPACK_IMPORTED_MODULE_2__.arc().cornerRadius(cornerRadius).outerRadius(radius).innerRadius(innerRadius || 0);
|
|
427
|
-
return pathFunction(
|
|
427
|
+
return pathFunction(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
428
428
|
startAngle,
|
|
429
429
|
endAngle,
|
|
430
430
|
padAngle
|
|
@@ -475,14 +475,14 @@ const evaluateProps = props => {
|
|
|
475
475
|
});
|
|
476
476
|
};
|
|
477
477
|
const defaultProps = {
|
|
478
|
-
pathComponent: /*#__PURE__*/
|
|
478
|
+
pathComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.Path, null),
|
|
479
479
|
role: "presentation",
|
|
480
480
|
shapeRendering: "auto"
|
|
481
481
|
};
|
|
482
482
|
const Slice = initialProps => {
|
|
483
|
-
const props = evaluateProps(
|
|
483
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps));
|
|
484
484
|
const defaultTransform = props.origin ? `translate(${props.origin.x}, ${props.origin.y})` : undefined;
|
|
485
|
-
return /*#__PURE__*/
|
|
485
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.pathComponent, {
|
|
486
486
|
...props.events,
|
|
487
487
|
"aria-label": props.ariaLabel,
|
|
488
488
|
d: getPath(props),
|
|
@@ -543,7 +543,7 @@ const datumHasXandY = datum => {
|
|
|
543
543
|
return !victory_core__WEBPACK_IMPORTED_MODULE_1__.isNil(datum._x) && !victory_core__WEBPACK_IMPORTED_MODULE_1__.isNil(datum._y);
|
|
544
544
|
};
|
|
545
545
|
|
|
546
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
546
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
547
547
|
|
|
548
548
|
class VictoryPieBase extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
|
549
549
|
static animationWhitelist = ["data", "endAngle", "height", "innerRadius", "cornerRadius", "padAngle", "padding", "colorScale", "startAngle", "style", "width"];
|
|
@@ -4959,10 +4959,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4959
4959
|
/* harmony export */ "isInterpolatable": function() { return /* binding */ isInterpolatable; },
|
|
4960
4960
|
/* harmony export */ "victoryInterpolator": function() { return /* binding */ victoryInterpolator; }
|
|
4961
4961
|
/* harmony export */ });
|
|
4962
|
-
/* harmony import */ var
|
|
4963
|
-
/* harmony import */ var
|
|
4964
|
-
/* harmony import */ var
|
|
4965
|
-
/* harmony import */ var
|
|
4962
|
+
/* 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");
|
|
4963
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__);
|
|
4964
|
+
/* 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");
|
|
4965
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_orderBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
4966
4966
|
/* harmony import */ var victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-vendor/d3-interpolate */ "../../victory-vendor/es/d3-interpolate.js");
|
|
4967
4967
|
|
|
4968
4968
|
|
|
@@ -4988,7 +4988,7 @@ const isInterpolatable = function (obj) {
|
|
|
4988
4988
|
return false;
|
|
4989
4989
|
case "object":
|
|
4990
4990
|
// Don't try to interpolate class instances (except Date or Array).
|
|
4991
|
-
return obj instanceof Date || Array.isArray(obj) ||
|
|
4991
|
+
return obj instanceof Date || Array.isArray(obj) || lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(obj);
|
|
4992
4992
|
case "function":
|
|
4993
4993
|
// Careful! There may be extra properties on function objects that the
|
|
4994
4994
|
// component expects to access - for instance, it may be a `d3.scale()`
|
|
@@ -5048,7 +5048,7 @@ const interpolateFunction = function (a, b) {
|
|
|
5048
5048
|
return b;
|
|
5049
5049
|
}
|
|
5050
5050
|
return function () {
|
|
5051
|
-
/* eslint-disable
|
|
5051
|
+
/* eslint-disable prefer-rest-params */
|
|
5052
5052
|
const aval = typeof a === "function" ? a.apply(this, arguments) : a;
|
|
5053
5053
|
const bval = typeof b === "function" ? b.apply(this, arguments) : b;
|
|
5054
5054
|
return (0,victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(aval, bval)(t);
|
|
@@ -5074,7 +5074,7 @@ const interpolateObject = function (startValue, endValue) {
|
|
|
5074
5074
|
if (typeof x === "function" || typeof y === "function") {
|
|
5075
5075
|
return interpolateFunction(x, y);
|
|
5076
5076
|
}
|
|
5077
|
-
if (typeof x === "object" &&
|
|
5077
|
+
if (typeof x === "object" && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(x) || typeof y === "object" && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(y)) {
|
|
5078
5078
|
return interpolateObject(x, y);
|
|
5079
5079
|
}
|
|
5080
5080
|
return (0,victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(x, y);
|
|
@@ -5083,7 +5083,7 @@ const interpolateObject = function (startValue, endValue) {
|
|
|
5083
5083
|
// When the value is an array, attempt to sort by "key" so that animating nodes may be identified
|
|
5084
5084
|
// based on "key" instead of index
|
|
5085
5085
|
const keyData = val => {
|
|
5086
|
-
return Array.isArray(val) ?
|
|
5086
|
+
return Array.isArray(val) ? lodash_orderBy__WEBPACK_IMPORTED_MODULE_1___default()(val, "key") : val;
|
|
5087
5087
|
};
|
|
5088
5088
|
const i = {};
|
|
5089
5089
|
const c = {};
|
|
@@ -5150,7 +5150,7 @@ const victoryInterpolator = function (a, b) {
|
|
|
5150
5150
|
if (typeof a === "function" || typeof b === "function") {
|
|
5151
5151
|
return interpolateFunction(a, b);
|
|
5152
5152
|
}
|
|
5153
|
-
if (
|
|
5153
|
+
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(a) || lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(b)) {
|
|
5154
5154
|
// @ts-expect-error These generics are tough, but they work :)
|
|
5155
5155
|
return interpolateObject(a, b);
|
|
5156
5156
|
}
|
|
@@ -5326,16 +5326,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5326
5326
|
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; },
|
|
5327
5327
|
/* harmony export */ "useVictoryContainer": function() { return /* binding */ useVictoryContainer; }
|
|
5328
5328
|
/* harmony export */ });
|
|
5329
|
-
/* harmony import */ var
|
|
5330
|
-
/* harmony import */ var
|
|
5331
|
-
/* harmony import */ var
|
|
5332
|
-
/* harmony import */ var
|
|
5329
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5330
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5331
|
+
/* 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");
|
|
5332
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1__);
|
|
5333
5333
|
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
5334
5334
|
/* 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");
|
|
5335
5335
|
/* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
|
|
5336
5336
|
/* 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");
|
|
5337
5337
|
/* 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");
|
|
5338
|
-
|
|
5339
5338
|
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); }
|
|
5340
5339
|
|
|
5341
5340
|
|
|
@@ -5343,9 +5342,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
5343
5342
|
|
|
5344
5343
|
|
|
5345
5344
|
|
|
5345
|
+
|
|
5346
5346
|
const defaultProps = {
|
|
5347
5347
|
className: "VictoryContainer",
|
|
5348
|
-
portalComponent: /*#__PURE__*/
|
|
5348
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
5349
5349
|
portalZIndex: 99,
|
|
5350
5350
|
responsive: true,
|
|
5351
5351
|
role: "img"
|
|
@@ -5362,10 +5362,10 @@ function useVictoryContainer(initialProps) {
|
|
|
5362
5362
|
height,
|
|
5363
5363
|
responsive
|
|
5364
5364
|
} = props;
|
|
5365
|
-
const localContainerRef = (0,
|
|
5365
|
+
const localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
5366
5366
|
|
|
5367
5367
|
// Generated ID stored in ref because it needs to persist across renders
|
|
5368
|
-
const generatedId = (0,
|
|
5368
|
+
const generatedId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default()("victory-container-"));
|
|
5369
5369
|
const containerId = props.containerId ?? generatedId.current;
|
|
5370
5370
|
const getIdForElement = elName => `${containerId}-${elName}`;
|
|
5371
5371
|
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props);
|
|
@@ -5424,7 +5424,7 @@ const VictoryContainer = initialProps => {
|
|
|
5424
5424
|
containerRef,
|
|
5425
5425
|
localContainerRef
|
|
5426
5426
|
} = useVictoryContainer(initialProps);
|
|
5427
|
-
|
|
5427
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
5428
5428
|
if (!events?.onWheel) return;
|
|
5429
5429
|
const handleWheel = e => e.preventDefault();
|
|
5430
5430
|
const container = localContainerRef?.current;
|
|
@@ -5434,21 +5434,21 @@ const VictoryContainer = initialProps => {
|
|
|
5434
5434
|
};
|
|
5435
5435
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5436
5436
|
}, []);
|
|
5437
|
-
return /*#__PURE__*/
|
|
5437
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
5438
5438
|
className: className,
|
|
5439
5439
|
style: {
|
|
5440
5440
|
...style,
|
|
5441
5441
|
width: responsive ? style?.width : dimensions.width,
|
|
5442
5442
|
height: responsive ? style?.height : dimensions.height,
|
|
5443
|
-
pointerEvents: "none",
|
|
5444
|
-
touchAction: "none",
|
|
5445
|
-
position: "relative"
|
|
5443
|
+
pointerEvents: style?.pointerEvents ?? "none",
|
|
5444
|
+
touchAction: style?.touchAction ?? "none",
|
|
5445
|
+
position: style?.position ?? "relative"
|
|
5446
5446
|
},
|
|
5447
5447
|
"data-ouia-component-id": ouiaId,
|
|
5448
5448
|
"data-ouia-component-type": ouiaType,
|
|
5449
5449
|
"data-ouia-safe": ouiaSafe,
|
|
5450
5450
|
ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
|
|
5451
|
-
}, /*#__PURE__*/
|
|
5451
|
+
}, /*#__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({
|
|
5452
5452
|
width: width,
|
|
5453
5453
|
height: height,
|
|
5454
5454
|
tabIndex: tabIndex,
|
|
@@ -5461,11 +5461,11 @@ const VictoryContainer = initialProps => {
|
|
|
5461
5461
|
...dimensions,
|
|
5462
5462
|
pointerEvents: "all"
|
|
5463
5463
|
}
|
|
5464
|
-
}, userProps, events), title ? /*#__PURE__*/
|
|
5464
|
+
}, userProps, events), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("title", {
|
|
5465
5465
|
id: titleId
|
|
5466
|
-
}, title) : null, desc ? /*#__PURE__*/
|
|
5466
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("desc", {
|
|
5467
5467
|
id: descId
|
|
5468
|
-
}, desc) : null, children), /*#__PURE__*/
|
|
5468
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
5469
5469
|
style: {
|
|
5470
5470
|
...dimensions,
|
|
5471
5471
|
zIndex: portalZIndex,
|
|
@@ -5473,7 +5473,7 @@ const VictoryContainer = initialProps => {
|
|
|
5473
5473
|
top: 0,
|
|
5474
5474
|
left: 0
|
|
5475
5475
|
}
|
|
5476
|
-
}, /*#__PURE__*/
|
|
5476
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__.PortalOutlet, {
|
|
5477
5477
|
as: portalComponent,
|
|
5478
5478
|
width: width,
|
|
5479
5479
|
height: height,
|
|
@@ -5500,12 +5500,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5500
5500
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5501
5501
|
/* harmony export */ "VictoryLabel": function() { return /* binding */ VictoryLabel; }
|
|
5502
5502
|
/* harmony export */ });
|
|
5503
|
-
/* harmony import */ var
|
|
5504
|
-
/* harmony import */ var
|
|
5503
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5504
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5505
5505
|
/* 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");
|
|
5506
5506
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
5507
|
-
/* harmony import */ var
|
|
5508
|
-
/* harmony import */ var
|
|
5507
|
+
/* 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");
|
|
5508
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
5509
5509
|
/* 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");
|
|
5510
5510
|
/* harmony import */ var _victory_primitives_rect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-primitives/rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
5511
5511
|
/* harmony import */ var _victory_primitives_text__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../victory-primitives/text */ "../../victory-core/es/victory-primitives/text.js");
|
|
@@ -5516,9 +5516,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5516
5516
|
/* harmony import */ var _victory_util_style__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/style */ "../../victory-core/es/victory-util/style.js");
|
|
5517
5517
|
/* harmony import */ var _victory_util_textsize__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../victory-util/textsize */ "../../victory-core/es/victory-util/textsize.js");
|
|
5518
5518
|
/* 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");
|
|
5519
|
+
/* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
|
|
5519
5520
|
|
|
5520
5521
|
|
|
5521
|
-
/* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
|
|
5522
5522
|
|
|
5523
5523
|
|
|
5524
5524
|
|
|
@@ -5570,7 +5570,7 @@ const shouldUseMultilineBackgrounds = props => {
|
|
|
5570
5570
|
backgroundStyle,
|
|
5571
5571
|
backgroundPadding
|
|
5572
5572
|
} = props;
|
|
5573
|
-
return Array.isArray(backgroundStyle) && !
|
|
5573
|
+
return Array.isArray(backgroundStyle) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(backgroundStyle) || Array.isArray(backgroundPadding) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(backgroundPadding);
|
|
5574
5574
|
};
|
|
5575
5575
|
const getStyles = (style, props) => {
|
|
5576
5576
|
if (props.disableInlineStyles) {
|
|
@@ -5586,32 +5586,28 @@ const getStyles = (style, props) => {
|
|
|
5586
5586
|
fontSize: getFontSize(baseStyles)
|
|
5587
5587
|
});
|
|
5588
5588
|
};
|
|
5589
|
-
return Array.isArray(style) && !
|
|
5589
|
+
return Array.isArray(style) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(style) ? style.map(s => getSingleStyle(s)) : getSingleStyle(style);
|
|
5590
5590
|
};
|
|
5591
5591
|
const getBackgroundStyles = (style, props) => {
|
|
5592
5592
|
if (!style) {
|
|
5593
5593
|
return undefined;
|
|
5594
5594
|
}
|
|
5595
|
-
return Array.isArray(style) && !
|
|
5595
|
+
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);
|
|
5596
5596
|
};
|
|
5597
5597
|
const getBackgroundPadding = props => {
|
|
5598
5598
|
if (props.backgroundPadding && Array.isArray(props.backgroundPadding)) {
|
|
5599
5599
|
return props.backgroundPadding.map(backgroundPadding => {
|
|
5600
5600
|
const padding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(backgroundPadding, props);
|
|
5601
|
-
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(
|
|
5602
|
-
padding
|
|
5603
|
-
});
|
|
5601
|
+
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(padding);
|
|
5604
5602
|
});
|
|
5605
5603
|
}
|
|
5606
5604
|
const padding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.backgroundPadding, props);
|
|
5607
|
-
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(
|
|
5608
|
-
padding
|
|
5609
|
-
});
|
|
5605
|
+
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(padding);
|
|
5610
5606
|
};
|
|
5611
5607
|
const getLineHeight = props => {
|
|
5612
5608
|
const lineHeight = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.lineHeight, props);
|
|
5613
5609
|
if (Array.isArray(lineHeight)) {
|
|
5614
|
-
return
|
|
5610
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(lineHeight) ? [1] : lineHeight;
|
|
5615
5611
|
}
|
|
5616
5612
|
return lineHeight;
|
|
5617
5613
|
};
|
|
@@ -5731,7 +5727,7 @@ const getFullBackground = (calculatedProps, tspanValues) => {
|
|
|
5731
5727
|
x: inline ? xCoordinate - backgroundPadding.left : xCoordinate + dx - backgroundPadding.left,
|
|
5732
5728
|
y: yCoordinate
|
|
5733
5729
|
};
|
|
5734
|
-
return /*#__PURE__*/
|
|
5730
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(backgroundComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, backgroundComponent.props, backgroundProps));
|
|
5735
5731
|
};
|
|
5736
5732
|
const getInlineXOffset = (calculatedProps, textElements, index) => {
|
|
5737
5733
|
const {
|
|
@@ -5801,7 +5797,7 @@ const getChildBackgrounds = (calculatedProps, tspanValues) => {
|
|
|
5801
5797
|
x: xCoord - padding.left,
|
|
5802
5798
|
y: yCoord
|
|
5803
5799
|
};
|
|
5804
|
-
return /*#__PURE__*/
|
|
5800
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(backgroundComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, backgroundComponent.props, backgroundProps));
|
|
5805
5801
|
});
|
|
5806
5802
|
};
|
|
5807
5803
|
const getBackgroundElement = (calculatedProps, tspanValues) => {
|
|
@@ -5932,16 +5928,16 @@ const renderLabel = (calculatedProps, tspanValues) => {
|
|
|
5932
5928
|
style: currentStyle,
|
|
5933
5929
|
children: line
|
|
5934
5930
|
};
|
|
5935
|
-
return /*#__PURE__*/
|
|
5931
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(tspanComponent, tspanProps);
|
|
5936
5932
|
});
|
|
5937
|
-
return /*#__PURE__*/
|
|
5933
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(textComponent, textProps, tspans);
|
|
5938
5934
|
};
|
|
5939
5935
|
const defaultProps = {
|
|
5940
|
-
backgroundComponent: /*#__PURE__*/
|
|
5941
|
-
groupComponent: /*#__PURE__*/
|
|
5936
|
+
backgroundComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_rect__WEBPACK_IMPORTED_MODULE_8__.Rect, null),
|
|
5937
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null),
|
|
5942
5938
|
direction: "inherit",
|
|
5943
|
-
textComponent: /*#__PURE__*/
|
|
5944
|
-
tspanComponent: /*#__PURE__*/
|
|
5939
|
+
textComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_text__WEBPACK_IMPORTED_MODULE_9__.Text, null),
|
|
5940
|
+
tspanComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_tspan__WEBPACK_IMPORTED_MODULE_10__.TSpan, null),
|
|
5945
5941
|
capHeight: 0.71,
|
|
5946
5942
|
// Magic number from d3.
|
|
5947
5943
|
lineHeight: 1
|
|
@@ -5978,10 +5974,10 @@ const VictoryLabel = initialProps => {
|
|
|
5978
5974
|
if (props.backgroundStyle) {
|
|
5979
5975
|
const backgroundElement = getBackgroundElement(calculatedProps, tspanValues);
|
|
5980
5976
|
const children = [backgroundElement, label];
|
|
5981
|
-
const backgroundWithLabel = /*#__PURE__*/
|
|
5982
|
-
return props.renderInPortal ? /*#__PURE__*/
|
|
5977
|
+
const backgroundWithLabel = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.groupComponent, {}, children);
|
|
5978
|
+
return props.renderInPortal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__.VictoryPortal, null, backgroundWithLabel) : backgroundWithLabel;
|
|
5983
5979
|
}
|
|
5984
|
-
return props.renderInPortal ? /*#__PURE__*/
|
|
5980
|
+
return props.renderInPortal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__.VictoryPortal, null, label) : label;
|
|
5985
5981
|
};
|
|
5986
5982
|
VictoryLabel.displayName = "VictoryLabel";
|
|
5987
5983
|
VictoryLabel.role = "label";
|
|
@@ -6107,12 +6103,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6107
6103
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6108
6104
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
6109
6105
|
/* harmony export */ });
|
|
6110
|
-
/* harmony import */ var
|
|
6111
|
-
/* harmony import */ var
|
|
6106
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6107
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6112
6108
|
/* 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");
|
|
6113
6109
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6114
|
-
/* harmony import */ var
|
|
6115
|
-
/* harmony import */ var
|
|
6110
|
+
/* 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");
|
|
6111
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2__);
|
|
6116
6112
|
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
6117
6113
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6118
6114
|
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
@@ -6123,14 +6119,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6123
6119
|
|
|
6124
6120
|
|
|
6125
6121
|
const defaultProps = {
|
|
6126
|
-
groupComponent: /*#__PURE__*/
|
|
6122
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null)
|
|
6127
6123
|
};
|
|
6128
6124
|
const VictoryPortal = initialProps => {
|
|
6129
6125
|
const props = {
|
|
6130
6126
|
...defaultProps,
|
|
6131
6127
|
...initialProps
|
|
6132
6128
|
};
|
|
6133
|
-
const [id] = (0,
|
|
6129
|
+
const [id] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default()());
|
|
6134
6130
|
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
6135
6131
|
if (!portalContext) {
|
|
6136
6132
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
@@ -6148,12 +6144,12 @@ const VictoryPortal = initialProps => {
|
|
|
6148
6144
|
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
6149
6145
|
key: childProps.key ?? id
|
|
6150
6146
|
});
|
|
6151
|
-
const child = children && /*#__PURE__*/
|
|
6152
|
-
|
|
6147
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(children, newProps);
|
|
6148
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
6153
6149
|
portalContext?.addChild(id, child);
|
|
6154
6150
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6155
6151
|
}, [props.children]);
|
|
6156
|
-
|
|
6152
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
6157
6153
|
return () => portalContext?.removeChild(id);
|
|
6158
6154
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6159
6155
|
}, []);
|
|
@@ -6174,10 +6170,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6174
6170
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6175
6171
|
/* harmony export */ "LineSegment": function() { return /* binding */ LineSegment; }
|
|
6176
6172
|
/* harmony export */ });
|
|
6177
|
-
/* harmony import */ var
|
|
6178
|
-
/* harmony import */ var
|
|
6179
|
-
/* harmony import */ var
|
|
6180
|
-
/* harmony import */ var
|
|
6173
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6174
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6175
|
+
/* 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");
|
|
6176
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6181
6177
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6182
6178
|
/* harmony import */ var _line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./line */ "../../victory-core/es/victory-primitives/line.js");
|
|
6183
6179
|
|
|
@@ -6209,13 +6205,13 @@ const evaluateProps = props => {
|
|
|
6209
6205
|
});
|
|
6210
6206
|
};
|
|
6211
6207
|
const defaultProps = {
|
|
6212
|
-
lineComponent: /*#__PURE__*/
|
|
6208
|
+
lineComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_line__WEBPACK_IMPORTED_MODULE_3__.Line, null),
|
|
6213
6209
|
role: "presentation",
|
|
6214
6210
|
shapeRendering: "auto"
|
|
6215
6211
|
};
|
|
6216
6212
|
const LineSegment = initialProps => {
|
|
6217
|
-
const props = evaluateProps(
|
|
6218
|
-
return /*#__PURE__*/
|
|
6213
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps));
|
|
6214
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.lineComponent, {
|
|
6219
6215
|
...props.events,
|
|
6220
6216
|
"aria-label": props.ariaLabel,
|
|
6221
6217
|
style: props.style,
|
|
@@ -7572,22 +7568,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7572
7568
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7573
7569
|
/* harmony export */ "VictoryTransition": function() { return /* binding */ VictoryTransition; }
|
|
7574
7570
|
/* harmony export */ });
|
|
7575
|
-
/* harmony import */ var
|
|
7576
|
-
/* harmony import */ var
|
|
7571
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7572
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7577
7573
|
/* 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");
|
|
7578
7574
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
7579
|
-
/* harmony import */ var
|
|
7580
|
-
/* harmony import */ var
|
|
7575
|
+
/* 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");
|
|
7576
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_2__);
|
|
7577
|
+
/* 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");
|
|
7578
|
+
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_3__);
|
|
7581
7579
|
/* 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");
|
|
7582
7580
|
/* harmony import */ var _victory_util_collection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../victory-util/collection */ "../../victory-core/es/victory-util/collection.js");
|
|
7583
7581
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7584
7582
|
/* 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");
|
|
7585
7583
|
/* harmony import */ var _victory_util_transitions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/transitions */ "../../victory-core/es/victory-util/transitions.js");
|
|
7586
|
-
|
|
7587
|
-
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_3__);
|
|
7584
|
+
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); }
|
|
7588
7585
|
|
|
7589
7586
|
|
|
7590
|
-
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); }
|
|
7591
7587
|
|
|
7592
7588
|
|
|
7593
7589
|
|
|
@@ -7595,7 +7591,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
7595
7591
|
|
|
7596
7592
|
|
|
7597
7593
|
|
|
7598
|
-
class VictoryTransition extends (
|
|
7594
|
+
class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
|
7599
7595
|
static displayName = "VictoryTransition";
|
|
7600
7596
|
static contextType = _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_4__["default"];
|
|
7601
7597
|
constructor(props, context) {
|
|
@@ -7612,7 +7608,7 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7612
7608
|
componentDidMount() {
|
|
7613
7609
|
this.setState({
|
|
7614
7610
|
nodesShouldLoad: true
|
|
7615
|
-
});
|
|
7611
|
+
});
|
|
7616
7612
|
}
|
|
7617
7613
|
shouldComponentUpdate(nextProps) {
|
|
7618
7614
|
if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default()(this.props, nextProps)) {
|
|
@@ -7638,8 +7634,8 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7638
7634
|
nextProps
|
|
7639
7635
|
};
|
|
7640
7636
|
}
|
|
7641
|
-
const oldChildren =
|
|
7642
|
-
const nextChildren =
|
|
7637
|
+
const oldChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
7638
|
+
const nextChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(nextProps.children);
|
|
7643
7639
|
const {
|
|
7644
7640
|
nodesWillExit,
|
|
7645
7641
|
nodesWillEnter,
|
|
@@ -7662,12 +7658,12 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7662
7658
|
const childDomain = child.props && child.type.getDomain(child.props, axis);
|
|
7663
7659
|
return childDomain ? memo.concat(childDomain) : memo;
|
|
7664
7660
|
} else if (child.props && child.props.children) {
|
|
7665
|
-
return memo.concat(getChildDomains(
|
|
7661
|
+
return memo.concat(getChildDomains(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children)));
|
|
7666
7662
|
}
|
|
7667
7663
|
return memo;
|
|
7668
7664
|
}, []);
|
|
7669
7665
|
};
|
|
7670
|
-
const child =
|
|
7666
|
+
const child = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children)[0];
|
|
7671
7667
|
const childProps = child.props || {};
|
|
7672
7668
|
const domain = Array.isArray(childProps.domain) ? childProps.domain : childProps.domain && childProps.domain[axis];
|
|
7673
7669
|
if (!childProps.children && domain) {
|
|
@@ -7700,7 +7696,7 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7700
7696
|
render() {
|
|
7701
7697
|
const props = this.pickProps();
|
|
7702
7698
|
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));
|
|
7703
|
-
const child =
|
|
7699
|
+
const child = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children)[0];
|
|
7704
7700
|
const transitionProps = getTransitionProps(child);
|
|
7705
7701
|
this.transitionProps = transitionProps;
|
|
7706
7702
|
const domain = {
|
|
@@ -7714,21 +7710,21 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7714
7710
|
}, transitionProps, child.props);
|
|
7715
7711
|
const animationWhitelist = props.animationWhitelist || [];
|
|
7716
7712
|
const whitelist = animationWhitelist.concat(["clipWidth"]);
|
|
7717
|
-
const propsToAnimate = whitelist.length ?
|
|
7718
|
-
return /*#__PURE__*/
|
|
7713
|
+
const propsToAnimate = whitelist.length ? lodash_pick__WEBPACK_IMPORTED_MODULE_2___default()(combinedProps, whitelist) : combinedProps;
|
|
7714
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_animation_victory_animation__WEBPACK_IMPORTED_MODULE_8__.VictoryAnimation, _extends({}, combinedProps.animate, {
|
|
7719
7715
|
data: propsToAnimate
|
|
7720
7716
|
}), newProps => {
|
|
7721
7717
|
if (child.props.groupComponent) {
|
|
7722
|
-
const groupComponent = this.continuous ? /*#__PURE__*/
|
|
7718
|
+
const groupComponent = this.continuous ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child.props.groupComponent, {
|
|
7723
7719
|
clipWidth: newProps.clipWidth || 0
|
|
7724
7720
|
}) : child.props.groupComponent;
|
|
7725
|
-
return /*#__PURE__*/
|
|
7721
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
7726
7722
|
animate: null,
|
|
7727
7723
|
animating: true,
|
|
7728
7724
|
groupComponent
|
|
7729
7725
|
}, newProps, combinedProps));
|
|
7730
7726
|
}
|
|
7731
|
-
return /*#__PURE__*/
|
|
7727
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
7732
7728
|
animate: null,
|
|
7733
7729
|
animating: true
|
|
7734
7730
|
}, newProps, combinedProps));
|
|
@@ -7749,14 +7745,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7749
7745
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7750
7746
|
/* harmony export */ "addEvents": function() { return /* binding */ addEvents; }
|
|
7751
7747
|
/* harmony export */ });
|
|
7752
|
-
/* harmony import */ var
|
|
7753
|
-
/* harmony import */ var
|
|
7754
|
-
/* harmony import */ var
|
|
7755
|
-
/* harmony import */ var
|
|
7756
|
-
/* harmony import */ var
|
|
7757
|
-
/* harmony import */ var
|
|
7758
|
-
/* harmony import */ var
|
|
7759
|
-
/* harmony import */ var
|
|
7748
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7749
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7750
|
+
/* 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");
|
|
7751
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
7752
|
+
/* 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");
|
|
7753
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
7754
|
+
/* 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");
|
|
7755
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
|
7760
7756
|
/* 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");
|
|
7761
7757
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_4__);
|
|
7762
7758
|
/* 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");
|
|
@@ -7826,7 +7822,7 @@ const defaultComponents = [{
|
|
|
7826
7822
|
function addEvents(WrappedComponent, options) {
|
|
7827
7823
|
if (options === void 0) {
|
|
7828
7824
|
options = {};
|
|
7829
|
-
} // eslint-disable-next-line @typescript-eslint/no-empty-
|
|
7825
|
+
} // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
7830
7826
|
// @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
|
|
7831
7827
|
class AddEventsMixin extends WrappedComponent {
|
|
7832
7828
|
constructor(props) {
|
|
@@ -7903,8 +7899,8 @@ function addEvents(WrappedComponent, options) {
|
|
|
7903
7899
|
return {};
|
|
7904
7900
|
}
|
|
7905
7901
|
const getState = (key, type) => {
|
|
7906
|
-
const result =
|
|
7907
|
-
return
|
|
7902
|
+
const result = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, this.getEventState(key, type), this.getSharedEventState(key, type));
|
|
7903
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
|
|
7908
7904
|
};
|
|
7909
7905
|
const components = options.components || defaultComponents;
|
|
7910
7906
|
const stateChanges = components.map(component => {
|
|
@@ -7917,7 +7913,7 @@ function addEvents(WrappedComponent, options) {
|
|
|
7917
7913
|
return stateChanges;
|
|
7918
7914
|
}
|
|
7919
7915
|
applyExternalMutations(props, externalMutations) {
|
|
7920
|
-
if (!
|
|
7916
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
7921
7917
|
const callbacks = props.externalEventMutations.reduce((memo, mutation) => (0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(mutation.callback) ? memo.concat(mutation.callback) : memo, []);
|
|
7922
7918
|
const compiledCallbacks = callbacks.length ? () => {
|
|
7923
7919
|
callbacks.forEach(c => c());
|
|
@@ -7950,7 +7946,7 @@ function addEvents(WrappedComponent, options) {
|
|
|
7950
7946
|
sharedEvents,
|
|
7951
7947
|
externalEventMutations
|
|
7952
7948
|
} = props;
|
|
7953
|
-
return
|
|
7949
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_6__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
|
|
7954
7950
|
}
|
|
7955
7951
|
cacheValues(obj) {
|
|
7956
7952
|
Object.keys(obj).forEach(key => {
|
|
@@ -7961,10 +7957,10 @@ function addEvents(WrappedComponent, options) {
|
|
|
7961
7957
|
const getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
|
|
7962
7958
|
const sharedParentState = getSharedEventStateFunction("parent", "parent");
|
|
7963
7959
|
const parentState = this.getEventState("parent", "parent");
|
|
7964
|
-
const baseParentProps =
|
|
7960
|
+
const baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parentState, sharedParentState);
|
|
7965
7961
|
const parentPropsList = baseParentProps.parentControlledProps;
|
|
7966
|
-
const parentProps = parentPropsList ?
|
|
7967
|
-
const modifiedProps =
|
|
7962
|
+
const parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(baseParentProps, parentPropsList) : {};
|
|
7963
|
+
const modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parentProps, props);
|
|
7968
7964
|
return typeof WrappedComponent.getBaseProps === "function" ? WrappedComponent.getBaseProps(modifiedProps) : {};
|
|
7969
7965
|
}
|
|
7970
7966
|
getAllEvents(props) {
|
|
@@ -7984,18 +7980,18 @@ function addEvents(WrappedComponent, options) {
|
|
|
7984
7980
|
const currentProps = component && typeof component === "object" && "props" in component ? component.props : undefined;
|
|
7985
7981
|
if (this.hasEvents) {
|
|
7986
7982
|
const baseEvents = this.getEvents(this.props, type, key);
|
|
7987
|
-
const componentProps =
|
|
7983
|
+
const componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
7988
7984
|
index,
|
|
7989
7985
|
key: id
|
|
7990
7986
|
}, this.getEventState(key, type), this.getSharedEventState(key, type), currentProps, baseProps, {
|
|
7991
7987
|
id
|
|
7992
7988
|
});
|
|
7993
|
-
const events =
|
|
7989
|
+
const events = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, _events__WEBPACK_IMPORTED_MODULE_6__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
|
|
7994
7990
|
return Object.assign({}, componentProps, {
|
|
7995
7991
|
events
|
|
7996
7992
|
});
|
|
7997
7993
|
}
|
|
7998
|
-
return
|
|
7994
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
7999
7995
|
index,
|
|
8000
7996
|
key: id
|
|
8001
7997
|
}, currentProps, baseProps, {
|
|
@@ -8009,15 +8005,15 @@ function addEvents(WrappedComponent, options) {
|
|
|
8009
8005
|
this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_6__.getGlobalEvents(parentProps.events);
|
|
8010
8006
|
parentProps.events = _events__WEBPACK_IMPORTED_MODULE_6__.omitGlobalEvents(parentProps.events);
|
|
8011
8007
|
}
|
|
8012
|
-
return /*#__PURE__*/
|
|
8008
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(component, parentProps, children);
|
|
8013
8009
|
}
|
|
8014
8010
|
animateComponent(props, defaultAnimationWhitelist) {
|
|
8015
8011
|
const animationWhitelist = typeof props.animate === "object" && props.animate?.animationWhitelist || defaultAnimationWhitelist;
|
|
8016
8012
|
const Comp = this.constructor;
|
|
8017
|
-
return /*#__PURE__*/
|
|
8013
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_8__.VictoryTransition, {
|
|
8018
8014
|
animate: props.animate,
|
|
8019
8015
|
animationWhitelist: animationWhitelist
|
|
8020
|
-
}, /*#__PURE__*/
|
|
8016
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Comp, props));
|
|
8021
8017
|
}
|
|
8022
8018
|
|
|
8023
8019
|
// Used by `VictoryLine` and `VictoryArea`
|
|
@@ -8032,12 +8028,12 @@ function addEvents(WrappedComponent, options) {
|
|
|
8032
8028
|
let newMemo = memo;
|
|
8033
8029
|
const labelProps = this.getComponentProps(labelComponent, "labels", key);
|
|
8034
8030
|
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
8035
|
-
newMemo = newMemo.concat( /*#__PURE__*/
|
|
8031
|
+
newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps));
|
|
8036
8032
|
}
|
|
8037
8033
|
return newMemo;
|
|
8038
8034
|
}, []);
|
|
8039
8035
|
const dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
8040
|
-
const children = [/*#__PURE__*/
|
|
8036
|
+
const children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(dataComponent, dataProps), ...labelComponents];
|
|
8041
8037
|
return this.renderContainer(groupComponent, children);
|
|
8042
8038
|
}
|
|
8043
8039
|
renderData(props, shouldRenderDatum) {
|
|
@@ -8052,14 +8048,14 @@ function addEvents(WrappedComponent, options) {
|
|
|
8052
8048
|
const dataComponents = this.dataKeys.reduce((validDataComponents, _dataKey, index) => {
|
|
8053
8049
|
const dataProps = this.getComponentProps(dataComponent, "data", index);
|
|
8054
8050
|
if (shouldRenderDatum(dataProps.datum)) {
|
|
8055
|
-
validDataComponents.push( /*#__PURE__*/
|
|
8051
|
+
validDataComponents.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(dataComponent, dataProps));
|
|
8056
8052
|
}
|
|
8057
8053
|
return validDataComponents;
|
|
8058
8054
|
}, []);
|
|
8059
8055
|
const labelComponents = this.dataKeys.map((_dataKey, index) => {
|
|
8060
8056
|
const labelProps = this.getComponentProps(labelComponent, "labels", index);
|
|
8061
8057
|
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
8062
|
-
return /*#__PURE__*/
|
|
8058
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps);
|
|
8063
8059
|
}
|
|
8064
8060
|
return undefined;
|
|
8065
8061
|
}).filter(Boolean);
|
|
@@ -8165,24 +8161,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8165
8161
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
8166
8162
|
/* harmony export */ "isDataComponent": function() { return /* binding */ isDataComponent; }
|
|
8167
8163
|
/* harmony export */ });
|
|
8168
|
-
/* harmony import */ var
|
|
8169
|
-
/* harmony import */ var
|
|
8170
|
-
/* harmony import */ var
|
|
8171
|
-
/* harmony import */ var
|
|
8164
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8165
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8166
|
+
/* 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");
|
|
8167
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1__);
|
|
8172
8168
|
/* 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");
|
|
8173
8169
|
/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEqual__WEBPACK_IMPORTED_MODULE_2__);
|
|
8174
|
-
/* harmony import */ var
|
|
8175
|
-
/* harmony import */ var
|
|
8176
|
-
/* harmony import */ var
|
|
8177
|
-
/* harmony import */ var
|
|
8178
|
-
/* harmony import */ var
|
|
8179
|
-
/* harmony import */ var
|
|
8180
|
-
/* harmony import */ var
|
|
8181
|
-
/* harmony import */ var
|
|
8182
|
-
/* harmony import */ var
|
|
8183
|
-
/* harmony import */ var
|
|
8184
|
-
/* harmony import */ var
|
|
8185
|
-
/* harmony import */ var
|
|
8170
|
+
/* 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");
|
|
8171
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3__);
|
|
8172
|
+
/* 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");
|
|
8173
|
+
/* harmony import */ var lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4__);
|
|
8174
|
+
/* 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");
|
|
8175
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_omitBy__WEBPACK_IMPORTED_MODULE_5__);
|
|
8176
|
+
/* 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");
|
|
8177
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_orderBy__WEBPACK_IMPORTED_MODULE_6__);
|
|
8178
|
+
/* 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");
|
|
8179
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_7__);
|
|
8180
|
+
/* 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");
|
|
8181
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_8__);
|
|
8186
8182
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
8187
8183
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
8188
8184
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
@@ -8195,7 +8191,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8195
8191
|
|
|
8196
8192
|
|
|
8197
8193
|
|
|
8198
|
-
/* eslint-disable no-use-before-define */
|
|
8199
8194
|
|
|
8200
8195
|
|
|
8201
8196
|
|
|
@@ -8217,7 +8212,7 @@ function getLength(data) {
|
|
|
8217
8212
|
|
|
8218
8213
|
// Returns generated data for a given axis based on domain and sample from props
|
|
8219
8214
|
function generateDataArray(props, axis) {
|
|
8220
|
-
const propsDomain =
|
|
8215
|
+
const propsDomain = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default()(props.domain) ? props.domain[axis] : props.domain;
|
|
8221
8216
|
const domain = propsDomain || _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis).domain();
|
|
8222
8217
|
const samples = props.samples || 1;
|
|
8223
8218
|
const domainMax = Math.max(...domain);
|
|
@@ -8242,7 +8237,7 @@ function sortData(dataset, sortKey, sortOrder) {
|
|
|
8242
8237
|
formattedSortKey = `_${sortKey}`;
|
|
8243
8238
|
}
|
|
8244
8239
|
const order = sortOrder === "ascending" ? "asc" : "desc";
|
|
8245
|
-
return
|
|
8240
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default()(dataset, formattedSortKey, order);
|
|
8246
8241
|
}
|
|
8247
8242
|
|
|
8248
8243
|
// This method will remove data points that break certain scales. (log scale only)
|
|
@@ -8286,7 +8281,7 @@ function getEventKey(key) {
|
|
|
8286
8281
|
return () => undefined;
|
|
8287
8282
|
}
|
|
8288
8283
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
8289
|
-
return
|
|
8284
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_7___default()(key);
|
|
8290
8285
|
}
|
|
8291
8286
|
|
|
8292
8287
|
// Returns data with an eventKey prop added to each datum
|
|
@@ -8321,8 +8316,6 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
8321
8316
|
const isUnderMinY = underMin(minDomainY);
|
|
8322
8317
|
const isOverMaxX = overMax(maxDomainX);
|
|
8323
8318
|
const isOverMaxY = overMax(maxDomainY);
|
|
8324
|
-
|
|
8325
|
-
// eslint-disable-next-line complexity
|
|
8326
8319
|
return dataset.map(datum => {
|
|
8327
8320
|
let {
|
|
8328
8321
|
_x,
|
|
@@ -8347,12 +8340,12 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
8347
8340
|
if (isUnderMinY(baseline) && !isUnderMinY(value)) _y0 = minDomainY;
|
|
8348
8341
|
// baseline and value with only baseline above max, set baseline to maxDomainY
|
|
8349
8342
|
if (isOverMaxY(baseline) && !isOverMaxY(value)) _y0 = maxDomainY;
|
|
8350
|
-
return Object.assign({}, datum,
|
|
8343
|
+
return Object.assign({}, datum, lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default()({
|
|
8351
8344
|
_x,
|
|
8352
8345
|
_y,
|
|
8353
8346
|
_y0,
|
|
8354
8347
|
_y1
|
|
8355
|
-
}, (
|
|
8348
|
+
}, (lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default())));
|
|
8356
8349
|
});
|
|
8357
8350
|
}
|
|
8358
8351
|
|
|
@@ -8366,7 +8359,7 @@ function createStringMap(props, axis) {
|
|
|
8366
8359
|
const stringsFromAxes = getStringsFromAxes(props, axis);
|
|
8367
8360
|
const stringsFromCategories = getStringsFromCategories(props, axis);
|
|
8368
8361
|
const stringsFromData = getStringsFromData(props, axis);
|
|
8369
|
-
const allStrings =
|
|
8362
|
+
const allStrings = lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default()([...stringsFromAxes, ...stringsFromCategories, ...stringsFromData]);
|
|
8370
8363
|
return allStrings.length === 0 ? null : allStrings.reduce((memo, string, index) => {
|
|
8371
8364
|
memo[string] = index + 1;
|
|
8372
8365
|
return memo;
|
|
@@ -8433,7 +8426,6 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
8433
8426
|
};
|
|
8434
8427
|
}
|
|
8435
8428
|
const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
|
|
8436
|
-
// eslint-disable-line complexity
|
|
8437
8429
|
const parsedDatum = parseDatum(datum);
|
|
8438
8430
|
const fallbackValues = {
|
|
8439
8431
|
x: index,
|
|
@@ -8453,7 +8445,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
8453
8445
|
return memo;
|
|
8454
8446
|
}, {});
|
|
8455
8447
|
const formattedDatum = Object.assign({}, processedValues, parsedDatum);
|
|
8456
|
-
if (!
|
|
8448
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(formattedDatum)) {
|
|
8457
8449
|
dataArr.push(formattedDatum);
|
|
8458
8450
|
}
|
|
8459
8451
|
return dataArr;
|
|
@@ -8580,7 +8572,7 @@ function isDataComponent(component) {
|
|
|
8580
8572
|
};
|
|
8581
8573
|
let role = getRole(component);
|
|
8582
8574
|
if (role === "portal") {
|
|
8583
|
-
const children =
|
|
8575
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
8584
8576
|
role = children.length ? getRole(children[0]) : "";
|
|
8585
8577
|
}
|
|
8586
8578
|
const whitelist = ["area", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -8611,20 +8603,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8611
8603
|
/* harmony export */ "getScopedEvents": function() { return /* binding */ getScopedEvents; },
|
|
8612
8604
|
/* harmony export */ "omitGlobalEvents": function() { return /* binding */ omitGlobalEvents; }
|
|
8613
8605
|
/* harmony export */ });
|
|
8614
|
-
/* harmony import */ var
|
|
8615
|
-
/* harmony import */ var
|
|
8616
|
-
/* harmony import */ var
|
|
8617
|
-
/* harmony import */ var
|
|
8618
|
-
/* harmony import */ var
|
|
8619
|
-
/* harmony import */ var
|
|
8620
|
-
/* harmony import */ var
|
|
8621
|
-
/* harmony import */ var
|
|
8606
|
+
/* 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");
|
|
8607
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0__);
|
|
8608
|
+
/* 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");
|
|
8609
|
+
/* harmony import */ var lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_pickBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
8610
|
+
/* 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");
|
|
8611
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_omitBy__WEBPACK_IMPORTED_MODULE_2__);
|
|
8612
|
+
/* 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");
|
|
8613
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_3__);
|
|
8622
8614
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
8623
8615
|
|
|
8624
8616
|
|
|
8625
8617
|
|
|
8626
8618
|
|
|
8627
|
-
/* eslint-disable no-use-before-define */
|
|
8628
8619
|
|
|
8629
8620
|
const GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
|
|
8630
8621
|
|
|
@@ -8672,11 +8663,10 @@ getScopedEvents) {
|
|
|
8672
8663
|
*/
|
|
8673
8664
|
const getAllEvents = () => {
|
|
8674
8665
|
// Mandatory usage: `getEvents.bind(this)`
|
|
8675
|
-
|
|
8666
|
+
|
|
8676
8667
|
if (Array.isArray(this.componentEvents)) {
|
|
8677
8668
|
return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
|
|
8678
8669
|
}
|
|
8679
|
-
/* eslint-enable no-invalid-this */
|
|
8680
8670
|
return props.events;
|
|
8681
8671
|
};
|
|
8682
8672
|
const allEvents = getAllEvents();
|
|
@@ -8696,12 +8686,12 @@ getScopedEvents) {
|
|
|
8696
8686
|
*/
|
|
8697
8687
|
// eslint-disable-next-line max-params
|
|
8698
8688
|
function getScopedEvents(events, namespace, childType, baseProps) {
|
|
8699
|
-
if (
|
|
8689
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
8700
8690
|
return {};
|
|
8701
8691
|
}
|
|
8702
8692
|
|
|
8703
8693
|
// Mandatory usage: `getScopedEvents.bind(this)`
|
|
8704
|
-
|
|
8694
|
+
|
|
8705
8695
|
const newBaseProps = baseProps || this.baseProps;
|
|
8706
8696
|
// returns the original base props or base state of a given target element
|
|
8707
8697
|
const getTargetProps = (identifier, type) => {
|
|
@@ -8710,7 +8700,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
8710
8700
|
target,
|
|
8711
8701
|
key
|
|
8712
8702
|
} = identifier;
|
|
8713
|
-
// eslint-disable-next-line no-invalid-this
|
|
8714
8703
|
const baseType = type === "props" ? newBaseProps : this.state || {};
|
|
8715
8704
|
const base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
8716
8705
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
@@ -8737,7 +8726,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
8737
8726
|
|
|
8738
8727
|
// returns the state object with mutated props applied for a single key
|
|
8739
8728
|
const getMutationObject = (key, childName) => {
|
|
8740
|
-
// eslint-disable-next-line no-invalid-this
|
|
8741
8729
|
const baseState = this.state || {};
|
|
8742
8730
|
if (!(0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(eventReturn.mutation)) {
|
|
8743
8731
|
return baseState;
|
|
@@ -8810,11 +8798,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
8810
8798
|
// into a state mutation, and calls setState
|
|
8811
8799
|
// eslint-disable-next-line max-params
|
|
8812
8800
|
const onEvent = (evt, childProps, eventKey, eventName) => {
|
|
8813
|
-
// eslint-disable-next-line no-invalid-this
|
|
8814
8801
|
const eventReturn = events[eventName](evt, childProps, eventKey, this);
|
|
8815
|
-
if (!
|
|
8802
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(eventReturn)) {
|
|
8816
8803
|
const callbacks = compileCallbacks(eventReturn);
|
|
8817
|
-
// eslint-disable-next-line no-invalid-this
|
|
8818
8804
|
this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
|
|
8819
8805
|
}
|
|
8820
8806
|
};
|
|
@@ -8844,7 +8830,7 @@ function getPartialEvents(events, eventKey, childProps) {
|
|
|
8844
8830
|
// eslint-disable-next-line max-params
|
|
8845
8831
|
function getEventState(eventKey, namespace, childType) {
|
|
8846
8832
|
// Mandatory usage: `getEventState.bind(this)`
|
|
8847
|
-
|
|
8833
|
+
|
|
8848
8834
|
const state = this.state || {};
|
|
8849
8835
|
if (!childType) {
|
|
8850
8836
|
return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
|
|
@@ -8874,7 +8860,7 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
8874
8860
|
const childState = baseState[childName];
|
|
8875
8861
|
const mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
8876
8862
|
memo[childName] = mutation ? mutation : childState;
|
|
8877
|
-
return
|
|
8863
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
8878
8864
|
}, {});
|
|
8879
8865
|
}
|
|
8880
8866
|
|
|
@@ -8910,7 +8896,7 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
8910
8896
|
} else {
|
|
8911
8897
|
// use keys from both state and props so that elements not intially included in baseProps
|
|
8912
8898
|
// will be used. (i.e. labels)
|
|
8913
|
-
const targets =
|
|
8899
|
+
const targets = lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default()(Object.keys(keyProps).concat(Object.keys(keyState)));
|
|
8914
8900
|
memo[eventKey] = targets.reduce((m, target) => {
|
|
8915
8901
|
const identifier = {
|
|
8916
8902
|
eventKey,
|
|
@@ -8919,10 +8905,10 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
8919
8905
|
};
|
|
8920
8906
|
const mutation = getExternalMutation(mutations, keyProps[target], keyState[target], identifier);
|
|
8921
8907
|
m[target] = mutation !== undefined ? Object.assign({}, keyState[target], mutation) : keyState[target];
|
|
8922
|
-
return
|
|
8908
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(m, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
8923
8909
|
}, {});
|
|
8924
8910
|
}
|
|
8925
|
-
return
|
|
8911
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
8926
8912
|
}, {});
|
|
8927
8913
|
}
|
|
8928
8914
|
|
|
@@ -8954,11 +8940,11 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
8954
8940
|
}
|
|
8955
8941
|
// find any mutation objects that match the target
|
|
8956
8942
|
const targetMutations = scopedMutations.filter(m => filterMutations(m, "target"));
|
|
8957
|
-
if (
|
|
8943
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(targetMutations)) {
|
|
8958
8944
|
return undefined;
|
|
8959
8945
|
}
|
|
8960
8946
|
const keyMutations = targetMutations.filter(m => filterMutations(m, "eventKey"));
|
|
8961
|
-
if (
|
|
8947
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(keyMutations)) {
|
|
8962
8948
|
return undefined;
|
|
8963
8949
|
}
|
|
8964
8950
|
return keyMutations.reduce((memo, curr) => {
|
|
@@ -8984,8 +8970,8 @@ function getGlobalEventNameFromKey(key) {
|
|
|
8984
8970
|
const match = key.match(GLOBAL_EVENT_REGEX);
|
|
8985
8971
|
return match && match[1] && match[1].toLowerCase();
|
|
8986
8972
|
}
|
|
8987
|
-
const getGlobalEvents = events =>
|
|
8988
|
-
const omitGlobalEvents = events =>
|
|
8973
|
+
const getGlobalEvents = events => lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(events, (_, key) => GLOBAL_EVENT_REGEX.test(key));
|
|
8974
|
+
const omitGlobalEvents = events => lodash_omitBy__WEBPACK_IMPORTED_MODULE_2___default()(events, (_, key) => GLOBAL_EVENT_REGEX.test(key));
|
|
8989
8975
|
const emulateReactEvent = event => Object.assign(event, {
|
|
8990
8976
|
nativeEvent: event
|
|
8991
8977
|
});
|
|
@@ -9026,41 +9012,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9026
9012
|
/* harmony export */ "reduceChildren": function() { return /* binding */ reduceChildren; },
|
|
9027
9013
|
/* harmony export */ "scalePoint": function() { return /* binding */ scalePoint; }
|
|
9028
9014
|
/* harmony export */ });
|
|
9029
|
-
/* harmony import */ var
|
|
9030
|
-
/* harmony import */ var
|
|
9031
|
-
/* harmony import */ var
|
|
9032
|
-
/* harmony import */ var
|
|
9033
|
-
/* harmony import */ var
|
|
9034
|
-
/* harmony import */ var
|
|
9035
|
-
/* harmony import */ var
|
|
9036
|
-
/* harmony import */ var
|
|
9037
|
-
|
|
9015
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
9016
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
9017
|
+
/* 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");
|
|
9018
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
9019
|
+
/* 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");
|
|
9020
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_2__);
|
|
9021
|
+
/* 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");
|
|
9022
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
|
9038
9023
|
|
|
9039
9024
|
|
|
9040
|
-
/* eslint-disable no-use-before-define */
|
|
9041
9025
|
|
|
9042
|
-
// Private Functions
|
|
9043
9026
|
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9027
|
+
/**
|
|
9028
|
+
* Determine the range of a cartesian axis
|
|
9029
|
+
*/
|
|
9030
|
+
function getCartesianRange(options) {
|
|
9031
|
+
const vertical = options.axis !== "x";
|
|
9048
9032
|
if (vertical) {
|
|
9049
|
-
return [
|
|
9033
|
+
return [options.height - options.padding.bottom, options.padding.top];
|
|
9050
9034
|
}
|
|
9051
|
-
return [padding.left,
|
|
9035
|
+
return [options.padding.left, options.width - options.padding.right];
|
|
9052
9036
|
}
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9037
|
+
|
|
9038
|
+
/**
|
|
9039
|
+
* Determine the range of a polar axis in radians
|
|
9040
|
+
*/
|
|
9041
|
+
function getPolarRange(options) {
|
|
9042
|
+
if (options.axis === "x") {
|
|
9043
|
+
const startAngle = degreesToRadians(options.startAngle || 0);
|
|
9044
|
+
const endAngle = degreesToRadians(options.endAngle || 360);
|
|
9057
9045
|
return [startAngle, endAngle];
|
|
9058
9046
|
}
|
|
9059
|
-
return [
|
|
9047
|
+
return [options.innerRadius || 0, getRadius({
|
|
9048
|
+
height: options.height,
|
|
9049
|
+
width: options.width,
|
|
9050
|
+
padding: options.padding
|
|
9051
|
+
})];
|
|
9060
9052
|
}
|
|
9061
9053
|
|
|
9062
|
-
// Exported Functions
|
|
9063
|
-
|
|
9064
9054
|
/**
|
|
9065
9055
|
* Creates an object composed of the inverted keys and values of object.
|
|
9066
9056
|
* If object contains duplicate values, subsequent values overwrite property assignments of previous values.
|
|
@@ -9097,8 +9087,11 @@ function omit(originalObject, ks) {
|
|
|
9097
9087
|
}
|
|
9098
9088
|
return newObject;
|
|
9099
9089
|
}
|
|
9090
|
+
|
|
9091
|
+
/**
|
|
9092
|
+
* Coalesce the x and y values from a data point
|
|
9093
|
+
*/
|
|
9100
9094
|
function getPoint(datum) {
|
|
9101
|
-
const exists = val => val !== undefined;
|
|
9102
9095
|
const {
|
|
9103
9096
|
_x,
|
|
9104
9097
|
_x1,
|
|
@@ -9109,16 +9102,20 @@ function getPoint(datum) {
|
|
|
9109
9102
|
_y0,
|
|
9110
9103
|
_voronoiY
|
|
9111
9104
|
} = datum;
|
|
9112
|
-
const defaultX =
|
|
9113
|
-
const defaultY =
|
|
9105
|
+
const defaultX = _x1 ?? _x;
|
|
9106
|
+
const defaultY = _y1 ?? _y;
|
|
9114
9107
|
const point = {
|
|
9115
|
-
x:
|
|
9116
|
-
x0:
|
|
9117
|
-
y:
|
|
9118
|
-
y0:
|
|
9108
|
+
x: _voronoiX ?? defaultX,
|
|
9109
|
+
x0: _x0 ?? _x,
|
|
9110
|
+
y: _voronoiY ?? defaultY,
|
|
9111
|
+
y0: _y0 ?? _y
|
|
9119
9112
|
};
|
|
9120
|
-
return
|
|
9113
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, point, datum);
|
|
9121
9114
|
}
|
|
9115
|
+
|
|
9116
|
+
/**
|
|
9117
|
+
* Scale a point based on the origin, direction, and given scale function
|
|
9118
|
+
*/
|
|
9122
9119
|
function scalePoint(props, datum) {
|
|
9123
9120
|
const {
|
|
9124
9121
|
scale,
|
|
@@ -9141,11 +9138,11 @@ function scalePoint(props, datum) {
|
|
|
9141
9138
|
y0: polar ? -y0 * Math.sin(x0) + origin.x : y0
|
|
9142
9139
|
};
|
|
9143
9140
|
}
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9141
|
+
|
|
9142
|
+
/**
|
|
9143
|
+
* Returns a padding value from a number or partial padding values
|
|
9144
|
+
*/
|
|
9145
|
+
function getPadding(padding) {
|
|
9149
9146
|
const paddingVal = typeof padding === "number" ? padding : 0;
|
|
9150
9147
|
const paddingObj = typeof padding === "object" ? padding : {};
|
|
9151
9148
|
return {
|
|
@@ -9155,6 +9152,10 @@ function getPadding(props, name) {
|
|
|
9155
9152
|
right: paddingObj.right || paddingVal
|
|
9156
9153
|
};
|
|
9157
9154
|
}
|
|
9155
|
+
|
|
9156
|
+
/**
|
|
9157
|
+
* Returns true if the component is defined as a tooltip
|
|
9158
|
+
*/
|
|
9158
9159
|
function isTooltip(component) {
|
|
9159
9160
|
const labelRole = component && component.type && component.type.role;
|
|
9160
9161
|
return labelRole === "tooltip";
|
|
@@ -9169,8 +9170,8 @@ function getDefaultStyles(props, role) {
|
|
|
9169
9170
|
return defaultStyles;
|
|
9170
9171
|
}
|
|
9171
9172
|
const tooltipStyle = theme.tooltip && theme.tooltip.style || {};
|
|
9172
|
-
const labelStyle =
|
|
9173
|
-
return
|
|
9173
|
+
const labelStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, tooltipStyle, defaultStyles.labels);
|
|
9174
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, {
|
|
9174
9175
|
labels: labelStyle
|
|
9175
9176
|
}, defaultStyles);
|
|
9176
9177
|
}
|
|
@@ -9178,7 +9179,7 @@ function getStyles(style, defaultStyles) {
|
|
|
9178
9179
|
const width = "100%";
|
|
9179
9180
|
const height = "100%";
|
|
9180
9181
|
if (!style) {
|
|
9181
|
-
return
|
|
9182
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
9182
9183
|
parent: {
|
|
9183
9184
|
height,
|
|
9184
9185
|
width
|
|
@@ -9194,14 +9195,18 @@ function getStyles(style, defaultStyles) {
|
|
|
9194
9195
|
const defaultLabels = defaultStyles && defaultStyles.labels || {};
|
|
9195
9196
|
const defaultData = defaultStyles && defaultStyles.data || {};
|
|
9196
9197
|
return {
|
|
9197
|
-
parent:
|
|
9198
|
+
parent: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parent, defaultParent, {
|
|
9198
9199
|
width,
|
|
9199
9200
|
height
|
|
9200
9201
|
}),
|
|
9201
|
-
labels:
|
|
9202
|
-
data:
|
|
9202
|
+
labels: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labels, defaultLabels),
|
|
9203
|
+
data: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, data, defaultData)
|
|
9203
9204
|
};
|
|
9204
9205
|
}
|
|
9206
|
+
|
|
9207
|
+
/**
|
|
9208
|
+
* Returns the value of a prop or accessor function with the given props
|
|
9209
|
+
*/
|
|
9205
9210
|
function evaluateProp(prop, props) {
|
|
9206
9211
|
return isFunction(prop) ? prop(props) : prop;
|
|
9207
9212
|
}
|
|
@@ -9223,19 +9228,28 @@ function degreesToRadians(degrees) {
|
|
|
9223
9228
|
function radiansToDegrees(radians) {
|
|
9224
9229
|
return typeof radians === "number" ? radians / (Math.PI / 180) : radians;
|
|
9225
9230
|
}
|
|
9226
|
-
|
|
9231
|
+
|
|
9232
|
+
/**
|
|
9233
|
+
* Get the maximum radius that will fit in the container
|
|
9234
|
+
*/
|
|
9235
|
+
function getRadius(options) {
|
|
9236
|
+
const {
|
|
9237
|
+
width,
|
|
9238
|
+
height,
|
|
9239
|
+
padding
|
|
9240
|
+
} = options;
|
|
9227
9241
|
const {
|
|
9228
9242
|
left,
|
|
9229
9243
|
right,
|
|
9230
9244
|
top,
|
|
9231
9245
|
bottom
|
|
9232
|
-
} =
|
|
9233
|
-
const {
|
|
9234
|
-
width,
|
|
9235
|
-
height
|
|
9236
|
-
} = props;
|
|
9246
|
+
} = padding;
|
|
9237
9247
|
return Math.min(width - left - right, height - top - bottom) / 2;
|
|
9238
9248
|
}
|
|
9249
|
+
|
|
9250
|
+
/**
|
|
9251
|
+
* Returns the origin for a polar chart within the padded area
|
|
9252
|
+
*/
|
|
9239
9253
|
function getPolarOrigin(props) {
|
|
9240
9254
|
const {
|
|
9241
9255
|
width,
|
|
@@ -9246,7 +9260,7 @@ function getPolarOrigin(props) {
|
|
|
9246
9260
|
bottom,
|
|
9247
9261
|
left,
|
|
9248
9262
|
right
|
|
9249
|
-
} = getPadding(props);
|
|
9263
|
+
} = getPadding(props.padding);
|
|
9250
9264
|
const radius = Math.min(width - left - right, height - top - bottom) / 2;
|
|
9251
9265
|
const offsetWidth = width / 2 + left - right;
|
|
9252
9266
|
const offsetHeight = height / 2 + top - bottom;
|
|
@@ -9255,13 +9269,30 @@ function getPolarOrigin(props) {
|
|
|
9255
9269
|
y: offsetHeight + radius > height ? radius + top - bottom : offsetHeight
|
|
9256
9270
|
};
|
|
9257
9271
|
}
|
|
9272
|
+
|
|
9273
|
+
/**
|
|
9274
|
+
* Determine the range of an axis based on the given props
|
|
9275
|
+
*/
|
|
9258
9276
|
function getRange(props, axis) {
|
|
9259
9277
|
if (props.range && props.range[axis]) {
|
|
9260
9278
|
return props.range[axis];
|
|
9261
9279
|
} else if (props.range && Array.isArray(props.range)) {
|
|
9262
9280
|
return props.range;
|
|
9263
9281
|
}
|
|
9264
|
-
return props.polar ? getPolarRange(
|
|
9282
|
+
return props.polar ? getPolarRange({
|
|
9283
|
+
axis,
|
|
9284
|
+
innerRadius: props.innerRadius,
|
|
9285
|
+
startAngle: props.startAngle,
|
|
9286
|
+
endAngle: props.endAngle,
|
|
9287
|
+
height: props.height,
|
|
9288
|
+
width: props.width,
|
|
9289
|
+
padding: getPadding(props.padding)
|
|
9290
|
+
}) : getCartesianRange({
|
|
9291
|
+
axis,
|
|
9292
|
+
height: props.height,
|
|
9293
|
+
width: props.width,
|
|
9294
|
+
padding: getPadding(props.padding)
|
|
9295
|
+
});
|
|
9265
9296
|
}
|
|
9266
9297
|
|
|
9267
9298
|
/**
|
|
@@ -9293,7 +9324,7 @@ function createAccessor(key) {
|
|
|
9293
9324
|
return x => x;
|
|
9294
9325
|
}
|
|
9295
9326
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
9296
|
-
return
|
|
9327
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_2___default()(key);
|
|
9297
9328
|
}
|
|
9298
9329
|
function modifyProps(props, fallbackProps, role) {
|
|
9299
9330
|
const theme = props.theme && props.theme[role] ? props.theme[role] : {};
|
|
@@ -9302,7 +9333,7 @@ function modifyProps(props, fallbackProps, role) {
|
|
|
9302
9333
|
const defaultObject = horizontal === undefined ? {} : {
|
|
9303
9334
|
horizontal
|
|
9304
9335
|
};
|
|
9305
|
-
return
|
|
9336
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(defaultObject, props, themeProps, fallbackProps);
|
|
9306
9337
|
}
|
|
9307
9338
|
|
|
9308
9339
|
/**
|
|
@@ -9389,10 +9420,10 @@ initialMemo, combine) {
|
|
|
9389
9420
|
const childRole = child.type && child.type.role;
|
|
9390
9421
|
const childName = child.props.name || `${childRole}-${names[index]}`;
|
|
9391
9422
|
if (child.props && child.props.children) {
|
|
9392
|
-
const childProps = Object.assign({}, child.props,
|
|
9393
|
-
const nestedChildren = child.type && child.type.role === "stack" && isFunction(child.type.getChildren) ? child.type.getChildren(childProps) :
|
|
9394
|
-
const nestedChildProps = Object.assign({}, c.props,
|
|
9395
|
-
return /*#__PURE__*/
|
|
9423
|
+
const childProps = Object.assign({}, child.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(parentProps, sharedProps));
|
|
9424
|
+
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 => {
|
|
9425
|
+
const nestedChildProps = Object.assign({}, c.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(childProps, sharedProps));
|
|
9426
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(c, nestedChildProps);
|
|
9396
9427
|
});
|
|
9397
9428
|
const childNames = nestedChildren.map((c, i) => `${childName}-${i}`);
|
|
9398
9429
|
const nestedResults = traverseChildren(nestedChildren, childNames, child);
|
|
@@ -9406,7 +9437,7 @@ initialMemo, combine) {
|
|
|
9406
9437
|
return newMemo;
|
|
9407
9438
|
}, initialMemo);
|
|
9408
9439
|
};
|
|
9409
|
-
const validChildren = children.filter(
|
|
9440
|
+
const validChildren = children.filter(react__WEBPACK_IMPORTED_MODULE_0__.isValidElement);
|
|
9410
9441
|
const childNames = validChildren.map((c, i) => i);
|
|
9411
9442
|
return traverseChildren(validChildren, childNames);
|
|
9412
9443
|
}
|
|
@@ -9426,10 +9457,10 @@ function isHorizontal(props) {
|
|
|
9426
9457
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
9427
9458
|
return memo || childProps.horizontal;
|
|
9428
9459
|
}
|
|
9429
|
-
return traverseChildren(
|
|
9460
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(childProps.children));
|
|
9430
9461
|
}, false);
|
|
9431
9462
|
};
|
|
9432
|
-
return traverseChildren(
|
|
9463
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children));
|
|
9433
9464
|
}
|
|
9434
9465
|
|
|
9435
9466
|
/***/ }),
|
|
@@ -9502,11 +9533,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9502
9533
|
/* harmony export */ "getProps": function() { return /* binding */ getProps; },
|
|
9503
9534
|
/* harmony export */ "getText": function() { return /* binding */ getText; }
|
|
9504
9535
|
/* harmony export */ });
|
|
9536
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
9505
9537
|
/* 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");
|
|
9506
9538
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
9507
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
9508
9539
|
|
|
9509
|
-
|
|
9540
|
+
|
|
9510
9541
|
|
|
9511
9542
|
// Private Functions
|
|
9512
9543
|
|
|
@@ -9751,11 +9782,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9751
9782
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9752
9783
|
/* harmony export */ "warn": function() { return /* binding */ warn; }
|
|
9753
9784
|
/* harmony export */ });
|
|
9754
|
-
/* global console */
|
|
9785
|
+
/* global console process */
|
|
9755
9786
|
/* eslint-disable no-console */
|
|
9756
9787
|
|
|
9757
|
-
// TODO: Use "warning" npm module like React is switching to.
|
|
9758
9788
|
function warn(message) {
|
|
9789
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9790
|
+
// @ts-ignore - Webpack DefinePlugin will replace process.env.NODE_ENV
|
|
9759
9791
|
if (true) {
|
|
9760
9792
|
if (console && console.warn) {
|
|
9761
9793
|
console.warn(message);
|
|
@@ -9826,7 +9858,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9826
9858
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
9827
9859
|
/* harmony import */ var victory_vendor_d3_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-vendor/d3-scale */ "../../victory-vendor/es/d3-scale.js");
|
|
9828
9860
|
|
|
9829
|
-
/* eslint-disable no-use-before-define */
|
|
9830
9861
|
|
|
9831
9862
|
|
|
9832
9863
|
|
|
@@ -10049,13 +10080,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10049
10080
|
/* harmony export */ "approximateTextSize": function() { return /* binding */ approximateTextSize; },
|
|
10050
10081
|
/* harmony export */ "convertLengthToPixels": function() { return /* binding */ convertLengthToPixels; }
|
|
10051
10082
|
/* harmony export */ });
|
|
10052
|
-
/* harmony import */ var
|
|
10053
|
-
/* harmony import */ var
|
|
10054
|
-
/* harmony import */ var
|
|
10055
|
-
/* harmony import */ var
|
|
10056
|
-
|
|
10057
|
-
// http://www.pearsonified.com/2012/01/characters-per-line.php
|
|
10083
|
+
/* 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");
|
|
10084
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
10085
|
+
/* 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");
|
|
10086
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_1__);
|
|
10087
|
+
// http://www.pearsonified.com/2012/01/characters-per-line.php
|
|
10058
10088
|
/* eslint-disable no-magic-numbers */
|
|
10089
|
+
|
|
10090
|
+
|
|
10091
|
+
|
|
10059
10092
|
// Based on measuring specific character widths
|
|
10060
10093
|
// as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
|
|
10061
10094
|
// For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
|
|
@@ -10234,7 +10267,7 @@ const convertLengthToPixels = (length, fontSize) => {
|
|
|
10234
10267
|
};
|
|
10235
10268
|
const _prepareParams = (inputStyle, index) => {
|
|
10236
10269
|
const lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
|
|
10237
|
-
const style =
|
|
10270
|
+
const style = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, lineStyle, defaultStyle);
|
|
10238
10271
|
return Object.assign({}, style, {
|
|
10239
10272
|
fontFamily: style.fontFamily,
|
|
10240
10273
|
letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
|
|
@@ -10282,7 +10315,7 @@ const _approximateDimensionsInternal = (text, style) => {
|
|
|
10282
10315
|
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
10283
10316
|
};
|
|
10284
10317
|
};
|
|
10285
|
-
const _getMeasurementContainer =
|
|
10318
|
+
const _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()(() => {
|
|
10286
10319
|
const element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
10287
10320
|
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
10288
10321
|
element.setAttribute("width", "300");
|
|
@@ -10303,7 +10336,7 @@ const styleToKeyComponent = style => {
|
|
|
10303
10336
|
}
|
|
10304
10337
|
return `${style.angle}:${style.fontFamily}:${style.fontSize}:${style.letterSpacing}:${style.lineHeight}`;
|
|
10305
10338
|
};
|
|
10306
|
-
const _measureDimensionsInternal =
|
|
10339
|
+
const _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()((text, style) => {
|
|
10307
10340
|
let containerElement = _getMeasurementContainer();
|
|
10308
10341
|
if (!containerElement.isConnected) {
|
|
10309
10342
|
_getMeasurementContainer.cache.clear?.();
|
|
@@ -10473,12 +10506,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10473
10506
|
/* harmony export */ "getInitialTransitionState": function() { return /* binding */ getInitialTransitionState; },
|
|
10474
10507
|
/* harmony export */ "getTransitionPropsFactory": function() { return /* binding */ getTransitionPropsFactory; }
|
|
10475
10508
|
/* harmony export */ });
|
|
10476
|
-
/* harmony import */ var
|
|
10477
|
-
/* harmony import */ var
|
|
10509
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
10510
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
10478
10511
|
/* 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");
|
|
10479
10512
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
10480
|
-
/* harmony import */ var
|
|
10481
|
-
/* harmony import */ var
|
|
10513
|
+
/* 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");
|
|
10514
|
+
/* harmony import */ var lodash_identity__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_identity__WEBPACK_IMPORTED_MODULE_2__);
|
|
10482
10515
|
|
|
10483
10516
|
|
|
10484
10517
|
|
|
@@ -10569,13 +10602,13 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
10569
10602
|
const getTransitionsFromChildren = (old, next) => {
|
|
10570
10603
|
return old.map((child, idx) => {
|
|
10571
10604
|
if (child && child.props && child.props.children && next[idx]) {
|
|
10572
|
-
return getTransitionsFromChildren(
|
|
10605
|
+
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));
|
|
10573
10606
|
}
|
|
10574
10607
|
// get Transition entering and exiting nodes
|
|
10575
10608
|
return getTransition(child, next[idx]);
|
|
10576
10609
|
});
|
|
10577
10610
|
};
|
|
10578
|
-
const childrenTransitions = getTransitionsFromChildren(
|
|
10611
|
+
const childrenTransitions = getTransitionsFromChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(oldChildren), react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(nextChildren));
|
|
10579
10612
|
return {
|
|
10580
10613
|
nodesWillExit,
|
|
10581
10614
|
nodesWillEnter,
|
|
@@ -10589,7 +10622,7 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
10589
10622
|
};
|
|
10590
10623
|
}
|
|
10591
10624
|
function getInitialChildProps(animate, data) {
|
|
10592
|
-
const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (
|
|
10625
|
+
const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
10593
10626
|
return {
|
|
10594
10627
|
data: data.map((datum, idx) => Object.assign({}, datum, after(datum, idx, data)))
|
|
10595
10628
|
};
|
|
@@ -10606,7 +10639,7 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
10606
10639
|
data
|
|
10607
10640
|
};
|
|
10608
10641
|
}
|
|
10609
|
-
const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (
|
|
10642
|
+
const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
10610
10643
|
// If nodes need to exit, transform them with the provided onLoad.before function.
|
|
10611
10644
|
const newData = data.map((datum, idx) => {
|
|
10612
10645
|
return Object.assign({}, datum, before(datum, idx, data));
|
|
@@ -10617,8 +10650,6 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
10617
10650
|
clipWidth: 0
|
|
10618
10651
|
};
|
|
10619
10652
|
}
|
|
10620
|
-
|
|
10621
|
-
// eslint-disable-next-line max-params
|
|
10622
10653
|
function getChildOnLoad(animate, data, cb) {
|
|
10623
10654
|
const newAnimate = Object.assign({}, animate, {
|
|
10624
10655
|
onEnd: cb
|
|
@@ -10630,7 +10661,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
10630
10661
|
data
|
|
10631
10662
|
};
|
|
10632
10663
|
}
|
|
10633
|
-
const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (
|
|
10664
|
+
const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
10634
10665
|
// If nodes need to exit, transform them with the provided onLoad.after function.
|
|
10635
10666
|
newData = data.map((datum, idx) => {
|
|
10636
10667
|
return Object.assign({}, datum, after(datum, idx, data));
|
|
@@ -10641,7 +10672,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
10641
10672
|
};
|
|
10642
10673
|
}
|
|
10643
10674
|
|
|
10644
|
-
// eslint-disable-next-line max-params
|
|
10675
|
+
// eslint-disable-next-line max-params
|
|
10645
10676
|
function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
10646
10677
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
10647
10678
|
// transition for all children to have the same duration, delay, etc.
|
|
@@ -10652,7 +10683,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
10652
10683
|
// After the exit transition occurs, trigger the animations for
|
|
10653
10684
|
// nodes that are neither exiting nor entering.
|
|
10654
10685
|
animate.onEnd = cb;
|
|
10655
|
-
const before = animate.onExit && animate.onExit.before ? animate.onExit.before : (
|
|
10686
|
+
const before = animate.onExit && animate.onExit.before ? animate.onExit.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
10656
10687
|
// If nodes need to exit, transform them with the provided onExit.before function.
|
|
10657
10688
|
newData = data.map((datum, idx) => {
|
|
10658
10689
|
const key = (datum.key || idx).toString();
|
|
@@ -10665,7 +10696,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
10665
10696
|
};
|
|
10666
10697
|
}
|
|
10667
10698
|
|
|
10668
|
-
// eslint-disable-next-line max-params
|
|
10699
|
+
// eslint-disable-next-line max-params
|
|
10669
10700
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
10670
10701
|
let newAnimate = animate;
|
|
10671
10702
|
let newData = data;
|
|
@@ -10675,7 +10706,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
10675
10706
|
newAnimate = Object.assign({}, animate, {
|
|
10676
10707
|
onEnd: cb
|
|
10677
10708
|
});
|
|
10678
|
-
const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (
|
|
10709
|
+
const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
10679
10710
|
// We want the entering nodes to be included in the transition target
|
|
10680
10711
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
10681
10712
|
// so perform the `onEnter.before` transformation on each node.
|
|
@@ -10690,7 +10721,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
10690
10721
|
};
|
|
10691
10722
|
}
|
|
10692
10723
|
|
|
10693
|
-
// eslint-disable-next-line max-params
|
|
10724
|
+
// eslint-disable-next-line max-params
|
|
10694
10725
|
function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
10695
10726
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
10696
10727
|
// transition for all children to have the same duration, delay, etc.
|
|
@@ -10702,7 +10733,7 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
10702
10733
|
// domain should encompass the nodes that will now enter. So perform
|
|
10703
10734
|
// the `onEnter.after` transformation on each node.
|
|
10704
10735
|
newAnimate.onEnd = cb;
|
|
10705
|
-
const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (
|
|
10736
|
+
const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
10706
10737
|
newData = data.map((datum, idx) => {
|
|
10707
10738
|
const key = getDatumKey(datum, idx);
|
|
10708
10739
|
return enteringNodes[key] ? Object.assign({}, datum, after(datum, idx, data)) : datum;
|
|
@@ -10797,8 +10828,6 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
10797
10828
|
}
|
|
10798
10829
|
return {};
|
|
10799
10830
|
};
|
|
10800
|
-
|
|
10801
|
-
// eslint-disable-next-line max-statements, complexity, max-len
|
|
10802
10831
|
return function getTransitionProps(child, index) {
|
|
10803
10832
|
const data = getChildData(child) || [];
|
|
10804
10833
|
const animate = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, props.animate, child.props.animate);
|