victory-area 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-area.js +355 -323
- package/dist/victory-area.min.js +1 -1
- package/es/area.js +2 -2
- package/es/helper-methods.js +2 -2
- package/es/victory-area.d.ts +7 -7
- package/es/victory-area.js +1 -1
- package/lib/area.js +2 -2
- package/lib/helper-methods.js +2 -2
- package/lib/victory-area.d.ts +7 -7
- package/lib/victory-area.js +1 -1
- package/package.json +7 -39
- package/src/area.tsx +2 -2
- package/src/helper-methods.tsx +2 -2
- package/src/victory-area.tsx +2 -2
package/dist/victory-area.js
CHANGED
|
@@ -22,20 +22,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
22
22
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23
23
|
/* harmony export */ "Area": function() { return /* binding */ Area; }
|
|
24
24
|
/* harmony export */ });
|
|
25
|
-
/* harmony import */ var
|
|
26
|
-
/* harmony import */ var
|
|
27
|
-
/* harmony import */ var
|
|
28
|
-
/* harmony import */ var
|
|
25
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
26
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
27
|
+
/* 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");
|
|
28
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
29
29
|
/* harmony import */ var victory_vendor_d3_shape__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-vendor/d3-shape */ "../../victory-vendor/es/d3-shape.js");
|
|
30
30
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/line-helpers.js");
|
|
31
31
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
32
32
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/path.js");
|
|
33
33
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/user-props.js");
|
|
34
|
-
|
|
35
34
|
/* eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2] }]*/
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
|
|
38
|
+
|
|
39
39
|
const defined = d => {
|
|
40
40
|
const y = d._y1 !== undefined ? d._y1 : d._y;
|
|
41
41
|
return y !== null && y !== undefined && d._y0 !== null;
|
|
@@ -96,8 +96,8 @@ const evaluateProps = props => {
|
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
98
|
const defaultProps = {
|
|
99
|
-
groupComponent: /*#__PURE__*/
|
|
100
|
-
pathComponent: /*#__PURE__*/
|
|
99
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null),
|
|
100
|
+
pathComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_5__.Path, null),
|
|
101
101
|
role: "presentation",
|
|
102
102
|
shapeRendering: "auto"
|
|
103
103
|
};
|
|
@@ -106,7 +106,7 @@ const defaultProps = {
|
|
|
106
106
|
* The area primitive used by VictoryArea
|
|
107
107
|
*/
|
|
108
108
|
const Area = initialProps => {
|
|
109
|
-
const props = evaluateProps(
|
|
109
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps));
|
|
110
110
|
const {
|
|
111
111
|
ariaLabel,
|
|
112
112
|
role,
|
|
@@ -141,7 +141,7 @@ const Area = initialProps => {
|
|
|
141
141
|
clipPath,
|
|
142
142
|
tabIndex
|
|
143
143
|
};
|
|
144
|
-
const area = /*#__PURE__*/
|
|
144
|
+
const area = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(pathComponent, Object.assign({
|
|
145
145
|
key: `${id}-area`,
|
|
146
146
|
style: Object.assign({}, style, {
|
|
147
147
|
stroke: areaStroke
|
|
@@ -150,14 +150,14 @@ const Area = initialProps => {
|
|
|
150
150
|
desc,
|
|
151
151
|
tabIndex
|
|
152
152
|
}, sharedProps, userProps));
|
|
153
|
-
const line = renderLine ? /*#__PURE__*/
|
|
153
|
+
const line = renderLine ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(pathComponent, Object.assign({
|
|
154
154
|
key: `${id}-area-stroke`,
|
|
155
155
|
style: Object.assign({}, style, {
|
|
156
156
|
fill: "none"
|
|
157
157
|
}),
|
|
158
158
|
d: lineFunction(data)
|
|
159
159
|
}, sharedProps)) : null;
|
|
160
|
-
return renderLine ? /*#__PURE__*/
|
|
160
|
+
return renderLine ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(groupComponent, userProps, [area, line]) : area;
|
|
161
161
|
};
|
|
162
162
|
|
|
163
163
|
/***/ }),
|
|
@@ -192,9 +192,9 @@ const getDataWithBaseline = (props, scale) => {
|
|
|
192
192
|
const minY = victory_core__WEBPACK_IMPORTED_MODULE_2__.getMinValue(domain);
|
|
193
193
|
const maxY = victory_core__WEBPACK_IMPORTED_MODULE_2__.getMaxValue(domain);
|
|
194
194
|
let defaultMin = defaultZero;
|
|
195
|
-
if (minY < 0 && maxY <= 0) {
|
|
195
|
+
if (minY.valueOf() < 0 && maxY.valueOf() <= 0) {
|
|
196
196
|
defaultMin = maxY;
|
|
197
|
-
} else if (minY >= 0 && maxY > 0) {
|
|
197
|
+
} else if (minY.valueOf() >= 0 && maxY.valueOf() > 0) {
|
|
198
198
|
defaultMin = minY;
|
|
199
199
|
}
|
|
200
200
|
return victory_core__WEBPACK_IMPORTED_MODULE_2__.containsDates(domain) ? new Date(defaultMin) : defaultMin;
|
|
@@ -355,7 +355,7 @@ const options = {
|
|
|
355
355
|
}]
|
|
356
356
|
};
|
|
357
357
|
|
|
358
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
358
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
359
359
|
|
|
360
360
|
/**
|
|
361
361
|
* Draw area charts with React. VictoryArea is a composable component, so it doesn't include axes.
|
|
@@ -4877,10 +4877,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4877
4877
|
/* harmony export */ "isInterpolatable": function() { return /* binding */ isInterpolatable; },
|
|
4878
4878
|
/* harmony export */ "victoryInterpolator": function() { return /* binding */ victoryInterpolator; }
|
|
4879
4879
|
/* harmony export */ });
|
|
4880
|
-
/* harmony import */ var
|
|
4881
|
-
/* harmony import */ var
|
|
4882
|
-
/* harmony import */ var
|
|
4883
|
-
/* harmony import */ var
|
|
4880
|
+
/* 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");
|
|
4881
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__);
|
|
4882
|
+
/* 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");
|
|
4883
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_orderBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
4884
4884
|
/* harmony import */ var victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-vendor/d3-interpolate */ "../../victory-vendor/es/d3-interpolate.js");
|
|
4885
4885
|
|
|
4886
4886
|
|
|
@@ -4906,7 +4906,7 @@ const isInterpolatable = function (obj) {
|
|
|
4906
4906
|
return false;
|
|
4907
4907
|
case "object":
|
|
4908
4908
|
// Don't try to interpolate class instances (except Date or Array).
|
|
4909
|
-
return obj instanceof Date || Array.isArray(obj) ||
|
|
4909
|
+
return obj instanceof Date || Array.isArray(obj) || lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(obj);
|
|
4910
4910
|
case "function":
|
|
4911
4911
|
// Careful! There may be extra properties on function objects that the
|
|
4912
4912
|
// component expects to access - for instance, it may be a `d3.scale()`
|
|
@@ -4966,7 +4966,7 @@ const interpolateFunction = function (a, b) {
|
|
|
4966
4966
|
return b;
|
|
4967
4967
|
}
|
|
4968
4968
|
return function () {
|
|
4969
|
-
/* eslint-disable
|
|
4969
|
+
/* eslint-disable prefer-rest-params */
|
|
4970
4970
|
const aval = typeof a === "function" ? a.apply(this, arguments) : a;
|
|
4971
4971
|
const bval = typeof b === "function" ? b.apply(this, arguments) : b;
|
|
4972
4972
|
return (0,victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(aval, bval)(t);
|
|
@@ -4992,7 +4992,7 @@ const interpolateObject = function (startValue, endValue) {
|
|
|
4992
4992
|
if (typeof x === "function" || typeof y === "function") {
|
|
4993
4993
|
return interpolateFunction(x, y);
|
|
4994
4994
|
}
|
|
4995
|
-
if (typeof x === "object" &&
|
|
4995
|
+
if (typeof x === "object" && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(x) || typeof y === "object" && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(y)) {
|
|
4996
4996
|
return interpolateObject(x, y);
|
|
4997
4997
|
}
|
|
4998
4998
|
return (0,victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(x, y);
|
|
@@ -5001,7 +5001,7 @@ const interpolateObject = function (startValue, endValue) {
|
|
|
5001
5001
|
// When the value is an array, attempt to sort by "key" so that animating nodes may be identified
|
|
5002
5002
|
// based on "key" instead of index
|
|
5003
5003
|
const keyData = val => {
|
|
5004
|
-
return Array.isArray(val) ?
|
|
5004
|
+
return Array.isArray(val) ? lodash_orderBy__WEBPACK_IMPORTED_MODULE_1___default()(val, "key") : val;
|
|
5005
5005
|
};
|
|
5006
5006
|
const i = {};
|
|
5007
5007
|
const c = {};
|
|
@@ -5068,7 +5068,7 @@ const victoryInterpolator = function (a, b) {
|
|
|
5068
5068
|
if (typeof a === "function" || typeof b === "function") {
|
|
5069
5069
|
return interpolateFunction(a, b);
|
|
5070
5070
|
}
|
|
5071
|
-
if (
|
|
5071
|
+
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(a) || lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(b)) {
|
|
5072
5072
|
// @ts-expect-error These generics are tough, but they work :)
|
|
5073
5073
|
return interpolateObject(a, b);
|
|
5074
5074
|
}
|
|
@@ -5243,20 +5243,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5243
5243
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5244
5244
|
/* harmony export */ "VictoryClipContainer": function() { return /* binding */ VictoryClipContainer; }
|
|
5245
5245
|
/* harmony export */ });
|
|
5246
|
-
/* harmony import */ var
|
|
5247
|
-
/* harmony import */ var
|
|
5248
|
-
/* harmony import */ var
|
|
5249
|
-
/* harmony import */ var
|
|
5250
|
-
/* harmony import */ var
|
|
5251
|
-
/* harmony import */ var
|
|
5252
|
-
/* harmony import */ var
|
|
5253
|
-
/* harmony import */ var
|
|
5254
|
-
/* harmony import */ var
|
|
5255
|
-
/* harmony import */ var
|
|
5256
|
-
/* harmony import */ var
|
|
5257
|
-
/* harmony import */ var _victory_primitives_circle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-primitives/circle */ "../../victory-core/es/victory-primitives/circle.js");
|
|
5258
|
-
/* harmony import */ var _victory_primitives_rect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-primitives/rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
5259
|
-
|
|
5246
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5247
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5248
|
+
/* 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");
|
|
5249
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
5250
|
+
/* 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");
|
|
5251
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2__);
|
|
5252
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
5253
|
+
/* 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");
|
|
5254
|
+
/* harmony import */ var _victory_primitives_clip_path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-primitives/clip-path */ "../../victory-core/es/victory-primitives/clip-path.js");
|
|
5255
|
+
/* harmony import */ var _victory_primitives_circle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-primitives/circle */ "../../victory-core/es/victory-primitives/circle.js");
|
|
5256
|
+
/* harmony import */ var _victory_primitives_rect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-primitives/rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
5260
5257
|
|
|
5261
5258
|
|
|
5262
5259
|
|
|
@@ -5265,18 +5262,31 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5265
5262
|
|
|
5266
5263
|
|
|
5267
5264
|
|
|
5268
|
-
class VictoryClipContainer extends (
|
|
5265
|
+
class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
|
5269
5266
|
static displayName = "VictoryClipContainer";
|
|
5270
5267
|
static role = "container";
|
|
5271
5268
|
static defaultProps = {
|
|
5272
|
-
circleComponent: /*#__PURE__*/
|
|
5273
|
-
rectComponent: /*#__PURE__*/
|
|
5274
|
-
clipPathComponent: /*#__PURE__*/
|
|
5275
|
-
groupComponent: /*#__PURE__*/
|
|
5269
|
+
circleComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_circle__WEBPACK_IMPORTED_MODULE_3__.Circle, null),
|
|
5270
|
+
rectComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_rect__WEBPACK_IMPORTED_MODULE_4__.Rect, null),
|
|
5271
|
+
clipPathComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_clip_path__WEBPACK_IMPORTED_MODULE_5__.ClipPath, null),
|
|
5272
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null)
|
|
5276
5273
|
};
|
|
5277
5274
|
constructor(props) {
|
|
5278
5275
|
super(props);
|
|
5279
|
-
this.
|
|
5276
|
+
this.state = {
|
|
5277
|
+
clipId: props?.clipId
|
|
5278
|
+
};
|
|
5279
|
+
}
|
|
5280
|
+
|
|
5281
|
+
// The clipId state is used to prevent hydration mismatches between the server and client (issue #2941).
|
|
5282
|
+
// A better alternative would be to utilize React 18's useId hook instead of uniqueId, which would avoid needing state for this purpose.
|
|
5283
|
+
// However, this component currently supports React 16 at the time of writing, so this workaround is necessary.
|
|
5284
|
+
componentDidMount() {
|
|
5285
|
+
if (!this.state.clipId) {
|
|
5286
|
+
this.setState({
|
|
5287
|
+
clipId: lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default()("victory-clip-")
|
|
5288
|
+
});
|
|
5289
|
+
}
|
|
5280
5290
|
}
|
|
5281
5291
|
calculateAttributes(props) {
|
|
5282
5292
|
const {
|
|
@@ -5287,10 +5297,8 @@ class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_3___default()
|
|
|
5287
5297
|
translateX = 0,
|
|
5288
5298
|
translateY = 0
|
|
5289
5299
|
} = props;
|
|
5290
|
-
const clipPadding =
|
|
5291
|
-
|
|
5292
|
-
});
|
|
5293
|
-
const radius = props.radius || _victory_util_helpers__WEBPACK_IMPORTED_MODULE_7__.getRadius(props);
|
|
5300
|
+
const clipPadding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getPadding(props.clipPadding);
|
|
5301
|
+
const radius = props.radius || _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getRadius(props);
|
|
5294
5302
|
return {
|
|
5295
5303
|
x: (polar ? origin.x : translateX) - clipPadding.left,
|
|
5296
5304
|
y: (polar ? origin.y : translateY) - clipPadding.top,
|
|
@@ -5299,7 +5307,7 @@ class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_3___default()
|
|
|
5299
5307
|
};
|
|
5300
5308
|
}
|
|
5301
5309
|
renderClippedGroup(props, clipId) {
|
|
5302
|
-
const userProps =
|
|
5310
|
+
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_7__.getSafeUserProps(props);
|
|
5303
5311
|
const {
|
|
5304
5312
|
style,
|
|
5305
5313
|
events,
|
|
@@ -5317,11 +5325,11 @@ class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_3___default()
|
|
|
5317
5325
|
key: `clipped-group-${clipId}`,
|
|
5318
5326
|
clipPath: `url(#${clipId})`
|
|
5319
5327
|
}, events);
|
|
5320
|
-
return /*#__PURE__*/
|
|
5328
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(groupComponent, {
|
|
5321
5329
|
...groupProps,
|
|
5322
5330
|
tabIndex,
|
|
5323
5331
|
...userProps
|
|
5324
|
-
}, [clipComponent, ...
|
|
5332
|
+
}, [clipComponent, ...react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(children)]);
|
|
5325
5333
|
}
|
|
5326
5334
|
renderGroup(props) {
|
|
5327
5335
|
const {
|
|
@@ -5333,7 +5341,7 @@ class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_3___default()
|
|
|
5333
5341
|
groupComponent,
|
|
5334
5342
|
tabIndex
|
|
5335
5343
|
} = props;
|
|
5336
|
-
return /*#__PURE__*/
|
|
5344
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(groupComponent, Object.assign({
|
|
5337
5345
|
className,
|
|
5338
5346
|
style,
|
|
5339
5347
|
transform,
|
|
@@ -5358,18 +5366,16 @@ class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_3___default()
|
|
|
5358
5366
|
bottom,
|
|
5359
5367
|
left,
|
|
5360
5368
|
right
|
|
5361
|
-
} =
|
|
5362
|
-
padding: props.clipPadding
|
|
5363
|
-
});
|
|
5369
|
+
} = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getPadding(props.clipPadding);
|
|
5364
5370
|
let child;
|
|
5365
5371
|
if (polar) {
|
|
5366
|
-
const radius = props.radius ||
|
|
5372
|
+
const radius = props.radius || _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getRadius(props);
|
|
5367
5373
|
const circleProps = {
|
|
5368
5374
|
r: Math.max(radius + left + right, radius + top + bottom, 0),
|
|
5369
5375
|
cx: origin.x - left,
|
|
5370
5376
|
cy: origin.y - top
|
|
5371
5377
|
};
|
|
5372
|
-
child = /*#__PURE__*/
|
|
5378
|
+
child = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(circleComponent, circleProps);
|
|
5373
5379
|
} else {
|
|
5374
5380
|
const rectProps = {
|
|
5375
5381
|
x: translateX - left,
|
|
@@ -5377,9 +5383,9 @@ class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_3___default()
|
|
|
5377
5383
|
width: Math.max(clipWidth + left + right, 0),
|
|
5378
5384
|
height: Math.max(clipHeight + top + bottom, 0)
|
|
5379
5385
|
};
|
|
5380
|
-
child = /*#__PURE__*/
|
|
5386
|
+
child = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(rectComponent, rectProps);
|
|
5381
5387
|
}
|
|
5382
|
-
return /*#__PURE__*/
|
|
5388
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(clipPathComponent, Object.assign({
|
|
5383
5389
|
key: `clip-path-${clipId}`
|
|
5384
5390
|
}, props, {
|
|
5385
5391
|
clipId
|
|
@@ -5393,7 +5399,7 @@ class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_3___default()
|
|
|
5393
5399
|
if (clipValues[axis] !== undefined) {
|
|
5394
5400
|
return clipValues[axis];
|
|
5395
5401
|
}
|
|
5396
|
-
const range =
|
|
5402
|
+
const range = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, axis);
|
|
5397
5403
|
return range ? Math.abs(range[0] - range[1]) || undefined : undefined;
|
|
5398
5404
|
}
|
|
5399
5405
|
getTranslateValue(props, axis) {
|
|
@@ -5404,7 +5410,7 @@ class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_3___default()
|
|
|
5404
5410
|
if (translateValues[axis] !== undefined) {
|
|
5405
5411
|
return translateValues[axis];
|
|
5406
5412
|
}
|
|
5407
|
-
const range =
|
|
5413
|
+
const range = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, axis);
|
|
5408
5414
|
return range ? Math.min(...range) : undefined;
|
|
5409
5415
|
}
|
|
5410
5416
|
render() {
|
|
@@ -5415,13 +5421,13 @@ class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_3___default()
|
|
|
5415
5421
|
}
|
|
5416
5422
|
const translateX = this.getTranslateValue(this.props, "x");
|
|
5417
5423
|
const translateY = this.getTranslateValue(this.props, "y");
|
|
5418
|
-
const clipProps =
|
|
5424
|
+
const clipProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, this.props, {
|
|
5419
5425
|
clipHeight,
|
|
5420
5426
|
clipWidth,
|
|
5421
5427
|
translateX,
|
|
5422
5428
|
translateY
|
|
5423
5429
|
});
|
|
5424
|
-
return this.renderClippedGroup(clipProps, this.clipId);
|
|
5430
|
+
return this.renderClippedGroup(clipProps, this.state.clipId);
|
|
5425
5431
|
}
|
|
5426
5432
|
}
|
|
5427
5433
|
|
|
@@ -5439,16 +5445,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5439
5445
|
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; },
|
|
5440
5446
|
/* harmony export */ "useVictoryContainer": function() { return /* binding */ useVictoryContainer; }
|
|
5441
5447
|
/* harmony export */ });
|
|
5442
|
-
/* harmony import */ var
|
|
5443
|
-
/* harmony import */ var
|
|
5444
|
-
/* harmony import */ var
|
|
5445
|
-
/* harmony import */ var
|
|
5448
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5449
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5450
|
+
/* 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");
|
|
5451
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1__);
|
|
5446
5452
|
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
5447
5453
|
/* 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");
|
|
5448
5454
|
/* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
|
|
5449
5455
|
/* 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");
|
|
5450
5456
|
/* 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");
|
|
5451
|
-
|
|
5452
5457
|
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); }
|
|
5453
5458
|
|
|
5454
5459
|
|
|
@@ -5456,9 +5461,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
5456
5461
|
|
|
5457
5462
|
|
|
5458
5463
|
|
|
5464
|
+
|
|
5459
5465
|
const defaultProps = {
|
|
5460
5466
|
className: "VictoryContainer",
|
|
5461
|
-
portalComponent: /*#__PURE__*/
|
|
5467
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
5462
5468
|
portalZIndex: 99,
|
|
5463
5469
|
responsive: true,
|
|
5464
5470
|
role: "img"
|
|
@@ -5475,10 +5481,10 @@ function useVictoryContainer(initialProps) {
|
|
|
5475
5481
|
height,
|
|
5476
5482
|
responsive
|
|
5477
5483
|
} = props;
|
|
5478
|
-
const localContainerRef = (0,
|
|
5484
|
+
const localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
5479
5485
|
|
|
5480
5486
|
// Generated ID stored in ref because it needs to persist across renders
|
|
5481
|
-
const generatedId = (0,
|
|
5487
|
+
const generatedId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default()("victory-container-"));
|
|
5482
5488
|
const containerId = props.containerId ?? generatedId.current;
|
|
5483
5489
|
const getIdForElement = elName => `${containerId}-${elName}`;
|
|
5484
5490
|
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props);
|
|
@@ -5537,7 +5543,7 @@ const VictoryContainer = initialProps => {
|
|
|
5537
5543
|
containerRef,
|
|
5538
5544
|
localContainerRef
|
|
5539
5545
|
} = useVictoryContainer(initialProps);
|
|
5540
|
-
|
|
5546
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
5541
5547
|
if (!events?.onWheel) return;
|
|
5542
5548
|
const handleWheel = e => e.preventDefault();
|
|
5543
5549
|
const container = localContainerRef?.current;
|
|
@@ -5547,21 +5553,21 @@ const VictoryContainer = initialProps => {
|
|
|
5547
5553
|
};
|
|
5548
5554
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5549
5555
|
}, []);
|
|
5550
|
-
return /*#__PURE__*/
|
|
5556
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
5551
5557
|
className: className,
|
|
5552
5558
|
style: {
|
|
5553
5559
|
...style,
|
|
5554
5560
|
width: responsive ? style?.width : dimensions.width,
|
|
5555
5561
|
height: responsive ? style?.height : dimensions.height,
|
|
5556
|
-
pointerEvents: "none",
|
|
5557
|
-
touchAction: "none",
|
|
5558
|
-
position: "relative"
|
|
5562
|
+
pointerEvents: style?.pointerEvents ?? "none",
|
|
5563
|
+
touchAction: style?.touchAction ?? "none",
|
|
5564
|
+
position: style?.position ?? "relative"
|
|
5559
5565
|
},
|
|
5560
5566
|
"data-ouia-component-id": ouiaId,
|
|
5561
5567
|
"data-ouia-component-type": ouiaType,
|
|
5562
5568
|
"data-ouia-safe": ouiaSafe,
|
|
5563
5569
|
ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
|
|
5564
|
-
}, /*#__PURE__*/
|
|
5570
|
+
}, /*#__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({
|
|
5565
5571
|
width: width,
|
|
5566
5572
|
height: height,
|
|
5567
5573
|
tabIndex: tabIndex,
|
|
@@ -5574,11 +5580,11 @@ const VictoryContainer = initialProps => {
|
|
|
5574
5580
|
...dimensions,
|
|
5575
5581
|
pointerEvents: "all"
|
|
5576
5582
|
}
|
|
5577
|
-
}, userProps, events), title ? /*#__PURE__*/
|
|
5583
|
+
}, userProps, events), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("title", {
|
|
5578
5584
|
id: titleId
|
|
5579
|
-
}, title) : null, desc ? /*#__PURE__*/
|
|
5585
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("desc", {
|
|
5580
5586
|
id: descId
|
|
5581
|
-
}, desc) : null, children), /*#__PURE__*/
|
|
5587
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
5582
5588
|
style: {
|
|
5583
5589
|
...dimensions,
|
|
5584
5590
|
zIndex: portalZIndex,
|
|
@@ -5586,7 +5592,7 @@ const VictoryContainer = initialProps => {
|
|
|
5586
5592
|
top: 0,
|
|
5587
5593
|
left: 0
|
|
5588
5594
|
}
|
|
5589
|
-
}, /*#__PURE__*/
|
|
5595
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__.PortalOutlet, {
|
|
5590
5596
|
as: portalComponent,
|
|
5591
5597
|
width: width,
|
|
5592
5598
|
height: height,
|
|
@@ -5613,12 +5619,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5613
5619
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5614
5620
|
/* harmony export */ "VictoryLabel": function() { return /* binding */ VictoryLabel; }
|
|
5615
5621
|
/* harmony export */ });
|
|
5616
|
-
/* harmony import */ var
|
|
5617
|
-
/* harmony import */ var
|
|
5622
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5623
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5618
5624
|
/* 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");
|
|
5619
5625
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
5620
|
-
/* harmony import */ var
|
|
5621
|
-
/* harmony import */ var
|
|
5626
|
+
/* 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");
|
|
5627
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
5622
5628
|
/* 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");
|
|
5623
5629
|
/* harmony import */ var _victory_primitives_rect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-primitives/rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
5624
5630
|
/* harmony import */ var _victory_primitives_text__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../victory-primitives/text */ "../../victory-core/es/victory-primitives/text.js");
|
|
@@ -5629,9 +5635,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5629
5635
|
/* harmony import */ var _victory_util_style__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/style */ "../../victory-core/es/victory-util/style.js");
|
|
5630
5636
|
/* harmony import */ var _victory_util_textsize__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../victory-util/textsize */ "../../victory-core/es/victory-util/textsize.js");
|
|
5631
5637
|
/* 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");
|
|
5638
|
+
/* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
|
|
5632
5639
|
|
|
5633
5640
|
|
|
5634
|
-
/* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
|
|
5635
5641
|
|
|
5636
5642
|
|
|
5637
5643
|
|
|
@@ -5683,7 +5689,7 @@ const shouldUseMultilineBackgrounds = props => {
|
|
|
5683
5689
|
backgroundStyle,
|
|
5684
5690
|
backgroundPadding
|
|
5685
5691
|
} = props;
|
|
5686
|
-
return Array.isArray(backgroundStyle) && !
|
|
5692
|
+
return Array.isArray(backgroundStyle) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(backgroundStyle) || Array.isArray(backgroundPadding) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(backgroundPadding);
|
|
5687
5693
|
};
|
|
5688
5694
|
const getStyles = (style, props) => {
|
|
5689
5695
|
if (props.disableInlineStyles) {
|
|
@@ -5699,32 +5705,28 @@ const getStyles = (style, props) => {
|
|
|
5699
5705
|
fontSize: getFontSize(baseStyles)
|
|
5700
5706
|
});
|
|
5701
5707
|
};
|
|
5702
|
-
return Array.isArray(style) && !
|
|
5708
|
+
return Array.isArray(style) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(style) ? style.map(s => getSingleStyle(s)) : getSingleStyle(style);
|
|
5703
5709
|
};
|
|
5704
5710
|
const getBackgroundStyles = (style, props) => {
|
|
5705
5711
|
if (!style) {
|
|
5706
5712
|
return undefined;
|
|
5707
5713
|
}
|
|
5708
|
-
return Array.isArray(style) && !
|
|
5714
|
+
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);
|
|
5709
5715
|
};
|
|
5710
5716
|
const getBackgroundPadding = props => {
|
|
5711
5717
|
if (props.backgroundPadding && Array.isArray(props.backgroundPadding)) {
|
|
5712
5718
|
return props.backgroundPadding.map(backgroundPadding => {
|
|
5713
5719
|
const padding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(backgroundPadding, props);
|
|
5714
|
-
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(
|
|
5715
|
-
padding
|
|
5716
|
-
});
|
|
5720
|
+
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(padding);
|
|
5717
5721
|
});
|
|
5718
5722
|
}
|
|
5719
5723
|
const padding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.backgroundPadding, props);
|
|
5720
|
-
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(
|
|
5721
|
-
padding
|
|
5722
|
-
});
|
|
5724
|
+
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(padding);
|
|
5723
5725
|
};
|
|
5724
5726
|
const getLineHeight = props => {
|
|
5725
5727
|
const lineHeight = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.lineHeight, props);
|
|
5726
5728
|
if (Array.isArray(lineHeight)) {
|
|
5727
|
-
return
|
|
5729
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(lineHeight) ? [1] : lineHeight;
|
|
5728
5730
|
}
|
|
5729
5731
|
return lineHeight;
|
|
5730
5732
|
};
|
|
@@ -5844,7 +5846,7 @@ const getFullBackground = (calculatedProps, tspanValues) => {
|
|
|
5844
5846
|
x: inline ? xCoordinate - backgroundPadding.left : xCoordinate + dx - backgroundPadding.left,
|
|
5845
5847
|
y: yCoordinate
|
|
5846
5848
|
};
|
|
5847
|
-
return /*#__PURE__*/
|
|
5849
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(backgroundComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, backgroundComponent.props, backgroundProps));
|
|
5848
5850
|
};
|
|
5849
5851
|
const getInlineXOffset = (calculatedProps, textElements, index) => {
|
|
5850
5852
|
const {
|
|
@@ -5914,7 +5916,7 @@ const getChildBackgrounds = (calculatedProps, tspanValues) => {
|
|
|
5914
5916
|
x: xCoord - padding.left,
|
|
5915
5917
|
y: yCoord
|
|
5916
5918
|
};
|
|
5917
|
-
return /*#__PURE__*/
|
|
5919
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(backgroundComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, backgroundComponent.props, backgroundProps));
|
|
5918
5920
|
});
|
|
5919
5921
|
};
|
|
5920
5922
|
const getBackgroundElement = (calculatedProps, tspanValues) => {
|
|
@@ -6045,16 +6047,16 @@ const renderLabel = (calculatedProps, tspanValues) => {
|
|
|
6045
6047
|
style: currentStyle,
|
|
6046
6048
|
children: line
|
|
6047
6049
|
};
|
|
6048
|
-
return /*#__PURE__*/
|
|
6050
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(tspanComponent, tspanProps);
|
|
6049
6051
|
});
|
|
6050
|
-
return /*#__PURE__*/
|
|
6052
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(textComponent, textProps, tspans);
|
|
6051
6053
|
};
|
|
6052
6054
|
const defaultProps = {
|
|
6053
|
-
backgroundComponent: /*#__PURE__*/
|
|
6054
|
-
groupComponent: /*#__PURE__*/
|
|
6055
|
+
backgroundComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_rect__WEBPACK_IMPORTED_MODULE_8__.Rect, null),
|
|
6056
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null),
|
|
6055
6057
|
direction: "inherit",
|
|
6056
|
-
textComponent: /*#__PURE__*/
|
|
6057
|
-
tspanComponent: /*#__PURE__*/
|
|
6058
|
+
textComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_text__WEBPACK_IMPORTED_MODULE_9__.Text, null),
|
|
6059
|
+
tspanComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_tspan__WEBPACK_IMPORTED_MODULE_10__.TSpan, null),
|
|
6058
6060
|
capHeight: 0.71,
|
|
6059
6061
|
// Magic number from d3.
|
|
6060
6062
|
lineHeight: 1
|
|
@@ -6091,10 +6093,10 @@ const VictoryLabel = initialProps => {
|
|
|
6091
6093
|
if (props.backgroundStyle) {
|
|
6092
6094
|
const backgroundElement = getBackgroundElement(calculatedProps, tspanValues);
|
|
6093
6095
|
const children = [backgroundElement, label];
|
|
6094
|
-
const backgroundWithLabel = /*#__PURE__*/
|
|
6095
|
-
return props.renderInPortal ? /*#__PURE__*/
|
|
6096
|
+
const backgroundWithLabel = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.groupComponent, {}, children);
|
|
6097
|
+
return props.renderInPortal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__.VictoryPortal, null, backgroundWithLabel) : backgroundWithLabel;
|
|
6096
6098
|
}
|
|
6097
|
-
return props.renderInPortal ? /*#__PURE__*/
|
|
6099
|
+
return props.renderInPortal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__.VictoryPortal, null, label) : label;
|
|
6098
6100
|
};
|
|
6099
6101
|
VictoryLabel.displayName = "VictoryLabel";
|
|
6100
6102
|
VictoryLabel.role = "label";
|
|
@@ -6220,12 +6222,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6220
6222
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6221
6223
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
6222
6224
|
/* harmony export */ });
|
|
6223
|
-
/* harmony import */ var
|
|
6224
|
-
/* harmony import */ var
|
|
6225
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6226
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6225
6227
|
/* 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");
|
|
6226
6228
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6227
|
-
/* harmony import */ var
|
|
6228
|
-
/* harmony import */ var
|
|
6229
|
+
/* 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");
|
|
6230
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2__);
|
|
6229
6231
|
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
6230
6232
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6231
6233
|
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
@@ -6236,14 +6238,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6236
6238
|
|
|
6237
6239
|
|
|
6238
6240
|
const defaultProps = {
|
|
6239
|
-
groupComponent: /*#__PURE__*/
|
|
6241
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null)
|
|
6240
6242
|
};
|
|
6241
6243
|
const VictoryPortal = initialProps => {
|
|
6242
6244
|
const props = {
|
|
6243
6245
|
...defaultProps,
|
|
6244
6246
|
...initialProps
|
|
6245
6247
|
};
|
|
6246
|
-
const [id] = (0,
|
|
6248
|
+
const [id] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default()());
|
|
6247
6249
|
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
6248
6250
|
if (!portalContext) {
|
|
6249
6251
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
@@ -6261,12 +6263,12 @@ const VictoryPortal = initialProps => {
|
|
|
6261
6263
|
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
6262
6264
|
key: childProps.key ?? id
|
|
6263
6265
|
});
|
|
6264
|
-
const child = children && /*#__PURE__*/
|
|
6265
|
-
|
|
6266
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(children, newProps);
|
|
6267
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
6266
6268
|
portalContext?.addChild(id, child);
|
|
6267
6269
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6268
6270
|
}, [props.children]);
|
|
6269
|
-
|
|
6271
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
6270
6272
|
return () => portalContext?.removeChild(id);
|
|
6271
6273
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6272
6274
|
}, []);
|
|
@@ -7633,22 +7635,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7633
7635
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7634
7636
|
/* harmony export */ "VictoryTransition": function() { return /* binding */ VictoryTransition; }
|
|
7635
7637
|
/* harmony export */ });
|
|
7636
|
-
/* harmony import */ var
|
|
7637
|
-
/* harmony import */ var
|
|
7638
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7639
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7638
7640
|
/* 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");
|
|
7639
7641
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
7640
|
-
/* harmony import */ var
|
|
7641
|
-
/* harmony import */ var
|
|
7642
|
+
/* 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");
|
|
7643
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_2__);
|
|
7644
|
+
/* 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");
|
|
7645
|
+
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_3__);
|
|
7642
7646
|
/* 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");
|
|
7643
7647
|
/* harmony import */ var _victory_util_collection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../victory-util/collection */ "../../victory-core/es/victory-util/collection.js");
|
|
7644
7648
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7645
7649
|
/* 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");
|
|
7646
7650
|
/* harmony import */ var _victory_util_transitions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/transitions */ "../../victory-core/es/victory-util/transitions.js");
|
|
7647
|
-
|
|
7648
|
-
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_3__);
|
|
7651
|
+
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); }
|
|
7649
7652
|
|
|
7650
7653
|
|
|
7651
|
-
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); }
|
|
7652
7654
|
|
|
7653
7655
|
|
|
7654
7656
|
|
|
@@ -7656,7 +7658,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
7656
7658
|
|
|
7657
7659
|
|
|
7658
7660
|
|
|
7659
|
-
class VictoryTransition extends (
|
|
7661
|
+
class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
|
7660
7662
|
static displayName = "VictoryTransition";
|
|
7661
7663
|
static contextType = _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_4__["default"];
|
|
7662
7664
|
constructor(props, context) {
|
|
@@ -7673,7 +7675,7 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7673
7675
|
componentDidMount() {
|
|
7674
7676
|
this.setState({
|
|
7675
7677
|
nodesShouldLoad: true
|
|
7676
|
-
});
|
|
7678
|
+
});
|
|
7677
7679
|
}
|
|
7678
7680
|
shouldComponentUpdate(nextProps) {
|
|
7679
7681
|
if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default()(this.props, nextProps)) {
|
|
@@ -7699,8 +7701,8 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7699
7701
|
nextProps
|
|
7700
7702
|
};
|
|
7701
7703
|
}
|
|
7702
|
-
const oldChildren =
|
|
7703
|
-
const nextChildren =
|
|
7704
|
+
const oldChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
7705
|
+
const nextChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(nextProps.children);
|
|
7704
7706
|
const {
|
|
7705
7707
|
nodesWillExit,
|
|
7706
7708
|
nodesWillEnter,
|
|
@@ -7723,12 +7725,12 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7723
7725
|
const childDomain = child.props && child.type.getDomain(child.props, axis);
|
|
7724
7726
|
return childDomain ? memo.concat(childDomain) : memo;
|
|
7725
7727
|
} else if (child.props && child.props.children) {
|
|
7726
|
-
return memo.concat(getChildDomains(
|
|
7728
|
+
return memo.concat(getChildDomains(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children)));
|
|
7727
7729
|
}
|
|
7728
7730
|
return memo;
|
|
7729
7731
|
}, []);
|
|
7730
7732
|
};
|
|
7731
|
-
const child =
|
|
7733
|
+
const child = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children)[0];
|
|
7732
7734
|
const childProps = child.props || {};
|
|
7733
7735
|
const domain = Array.isArray(childProps.domain) ? childProps.domain : childProps.domain && childProps.domain[axis];
|
|
7734
7736
|
if (!childProps.children && domain) {
|
|
@@ -7761,7 +7763,7 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7761
7763
|
render() {
|
|
7762
7764
|
const props = this.pickProps();
|
|
7763
7765
|
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));
|
|
7764
|
-
const child =
|
|
7766
|
+
const child = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children)[0];
|
|
7765
7767
|
const transitionProps = getTransitionProps(child);
|
|
7766
7768
|
this.transitionProps = transitionProps;
|
|
7767
7769
|
const domain = {
|
|
@@ -7775,21 +7777,21 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
7775
7777
|
}, transitionProps, child.props);
|
|
7776
7778
|
const animationWhitelist = props.animationWhitelist || [];
|
|
7777
7779
|
const whitelist = animationWhitelist.concat(["clipWidth"]);
|
|
7778
|
-
const propsToAnimate = whitelist.length ?
|
|
7779
|
-
return /*#__PURE__*/
|
|
7780
|
+
const propsToAnimate = whitelist.length ? lodash_pick__WEBPACK_IMPORTED_MODULE_2___default()(combinedProps, whitelist) : combinedProps;
|
|
7781
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_animation_victory_animation__WEBPACK_IMPORTED_MODULE_8__.VictoryAnimation, _extends({}, combinedProps.animate, {
|
|
7780
7782
|
data: propsToAnimate
|
|
7781
7783
|
}), newProps => {
|
|
7782
7784
|
if (child.props.groupComponent) {
|
|
7783
|
-
const groupComponent = this.continuous ? /*#__PURE__*/
|
|
7785
|
+
const groupComponent = this.continuous ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child.props.groupComponent, {
|
|
7784
7786
|
clipWidth: newProps.clipWidth || 0
|
|
7785
7787
|
}) : child.props.groupComponent;
|
|
7786
|
-
return /*#__PURE__*/
|
|
7788
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
7787
7789
|
animate: null,
|
|
7788
7790
|
animating: true,
|
|
7789
7791
|
groupComponent
|
|
7790
7792
|
}, newProps, combinedProps));
|
|
7791
7793
|
}
|
|
7792
|
-
return /*#__PURE__*/
|
|
7794
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
7793
7795
|
animate: null,
|
|
7794
7796
|
animating: true
|
|
7795
7797
|
}, newProps, combinedProps));
|
|
@@ -7810,14 +7812,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7810
7812
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7811
7813
|
/* harmony export */ "addEvents": function() { return /* binding */ addEvents; }
|
|
7812
7814
|
/* harmony export */ });
|
|
7813
|
-
/* harmony import */ var
|
|
7814
|
-
/* harmony import */ var
|
|
7815
|
-
/* harmony import */ var
|
|
7816
|
-
/* harmony import */ var
|
|
7817
|
-
/* harmony import */ var
|
|
7818
|
-
/* harmony import */ var
|
|
7819
|
-
/* harmony import */ var
|
|
7820
|
-
/* harmony import */ var
|
|
7815
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7816
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7817
|
+
/* 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");
|
|
7818
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
7819
|
+
/* 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");
|
|
7820
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
7821
|
+
/* 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");
|
|
7822
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
|
7821
7823
|
/* 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");
|
|
7822
7824
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_4__);
|
|
7823
7825
|
/* 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");
|
|
@@ -7887,7 +7889,7 @@ const defaultComponents = [{
|
|
|
7887
7889
|
function addEvents(WrappedComponent, options) {
|
|
7888
7890
|
if (options === void 0) {
|
|
7889
7891
|
options = {};
|
|
7890
|
-
} // eslint-disable-next-line @typescript-eslint/no-empty-
|
|
7892
|
+
} // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
7891
7893
|
// @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
|
|
7892
7894
|
class AddEventsMixin extends WrappedComponent {
|
|
7893
7895
|
constructor(props) {
|
|
@@ -7964,8 +7966,8 @@ function addEvents(WrappedComponent, options) {
|
|
|
7964
7966
|
return {};
|
|
7965
7967
|
}
|
|
7966
7968
|
const getState = (key, type) => {
|
|
7967
|
-
const result =
|
|
7968
|
-
return
|
|
7969
|
+
const result = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, this.getEventState(key, type), this.getSharedEventState(key, type));
|
|
7970
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
|
|
7969
7971
|
};
|
|
7970
7972
|
const components = options.components || defaultComponents;
|
|
7971
7973
|
const stateChanges = components.map(component => {
|
|
@@ -7978,7 +7980,7 @@ function addEvents(WrappedComponent, options) {
|
|
|
7978
7980
|
return stateChanges;
|
|
7979
7981
|
}
|
|
7980
7982
|
applyExternalMutations(props, externalMutations) {
|
|
7981
|
-
if (!
|
|
7983
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
7982
7984
|
const callbacks = props.externalEventMutations.reduce((memo, mutation) => (0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(mutation.callback) ? memo.concat(mutation.callback) : memo, []);
|
|
7983
7985
|
const compiledCallbacks = callbacks.length ? () => {
|
|
7984
7986
|
callbacks.forEach(c => c());
|
|
@@ -8011,7 +8013,7 @@ function addEvents(WrappedComponent, options) {
|
|
|
8011
8013
|
sharedEvents,
|
|
8012
8014
|
externalEventMutations
|
|
8013
8015
|
} = props;
|
|
8014
|
-
return
|
|
8016
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_6__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
|
|
8015
8017
|
}
|
|
8016
8018
|
cacheValues(obj) {
|
|
8017
8019
|
Object.keys(obj).forEach(key => {
|
|
@@ -8022,10 +8024,10 @@ function addEvents(WrappedComponent, options) {
|
|
|
8022
8024
|
const getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
|
|
8023
8025
|
const sharedParentState = getSharedEventStateFunction("parent", "parent");
|
|
8024
8026
|
const parentState = this.getEventState("parent", "parent");
|
|
8025
|
-
const baseParentProps =
|
|
8027
|
+
const baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parentState, sharedParentState);
|
|
8026
8028
|
const parentPropsList = baseParentProps.parentControlledProps;
|
|
8027
|
-
const parentProps = parentPropsList ?
|
|
8028
|
-
const modifiedProps =
|
|
8029
|
+
const parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(baseParentProps, parentPropsList) : {};
|
|
8030
|
+
const modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parentProps, props);
|
|
8029
8031
|
return typeof WrappedComponent.getBaseProps === "function" ? WrappedComponent.getBaseProps(modifiedProps) : {};
|
|
8030
8032
|
}
|
|
8031
8033
|
getAllEvents(props) {
|
|
@@ -8045,18 +8047,18 @@ function addEvents(WrappedComponent, options) {
|
|
|
8045
8047
|
const currentProps = component && typeof component === "object" && "props" in component ? component.props : undefined;
|
|
8046
8048
|
if (this.hasEvents) {
|
|
8047
8049
|
const baseEvents = this.getEvents(this.props, type, key);
|
|
8048
|
-
const componentProps =
|
|
8050
|
+
const componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8049
8051
|
index,
|
|
8050
8052
|
key: id
|
|
8051
8053
|
}, this.getEventState(key, type), this.getSharedEventState(key, type), currentProps, baseProps, {
|
|
8052
8054
|
id
|
|
8053
8055
|
});
|
|
8054
|
-
const events =
|
|
8056
|
+
const events = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, _events__WEBPACK_IMPORTED_MODULE_6__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
|
|
8055
8057
|
return Object.assign({}, componentProps, {
|
|
8056
8058
|
events
|
|
8057
8059
|
});
|
|
8058
8060
|
}
|
|
8059
|
-
return
|
|
8061
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8060
8062
|
index,
|
|
8061
8063
|
key: id
|
|
8062
8064
|
}, currentProps, baseProps, {
|
|
@@ -8070,15 +8072,15 @@ function addEvents(WrappedComponent, options) {
|
|
|
8070
8072
|
this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_6__.getGlobalEvents(parentProps.events);
|
|
8071
8073
|
parentProps.events = _events__WEBPACK_IMPORTED_MODULE_6__.omitGlobalEvents(parentProps.events);
|
|
8072
8074
|
}
|
|
8073
|
-
return /*#__PURE__*/
|
|
8075
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(component, parentProps, children);
|
|
8074
8076
|
}
|
|
8075
8077
|
animateComponent(props, defaultAnimationWhitelist) {
|
|
8076
8078
|
const animationWhitelist = typeof props.animate === "object" && props.animate?.animationWhitelist || defaultAnimationWhitelist;
|
|
8077
8079
|
const Comp = this.constructor;
|
|
8078
|
-
return /*#__PURE__*/
|
|
8080
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_8__.VictoryTransition, {
|
|
8079
8081
|
animate: props.animate,
|
|
8080
8082
|
animationWhitelist: animationWhitelist
|
|
8081
|
-
}, /*#__PURE__*/
|
|
8083
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Comp, props));
|
|
8082
8084
|
}
|
|
8083
8085
|
|
|
8084
8086
|
// Used by `VictoryLine` and `VictoryArea`
|
|
@@ -8093,12 +8095,12 @@ function addEvents(WrappedComponent, options) {
|
|
|
8093
8095
|
let newMemo = memo;
|
|
8094
8096
|
const labelProps = this.getComponentProps(labelComponent, "labels", key);
|
|
8095
8097
|
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
8096
|
-
newMemo = newMemo.concat( /*#__PURE__*/
|
|
8098
|
+
newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps));
|
|
8097
8099
|
}
|
|
8098
8100
|
return newMemo;
|
|
8099
8101
|
}, []);
|
|
8100
8102
|
const dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
8101
|
-
const children = [/*#__PURE__*/
|
|
8103
|
+
const children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(dataComponent, dataProps), ...labelComponents];
|
|
8102
8104
|
return this.renderContainer(groupComponent, children);
|
|
8103
8105
|
}
|
|
8104
8106
|
renderData(props, shouldRenderDatum) {
|
|
@@ -8113,14 +8115,14 @@ function addEvents(WrappedComponent, options) {
|
|
|
8113
8115
|
const dataComponents = this.dataKeys.reduce((validDataComponents, _dataKey, index) => {
|
|
8114
8116
|
const dataProps = this.getComponentProps(dataComponent, "data", index);
|
|
8115
8117
|
if (shouldRenderDatum(dataProps.datum)) {
|
|
8116
|
-
validDataComponents.push( /*#__PURE__*/
|
|
8118
|
+
validDataComponents.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(dataComponent, dataProps));
|
|
8117
8119
|
}
|
|
8118
8120
|
return validDataComponents;
|
|
8119
8121
|
}, []);
|
|
8120
8122
|
const labelComponents = this.dataKeys.map((_dataKey, index) => {
|
|
8121
8123
|
const labelProps = this.getComponentProps(labelComponent, "labels", index);
|
|
8122
8124
|
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
8123
|
-
return /*#__PURE__*/
|
|
8125
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps);
|
|
8124
8126
|
}
|
|
8125
8127
|
return undefined;
|
|
8126
8128
|
}).filter(Boolean);
|
|
@@ -8226,24 +8228,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8226
8228
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
8227
8229
|
/* harmony export */ "isDataComponent": function() { return /* binding */ isDataComponent; }
|
|
8228
8230
|
/* harmony export */ });
|
|
8229
|
-
/* harmony import */ var
|
|
8230
|
-
/* harmony import */ var
|
|
8231
|
-
/* harmony import */ var
|
|
8232
|
-
/* harmony import */ var
|
|
8231
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8232
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8233
|
+
/* 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");
|
|
8234
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1__);
|
|
8233
8235
|
/* 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");
|
|
8234
8236
|
/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEqual__WEBPACK_IMPORTED_MODULE_2__);
|
|
8235
|
-
/* harmony import */ var
|
|
8236
|
-
/* harmony import */ var
|
|
8237
|
-
/* harmony import */ var
|
|
8238
|
-
/* harmony import */ var
|
|
8239
|
-
/* harmony import */ var
|
|
8240
|
-
/* harmony import */ var
|
|
8241
|
-
/* harmony import */ var
|
|
8242
|
-
/* harmony import */ var
|
|
8243
|
-
/* harmony import */ var
|
|
8244
|
-
/* harmony import */ var
|
|
8245
|
-
/* harmony import */ var
|
|
8246
|
-
/* harmony import */ var
|
|
8237
|
+
/* 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");
|
|
8238
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3__);
|
|
8239
|
+
/* 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");
|
|
8240
|
+
/* harmony import */ var lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4__);
|
|
8241
|
+
/* 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");
|
|
8242
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_omitBy__WEBPACK_IMPORTED_MODULE_5__);
|
|
8243
|
+
/* 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");
|
|
8244
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_orderBy__WEBPACK_IMPORTED_MODULE_6__);
|
|
8245
|
+
/* 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");
|
|
8246
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_7__);
|
|
8247
|
+
/* 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");
|
|
8248
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_8__);
|
|
8247
8249
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
8248
8250
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
8249
8251
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
@@ -8256,7 +8258,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8256
8258
|
|
|
8257
8259
|
|
|
8258
8260
|
|
|
8259
|
-
/* eslint-disable no-use-before-define */
|
|
8260
8261
|
|
|
8261
8262
|
|
|
8262
8263
|
|
|
@@ -8278,7 +8279,7 @@ function getLength(data) {
|
|
|
8278
8279
|
|
|
8279
8280
|
// Returns generated data for a given axis based on domain and sample from props
|
|
8280
8281
|
function generateDataArray(props, axis) {
|
|
8281
|
-
const propsDomain =
|
|
8282
|
+
const propsDomain = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default()(props.domain) ? props.domain[axis] : props.domain;
|
|
8282
8283
|
const domain = propsDomain || _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis).domain();
|
|
8283
8284
|
const samples = props.samples || 1;
|
|
8284
8285
|
const domainMax = Math.max(...domain);
|
|
@@ -8303,7 +8304,7 @@ function sortData(dataset, sortKey, sortOrder) {
|
|
|
8303
8304
|
formattedSortKey = `_${sortKey}`;
|
|
8304
8305
|
}
|
|
8305
8306
|
const order = sortOrder === "ascending" ? "asc" : "desc";
|
|
8306
|
-
return
|
|
8307
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default()(dataset, formattedSortKey, order);
|
|
8307
8308
|
}
|
|
8308
8309
|
|
|
8309
8310
|
// This method will remove data points that break certain scales. (log scale only)
|
|
@@ -8347,7 +8348,7 @@ function getEventKey(key) {
|
|
|
8347
8348
|
return () => undefined;
|
|
8348
8349
|
}
|
|
8349
8350
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
8350
|
-
return
|
|
8351
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_7___default()(key);
|
|
8351
8352
|
}
|
|
8352
8353
|
|
|
8353
8354
|
// Returns data with an eventKey prop added to each datum
|
|
@@ -8382,8 +8383,6 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
8382
8383
|
const isUnderMinY = underMin(minDomainY);
|
|
8383
8384
|
const isOverMaxX = overMax(maxDomainX);
|
|
8384
8385
|
const isOverMaxY = overMax(maxDomainY);
|
|
8385
|
-
|
|
8386
|
-
// eslint-disable-next-line complexity
|
|
8387
8386
|
return dataset.map(datum => {
|
|
8388
8387
|
let {
|
|
8389
8388
|
_x,
|
|
@@ -8408,12 +8407,12 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
8408
8407
|
if (isUnderMinY(baseline) && !isUnderMinY(value)) _y0 = minDomainY;
|
|
8409
8408
|
// baseline and value with only baseline above max, set baseline to maxDomainY
|
|
8410
8409
|
if (isOverMaxY(baseline) && !isOverMaxY(value)) _y0 = maxDomainY;
|
|
8411
|
-
return Object.assign({}, datum,
|
|
8410
|
+
return Object.assign({}, datum, lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default()({
|
|
8412
8411
|
_x,
|
|
8413
8412
|
_y,
|
|
8414
8413
|
_y0,
|
|
8415
8414
|
_y1
|
|
8416
|
-
}, (
|
|
8415
|
+
}, (lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default())));
|
|
8417
8416
|
});
|
|
8418
8417
|
}
|
|
8419
8418
|
|
|
@@ -8427,7 +8426,7 @@ function createStringMap(props, axis) {
|
|
|
8427
8426
|
const stringsFromAxes = getStringsFromAxes(props, axis);
|
|
8428
8427
|
const stringsFromCategories = getStringsFromCategories(props, axis);
|
|
8429
8428
|
const stringsFromData = getStringsFromData(props, axis);
|
|
8430
|
-
const allStrings =
|
|
8429
|
+
const allStrings = lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default()([...stringsFromAxes, ...stringsFromCategories, ...stringsFromData]);
|
|
8431
8430
|
return allStrings.length === 0 ? null : allStrings.reduce((memo, string, index) => {
|
|
8432
8431
|
memo[string] = index + 1;
|
|
8433
8432
|
return memo;
|
|
@@ -8494,7 +8493,6 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
8494
8493
|
};
|
|
8495
8494
|
}
|
|
8496
8495
|
const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
|
|
8497
|
-
// eslint-disable-line complexity
|
|
8498
8496
|
const parsedDatum = parseDatum(datum);
|
|
8499
8497
|
const fallbackValues = {
|
|
8500
8498
|
x: index,
|
|
@@ -8514,7 +8512,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
8514
8512
|
return memo;
|
|
8515
8513
|
}, {});
|
|
8516
8514
|
const formattedDatum = Object.assign({}, processedValues, parsedDatum);
|
|
8517
|
-
if (!
|
|
8515
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(formattedDatum)) {
|
|
8518
8516
|
dataArr.push(formattedDatum);
|
|
8519
8517
|
}
|
|
8520
8518
|
return dataArr;
|
|
@@ -8641,7 +8639,7 @@ function isDataComponent(component) {
|
|
|
8641
8639
|
};
|
|
8642
8640
|
let role = getRole(component);
|
|
8643
8641
|
if (role === "portal") {
|
|
8644
|
-
const children =
|
|
8642
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
8645
8643
|
role = children.length ? getRole(children[0]) : "";
|
|
8646
8644
|
}
|
|
8647
8645
|
const whitelist = ["area", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -8776,14 +8774,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8776
8774
|
/* harmony export */ "getSymmetricDomain": function() { return /* binding */ getSymmetricDomain; },
|
|
8777
8775
|
/* harmony export */ "isDomainComponent": function() { return /* binding */ isDomainComponent; }
|
|
8778
8776
|
/* harmony export */ });
|
|
8779
|
-
/* harmony import */ var
|
|
8780
|
-
/* harmony import */ var
|
|
8781
|
-
/* harmony import */ var
|
|
8782
|
-
/* harmony import */ var
|
|
8777
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8778
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8779
|
+
/* harmony import */ var lodash_isDate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/isDate */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isDate.js");
|
|
8780
|
+
/* harmony import */ var lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isDate__WEBPACK_IMPORTED_MODULE_1__);
|
|
8783
8781
|
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash/isPlainObject */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isPlainObject.js");
|
|
8784
8782
|
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__);
|
|
8785
|
-
/* harmony import */ var
|
|
8786
|
-
/* harmony import */ var
|
|
8783
|
+
/* harmony import */ var lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash/sortedUniq */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/sortedUniq.js");
|
|
8784
|
+
/* harmony import */ var lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3__);
|
|
8787
8785
|
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
8788
8786
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
8789
8787
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
@@ -8791,7 +8789,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8791
8789
|
|
|
8792
8790
|
|
|
8793
8791
|
|
|
8794
|
-
/* eslint-disable no-use-before-define */
|
|
8795
8792
|
|
|
8796
8793
|
|
|
8797
8794
|
|
|
@@ -8847,8 +8844,6 @@ function getExtremeFromData(dataset, axis, type) {
|
|
|
8847
8844
|
}, initialValue);
|
|
8848
8845
|
return containsDate ? new Date(result) : result;
|
|
8849
8846
|
}
|
|
8850
|
-
|
|
8851
|
-
// eslint-disable-next-line max-statements
|
|
8852
8847
|
function padDomain(domain, props, axis) {
|
|
8853
8848
|
if (!props.domainPadding) {
|
|
8854
8849
|
return domain;
|
|
@@ -8875,9 +8870,9 @@ function padDomain(domain, props, axis) {
|
|
|
8875
8870
|
max: max.valueOf() + simplePadding.right
|
|
8876
8871
|
};
|
|
8877
8872
|
const singleQuadrantDomainPadding = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.singleQuadrantDomainPadding) ? props.singleQuadrantDomainPadding[axis] : props.singleQuadrantDomainPadding;
|
|
8878
|
-
const addsQuadrants = min >= 0 && paddedDomain.min <= 0 || max <= 0 && paddedDomain.max >= 0;
|
|
8873
|
+
const addsQuadrants = min.valueOf() >= 0 && paddedDomain.min <= 0 || max.valueOf() <= 0 && paddedDomain.max >= 0;
|
|
8879
8874
|
const adjust = (val, type) => {
|
|
8880
|
-
const coerce = type === "min" && min >= 0 && val <= 0 || type === "max" && max <= 0 && val >= 0;
|
|
8875
|
+
const coerce = type === "min" && min.valueOf() >= 0 && val <= 0 || type === "max" && max.valueOf() <= 0 && val >= 0;
|
|
8881
8876
|
return coerce ? 0 : val;
|
|
8882
8877
|
};
|
|
8883
8878
|
if (addsQuadrants && singleQuadrantDomainPadding !== false) {
|
|
@@ -9100,7 +9095,7 @@ function getMaxFromProps(props, axis) {
|
|
|
9100
9095
|
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.maxDomain) && props.maxDomain[axis] !== undefined) {
|
|
9101
9096
|
return props.maxDomain[axis];
|
|
9102
9097
|
}
|
|
9103
|
-
return typeof props.maxDomain === "number" ||
|
|
9098
|
+
return typeof props.maxDomain === "number" || lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default()(props.maxDomain) ? props.maxDomain : undefined;
|
|
9104
9099
|
}
|
|
9105
9100
|
|
|
9106
9101
|
/**
|
|
@@ -9113,7 +9108,7 @@ function getMinFromProps(props, axis) {
|
|
|
9113
9108
|
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.minDomain) && props.minDomain[axis] !== undefined) {
|
|
9114
9109
|
return props.minDomain[axis];
|
|
9115
9110
|
}
|
|
9116
|
-
return typeof props.minDomain === "number" ||
|
|
9111
|
+
return typeof props.minDomain === "number" || lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default()(props.minDomain) ? props.minDomain : undefined;
|
|
9117
9112
|
}
|
|
9118
9113
|
|
|
9119
9114
|
/**
|
|
@@ -9124,7 +9119,7 @@ function getMinFromProps(props, axis) {
|
|
|
9124
9119
|
* @returns {Array} the symmetric domain
|
|
9125
9120
|
*/
|
|
9126
9121
|
function getSymmetricDomain(domain, values) {
|
|
9127
|
-
const processedData =
|
|
9122
|
+
const processedData = lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3___default()(values.sort((a, b) => a - b));
|
|
9128
9123
|
const step = processedData[1] - processedData[0];
|
|
9129
9124
|
return [domain[0], domain[1] + step];
|
|
9130
9125
|
}
|
|
@@ -9140,7 +9135,7 @@ function isDomainComponent(component) {
|
|
|
9140
9135
|
};
|
|
9141
9136
|
let role = getRole(component);
|
|
9142
9137
|
if (role === "portal") {
|
|
9143
|
-
const children =
|
|
9138
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
9144
9139
|
role = children.length ? getRole(children[0]) : "";
|
|
9145
9140
|
}
|
|
9146
9141
|
const whitelist = ["area", "axis", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -9171,20 +9166,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9171
9166
|
/* harmony export */ "getScopedEvents": function() { return /* binding */ getScopedEvents; },
|
|
9172
9167
|
/* harmony export */ "omitGlobalEvents": function() { return /* binding */ omitGlobalEvents; }
|
|
9173
9168
|
/* harmony export */ });
|
|
9174
|
-
/* harmony import */ var
|
|
9175
|
-
/* harmony import */ var
|
|
9176
|
-
/* harmony import */ var
|
|
9177
|
-
/* harmony import */ var
|
|
9178
|
-
/* harmony import */ var
|
|
9179
|
-
/* harmony import */ var
|
|
9180
|
-
/* harmony import */ var
|
|
9181
|
-
/* harmony import */ var
|
|
9169
|
+
/* 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");
|
|
9170
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0__);
|
|
9171
|
+
/* 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");
|
|
9172
|
+
/* harmony import */ var lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_pickBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
9173
|
+
/* 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");
|
|
9174
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_omitBy__WEBPACK_IMPORTED_MODULE_2__);
|
|
9175
|
+
/* 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");
|
|
9176
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_3__);
|
|
9182
9177
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
9183
9178
|
|
|
9184
9179
|
|
|
9185
9180
|
|
|
9186
9181
|
|
|
9187
|
-
/* eslint-disable no-use-before-define */
|
|
9188
9182
|
|
|
9189
9183
|
const GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
|
|
9190
9184
|
|
|
@@ -9232,11 +9226,10 @@ getScopedEvents) {
|
|
|
9232
9226
|
*/
|
|
9233
9227
|
const getAllEvents = () => {
|
|
9234
9228
|
// Mandatory usage: `getEvents.bind(this)`
|
|
9235
|
-
|
|
9229
|
+
|
|
9236
9230
|
if (Array.isArray(this.componentEvents)) {
|
|
9237
9231
|
return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
|
|
9238
9232
|
}
|
|
9239
|
-
/* eslint-enable no-invalid-this */
|
|
9240
9233
|
return props.events;
|
|
9241
9234
|
};
|
|
9242
9235
|
const allEvents = getAllEvents();
|
|
@@ -9256,12 +9249,12 @@ getScopedEvents) {
|
|
|
9256
9249
|
*/
|
|
9257
9250
|
// eslint-disable-next-line max-params
|
|
9258
9251
|
function getScopedEvents(events, namespace, childType, baseProps) {
|
|
9259
|
-
if (
|
|
9252
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
9260
9253
|
return {};
|
|
9261
9254
|
}
|
|
9262
9255
|
|
|
9263
9256
|
// Mandatory usage: `getScopedEvents.bind(this)`
|
|
9264
|
-
|
|
9257
|
+
|
|
9265
9258
|
const newBaseProps = baseProps || this.baseProps;
|
|
9266
9259
|
// returns the original base props or base state of a given target element
|
|
9267
9260
|
const getTargetProps = (identifier, type) => {
|
|
@@ -9270,7 +9263,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
9270
9263
|
target,
|
|
9271
9264
|
key
|
|
9272
9265
|
} = identifier;
|
|
9273
|
-
// eslint-disable-next-line no-invalid-this
|
|
9274
9266
|
const baseType = type === "props" ? newBaseProps : this.state || {};
|
|
9275
9267
|
const base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
9276
9268
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
@@ -9297,7 +9289,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
9297
9289
|
|
|
9298
9290
|
// returns the state object with mutated props applied for a single key
|
|
9299
9291
|
const getMutationObject = (key, childName) => {
|
|
9300
|
-
// eslint-disable-next-line no-invalid-this
|
|
9301
9292
|
const baseState = this.state || {};
|
|
9302
9293
|
if (!(0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(eventReturn.mutation)) {
|
|
9303
9294
|
return baseState;
|
|
@@ -9370,11 +9361,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
9370
9361
|
// into a state mutation, and calls setState
|
|
9371
9362
|
// eslint-disable-next-line max-params
|
|
9372
9363
|
const onEvent = (evt, childProps, eventKey, eventName) => {
|
|
9373
|
-
// eslint-disable-next-line no-invalid-this
|
|
9374
9364
|
const eventReturn = events[eventName](evt, childProps, eventKey, this);
|
|
9375
|
-
if (!
|
|
9365
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(eventReturn)) {
|
|
9376
9366
|
const callbacks = compileCallbacks(eventReturn);
|
|
9377
|
-
// eslint-disable-next-line no-invalid-this
|
|
9378
9367
|
this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
|
|
9379
9368
|
}
|
|
9380
9369
|
};
|
|
@@ -9404,7 +9393,7 @@ function getPartialEvents(events, eventKey, childProps) {
|
|
|
9404
9393
|
// eslint-disable-next-line max-params
|
|
9405
9394
|
function getEventState(eventKey, namespace, childType) {
|
|
9406
9395
|
// Mandatory usage: `getEventState.bind(this)`
|
|
9407
|
-
|
|
9396
|
+
|
|
9408
9397
|
const state = this.state || {};
|
|
9409
9398
|
if (!childType) {
|
|
9410
9399
|
return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
|
|
@@ -9434,7 +9423,7 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
9434
9423
|
const childState = baseState[childName];
|
|
9435
9424
|
const mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
9436
9425
|
memo[childName] = mutation ? mutation : childState;
|
|
9437
|
-
return
|
|
9426
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
9438
9427
|
}, {});
|
|
9439
9428
|
}
|
|
9440
9429
|
|
|
@@ -9470,7 +9459,7 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
9470
9459
|
} else {
|
|
9471
9460
|
// use keys from both state and props so that elements not intially included in baseProps
|
|
9472
9461
|
// will be used. (i.e. labels)
|
|
9473
|
-
const targets =
|
|
9462
|
+
const targets = lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default()(Object.keys(keyProps).concat(Object.keys(keyState)));
|
|
9474
9463
|
memo[eventKey] = targets.reduce((m, target) => {
|
|
9475
9464
|
const identifier = {
|
|
9476
9465
|
eventKey,
|
|
@@ -9479,10 +9468,10 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
9479
9468
|
};
|
|
9480
9469
|
const mutation = getExternalMutation(mutations, keyProps[target], keyState[target], identifier);
|
|
9481
9470
|
m[target] = mutation !== undefined ? Object.assign({}, keyState[target], mutation) : keyState[target];
|
|
9482
|
-
return
|
|
9471
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(m, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
9483
9472
|
}, {});
|
|
9484
9473
|
}
|
|
9485
|
-
return
|
|
9474
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
9486
9475
|
}, {});
|
|
9487
9476
|
}
|
|
9488
9477
|
|
|
@@ -9514,11 +9503,11 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
9514
9503
|
}
|
|
9515
9504
|
// find any mutation objects that match the target
|
|
9516
9505
|
const targetMutations = scopedMutations.filter(m => filterMutations(m, "target"));
|
|
9517
|
-
if (
|
|
9506
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(targetMutations)) {
|
|
9518
9507
|
return undefined;
|
|
9519
9508
|
}
|
|
9520
9509
|
const keyMutations = targetMutations.filter(m => filterMutations(m, "eventKey"));
|
|
9521
|
-
if (
|
|
9510
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(keyMutations)) {
|
|
9522
9511
|
return undefined;
|
|
9523
9512
|
}
|
|
9524
9513
|
return keyMutations.reduce((memo, curr) => {
|
|
@@ -9544,8 +9533,8 @@ function getGlobalEventNameFromKey(key) {
|
|
|
9544
9533
|
const match = key.match(GLOBAL_EVENT_REGEX);
|
|
9545
9534
|
return match && match[1] && match[1].toLowerCase();
|
|
9546
9535
|
}
|
|
9547
|
-
const getGlobalEvents = events =>
|
|
9548
|
-
const omitGlobalEvents = events =>
|
|
9536
|
+
const getGlobalEvents = events => lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(events, (_, key) => GLOBAL_EVENT_REGEX.test(key));
|
|
9537
|
+
const omitGlobalEvents = events => lodash_omitBy__WEBPACK_IMPORTED_MODULE_2___default()(events, (_, key) => GLOBAL_EVENT_REGEX.test(key));
|
|
9549
9538
|
const emulateReactEvent = event => Object.assign(event, {
|
|
9550
9539
|
nativeEvent: event
|
|
9551
9540
|
});
|
|
@@ -9586,41 +9575,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9586
9575
|
/* harmony export */ "reduceChildren": function() { return /* binding */ reduceChildren; },
|
|
9587
9576
|
/* harmony export */ "scalePoint": function() { return /* binding */ scalePoint; }
|
|
9588
9577
|
/* harmony export */ });
|
|
9589
|
-
/* harmony import */ var
|
|
9590
|
-
/* harmony import */ var
|
|
9591
|
-
/* harmony import */ var
|
|
9592
|
-
/* harmony import */ var
|
|
9593
|
-
/* harmony import */ var
|
|
9594
|
-
/* harmony import */ var
|
|
9595
|
-
/* harmony import */ var
|
|
9596
|
-
/* harmony import */ var
|
|
9597
|
-
|
|
9578
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
9579
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
9580
|
+
/* 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");
|
|
9581
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
9582
|
+
/* 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");
|
|
9583
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_2__);
|
|
9584
|
+
/* 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");
|
|
9585
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
|
9598
9586
|
|
|
9599
9587
|
|
|
9600
|
-
/* eslint-disable no-use-before-define */
|
|
9601
9588
|
|
|
9602
|
-
// Private Functions
|
|
9603
9589
|
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9590
|
+
/**
|
|
9591
|
+
* Determine the range of a cartesian axis
|
|
9592
|
+
*/
|
|
9593
|
+
function getCartesianRange(options) {
|
|
9594
|
+
const vertical = options.axis !== "x";
|
|
9608
9595
|
if (vertical) {
|
|
9609
|
-
return [
|
|
9596
|
+
return [options.height - options.padding.bottom, options.padding.top];
|
|
9610
9597
|
}
|
|
9611
|
-
return [padding.left,
|
|
9598
|
+
return [options.padding.left, options.width - options.padding.right];
|
|
9612
9599
|
}
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9600
|
+
|
|
9601
|
+
/**
|
|
9602
|
+
* Determine the range of a polar axis in radians
|
|
9603
|
+
*/
|
|
9604
|
+
function getPolarRange(options) {
|
|
9605
|
+
if (options.axis === "x") {
|
|
9606
|
+
const startAngle = degreesToRadians(options.startAngle || 0);
|
|
9607
|
+
const endAngle = degreesToRadians(options.endAngle || 360);
|
|
9617
9608
|
return [startAngle, endAngle];
|
|
9618
9609
|
}
|
|
9619
|
-
return [
|
|
9610
|
+
return [options.innerRadius || 0, getRadius({
|
|
9611
|
+
height: options.height,
|
|
9612
|
+
width: options.width,
|
|
9613
|
+
padding: options.padding
|
|
9614
|
+
})];
|
|
9620
9615
|
}
|
|
9621
9616
|
|
|
9622
|
-
// Exported Functions
|
|
9623
|
-
|
|
9624
9617
|
/**
|
|
9625
9618
|
* Creates an object composed of the inverted keys and values of object.
|
|
9626
9619
|
* If object contains duplicate values, subsequent values overwrite property assignments of previous values.
|
|
@@ -9657,8 +9650,11 @@ function omit(originalObject, ks) {
|
|
|
9657
9650
|
}
|
|
9658
9651
|
return newObject;
|
|
9659
9652
|
}
|
|
9653
|
+
|
|
9654
|
+
/**
|
|
9655
|
+
* Coalesce the x and y values from a data point
|
|
9656
|
+
*/
|
|
9660
9657
|
function getPoint(datum) {
|
|
9661
|
-
const exists = val => val !== undefined;
|
|
9662
9658
|
const {
|
|
9663
9659
|
_x,
|
|
9664
9660
|
_x1,
|
|
@@ -9669,16 +9665,20 @@ function getPoint(datum) {
|
|
|
9669
9665
|
_y0,
|
|
9670
9666
|
_voronoiY
|
|
9671
9667
|
} = datum;
|
|
9672
|
-
const defaultX =
|
|
9673
|
-
const defaultY =
|
|
9668
|
+
const defaultX = _x1 ?? _x;
|
|
9669
|
+
const defaultY = _y1 ?? _y;
|
|
9674
9670
|
const point = {
|
|
9675
|
-
x:
|
|
9676
|
-
x0:
|
|
9677
|
-
y:
|
|
9678
|
-
y0:
|
|
9671
|
+
x: _voronoiX ?? defaultX,
|
|
9672
|
+
x0: _x0 ?? _x,
|
|
9673
|
+
y: _voronoiY ?? defaultY,
|
|
9674
|
+
y0: _y0 ?? _y
|
|
9679
9675
|
};
|
|
9680
|
-
return
|
|
9676
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, point, datum);
|
|
9681
9677
|
}
|
|
9678
|
+
|
|
9679
|
+
/**
|
|
9680
|
+
* Scale a point based on the origin, direction, and given scale function
|
|
9681
|
+
*/
|
|
9682
9682
|
function scalePoint(props, datum) {
|
|
9683
9683
|
const {
|
|
9684
9684
|
scale,
|
|
@@ -9701,11 +9701,11 @@ function scalePoint(props, datum) {
|
|
|
9701
9701
|
y0: polar ? -y0 * Math.sin(x0) + origin.x : y0
|
|
9702
9702
|
};
|
|
9703
9703
|
}
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9704
|
+
|
|
9705
|
+
/**
|
|
9706
|
+
* Returns a padding value from a number or partial padding values
|
|
9707
|
+
*/
|
|
9708
|
+
function getPadding(padding) {
|
|
9709
9709
|
const paddingVal = typeof padding === "number" ? padding : 0;
|
|
9710
9710
|
const paddingObj = typeof padding === "object" ? padding : {};
|
|
9711
9711
|
return {
|
|
@@ -9715,6 +9715,10 @@ function getPadding(props, name) {
|
|
|
9715
9715
|
right: paddingObj.right || paddingVal
|
|
9716
9716
|
};
|
|
9717
9717
|
}
|
|
9718
|
+
|
|
9719
|
+
/**
|
|
9720
|
+
* Returns true if the component is defined as a tooltip
|
|
9721
|
+
*/
|
|
9718
9722
|
function isTooltip(component) {
|
|
9719
9723
|
const labelRole = component && component.type && component.type.role;
|
|
9720
9724
|
return labelRole === "tooltip";
|
|
@@ -9729,8 +9733,8 @@ function getDefaultStyles(props, role) {
|
|
|
9729
9733
|
return defaultStyles;
|
|
9730
9734
|
}
|
|
9731
9735
|
const tooltipStyle = theme.tooltip && theme.tooltip.style || {};
|
|
9732
|
-
const labelStyle =
|
|
9733
|
-
return
|
|
9736
|
+
const labelStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, tooltipStyle, defaultStyles.labels);
|
|
9737
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, {
|
|
9734
9738
|
labels: labelStyle
|
|
9735
9739
|
}, defaultStyles);
|
|
9736
9740
|
}
|
|
@@ -9738,7 +9742,7 @@ function getStyles(style, defaultStyles) {
|
|
|
9738
9742
|
const width = "100%";
|
|
9739
9743
|
const height = "100%";
|
|
9740
9744
|
if (!style) {
|
|
9741
|
-
return
|
|
9745
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
9742
9746
|
parent: {
|
|
9743
9747
|
height,
|
|
9744
9748
|
width
|
|
@@ -9754,14 +9758,18 @@ function getStyles(style, defaultStyles) {
|
|
|
9754
9758
|
const defaultLabels = defaultStyles && defaultStyles.labels || {};
|
|
9755
9759
|
const defaultData = defaultStyles && defaultStyles.data || {};
|
|
9756
9760
|
return {
|
|
9757
|
-
parent:
|
|
9761
|
+
parent: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parent, defaultParent, {
|
|
9758
9762
|
width,
|
|
9759
9763
|
height
|
|
9760
9764
|
}),
|
|
9761
|
-
labels:
|
|
9762
|
-
data:
|
|
9765
|
+
labels: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labels, defaultLabels),
|
|
9766
|
+
data: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, data, defaultData)
|
|
9763
9767
|
};
|
|
9764
9768
|
}
|
|
9769
|
+
|
|
9770
|
+
/**
|
|
9771
|
+
* Returns the value of a prop or accessor function with the given props
|
|
9772
|
+
*/
|
|
9765
9773
|
function evaluateProp(prop, props) {
|
|
9766
9774
|
return isFunction(prop) ? prop(props) : prop;
|
|
9767
9775
|
}
|
|
@@ -9783,19 +9791,28 @@ function degreesToRadians(degrees) {
|
|
|
9783
9791
|
function radiansToDegrees(radians) {
|
|
9784
9792
|
return typeof radians === "number" ? radians / (Math.PI / 180) : radians;
|
|
9785
9793
|
}
|
|
9786
|
-
|
|
9794
|
+
|
|
9795
|
+
/**
|
|
9796
|
+
* Get the maximum radius that will fit in the container
|
|
9797
|
+
*/
|
|
9798
|
+
function getRadius(options) {
|
|
9799
|
+
const {
|
|
9800
|
+
width,
|
|
9801
|
+
height,
|
|
9802
|
+
padding
|
|
9803
|
+
} = options;
|
|
9787
9804
|
const {
|
|
9788
9805
|
left,
|
|
9789
9806
|
right,
|
|
9790
9807
|
top,
|
|
9791
9808
|
bottom
|
|
9792
|
-
} =
|
|
9793
|
-
const {
|
|
9794
|
-
width,
|
|
9795
|
-
height
|
|
9796
|
-
} = props;
|
|
9809
|
+
} = padding;
|
|
9797
9810
|
return Math.min(width - left - right, height - top - bottom) / 2;
|
|
9798
9811
|
}
|
|
9812
|
+
|
|
9813
|
+
/**
|
|
9814
|
+
* Returns the origin for a polar chart within the padded area
|
|
9815
|
+
*/
|
|
9799
9816
|
function getPolarOrigin(props) {
|
|
9800
9817
|
const {
|
|
9801
9818
|
width,
|
|
@@ -9806,7 +9823,7 @@ function getPolarOrigin(props) {
|
|
|
9806
9823
|
bottom,
|
|
9807
9824
|
left,
|
|
9808
9825
|
right
|
|
9809
|
-
} = getPadding(props);
|
|
9826
|
+
} = getPadding(props.padding);
|
|
9810
9827
|
const radius = Math.min(width - left - right, height - top - bottom) / 2;
|
|
9811
9828
|
const offsetWidth = width / 2 + left - right;
|
|
9812
9829
|
const offsetHeight = height / 2 + top - bottom;
|
|
@@ -9815,13 +9832,30 @@ function getPolarOrigin(props) {
|
|
|
9815
9832
|
y: offsetHeight + radius > height ? radius + top - bottom : offsetHeight
|
|
9816
9833
|
};
|
|
9817
9834
|
}
|
|
9835
|
+
|
|
9836
|
+
/**
|
|
9837
|
+
* Determine the range of an axis based on the given props
|
|
9838
|
+
*/
|
|
9818
9839
|
function getRange(props, axis) {
|
|
9819
9840
|
if (props.range && props.range[axis]) {
|
|
9820
9841
|
return props.range[axis];
|
|
9821
9842
|
} else if (props.range && Array.isArray(props.range)) {
|
|
9822
9843
|
return props.range;
|
|
9823
9844
|
}
|
|
9824
|
-
return props.polar ? getPolarRange(
|
|
9845
|
+
return props.polar ? getPolarRange({
|
|
9846
|
+
axis,
|
|
9847
|
+
innerRadius: props.innerRadius,
|
|
9848
|
+
startAngle: props.startAngle,
|
|
9849
|
+
endAngle: props.endAngle,
|
|
9850
|
+
height: props.height,
|
|
9851
|
+
width: props.width,
|
|
9852
|
+
padding: getPadding(props.padding)
|
|
9853
|
+
}) : getCartesianRange({
|
|
9854
|
+
axis,
|
|
9855
|
+
height: props.height,
|
|
9856
|
+
width: props.width,
|
|
9857
|
+
padding: getPadding(props.padding)
|
|
9858
|
+
});
|
|
9825
9859
|
}
|
|
9826
9860
|
|
|
9827
9861
|
/**
|
|
@@ -9853,7 +9887,7 @@ function createAccessor(key) {
|
|
|
9853
9887
|
return x => x;
|
|
9854
9888
|
}
|
|
9855
9889
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
9856
|
-
return
|
|
9890
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_2___default()(key);
|
|
9857
9891
|
}
|
|
9858
9892
|
function modifyProps(props, fallbackProps, role) {
|
|
9859
9893
|
const theme = props.theme && props.theme[role] ? props.theme[role] : {};
|
|
@@ -9862,7 +9896,7 @@ function modifyProps(props, fallbackProps, role) {
|
|
|
9862
9896
|
const defaultObject = horizontal === undefined ? {} : {
|
|
9863
9897
|
horizontal
|
|
9864
9898
|
};
|
|
9865
|
-
return
|
|
9899
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(defaultObject, props, themeProps, fallbackProps);
|
|
9866
9900
|
}
|
|
9867
9901
|
|
|
9868
9902
|
/**
|
|
@@ -9949,10 +9983,10 @@ initialMemo, combine) {
|
|
|
9949
9983
|
const childRole = child.type && child.type.role;
|
|
9950
9984
|
const childName = child.props.name || `${childRole}-${names[index]}`;
|
|
9951
9985
|
if (child.props && child.props.children) {
|
|
9952
|
-
const childProps = Object.assign({}, child.props,
|
|
9953
|
-
const nestedChildren = child.type && child.type.role === "stack" && isFunction(child.type.getChildren) ? child.type.getChildren(childProps) :
|
|
9954
|
-
const nestedChildProps = Object.assign({}, c.props,
|
|
9955
|
-
return /*#__PURE__*/
|
|
9986
|
+
const childProps = Object.assign({}, child.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(parentProps, sharedProps));
|
|
9987
|
+
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 => {
|
|
9988
|
+
const nestedChildProps = Object.assign({}, c.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(childProps, sharedProps));
|
|
9989
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(c, nestedChildProps);
|
|
9956
9990
|
});
|
|
9957
9991
|
const childNames = nestedChildren.map((c, i) => `${childName}-${i}`);
|
|
9958
9992
|
const nestedResults = traverseChildren(nestedChildren, childNames, child);
|
|
@@ -9966,7 +10000,7 @@ initialMemo, combine) {
|
|
|
9966
10000
|
return newMemo;
|
|
9967
10001
|
}, initialMemo);
|
|
9968
10002
|
};
|
|
9969
|
-
const validChildren = children.filter(
|
|
10003
|
+
const validChildren = children.filter(react__WEBPACK_IMPORTED_MODULE_0__.isValidElement);
|
|
9970
10004
|
const childNames = validChildren.map((c, i) => i);
|
|
9971
10005
|
return traverseChildren(validChildren, childNames);
|
|
9972
10006
|
}
|
|
@@ -9986,10 +10020,10 @@ function isHorizontal(props) {
|
|
|
9986
10020
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
9987
10021
|
return memo || childProps.horizontal;
|
|
9988
10022
|
}
|
|
9989
|
-
return traverseChildren(
|
|
10023
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(childProps.children));
|
|
9990
10024
|
}, false);
|
|
9991
10025
|
};
|
|
9992
|
-
return traverseChildren(
|
|
10026
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children));
|
|
9993
10027
|
}
|
|
9994
10028
|
|
|
9995
10029
|
/***/ }),
|
|
@@ -10062,11 +10096,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10062
10096
|
/* harmony export */ "getProps": function() { return /* binding */ getProps; },
|
|
10063
10097
|
/* harmony export */ "getText": function() { return /* binding */ getText; }
|
|
10064
10098
|
/* harmony export */ });
|
|
10099
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
10065
10100
|
/* 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");
|
|
10066
10101
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
10067
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
10068
10102
|
|
|
10069
|
-
|
|
10103
|
+
|
|
10070
10104
|
|
|
10071
10105
|
// Private Functions
|
|
10072
10106
|
|
|
@@ -10377,11 +10411,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10377
10411
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10378
10412
|
/* harmony export */ "warn": function() { return /* binding */ warn; }
|
|
10379
10413
|
/* harmony export */ });
|
|
10380
|
-
/* global console */
|
|
10414
|
+
/* global console process */
|
|
10381
10415
|
/* eslint-disable no-console */
|
|
10382
10416
|
|
|
10383
|
-
// TODO: Use "warning" npm module like React is switching to.
|
|
10384
10417
|
function warn(message) {
|
|
10418
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10419
|
+
// @ts-ignore - Webpack DefinePlugin will replace process.env.NODE_ENV
|
|
10385
10420
|
if (true) {
|
|
10386
10421
|
if (console && console.warn) {
|
|
10387
10422
|
console.warn(message);
|
|
@@ -10452,7 +10487,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10452
10487
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
10453
10488
|
/* harmony import */ var victory_vendor_d3_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-vendor/d3-scale */ "../../victory-vendor/es/d3-scale.js");
|
|
10454
10489
|
|
|
10455
|
-
/* eslint-disable no-use-before-define */
|
|
10456
10490
|
|
|
10457
10491
|
|
|
10458
10492
|
|
|
@@ -10675,13 +10709,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10675
10709
|
/* harmony export */ "approximateTextSize": function() { return /* binding */ approximateTextSize; },
|
|
10676
10710
|
/* harmony export */ "convertLengthToPixels": function() { return /* binding */ convertLengthToPixels; }
|
|
10677
10711
|
/* harmony export */ });
|
|
10678
|
-
/* harmony import */ var
|
|
10679
|
-
/* harmony import */ var
|
|
10680
|
-
/* harmony import */ var
|
|
10681
|
-
/* harmony import */ var
|
|
10682
|
-
|
|
10683
|
-
// http://www.pearsonified.com/2012/01/characters-per-line.php
|
|
10712
|
+
/* 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");
|
|
10713
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
10714
|
+
/* 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");
|
|
10715
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_1__);
|
|
10716
|
+
// http://www.pearsonified.com/2012/01/characters-per-line.php
|
|
10684
10717
|
/* eslint-disable no-magic-numbers */
|
|
10718
|
+
|
|
10719
|
+
|
|
10720
|
+
|
|
10685
10721
|
// Based on measuring specific character widths
|
|
10686
10722
|
// as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
|
|
10687
10723
|
// For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
|
|
@@ -10860,7 +10896,7 @@ const convertLengthToPixels = (length, fontSize) => {
|
|
|
10860
10896
|
};
|
|
10861
10897
|
const _prepareParams = (inputStyle, index) => {
|
|
10862
10898
|
const lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
|
|
10863
|
-
const style =
|
|
10899
|
+
const style = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, lineStyle, defaultStyle);
|
|
10864
10900
|
return Object.assign({}, style, {
|
|
10865
10901
|
fontFamily: style.fontFamily,
|
|
10866
10902
|
letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
|
|
@@ -10908,7 +10944,7 @@ const _approximateDimensionsInternal = (text, style) => {
|
|
|
10908
10944
|
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
10909
10945
|
};
|
|
10910
10946
|
};
|
|
10911
|
-
const _getMeasurementContainer =
|
|
10947
|
+
const _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()(() => {
|
|
10912
10948
|
const element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
10913
10949
|
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
10914
10950
|
element.setAttribute("width", "300");
|
|
@@ -10929,7 +10965,7 @@ const styleToKeyComponent = style => {
|
|
|
10929
10965
|
}
|
|
10930
10966
|
return `${style.angle}:${style.fontFamily}:${style.fontSize}:${style.letterSpacing}:${style.lineHeight}`;
|
|
10931
10967
|
};
|
|
10932
|
-
const _measureDimensionsInternal =
|
|
10968
|
+
const _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()((text, style) => {
|
|
10933
10969
|
let containerElement = _getMeasurementContainer();
|
|
10934
10970
|
if (!containerElement.isConnected) {
|
|
10935
10971
|
_getMeasurementContainer.cache.clear?.();
|
|
@@ -11099,12 +11135,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11099
11135
|
/* harmony export */ "getInitialTransitionState": function() { return /* binding */ getInitialTransitionState; },
|
|
11100
11136
|
/* harmony export */ "getTransitionPropsFactory": function() { return /* binding */ getTransitionPropsFactory; }
|
|
11101
11137
|
/* harmony export */ });
|
|
11102
|
-
/* harmony import */ var
|
|
11103
|
-
/* harmony import */ var
|
|
11138
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
11139
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
11104
11140
|
/* 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");
|
|
11105
11141
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
11106
|
-
/* harmony import */ var
|
|
11107
|
-
/* harmony import */ var
|
|
11142
|
+
/* 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");
|
|
11143
|
+
/* harmony import */ var lodash_identity__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_identity__WEBPACK_IMPORTED_MODULE_2__);
|
|
11108
11144
|
|
|
11109
11145
|
|
|
11110
11146
|
|
|
@@ -11195,13 +11231,13 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
11195
11231
|
const getTransitionsFromChildren = (old, next) => {
|
|
11196
11232
|
return old.map((child, idx) => {
|
|
11197
11233
|
if (child && child.props && child.props.children && next[idx]) {
|
|
11198
|
-
return getTransitionsFromChildren(
|
|
11234
|
+
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));
|
|
11199
11235
|
}
|
|
11200
11236
|
// get Transition entering and exiting nodes
|
|
11201
11237
|
return getTransition(child, next[idx]);
|
|
11202
11238
|
});
|
|
11203
11239
|
};
|
|
11204
|
-
const childrenTransitions = getTransitionsFromChildren(
|
|
11240
|
+
const childrenTransitions = getTransitionsFromChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(oldChildren), react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(nextChildren));
|
|
11205
11241
|
return {
|
|
11206
11242
|
nodesWillExit,
|
|
11207
11243
|
nodesWillEnter,
|
|
@@ -11215,7 +11251,7 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
11215
11251
|
};
|
|
11216
11252
|
}
|
|
11217
11253
|
function getInitialChildProps(animate, data) {
|
|
11218
|
-
const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (
|
|
11254
|
+
const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11219
11255
|
return {
|
|
11220
11256
|
data: data.map((datum, idx) => Object.assign({}, datum, after(datum, idx, data)))
|
|
11221
11257
|
};
|
|
@@ -11232,7 +11268,7 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
11232
11268
|
data
|
|
11233
11269
|
};
|
|
11234
11270
|
}
|
|
11235
|
-
const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (
|
|
11271
|
+
const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11236
11272
|
// If nodes need to exit, transform them with the provided onLoad.before function.
|
|
11237
11273
|
const newData = data.map((datum, idx) => {
|
|
11238
11274
|
return Object.assign({}, datum, before(datum, idx, data));
|
|
@@ -11243,8 +11279,6 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
11243
11279
|
clipWidth: 0
|
|
11244
11280
|
};
|
|
11245
11281
|
}
|
|
11246
|
-
|
|
11247
|
-
// eslint-disable-next-line max-params
|
|
11248
11282
|
function getChildOnLoad(animate, data, cb) {
|
|
11249
11283
|
const newAnimate = Object.assign({}, animate, {
|
|
11250
11284
|
onEnd: cb
|
|
@@ -11256,7 +11290,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
11256
11290
|
data
|
|
11257
11291
|
};
|
|
11258
11292
|
}
|
|
11259
|
-
const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (
|
|
11293
|
+
const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11260
11294
|
// If nodes need to exit, transform them with the provided onLoad.after function.
|
|
11261
11295
|
newData = data.map((datum, idx) => {
|
|
11262
11296
|
return Object.assign({}, datum, after(datum, idx, data));
|
|
@@ -11267,7 +11301,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
11267
11301
|
};
|
|
11268
11302
|
}
|
|
11269
11303
|
|
|
11270
|
-
// eslint-disable-next-line max-params
|
|
11304
|
+
// eslint-disable-next-line max-params
|
|
11271
11305
|
function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
11272
11306
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
11273
11307
|
// transition for all children to have the same duration, delay, etc.
|
|
@@ -11278,7 +11312,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
11278
11312
|
// After the exit transition occurs, trigger the animations for
|
|
11279
11313
|
// nodes that are neither exiting nor entering.
|
|
11280
11314
|
animate.onEnd = cb;
|
|
11281
|
-
const before = animate.onExit && animate.onExit.before ? animate.onExit.before : (
|
|
11315
|
+
const before = animate.onExit && animate.onExit.before ? animate.onExit.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11282
11316
|
// If nodes need to exit, transform them with the provided onExit.before function.
|
|
11283
11317
|
newData = data.map((datum, idx) => {
|
|
11284
11318
|
const key = (datum.key || idx).toString();
|
|
@@ -11291,7 +11325,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
11291
11325
|
};
|
|
11292
11326
|
}
|
|
11293
11327
|
|
|
11294
|
-
// eslint-disable-next-line max-params
|
|
11328
|
+
// eslint-disable-next-line max-params
|
|
11295
11329
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
11296
11330
|
let newAnimate = animate;
|
|
11297
11331
|
let newData = data;
|
|
@@ -11301,7 +11335,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
11301
11335
|
newAnimate = Object.assign({}, animate, {
|
|
11302
11336
|
onEnd: cb
|
|
11303
11337
|
});
|
|
11304
|
-
const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (
|
|
11338
|
+
const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11305
11339
|
// We want the entering nodes to be included in the transition target
|
|
11306
11340
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
11307
11341
|
// so perform the `onEnter.before` transformation on each node.
|
|
@@ -11316,7 +11350,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
11316
11350
|
};
|
|
11317
11351
|
}
|
|
11318
11352
|
|
|
11319
|
-
// eslint-disable-next-line max-params
|
|
11353
|
+
// eslint-disable-next-line max-params
|
|
11320
11354
|
function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
11321
11355
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
11322
11356
|
// transition for all children to have the same duration, delay, etc.
|
|
@@ -11328,7 +11362,7 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
11328
11362
|
// domain should encompass the nodes that will now enter. So perform
|
|
11329
11363
|
// the `onEnter.after` transformation on each node.
|
|
11330
11364
|
newAnimate.onEnd = cb;
|
|
11331
|
-
const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (
|
|
11365
|
+
const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11332
11366
|
newData = data.map((datum, idx) => {
|
|
11333
11367
|
const key = getDatumKey(datum, idx);
|
|
11334
11368
|
return enteringNodes[key] ? Object.assign({}, datum, after(datum, idx, data)) : datum;
|
|
@@ -11423,8 +11457,6 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
11423
11457
|
}
|
|
11424
11458
|
return {};
|
|
11425
11459
|
};
|
|
11426
|
-
|
|
11427
|
-
// eslint-disable-next-line max-statements, complexity, max-len
|
|
11428
11460
|
return function getTransitionProps(child, index) {
|
|
11429
11461
|
const data = getChildData(child) || [];
|
|
11430
11462
|
const animate = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, props.animate, child.props.animate);
|