victory-histogram 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 +4 -0
- package/dist/victory-histogram.js +584 -296
- package/dist/victory-histogram.min.js +1 -1
- package/es/victory-histogram.d.ts +7 -7
- package/es/victory-histogram.js +1 -1
- package/lib/victory-histogram.d.ts +7 -7
- package/lib/victory-histogram.js +1 -1
- package/package.json +8 -40
- package/src/victory-histogram.tsx +1 -1
|
@@ -333,7 +333,7 @@ const fallbackProps = {
|
|
|
333
333
|
};
|
|
334
334
|
const defaultData = [];
|
|
335
335
|
|
|
336
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-
|
|
336
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
337
337
|
|
|
338
338
|
/**
|
|
339
339
|
* Draw SVG histogram charts with React. VictoryHistogram is a composable component, so it doesn't include axes
|
|
@@ -4983,10 +4983,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4983
4983
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4984
4984
|
/* harmony export */ "Bar": function() { return /* binding */ Bar; }
|
|
4985
4985
|
/* harmony export */ });
|
|
4986
|
-
/* harmony import */ var
|
|
4987
|
-
/* harmony import */ var
|
|
4988
|
-
/* harmony import */ var
|
|
4989
|
-
/* harmony import */ var
|
|
4986
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
4987
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
4988
|
+
/* 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");
|
|
4989
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
4990
4990
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
4991
4991
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/path.js");
|
|
4992
4992
|
/* harmony import */ var _bar_helper_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bar-helper-methods */ "../../victory-bar/es/bar-helper-methods.js");
|
|
@@ -5032,14 +5032,14 @@ const evaluateProps = props => {
|
|
|
5032
5032
|
});
|
|
5033
5033
|
};
|
|
5034
5034
|
const defaultProps = {
|
|
5035
|
-
pathComponent: /*#__PURE__*/
|
|
5035
|
+
pathComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.Path, null),
|
|
5036
5036
|
role: "presentation",
|
|
5037
5037
|
shapeRendering: "auto"
|
|
5038
5038
|
};
|
|
5039
|
-
|
|
5039
|
+
const Bar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
|
|
5040
5040
|
// eslint-disable-next-line prefer-arrow-callback
|
|
5041
|
-
|
|
5042
|
-
const props = evaluateProps(
|
|
5041
|
+
function Bar(initialProps, ref) {
|
|
5042
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps));
|
|
5043
5043
|
const {
|
|
5044
5044
|
polar,
|
|
5045
5045
|
origin,
|
|
@@ -5052,7 +5052,7 @@ const Bar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(funct
|
|
|
5052
5052
|
if (!props.pathComponent) {
|
|
5053
5053
|
return null;
|
|
5054
5054
|
}
|
|
5055
|
-
return /*#__PURE__*/
|
|
5055
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.pathComponent, {
|
|
5056
5056
|
...props.events,
|
|
5057
5057
|
"aria-label": props.ariaLabel,
|
|
5058
5058
|
style,
|
|
@@ -5147,7 +5147,6 @@ const circle = (center, radius) => ({
|
|
|
5147
5147
|
// Left-most point is returned as 0th element of array
|
|
5148
5148
|
// Right-most point is returned as 1st elemennt of array
|
|
5149
5149
|
intersection(circle1) {
|
|
5150
|
-
// eslint-disable-line max-statements
|
|
5151
5150
|
const P0 = this.center;
|
|
5152
5151
|
const P1 = circle1.center;
|
|
5153
5152
|
const r0 = this.radius;
|
|
@@ -5204,7 +5203,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5204
5203
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
5205
5204
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/domain.js");
|
|
5206
5205
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/data.js");
|
|
5207
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
5206
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-clip-container/victory-clip-container.js");
|
|
5207
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/label-helpers.js");
|
|
5208
5208
|
|
|
5209
5209
|
const getBarPosition = (props, datum) => {
|
|
5210
5210
|
const getDefaultMin = axis => {
|
|
@@ -5247,6 +5247,16 @@ const getCalculatedValues = props => {
|
|
|
5247
5247
|
const origin = polar ? props.origin || victory_core__WEBPACK_IMPORTED_MODULE_2__.getPolarOrigin(props) : undefined;
|
|
5248
5248
|
let data = victory_core__WEBPACK_IMPORTED_MODULE_4__.getData(props);
|
|
5249
5249
|
data = victory_core__WEBPACK_IMPORTED_MODULE_4__.formatDataFromDomain(data, domain, 0);
|
|
5250
|
+
|
|
5251
|
+
// when inside a zoom container, reset the _x and _y properties of each datum to the original
|
|
5252
|
+
// x and y property values so they will not be clipped. See https://github.com/FormidableLabs/victory/pull/2970
|
|
5253
|
+
if (props.groupComponent.type === victory_core__WEBPACK_IMPORTED_MODULE_5__.VictoryClipContainer) {
|
|
5254
|
+
data = data.map(datum => ({
|
|
5255
|
+
...datum,
|
|
5256
|
+
_x: datum.x,
|
|
5257
|
+
_y: datum.y
|
|
5258
|
+
}));
|
|
5259
|
+
}
|
|
5250
5260
|
return {
|
|
5251
5261
|
style,
|
|
5252
5262
|
data,
|
|
@@ -5332,9 +5342,9 @@ const getBaseProps = (initialProps, fallbackProps) => {
|
|
|
5332
5342
|
childProps[eventKey] = {
|
|
5333
5343
|
data: dataProps
|
|
5334
5344
|
};
|
|
5335
|
-
const text =
|
|
5345
|
+
const text = victory_core__WEBPACK_IMPORTED_MODULE_6__.getText(props, datum, index);
|
|
5336
5346
|
if (text !== undefined && text !== null || labels && (events || sharedEvents)) {
|
|
5337
|
-
childProps[eventKey].labels =
|
|
5347
|
+
childProps[eventKey].labels = victory_core__WEBPACK_IMPORTED_MODULE_6__.getProps(props, index);
|
|
5338
5348
|
}
|
|
5339
5349
|
return childProps;
|
|
5340
5350
|
}, initialChildProps);
|
|
@@ -5469,8 +5479,6 @@ const getVerticalBarPoints = (position, sign, cr) => {
|
|
|
5469
5479
|
y0,
|
|
5470
5480
|
y1
|
|
5471
5481
|
} = position;
|
|
5472
|
-
|
|
5473
|
-
// eslint-disable-next-line max-statements, max-len
|
|
5474
5482
|
const getHalfPoints = side => {
|
|
5475
5483
|
const isLeft = side === "Left";
|
|
5476
5484
|
const signL = isLeft ? 1 : -1;
|
|
@@ -5554,8 +5562,6 @@ const getHorizontalBarPoints = (position, sign, cr) => {
|
|
|
5554
5562
|
} = position;
|
|
5555
5563
|
const x0 = position.x0 < position.x1 ? position.x0 : position.x1;
|
|
5556
5564
|
const x1 = position.x0 < position.x1 ? position.x1 : position.x0;
|
|
5557
|
-
|
|
5558
|
-
// eslint-disable-next-line max-statements, max-len
|
|
5559
5565
|
const getHalfPoints = side => {
|
|
5560
5566
|
const isTop = side === "top";
|
|
5561
5567
|
const signL = isTop ? -1 : 1;
|
|
@@ -5635,8 +5641,6 @@ const getHorizontalBarPoints = (position, sign, cr) => {
|
|
|
5635
5641
|
// eslint-disable-next-line no-magic-numbers
|
|
5636
5642
|
bottomPoints[3], bottomPoints[2]];
|
|
5637
5643
|
};
|
|
5638
|
-
|
|
5639
|
-
// eslint-disable-next-line max-params
|
|
5640
5644
|
const getVerticalBarPath = (props, width, cornerRadius) => {
|
|
5641
5645
|
const position = getPosition(props, width);
|
|
5642
5646
|
const sign = position.y0 > position.y1 ? 1 : -1;
|
|
@@ -5644,8 +5648,6 @@ const getVerticalBarPath = (props, width, cornerRadius) => {
|
|
|
5644
5648
|
const points = getVerticalBarPoints(position, sign, cornerRadius);
|
|
5645
5649
|
return mapPointsToPath(points, cornerRadius, direction);
|
|
5646
5650
|
};
|
|
5647
|
-
|
|
5648
|
-
// eslint-disable-next-line max-params
|
|
5649
5651
|
const getHorizontalBarPath = (props, width, cornerRadius) => {
|
|
5650
5652
|
const position = getPosition(props, width);
|
|
5651
5653
|
const sign = position.x0 < position.x1 ? 1 : -1;
|
|
@@ -5703,8 +5705,6 @@ const getVerticalPolarBarPath = (props, cornerRadius) => {
|
|
|
5703
5705
|
leftMiddle
|
|
5704
5706
|
};
|
|
5705
5707
|
};
|
|
5706
|
-
|
|
5707
|
-
// eslint-disable-next-line max-statements
|
|
5708
5708
|
const getTopPath = () => {
|
|
5709
5709
|
const {
|
|
5710
5710
|
topRight,
|
|
@@ -5747,8 +5747,6 @@ const getVerticalPolarBarPath = (props, cornerRadius) => {
|
|
|
5747
5747
|
coords: subCoords[i].split(",")
|
|
5748
5748
|
}));
|
|
5749
5749
|
};
|
|
5750
|
-
|
|
5751
|
-
// eslint-disable-next-line max-statements
|
|
5752
5750
|
const getBottomPath = () => {
|
|
5753
5751
|
const {
|
|
5754
5752
|
bottomRight,
|
|
@@ -5820,10 +5818,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5820
5818
|
/* harmony export */ "isInterpolatable": function() { return /* binding */ isInterpolatable; },
|
|
5821
5819
|
/* harmony export */ "victoryInterpolator": function() { return /* binding */ victoryInterpolator; }
|
|
5822
5820
|
/* harmony export */ });
|
|
5823
|
-
/* harmony import */ var
|
|
5824
|
-
/* harmony import */ var
|
|
5825
|
-
/* harmony import */ var
|
|
5826
|
-
/* harmony import */ var
|
|
5821
|
+
/* 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");
|
|
5822
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__);
|
|
5823
|
+
/* 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");
|
|
5824
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_orderBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
5827
5825
|
/* harmony import */ var victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-vendor/d3-interpolate */ "../../victory-vendor/es/d3-interpolate.js");
|
|
5828
5826
|
|
|
5829
5827
|
|
|
@@ -5849,7 +5847,7 @@ const isInterpolatable = function (obj) {
|
|
|
5849
5847
|
return false;
|
|
5850
5848
|
case "object":
|
|
5851
5849
|
// Don't try to interpolate class instances (except Date or Array).
|
|
5852
|
-
return obj instanceof Date || Array.isArray(obj) ||
|
|
5850
|
+
return obj instanceof Date || Array.isArray(obj) || lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(obj);
|
|
5853
5851
|
case "function":
|
|
5854
5852
|
// Careful! There may be extra properties on function objects that the
|
|
5855
5853
|
// component expects to access - for instance, it may be a `d3.scale()`
|
|
@@ -5909,7 +5907,7 @@ const interpolateFunction = function (a, b) {
|
|
|
5909
5907
|
return b;
|
|
5910
5908
|
}
|
|
5911
5909
|
return function () {
|
|
5912
|
-
/* eslint-disable
|
|
5910
|
+
/* eslint-disable prefer-rest-params */
|
|
5913
5911
|
const aval = typeof a === "function" ? a.apply(this, arguments) : a;
|
|
5914
5912
|
const bval = typeof b === "function" ? b.apply(this, arguments) : b;
|
|
5915
5913
|
return (0,victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(aval, bval)(t);
|
|
@@ -5935,7 +5933,7 @@ const interpolateObject = function (startValue, endValue) {
|
|
|
5935
5933
|
if (typeof x === "function" || typeof y === "function") {
|
|
5936
5934
|
return interpolateFunction(x, y);
|
|
5937
5935
|
}
|
|
5938
|
-
if (typeof x === "object" &&
|
|
5936
|
+
if (typeof x === "object" && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(x) || typeof y === "object" && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(y)) {
|
|
5939
5937
|
return interpolateObject(x, y);
|
|
5940
5938
|
}
|
|
5941
5939
|
return (0,victory_vendor_d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(x, y);
|
|
@@ -5944,7 +5942,7 @@ const interpolateObject = function (startValue, endValue) {
|
|
|
5944
5942
|
// When the value is an array, attempt to sort by "key" so that animating nodes may be identified
|
|
5945
5943
|
// based on "key" instead of index
|
|
5946
5944
|
const keyData = val => {
|
|
5947
|
-
return Array.isArray(val) ?
|
|
5945
|
+
return Array.isArray(val) ? lodash_orderBy__WEBPACK_IMPORTED_MODULE_1___default()(val, "key") : val;
|
|
5948
5946
|
};
|
|
5949
5947
|
const i = {};
|
|
5950
5948
|
const c = {};
|
|
@@ -6011,7 +6009,7 @@ const victoryInterpolator = function (a, b) {
|
|
|
6011
6009
|
if (typeof a === "function" || typeof b === "function") {
|
|
6012
6010
|
return interpolateFunction(a, b);
|
|
6013
6011
|
}
|
|
6014
|
-
if (
|
|
6012
|
+
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(a) || lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(b)) {
|
|
6015
6013
|
// @ts-expect-error These generics are tough, but they work :)
|
|
6016
6014
|
return interpolateObject(a, b);
|
|
6017
6015
|
}
|
|
@@ -6175,6 +6173,207 @@ const VictoryAnimation = _ref => {
|
|
|
6175
6173
|
|
|
6176
6174
|
/***/ }),
|
|
6177
6175
|
|
|
6176
|
+
/***/ "../../victory-core/es/victory-clip-container/victory-clip-container.js":
|
|
6177
|
+
/*!******************************************************************************!*\
|
|
6178
|
+
!*** ../../victory-core/es/victory-clip-container/victory-clip-container.js ***!
|
|
6179
|
+
\******************************************************************************/
|
|
6180
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6181
|
+
|
|
6182
|
+
"use strict";
|
|
6183
|
+
__webpack_require__.r(__webpack_exports__);
|
|
6184
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6185
|
+
/* harmony export */ "VictoryClipContainer": function() { return /* binding */ VictoryClipContainer; }
|
|
6186
|
+
/* harmony export */ });
|
|
6187
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6188
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6189
|
+
/* 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");
|
|
6190
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6191
|
+
/* 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");
|
|
6192
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2__);
|
|
6193
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6194
|
+
/* 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");
|
|
6195
|
+
/* 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");
|
|
6196
|
+
/* harmony import */ var _victory_primitives_circle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../victory-primitives/circle */ "../../victory-core/es/victory-primitives/circle.js");
|
|
6197
|
+
/* harmony import */ var _victory_primitives_rect__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-primitives/rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
6198
|
+
|
|
6199
|
+
|
|
6200
|
+
|
|
6201
|
+
|
|
6202
|
+
|
|
6203
|
+
|
|
6204
|
+
|
|
6205
|
+
|
|
6206
|
+
class VictoryClipContainer extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
|
6207
|
+
static displayName = "VictoryClipContainer";
|
|
6208
|
+
static role = "container";
|
|
6209
|
+
static defaultProps = {
|
|
6210
|
+
circleComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_circle__WEBPACK_IMPORTED_MODULE_3__.Circle, null),
|
|
6211
|
+
rectComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_rect__WEBPACK_IMPORTED_MODULE_4__.Rect, null),
|
|
6212
|
+
clipPathComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_clip_path__WEBPACK_IMPORTED_MODULE_5__.ClipPath, null),
|
|
6213
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null)
|
|
6214
|
+
};
|
|
6215
|
+
constructor(props) {
|
|
6216
|
+
super(props);
|
|
6217
|
+
this.state = {
|
|
6218
|
+
clipId: props?.clipId
|
|
6219
|
+
};
|
|
6220
|
+
}
|
|
6221
|
+
|
|
6222
|
+
// The clipId state is used to prevent hydration mismatches between the server and client (issue #2941).
|
|
6223
|
+
// A better alternative would be to utilize React 18's useId hook instead of uniqueId, which would avoid needing state for this purpose.
|
|
6224
|
+
// However, this component currently supports React 16 at the time of writing, so this workaround is necessary.
|
|
6225
|
+
componentDidMount() {
|
|
6226
|
+
if (!this.state.clipId) {
|
|
6227
|
+
this.setState({
|
|
6228
|
+
clipId: lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default()("victory-clip-")
|
|
6229
|
+
});
|
|
6230
|
+
}
|
|
6231
|
+
}
|
|
6232
|
+
calculateAttributes(props) {
|
|
6233
|
+
const {
|
|
6234
|
+
polar,
|
|
6235
|
+
origin,
|
|
6236
|
+
clipWidth = 0,
|
|
6237
|
+
clipHeight = 0,
|
|
6238
|
+
translateX = 0,
|
|
6239
|
+
translateY = 0
|
|
6240
|
+
} = props;
|
|
6241
|
+
const clipPadding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getPadding(props.clipPadding);
|
|
6242
|
+
const radius = props.radius || _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getRadius(props);
|
|
6243
|
+
return {
|
|
6244
|
+
x: (polar ? origin.x : translateX) - clipPadding.left,
|
|
6245
|
+
y: (polar ? origin.y : translateY) - clipPadding.top,
|
|
6246
|
+
width: Math.max((polar ? radius : clipWidth) + clipPadding.left + clipPadding.right, 0),
|
|
6247
|
+
height: Math.max((polar ? radius : clipHeight) + clipPadding.top + clipPadding.bottom, 0)
|
|
6248
|
+
};
|
|
6249
|
+
}
|
|
6250
|
+
renderClippedGroup(props, clipId) {
|
|
6251
|
+
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_7__.getSafeUserProps(props);
|
|
6252
|
+
const {
|
|
6253
|
+
style,
|
|
6254
|
+
events,
|
|
6255
|
+
transform,
|
|
6256
|
+
children,
|
|
6257
|
+
className,
|
|
6258
|
+
groupComponent,
|
|
6259
|
+
tabIndex
|
|
6260
|
+
} = props;
|
|
6261
|
+
const clipComponent = this.renderClipComponent(props, clipId);
|
|
6262
|
+
const groupProps = Object.assign({
|
|
6263
|
+
className,
|
|
6264
|
+
style,
|
|
6265
|
+
transform,
|
|
6266
|
+
key: `clipped-group-${clipId}`,
|
|
6267
|
+
clipPath: `url(#${clipId})`
|
|
6268
|
+
}, events);
|
|
6269
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(groupComponent, {
|
|
6270
|
+
...groupProps,
|
|
6271
|
+
tabIndex,
|
|
6272
|
+
...userProps
|
|
6273
|
+
}, [clipComponent, ...react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(children)]);
|
|
6274
|
+
}
|
|
6275
|
+
renderGroup(props) {
|
|
6276
|
+
const {
|
|
6277
|
+
style,
|
|
6278
|
+
events,
|
|
6279
|
+
transform,
|
|
6280
|
+
children,
|
|
6281
|
+
className,
|
|
6282
|
+
groupComponent,
|
|
6283
|
+
tabIndex
|
|
6284
|
+
} = props;
|
|
6285
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(groupComponent, Object.assign({
|
|
6286
|
+
className,
|
|
6287
|
+
style,
|
|
6288
|
+
transform,
|
|
6289
|
+
"aria-label": props["aria-label"],
|
|
6290
|
+
tabIndex
|
|
6291
|
+
}, events), children);
|
|
6292
|
+
}
|
|
6293
|
+
renderClipComponent(props, clipId) {
|
|
6294
|
+
const {
|
|
6295
|
+
polar,
|
|
6296
|
+
origin,
|
|
6297
|
+
clipWidth = 0,
|
|
6298
|
+
clipHeight = 0,
|
|
6299
|
+
translateX = 0,
|
|
6300
|
+
translateY = 0,
|
|
6301
|
+
circleComponent,
|
|
6302
|
+
rectComponent,
|
|
6303
|
+
clipPathComponent
|
|
6304
|
+
} = props;
|
|
6305
|
+
const {
|
|
6306
|
+
top,
|
|
6307
|
+
bottom,
|
|
6308
|
+
left,
|
|
6309
|
+
right
|
|
6310
|
+
} = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getPadding(props.clipPadding);
|
|
6311
|
+
let child;
|
|
6312
|
+
if (polar) {
|
|
6313
|
+
const radius = props.radius || _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getRadius(props);
|
|
6314
|
+
const circleProps = {
|
|
6315
|
+
r: Math.max(radius + left + right, radius + top + bottom, 0),
|
|
6316
|
+
cx: origin.x - left,
|
|
6317
|
+
cy: origin.y - top
|
|
6318
|
+
};
|
|
6319
|
+
child = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(circleComponent, circleProps);
|
|
6320
|
+
} else {
|
|
6321
|
+
const rectProps = {
|
|
6322
|
+
x: translateX - left,
|
|
6323
|
+
y: translateY - top,
|
|
6324
|
+
width: Math.max(clipWidth + left + right, 0),
|
|
6325
|
+
height: Math.max(clipHeight + top + bottom, 0)
|
|
6326
|
+
};
|
|
6327
|
+
child = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(rectComponent, rectProps);
|
|
6328
|
+
}
|
|
6329
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(clipPathComponent, Object.assign({
|
|
6330
|
+
key: `clip-path-${clipId}`
|
|
6331
|
+
}, props, {
|
|
6332
|
+
clipId
|
|
6333
|
+
}), child);
|
|
6334
|
+
}
|
|
6335
|
+
getClipValue(props, axis) {
|
|
6336
|
+
const clipValues = {
|
|
6337
|
+
x: props.clipWidth,
|
|
6338
|
+
y: props.clipHeight
|
|
6339
|
+
};
|
|
6340
|
+
if (clipValues[axis] !== undefined) {
|
|
6341
|
+
return clipValues[axis];
|
|
6342
|
+
}
|
|
6343
|
+
const range = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, axis);
|
|
6344
|
+
return range ? Math.abs(range[0] - range[1]) || undefined : undefined;
|
|
6345
|
+
}
|
|
6346
|
+
getTranslateValue(props, axis) {
|
|
6347
|
+
const translateValues = {
|
|
6348
|
+
x: props.translateX,
|
|
6349
|
+
y: props.translateY
|
|
6350
|
+
};
|
|
6351
|
+
if (translateValues[axis] !== undefined) {
|
|
6352
|
+
return translateValues[axis];
|
|
6353
|
+
}
|
|
6354
|
+
const range = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__.getRange(props, axis);
|
|
6355
|
+
return range ? Math.min(...range) : undefined;
|
|
6356
|
+
}
|
|
6357
|
+
render() {
|
|
6358
|
+
const clipHeight = this.getClipValue(this.props, "y");
|
|
6359
|
+
const clipWidth = this.getClipValue(this.props, "x");
|
|
6360
|
+
if (clipWidth === undefined || clipHeight === undefined) {
|
|
6361
|
+
return this.renderGroup(this.props);
|
|
6362
|
+
}
|
|
6363
|
+
const translateX = this.getTranslateValue(this.props, "x");
|
|
6364
|
+
const translateY = this.getTranslateValue(this.props, "y");
|
|
6365
|
+
const clipProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, this.props, {
|
|
6366
|
+
clipHeight,
|
|
6367
|
+
clipWidth,
|
|
6368
|
+
translateX,
|
|
6369
|
+
translateY
|
|
6370
|
+
});
|
|
6371
|
+
return this.renderClippedGroup(clipProps, this.state.clipId);
|
|
6372
|
+
}
|
|
6373
|
+
}
|
|
6374
|
+
|
|
6375
|
+
/***/ }),
|
|
6376
|
+
|
|
6178
6377
|
/***/ "../../victory-core/es/victory-container/victory-container.js":
|
|
6179
6378
|
/*!********************************************************************!*\
|
|
6180
6379
|
!*** ../../victory-core/es/victory-container/victory-container.js ***!
|
|
@@ -6187,16 +6386,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6187
6386
|
/* harmony export */ "VictoryContainer": function() { return /* binding */ VictoryContainer; },
|
|
6188
6387
|
/* harmony export */ "useVictoryContainer": function() { return /* binding */ useVictoryContainer; }
|
|
6189
6388
|
/* harmony export */ });
|
|
6190
|
-
/* harmony import */ var
|
|
6191
|
-
/* harmony import */ var
|
|
6192
|
-
/* harmony import */ var
|
|
6193
|
-
/* harmony import */ var
|
|
6389
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6390
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6391
|
+
/* 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");
|
|
6392
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1__);
|
|
6194
6393
|
/* harmony import */ var _victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../victory-portal/portal */ "../../victory-core/es/victory-portal/portal.js");
|
|
6195
6394
|
/* 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");
|
|
6196
6395
|
/* harmony import */ var _victory_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util */ "../../victory-core/es/victory-util/merge-refs.js");
|
|
6197
6396
|
/* 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");
|
|
6198
6397
|
/* 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");
|
|
6199
|
-
|
|
6200
6398
|
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); }
|
|
6201
6399
|
|
|
6202
6400
|
|
|
@@ -6204,9 +6402,10 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
6204
6402
|
|
|
6205
6403
|
|
|
6206
6404
|
|
|
6405
|
+
|
|
6207
6406
|
const defaultProps = {
|
|
6208
6407
|
className: "VictoryContainer",
|
|
6209
|
-
portalComponent: /*#__PURE__*/
|
|
6408
|
+
portalComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal__WEBPACK_IMPORTED_MODULE_2__.Portal, null),
|
|
6210
6409
|
portalZIndex: 99,
|
|
6211
6410
|
responsive: true,
|
|
6212
6411
|
role: "img"
|
|
@@ -6223,10 +6422,10 @@ function useVictoryContainer(initialProps) {
|
|
|
6223
6422
|
height,
|
|
6224
6423
|
responsive
|
|
6225
6424
|
} = props;
|
|
6226
|
-
const localContainerRef = (0,
|
|
6425
|
+
const localContainerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
6227
6426
|
|
|
6228
6427
|
// Generated ID stored in ref because it needs to persist across renders
|
|
6229
|
-
const generatedId = (0,
|
|
6428
|
+
const generatedId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_1___default()("victory-container-"));
|
|
6230
6429
|
const containerId = props.containerId ?? generatedId.current;
|
|
6231
6430
|
const getIdForElement = elName => `${containerId}-${elName}`;
|
|
6232
6431
|
const userProps = _victory_util_user_props__WEBPACK_IMPORTED_MODULE_3__.getSafeUserProps(props);
|
|
@@ -6285,7 +6484,7 @@ const VictoryContainer = initialProps => {
|
|
|
6285
6484
|
containerRef,
|
|
6286
6485
|
localContainerRef
|
|
6287
6486
|
} = useVictoryContainer(initialProps);
|
|
6288
|
-
|
|
6487
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
6289
6488
|
if (!events?.onWheel) return;
|
|
6290
6489
|
const handleWheel = e => e.preventDefault();
|
|
6291
6490
|
const container = localContainerRef?.current;
|
|
@@ -6295,21 +6494,21 @@ const VictoryContainer = initialProps => {
|
|
|
6295
6494
|
};
|
|
6296
6495
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6297
6496
|
}, []);
|
|
6298
|
-
return /*#__PURE__*/
|
|
6497
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
6299
6498
|
className: className,
|
|
6300
6499
|
style: {
|
|
6301
6500
|
...style,
|
|
6302
6501
|
width: responsive ? style?.width : dimensions.width,
|
|
6303
6502
|
height: responsive ? style?.height : dimensions.height,
|
|
6304
|
-
pointerEvents: "none",
|
|
6305
|
-
touchAction: "none",
|
|
6306
|
-
position: "relative"
|
|
6503
|
+
pointerEvents: style?.pointerEvents ?? "none",
|
|
6504
|
+
touchAction: style?.touchAction ?? "none",
|
|
6505
|
+
position: style?.position ?? "relative"
|
|
6307
6506
|
},
|
|
6308
6507
|
"data-ouia-component-id": ouiaId,
|
|
6309
6508
|
"data-ouia-component-type": ouiaType,
|
|
6310
6509
|
"data-ouia-safe": ouiaSafe,
|
|
6311
6510
|
ref: (0,_victory_util__WEBPACK_IMPORTED_MODULE_4__.mergeRefs)([localContainerRef, containerRef])
|
|
6312
|
-
}, /*#__PURE__*/
|
|
6511
|
+
}, /*#__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({
|
|
6313
6512
|
width: width,
|
|
6314
6513
|
height: height,
|
|
6315
6514
|
tabIndex: tabIndex,
|
|
@@ -6322,11 +6521,11 @@ const VictoryContainer = initialProps => {
|
|
|
6322
6521
|
...dimensions,
|
|
6323
6522
|
pointerEvents: "all"
|
|
6324
6523
|
}
|
|
6325
|
-
}, userProps, events), title ? /*#__PURE__*/
|
|
6524
|
+
}, userProps, events), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("title", {
|
|
6326
6525
|
id: titleId
|
|
6327
|
-
}, title) : null, desc ? /*#__PURE__*/
|
|
6526
|
+
}, title) : null, desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("desc", {
|
|
6328
6527
|
id: descId
|
|
6329
|
-
}, desc) : null, children), /*#__PURE__*/
|
|
6528
|
+
}, desc) : null, children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
6330
6529
|
style: {
|
|
6331
6530
|
...dimensions,
|
|
6332
6531
|
zIndex: portalZIndex,
|
|
@@ -6334,7 +6533,7 @@ const VictoryContainer = initialProps => {
|
|
|
6334
6533
|
top: 0,
|
|
6335
6534
|
left: 0
|
|
6336
6535
|
}
|
|
6337
|
-
}, /*#__PURE__*/
|
|
6536
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_portal_outlet__WEBPACK_IMPORTED_MODULE_6__.PortalOutlet, {
|
|
6338
6537
|
as: portalComponent,
|
|
6339
6538
|
width: width,
|
|
6340
6539
|
height: height,
|
|
@@ -6361,12 +6560,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6361
6560
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6362
6561
|
/* harmony export */ "VictoryLabel": function() { return /* binding */ VictoryLabel; }
|
|
6363
6562
|
/* harmony export */ });
|
|
6364
|
-
/* harmony import */ var
|
|
6365
|
-
/* harmony import */ var
|
|
6563
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
6564
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6366
6565
|
/* 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");
|
|
6367
6566
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6368
|
-
/* harmony import */ var
|
|
6369
|
-
/* harmony import */ var
|
|
6567
|
+
/* 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");
|
|
6568
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
6370
6569
|
/* 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");
|
|
6371
6570
|
/* harmony import */ var _victory_primitives_rect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../victory-primitives/rect */ "../../victory-core/es/victory-primitives/rect.js");
|
|
6372
6571
|
/* harmony import */ var _victory_primitives_text__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../victory-primitives/text */ "../../victory-core/es/victory-primitives/text.js");
|
|
@@ -6377,9 +6576,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6377
6576
|
/* harmony import */ var _victory_util_style__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/style */ "../../victory-core/es/victory-util/style.js");
|
|
6378
6577
|
/* harmony import */ var _victory_util_textsize__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../victory-util/textsize */ "../../victory-core/es/victory-util/textsize.js");
|
|
6379
6578
|
/* 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");
|
|
6579
|
+
/* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
|
|
6380
6580
|
|
|
6381
6581
|
|
|
6382
|
-
/* eslint no-magic-numbers: ["error", { "ignore": [-0.5, 0.5, 0, 1, 2] }]*/
|
|
6383
6582
|
|
|
6384
6583
|
|
|
6385
6584
|
|
|
@@ -6431,7 +6630,7 @@ const shouldUseMultilineBackgrounds = props => {
|
|
|
6431
6630
|
backgroundStyle,
|
|
6432
6631
|
backgroundPadding
|
|
6433
6632
|
} = props;
|
|
6434
|
-
return Array.isArray(backgroundStyle) && !
|
|
6633
|
+
return Array.isArray(backgroundStyle) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(backgroundStyle) || Array.isArray(backgroundPadding) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(backgroundPadding);
|
|
6435
6634
|
};
|
|
6436
6635
|
const getStyles = (style, props) => {
|
|
6437
6636
|
if (props.disableInlineStyles) {
|
|
@@ -6447,32 +6646,28 @@ const getStyles = (style, props) => {
|
|
|
6447
6646
|
fontSize: getFontSize(baseStyles)
|
|
6448
6647
|
});
|
|
6449
6648
|
};
|
|
6450
|
-
return Array.isArray(style) && !
|
|
6649
|
+
return Array.isArray(style) && !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(style) ? style.map(s => getSingleStyle(s)) : getSingleStyle(style);
|
|
6451
6650
|
};
|
|
6452
6651
|
const getBackgroundStyles = (style, props) => {
|
|
6453
6652
|
if (!style) {
|
|
6454
6653
|
return undefined;
|
|
6455
6654
|
}
|
|
6456
|
-
return Array.isArray(style) && !
|
|
6655
|
+
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);
|
|
6457
6656
|
};
|
|
6458
6657
|
const getBackgroundPadding = props => {
|
|
6459
6658
|
if (props.backgroundPadding && Array.isArray(props.backgroundPadding)) {
|
|
6460
6659
|
return props.backgroundPadding.map(backgroundPadding => {
|
|
6461
6660
|
const padding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(backgroundPadding, props);
|
|
6462
|
-
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(
|
|
6463
|
-
padding
|
|
6464
|
-
});
|
|
6661
|
+
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(padding);
|
|
6465
6662
|
});
|
|
6466
6663
|
}
|
|
6467
6664
|
const padding = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.backgroundPadding, props);
|
|
6468
|
-
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(
|
|
6469
|
-
padding
|
|
6470
|
-
});
|
|
6665
|
+
return _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.getPadding(padding);
|
|
6471
6666
|
};
|
|
6472
6667
|
const getLineHeight = props => {
|
|
6473
6668
|
const lineHeight = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.lineHeight, props);
|
|
6474
6669
|
if (Array.isArray(lineHeight)) {
|
|
6475
|
-
return
|
|
6670
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(lineHeight) ? [1] : lineHeight;
|
|
6476
6671
|
}
|
|
6477
6672
|
return lineHeight;
|
|
6478
6673
|
};
|
|
@@ -6592,7 +6787,7 @@ const getFullBackground = (calculatedProps, tspanValues) => {
|
|
|
6592
6787
|
x: inline ? xCoordinate - backgroundPadding.left : xCoordinate + dx - backgroundPadding.left,
|
|
6593
6788
|
y: yCoordinate
|
|
6594
6789
|
};
|
|
6595
|
-
return /*#__PURE__*/
|
|
6790
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(backgroundComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, backgroundComponent.props, backgroundProps));
|
|
6596
6791
|
};
|
|
6597
6792
|
const getInlineXOffset = (calculatedProps, textElements, index) => {
|
|
6598
6793
|
const {
|
|
@@ -6662,7 +6857,7 @@ const getChildBackgrounds = (calculatedProps, tspanValues) => {
|
|
|
6662
6857
|
x: xCoord - padding.left,
|
|
6663
6858
|
y: yCoord
|
|
6664
6859
|
};
|
|
6665
|
-
return /*#__PURE__*/
|
|
6860
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(backgroundComponent, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, backgroundComponent.props, backgroundProps));
|
|
6666
6861
|
});
|
|
6667
6862
|
};
|
|
6668
6863
|
const getBackgroundElement = (calculatedProps, tspanValues) => {
|
|
@@ -6793,16 +6988,16 @@ const renderLabel = (calculatedProps, tspanValues) => {
|
|
|
6793
6988
|
style: currentStyle,
|
|
6794
6989
|
children: line
|
|
6795
6990
|
};
|
|
6796
|
-
return /*#__PURE__*/
|
|
6991
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(tspanComponent, tspanProps);
|
|
6797
6992
|
});
|
|
6798
|
-
return /*#__PURE__*/
|
|
6993
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(textComponent, textProps, tspans);
|
|
6799
6994
|
};
|
|
6800
6995
|
const defaultProps = {
|
|
6801
|
-
backgroundComponent: /*#__PURE__*/
|
|
6802
|
-
groupComponent: /*#__PURE__*/
|
|
6996
|
+
backgroundComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_rect__WEBPACK_IMPORTED_MODULE_8__.Rect, null),
|
|
6997
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null),
|
|
6803
6998
|
direction: "inherit",
|
|
6804
|
-
textComponent: /*#__PURE__*/
|
|
6805
|
-
tspanComponent: /*#__PURE__*/
|
|
6999
|
+
textComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_text__WEBPACK_IMPORTED_MODULE_9__.Text, null),
|
|
7000
|
+
tspanComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_primitives_tspan__WEBPACK_IMPORTED_MODULE_10__.TSpan, null),
|
|
6806
7001
|
capHeight: 0.71,
|
|
6807
7002
|
// Magic number from d3.
|
|
6808
7003
|
lineHeight: 1
|
|
@@ -6839,10 +7034,10 @@ const VictoryLabel = initialProps => {
|
|
|
6839
7034
|
if (props.backgroundStyle) {
|
|
6840
7035
|
const backgroundElement = getBackgroundElement(calculatedProps, tspanValues);
|
|
6841
7036
|
const children = [backgroundElement, label];
|
|
6842
|
-
const backgroundWithLabel = /*#__PURE__*/
|
|
6843
|
-
return props.renderInPortal ? /*#__PURE__*/
|
|
7037
|
+
const backgroundWithLabel = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.groupComponent, {}, children);
|
|
7038
|
+
return props.renderInPortal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__.VictoryPortal, null, backgroundWithLabel) : backgroundWithLabel;
|
|
6844
7039
|
}
|
|
6845
|
-
return props.renderInPortal ? /*#__PURE__*/
|
|
7040
|
+
return props.renderInPortal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_portal_victory_portal__WEBPACK_IMPORTED_MODULE_12__.VictoryPortal, null, label) : label;
|
|
6846
7041
|
};
|
|
6847
7042
|
VictoryLabel.displayName = "VictoryLabel";
|
|
6848
7043
|
VictoryLabel.role = "label";
|
|
@@ -6968,12 +7163,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6968
7163
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6969
7164
|
/* harmony export */ "VictoryPortal": function() { return /* binding */ VictoryPortal; }
|
|
6970
7165
|
/* harmony export */ });
|
|
6971
|
-
/* harmony import */ var
|
|
6972
|
-
/* harmony import */ var
|
|
7166
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7167
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6973
7168
|
/* 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");
|
|
6974
7169
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
6975
|
-
/* harmony import */ var
|
|
6976
|
-
/* harmony import */ var
|
|
7170
|
+
/* 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");
|
|
7171
|
+
/* harmony import */ var lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2__);
|
|
6977
7172
|
/* harmony import */ var _victory_util_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../victory-util/log */ "../../victory-core/es/victory-util/log.js");
|
|
6978
7173
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
6979
7174
|
/* harmony import */ var _portal_context__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./portal-context */ "../../victory-core/es/victory-portal/portal-context.js");
|
|
@@ -6984,14 +7179,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6984
7179
|
|
|
6985
7180
|
|
|
6986
7181
|
const defaultProps = {
|
|
6987
|
-
groupComponent: /*#__PURE__*/
|
|
7182
|
+
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null)
|
|
6988
7183
|
};
|
|
6989
7184
|
const VictoryPortal = initialProps => {
|
|
6990
7185
|
const props = {
|
|
6991
7186
|
...defaultProps,
|
|
6992
7187
|
...initialProps
|
|
6993
7188
|
};
|
|
6994
|
-
const [id] = (0,
|
|
7189
|
+
const [id] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(lodash_uniqueId__WEBPACK_IMPORTED_MODULE_2___default()());
|
|
6995
7190
|
const portalContext = (0,_portal_context__WEBPACK_IMPORTED_MODULE_3__.usePortalContext)();
|
|
6996
7191
|
if (!portalContext) {
|
|
6997
7192
|
const msg = "`renderInPortal` is not supported outside of `VictoryContainer`. " + "Component will be rendered in place";
|
|
@@ -7009,12 +7204,12 @@ const VictoryPortal = initialProps => {
|
|
|
7009
7204
|
const newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(standardProps, childProps, _victory_util_helpers__WEBPACK_IMPORTED_MODULE_5__.omit(props, ["children", "groupComponent"]), {
|
|
7010
7205
|
key: childProps.key ?? id
|
|
7011
7206
|
});
|
|
7012
|
-
const child = children && /*#__PURE__*/
|
|
7013
|
-
|
|
7207
|
+
const child = children && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(children, newProps);
|
|
7208
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
7014
7209
|
portalContext?.addChild(id, child);
|
|
7015
7210
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7016
7211
|
}, [props.children]);
|
|
7017
|
-
|
|
7212
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
|
|
7018
7213
|
return () => portalContext?.removeChild(id);
|
|
7019
7214
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7020
7215
|
}, []);
|
|
@@ -7024,6 +7219,69 @@ VictoryPortal.role = "portal";
|
|
|
7024
7219
|
|
|
7025
7220
|
/***/ }),
|
|
7026
7221
|
|
|
7222
|
+
/***/ "../../victory-core/es/victory-primitives/circle.js":
|
|
7223
|
+
/*!**********************************************************!*\
|
|
7224
|
+
!*** ../../victory-core/es/victory-primitives/circle.js ***!
|
|
7225
|
+
\**********************************************************/
|
|
7226
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7227
|
+
|
|
7228
|
+
"use strict";
|
|
7229
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7230
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7231
|
+
/* harmony export */ "Circle": function() { return /* binding */ Circle; }
|
|
7232
|
+
/* harmony export */ });
|
|
7233
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7234
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7235
|
+
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
7236
|
+
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); }
|
|
7237
|
+
|
|
7238
|
+
|
|
7239
|
+
const Circle = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((props, ref) => {
|
|
7240
|
+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars --
|
|
7241
|
+
* origin conflicts with the SVG element's origin attribute
|
|
7242
|
+
*/
|
|
7243
|
+
const {
|
|
7244
|
+
desc,
|
|
7245
|
+
id,
|
|
7246
|
+
tabIndex,
|
|
7247
|
+
origin,
|
|
7248
|
+
...rest
|
|
7249
|
+
} = props;
|
|
7250
|
+
const svgProps = {
|
|
7251
|
+
vectorEffect: "non-scaling-stroke",
|
|
7252
|
+
id: (0,_victory_util_helpers__WEBPACK_IMPORTED_MODULE_1__.evaluateProp)(id, props)?.toString(),
|
|
7253
|
+
tabIndex: (0,_victory_util_helpers__WEBPACK_IMPORTED_MODULE_1__.evaluateProp)(tabIndex, props),
|
|
7254
|
+
...rest
|
|
7255
|
+
};
|
|
7256
|
+
return desc ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("circle", _extends({}, svgProps, {
|
|
7257
|
+
ref: ref
|
|
7258
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("desc", null, desc)) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("circle", _extends({}, svgProps, {
|
|
7259
|
+
ref: ref
|
|
7260
|
+
}));
|
|
7261
|
+
});
|
|
7262
|
+
|
|
7263
|
+
/***/ }),
|
|
7264
|
+
|
|
7265
|
+
/***/ "../../victory-core/es/victory-primitives/clip-path.js":
|
|
7266
|
+
/*!*************************************************************!*\
|
|
7267
|
+
!*** ../../victory-core/es/victory-primitives/clip-path.js ***!
|
|
7268
|
+
\*************************************************************/
|
|
7269
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7270
|
+
|
|
7271
|
+
"use strict";
|
|
7272
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7273
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7274
|
+
/* harmony export */ "ClipPath": function() { return /* binding */ ClipPath; }
|
|
7275
|
+
/* harmony export */ });
|
|
7276
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7277
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7278
|
+
|
|
7279
|
+
const ClipPath = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("clipPath", {
|
|
7280
|
+
id: props.clipId?.toString()
|
|
7281
|
+
}, props.children));
|
|
7282
|
+
|
|
7283
|
+
/***/ }),
|
|
7284
|
+
|
|
7027
7285
|
/***/ "../../victory-core/es/victory-primitives/path.js":
|
|
7028
7286
|
/*!********************************************************!*\
|
|
7029
7287
|
!*** ../../victory-core/es/victory-primitives/path.js ***!
|
|
@@ -8318,22 +8576,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8318
8576
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8319
8577
|
/* harmony export */ "VictoryTransition": function() { return /* binding */ VictoryTransition; }
|
|
8320
8578
|
/* harmony export */ });
|
|
8321
|
-
/* harmony import */ var
|
|
8322
|
-
/* harmony import */ var
|
|
8579
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8580
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8323
8581
|
/* 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");
|
|
8324
8582
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
8325
|
-
/* harmony import */ var
|
|
8326
|
-
/* harmony import */ var
|
|
8583
|
+
/* 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");
|
|
8584
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_2__);
|
|
8585
|
+
/* 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");
|
|
8586
|
+
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_3__);
|
|
8327
8587
|
/* 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");
|
|
8328
8588
|
/* harmony import */ var _victory_util_collection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../victory-util/collection */ "../../victory-core/es/victory-util/collection.js");
|
|
8329
8589
|
/* harmony import */ var _victory_util_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../victory-util/helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
8330
8590
|
/* 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");
|
|
8331
8591
|
/* harmony import */ var _victory_util_transitions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../victory-util/transitions */ "../../victory-core/es/victory-util/transitions.js");
|
|
8332
|
-
|
|
8333
|
-
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_3__);
|
|
8592
|
+
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); }
|
|
8334
8593
|
|
|
8335
8594
|
|
|
8336
|
-
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); }
|
|
8337
8595
|
|
|
8338
8596
|
|
|
8339
8597
|
|
|
@@ -8341,7 +8599,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
8341
8599
|
|
|
8342
8600
|
|
|
8343
8601
|
|
|
8344
|
-
class VictoryTransition extends (
|
|
8602
|
+
class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component) {
|
|
8345
8603
|
static displayName = "VictoryTransition";
|
|
8346
8604
|
static contextType = _victory_util_timer_context__WEBPACK_IMPORTED_MODULE_4__["default"];
|
|
8347
8605
|
constructor(props, context) {
|
|
@@ -8358,7 +8616,7 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
8358
8616
|
componentDidMount() {
|
|
8359
8617
|
this.setState({
|
|
8360
8618
|
nodesShouldLoad: true
|
|
8361
|
-
});
|
|
8619
|
+
});
|
|
8362
8620
|
}
|
|
8363
8621
|
shouldComponentUpdate(nextProps) {
|
|
8364
8622
|
if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_3___default()(this.props, nextProps)) {
|
|
@@ -8384,8 +8642,8 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
8384
8642
|
nextProps
|
|
8385
8643
|
};
|
|
8386
8644
|
}
|
|
8387
|
-
const oldChildren =
|
|
8388
|
-
const nextChildren =
|
|
8645
|
+
const oldChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children);
|
|
8646
|
+
const nextChildren = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(nextProps.children);
|
|
8389
8647
|
const {
|
|
8390
8648
|
nodesWillExit,
|
|
8391
8649
|
nodesWillEnter,
|
|
@@ -8408,12 +8666,12 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
8408
8666
|
const childDomain = child.props && child.type.getDomain(child.props, axis);
|
|
8409
8667
|
return childDomain ? memo.concat(childDomain) : memo;
|
|
8410
8668
|
} else if (child.props && child.props.children) {
|
|
8411
|
-
return memo.concat(getChildDomains(
|
|
8669
|
+
return memo.concat(getChildDomains(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(child.props.children)));
|
|
8412
8670
|
}
|
|
8413
8671
|
return memo;
|
|
8414
8672
|
}, []);
|
|
8415
8673
|
};
|
|
8416
|
-
const child =
|
|
8674
|
+
const child = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children)[0];
|
|
8417
8675
|
const childProps = child.props || {};
|
|
8418
8676
|
const domain = Array.isArray(childProps.domain) ? childProps.domain : childProps.domain && childProps.domain[axis];
|
|
8419
8677
|
if (!childProps.children && domain) {
|
|
@@ -8446,7 +8704,7 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
8446
8704
|
render() {
|
|
8447
8705
|
const props = this.pickProps();
|
|
8448
8706
|
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));
|
|
8449
|
-
const child =
|
|
8707
|
+
const child = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children)[0];
|
|
8450
8708
|
const transitionProps = getTransitionProps(child);
|
|
8451
8709
|
this.transitionProps = transitionProps;
|
|
8452
8710
|
const domain = {
|
|
@@ -8460,21 +8718,21 @@ class VictoryTransition extends (react__WEBPACK_IMPORTED_MODULE_2___default().Co
|
|
|
8460
8718
|
}, transitionProps, child.props);
|
|
8461
8719
|
const animationWhitelist = props.animationWhitelist || [];
|
|
8462
8720
|
const whitelist = animationWhitelist.concat(["clipWidth"]);
|
|
8463
|
-
const propsToAnimate = whitelist.length ?
|
|
8464
|
-
return /*#__PURE__*/
|
|
8721
|
+
const propsToAnimate = whitelist.length ? lodash_pick__WEBPACK_IMPORTED_MODULE_2___default()(combinedProps, whitelist) : combinedProps;
|
|
8722
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_animation_victory_animation__WEBPACK_IMPORTED_MODULE_8__.VictoryAnimation, _extends({}, combinedProps.animate, {
|
|
8465
8723
|
data: propsToAnimate
|
|
8466
8724
|
}), newProps => {
|
|
8467
8725
|
if (child.props.groupComponent) {
|
|
8468
|
-
const groupComponent = this.continuous ? /*#__PURE__*/
|
|
8726
|
+
const groupComponent = this.continuous ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child.props.groupComponent, {
|
|
8469
8727
|
clipWidth: newProps.clipWidth || 0
|
|
8470
8728
|
}) : child.props.groupComponent;
|
|
8471
|
-
return /*#__PURE__*/
|
|
8729
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8472
8730
|
animate: null,
|
|
8473
8731
|
animating: true,
|
|
8474
8732
|
groupComponent
|
|
8475
8733
|
}, newProps, combinedProps));
|
|
8476
8734
|
}
|
|
8477
|
-
return /*#__PURE__*/
|
|
8735
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(child, lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8478
8736
|
animate: null,
|
|
8479
8737
|
animating: true
|
|
8480
8738
|
}, newProps, combinedProps));
|
|
@@ -8495,14 +8753,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8495
8753
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8496
8754
|
/* harmony export */ "addEvents": function() { return /* binding */ addEvents; }
|
|
8497
8755
|
/* harmony export */ });
|
|
8498
|
-
/* harmony import */ var
|
|
8499
|
-
/* harmony import */ var
|
|
8500
|
-
/* harmony import */ var
|
|
8501
|
-
/* harmony import */ var
|
|
8502
|
-
/* harmony import */ var
|
|
8503
|
-
/* harmony import */ var
|
|
8504
|
-
/* harmony import */ var
|
|
8505
|
-
/* harmony import */ var
|
|
8756
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
8757
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8758
|
+
/* 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");
|
|
8759
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
8760
|
+
/* 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");
|
|
8761
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2__);
|
|
8762
|
+
/* 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");
|
|
8763
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
|
8506
8764
|
/* 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");
|
|
8507
8765
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_4__);
|
|
8508
8766
|
/* 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");
|
|
@@ -8572,7 +8830,7 @@ const defaultComponents = [{
|
|
|
8572
8830
|
function addEvents(WrappedComponent, options) {
|
|
8573
8831
|
if (options === void 0) {
|
|
8574
8832
|
options = {};
|
|
8575
|
-
} // eslint-disable-next-line @typescript-eslint/no-empty-
|
|
8833
|
+
} // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
8576
8834
|
// @ts-expect-error "TS2545: A mixin class must have a constructor with a single rest parameter of type 'any[]'."
|
|
8577
8835
|
class AddEventsMixin extends WrappedComponent {
|
|
8578
8836
|
constructor(props) {
|
|
@@ -8649,8 +8907,8 @@ function addEvents(WrappedComponent, options) {
|
|
|
8649
8907
|
return {};
|
|
8650
8908
|
}
|
|
8651
8909
|
const getState = (key, type) => {
|
|
8652
|
-
const result =
|
|
8653
|
-
return
|
|
8910
|
+
const result = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, this.getEventState(key, type), this.getSharedEventState(key, type));
|
|
8911
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
|
|
8654
8912
|
};
|
|
8655
8913
|
const components = options.components || defaultComponents;
|
|
8656
8914
|
const stateChanges = components.map(component => {
|
|
@@ -8663,7 +8921,7 @@ function addEvents(WrappedComponent, options) {
|
|
|
8663
8921
|
return stateChanges;
|
|
8664
8922
|
}
|
|
8665
8923
|
applyExternalMutations(props, externalMutations) {
|
|
8666
|
-
if (!
|
|
8924
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
8667
8925
|
const callbacks = props.externalEventMutations.reduce((memo, mutation) => (0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(mutation.callback) ? memo.concat(mutation.callback) : memo, []);
|
|
8668
8926
|
const compiledCallbacks = callbacks.length ? () => {
|
|
8669
8927
|
callbacks.forEach(c => c());
|
|
@@ -8696,7 +8954,7 @@ function addEvents(WrappedComponent, options) {
|
|
|
8696
8954
|
sharedEvents,
|
|
8697
8955
|
externalEventMutations
|
|
8698
8956
|
} = props;
|
|
8699
|
-
return
|
|
8957
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_6__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
|
|
8700
8958
|
}
|
|
8701
8959
|
cacheValues(obj) {
|
|
8702
8960
|
Object.keys(obj).forEach(key => {
|
|
@@ -8707,10 +8965,10 @@ function addEvents(WrappedComponent, options) {
|
|
|
8707
8965
|
const getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
|
|
8708
8966
|
const sharedParentState = getSharedEventStateFunction("parent", "parent");
|
|
8709
8967
|
const parentState = this.getEventState("parent", "parent");
|
|
8710
|
-
const baseParentProps =
|
|
8968
|
+
const baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parentState, sharedParentState);
|
|
8711
8969
|
const parentPropsList = baseParentProps.parentControlledProps;
|
|
8712
|
-
const parentProps = parentPropsList ?
|
|
8713
|
-
const modifiedProps =
|
|
8970
|
+
const parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(baseParentProps, parentPropsList) : {};
|
|
8971
|
+
const modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parentProps, props);
|
|
8714
8972
|
return typeof WrappedComponent.getBaseProps === "function" ? WrappedComponent.getBaseProps(modifiedProps) : {};
|
|
8715
8973
|
}
|
|
8716
8974
|
getAllEvents(props) {
|
|
@@ -8730,18 +8988,18 @@ function addEvents(WrappedComponent, options) {
|
|
|
8730
8988
|
const currentProps = component && typeof component === "object" && "props" in component ? component.props : undefined;
|
|
8731
8989
|
if (this.hasEvents) {
|
|
8732
8990
|
const baseEvents = this.getEvents(this.props, type, key);
|
|
8733
|
-
const componentProps =
|
|
8991
|
+
const componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8734
8992
|
index,
|
|
8735
8993
|
key: id
|
|
8736
8994
|
}, this.getEventState(key, type), this.getSharedEventState(key, type), currentProps, baseProps, {
|
|
8737
8995
|
id
|
|
8738
8996
|
});
|
|
8739
|
-
const events =
|
|
8997
|
+
const events = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, _events__WEBPACK_IMPORTED_MODULE_6__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
|
|
8740
8998
|
return Object.assign({}, componentProps, {
|
|
8741
8999
|
events
|
|
8742
9000
|
});
|
|
8743
9001
|
}
|
|
8744
|
-
return
|
|
9002
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
8745
9003
|
index,
|
|
8746
9004
|
key: id
|
|
8747
9005
|
}, currentProps, baseProps, {
|
|
@@ -8755,15 +9013,15 @@ function addEvents(WrappedComponent, options) {
|
|
|
8755
9013
|
this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_6__.getGlobalEvents(parentProps.events);
|
|
8756
9014
|
parentProps.events = _events__WEBPACK_IMPORTED_MODULE_6__.omitGlobalEvents(parentProps.events);
|
|
8757
9015
|
}
|
|
8758
|
-
return /*#__PURE__*/
|
|
9016
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(component, parentProps, children);
|
|
8759
9017
|
}
|
|
8760
9018
|
animateComponent(props, defaultAnimationWhitelist) {
|
|
8761
9019
|
const animationWhitelist = typeof props.animate === "object" && props.animate?.animationWhitelist || defaultAnimationWhitelist;
|
|
8762
9020
|
const Comp = this.constructor;
|
|
8763
|
-
return /*#__PURE__*/
|
|
9021
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_8__.VictoryTransition, {
|
|
8764
9022
|
animate: props.animate,
|
|
8765
9023
|
animationWhitelist: animationWhitelist
|
|
8766
|
-
}, /*#__PURE__*/
|
|
9024
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Comp, props));
|
|
8767
9025
|
}
|
|
8768
9026
|
|
|
8769
9027
|
// Used by `VictoryLine` and `VictoryArea`
|
|
@@ -8778,12 +9036,12 @@ function addEvents(WrappedComponent, options) {
|
|
|
8778
9036
|
let newMemo = memo;
|
|
8779
9037
|
const labelProps = this.getComponentProps(labelComponent, "labels", key);
|
|
8780
9038
|
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
8781
|
-
newMemo = newMemo.concat( /*#__PURE__*/
|
|
9039
|
+
newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps));
|
|
8782
9040
|
}
|
|
8783
9041
|
return newMemo;
|
|
8784
9042
|
}, []);
|
|
8785
9043
|
const dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
8786
|
-
const children = [/*#__PURE__*/
|
|
9044
|
+
const children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(dataComponent, dataProps), ...labelComponents];
|
|
8787
9045
|
return this.renderContainer(groupComponent, children);
|
|
8788
9046
|
}
|
|
8789
9047
|
renderData(props, shouldRenderDatum) {
|
|
@@ -8798,14 +9056,14 @@ function addEvents(WrappedComponent, options) {
|
|
|
8798
9056
|
const dataComponents = this.dataKeys.reduce((validDataComponents, _dataKey, index) => {
|
|
8799
9057
|
const dataProps = this.getComponentProps(dataComponent, "data", index);
|
|
8800
9058
|
if (shouldRenderDatum(dataProps.datum)) {
|
|
8801
|
-
validDataComponents.push( /*#__PURE__*/
|
|
9059
|
+
validDataComponents.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(dataComponent, dataProps));
|
|
8802
9060
|
}
|
|
8803
9061
|
return validDataComponents;
|
|
8804
9062
|
}, []);
|
|
8805
9063
|
const labelComponents = this.dataKeys.map((_dataKey, index) => {
|
|
8806
9064
|
const labelProps = this.getComponentProps(labelComponent, "labels", index);
|
|
8807
9065
|
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
8808
|
-
return /*#__PURE__*/
|
|
9066
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps);
|
|
8809
9067
|
}
|
|
8810
9068
|
return undefined;
|
|
8811
9069
|
}).filter(Boolean);
|
|
@@ -8911,24 +9169,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8911
9169
|
/* harmony export */ "getStringsFromData": function() { return /* binding */ getStringsFromData; },
|
|
8912
9170
|
/* harmony export */ "isDataComponent": function() { return /* binding */ isDataComponent; }
|
|
8913
9171
|
/* harmony export */ });
|
|
8914
|
-
/* harmony import */ var
|
|
8915
|
-
/* harmony import */ var
|
|
8916
|
-
/* harmony import */ var
|
|
8917
|
-
/* harmony import */ var
|
|
9172
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
9173
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
9174
|
+
/* 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");
|
|
9175
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1__);
|
|
8918
9176
|
/* 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");
|
|
8919
9177
|
/* harmony import */ var lodash_isEqual__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isEqual__WEBPACK_IMPORTED_MODULE_2__);
|
|
8920
|
-
/* harmony import */ var
|
|
8921
|
-
/* harmony import */ var
|
|
8922
|
-
/* harmony import */ var
|
|
8923
|
-
/* harmony import */ var
|
|
8924
|
-
/* harmony import */ var
|
|
8925
|
-
/* harmony import */ var
|
|
8926
|
-
/* harmony import */ var
|
|
8927
|
-
/* harmony import */ var
|
|
8928
|
-
/* harmony import */ var
|
|
8929
|
-
/* harmony import */ var
|
|
8930
|
-
/* harmony import */ var
|
|
8931
|
-
/* harmony import */ var
|
|
9178
|
+
/* 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");
|
|
9179
|
+
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3__);
|
|
9180
|
+
/* 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");
|
|
9181
|
+
/* harmony import */ var lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4__);
|
|
9182
|
+
/* 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");
|
|
9183
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_omitBy__WEBPACK_IMPORTED_MODULE_5__);
|
|
9184
|
+
/* 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");
|
|
9185
|
+
/* harmony import */ var lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_orderBy__WEBPACK_IMPORTED_MODULE_6__);
|
|
9186
|
+
/* 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");
|
|
9187
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_7__);
|
|
9188
|
+
/* 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");
|
|
9189
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_8__);
|
|
8932
9190
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
8933
9191
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
8934
9192
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
@@ -8941,7 +9199,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8941
9199
|
|
|
8942
9200
|
|
|
8943
9201
|
|
|
8944
|
-
/* eslint-disable no-use-before-define */
|
|
8945
9202
|
|
|
8946
9203
|
|
|
8947
9204
|
|
|
@@ -8963,7 +9220,7 @@ function getLength(data) {
|
|
|
8963
9220
|
|
|
8964
9221
|
// Returns generated data for a given axis based on domain and sample from props
|
|
8965
9222
|
function generateDataArray(props, axis) {
|
|
8966
|
-
const propsDomain =
|
|
9223
|
+
const propsDomain = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_3___default()(props.domain) ? props.domain[axis] : props.domain;
|
|
8967
9224
|
const domain = propsDomain || _scale__WEBPACK_IMPORTED_MODULE_10__.getBaseScale(props, axis).domain();
|
|
8968
9225
|
const samples = props.samples || 1;
|
|
8969
9226
|
const domainMax = Math.max(...domain);
|
|
@@ -8988,7 +9245,7 @@ function sortData(dataset, sortKey, sortOrder) {
|
|
|
8988
9245
|
formattedSortKey = `_${sortKey}`;
|
|
8989
9246
|
}
|
|
8990
9247
|
const order = sortOrder === "ascending" ? "asc" : "desc";
|
|
8991
|
-
return
|
|
9248
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_6___default()(dataset, formattedSortKey, order);
|
|
8992
9249
|
}
|
|
8993
9250
|
|
|
8994
9251
|
// This method will remove data points that break certain scales. (log scale only)
|
|
@@ -9032,7 +9289,7 @@ function getEventKey(key) {
|
|
|
9032
9289
|
return () => undefined;
|
|
9033
9290
|
}
|
|
9034
9291
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
9035
|
-
return
|
|
9292
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_7___default()(key);
|
|
9036
9293
|
}
|
|
9037
9294
|
|
|
9038
9295
|
// Returns data with an eventKey prop added to each datum
|
|
@@ -9067,8 +9324,6 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
9067
9324
|
const isUnderMinY = underMin(minDomainY);
|
|
9068
9325
|
const isOverMaxX = overMax(maxDomainX);
|
|
9069
9326
|
const isOverMaxY = overMax(maxDomainY);
|
|
9070
|
-
|
|
9071
|
-
// eslint-disable-next-line complexity
|
|
9072
9327
|
return dataset.map(datum => {
|
|
9073
9328
|
let {
|
|
9074
9329
|
_x,
|
|
@@ -9093,12 +9348,12 @@ function formatDataFromDomain(dataset, domain, defaultBaseline) {
|
|
|
9093
9348
|
if (isUnderMinY(baseline) && !isUnderMinY(value)) _y0 = minDomainY;
|
|
9094
9349
|
// baseline and value with only baseline above max, set baseline to maxDomainY
|
|
9095
9350
|
if (isOverMaxY(baseline) && !isOverMaxY(value)) _y0 = maxDomainY;
|
|
9096
|
-
return Object.assign({}, datum,
|
|
9351
|
+
return Object.assign({}, datum, lodash_omitBy__WEBPACK_IMPORTED_MODULE_5___default()({
|
|
9097
9352
|
_x,
|
|
9098
9353
|
_y,
|
|
9099
9354
|
_y0,
|
|
9100
9355
|
_y1
|
|
9101
|
-
}, (
|
|
9356
|
+
}, (lodash_isUndefined__WEBPACK_IMPORTED_MODULE_4___default())));
|
|
9102
9357
|
});
|
|
9103
9358
|
}
|
|
9104
9359
|
|
|
@@ -9112,7 +9367,7 @@ function createStringMap(props, axis) {
|
|
|
9112
9367
|
const stringsFromAxes = getStringsFromAxes(props, axis);
|
|
9113
9368
|
const stringsFromCategories = getStringsFromCategories(props, axis);
|
|
9114
9369
|
const stringsFromData = getStringsFromData(props, axis);
|
|
9115
|
-
const allStrings =
|
|
9370
|
+
const allStrings = lodash_uniq__WEBPACK_IMPORTED_MODULE_8___default()([...stringsFromAxes, ...stringsFromCategories, ...stringsFromData]);
|
|
9116
9371
|
return allStrings.length === 0 ? null : allStrings.reduce((memo, string, index) => {
|
|
9117
9372
|
memo[string] = index + 1;
|
|
9118
9373
|
return memo;
|
|
@@ -9179,7 +9434,6 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9179
9434
|
};
|
|
9180
9435
|
}
|
|
9181
9436
|
const data = preformattedData ? dataset : dataset.reduce((dataArr, datum, index) => {
|
|
9182
|
-
// eslint-disable-line complexity
|
|
9183
9437
|
const parsedDatum = parseDatum(datum);
|
|
9184
9438
|
const fallbackValues = {
|
|
9185
9439
|
x: index,
|
|
@@ -9199,7 +9453,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9199
9453
|
return memo;
|
|
9200
9454
|
}, {});
|
|
9201
9455
|
const formattedDatum = Object.assign({}, processedValues, parsedDatum);
|
|
9202
|
-
if (!
|
|
9456
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_1___default()(formattedDatum)) {
|
|
9203
9457
|
dataArr.push(formattedDatum);
|
|
9204
9458
|
}
|
|
9205
9459
|
return dataArr;
|
|
@@ -9326,7 +9580,7 @@ function isDataComponent(component) {
|
|
|
9326
9580
|
};
|
|
9327
9581
|
let role = getRole(component);
|
|
9328
9582
|
if (role === "portal") {
|
|
9329
|
-
const children =
|
|
9583
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
9330
9584
|
role = children.length ? getRole(children[0]) : "";
|
|
9331
9585
|
}
|
|
9332
9586
|
const whitelist = ["area", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -9357,14 +9611,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9357
9611
|
/* harmony export */ "getSymmetricDomain": function() { return /* binding */ getSymmetricDomain; },
|
|
9358
9612
|
/* harmony export */ "isDomainComponent": function() { return /* binding */ isDomainComponent; }
|
|
9359
9613
|
/* harmony export */ });
|
|
9360
|
-
/* harmony import */ var
|
|
9361
|
-
/* harmony import */ var
|
|
9362
|
-
/* harmony import */ var
|
|
9363
|
-
/* harmony import */ var
|
|
9614
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
9615
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
9616
|
+
/* 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");
|
|
9617
|
+
/* harmony import */ var lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isDate__WEBPACK_IMPORTED_MODULE_1__);
|
|
9364
9618
|
/* 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");
|
|
9365
9619
|
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2__);
|
|
9366
|
-
/* harmony import */ var
|
|
9367
|
-
/* harmony import */ var
|
|
9620
|
+
/* 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");
|
|
9621
|
+
/* harmony import */ var lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3__);
|
|
9368
9622
|
/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./data */ "../../victory-core/es/victory-util/data.js");
|
|
9369
9623
|
/* harmony import */ var _scale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scale */ "../../victory-core/es/victory-util/scale.js");
|
|
9370
9624
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
@@ -9372,7 +9626,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9372
9626
|
|
|
9373
9627
|
|
|
9374
9628
|
|
|
9375
|
-
/* eslint-disable no-use-before-define */
|
|
9376
9629
|
|
|
9377
9630
|
|
|
9378
9631
|
|
|
@@ -9428,8 +9681,6 @@ function getExtremeFromData(dataset, axis, type) {
|
|
|
9428
9681
|
}, initialValue);
|
|
9429
9682
|
return containsDate ? new Date(result) : result;
|
|
9430
9683
|
}
|
|
9431
|
-
|
|
9432
|
-
// eslint-disable-next-line max-statements
|
|
9433
9684
|
function padDomain(domain, props, axis) {
|
|
9434
9685
|
if (!props.domainPadding) {
|
|
9435
9686
|
return domain;
|
|
@@ -9456,9 +9707,9 @@ function padDomain(domain, props, axis) {
|
|
|
9456
9707
|
max: max.valueOf() + simplePadding.right
|
|
9457
9708
|
};
|
|
9458
9709
|
const singleQuadrantDomainPadding = lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.singleQuadrantDomainPadding) ? props.singleQuadrantDomainPadding[axis] : props.singleQuadrantDomainPadding;
|
|
9459
|
-
const addsQuadrants = min >= 0 && paddedDomain.min <= 0 || max <= 0 && paddedDomain.max >= 0;
|
|
9710
|
+
const addsQuadrants = min.valueOf() >= 0 && paddedDomain.min <= 0 || max.valueOf() <= 0 && paddedDomain.max >= 0;
|
|
9460
9711
|
const adjust = (val, type) => {
|
|
9461
|
-
const coerce = type === "min" && min >= 0 && val <= 0 || type === "max" && max <= 0 && val >= 0;
|
|
9712
|
+
const coerce = type === "min" && min.valueOf() >= 0 && val <= 0 || type === "max" && max.valueOf() <= 0 && val >= 0;
|
|
9462
9713
|
return coerce ? 0 : val;
|
|
9463
9714
|
};
|
|
9464
9715
|
if (addsQuadrants && singleQuadrantDomainPadding !== false) {
|
|
@@ -9681,7 +9932,7 @@ function getMaxFromProps(props, axis) {
|
|
|
9681
9932
|
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.maxDomain) && props.maxDomain[axis] !== undefined) {
|
|
9682
9933
|
return props.maxDomain[axis];
|
|
9683
9934
|
}
|
|
9684
|
-
return typeof props.maxDomain === "number" ||
|
|
9935
|
+
return typeof props.maxDomain === "number" || lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default()(props.maxDomain) ? props.maxDomain : undefined;
|
|
9685
9936
|
}
|
|
9686
9937
|
|
|
9687
9938
|
/**
|
|
@@ -9694,7 +9945,7 @@ function getMinFromProps(props, axis) {
|
|
|
9694
9945
|
if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_2___default()(props.minDomain) && props.minDomain[axis] !== undefined) {
|
|
9695
9946
|
return props.minDomain[axis];
|
|
9696
9947
|
}
|
|
9697
|
-
return typeof props.minDomain === "number" ||
|
|
9948
|
+
return typeof props.minDomain === "number" || lodash_isDate__WEBPACK_IMPORTED_MODULE_1___default()(props.minDomain) ? props.minDomain : undefined;
|
|
9698
9949
|
}
|
|
9699
9950
|
|
|
9700
9951
|
/**
|
|
@@ -9705,7 +9956,7 @@ function getMinFromProps(props, axis) {
|
|
|
9705
9956
|
* @returns {Array} the symmetric domain
|
|
9706
9957
|
*/
|
|
9707
9958
|
function getSymmetricDomain(domain, values) {
|
|
9708
|
-
const processedData =
|
|
9959
|
+
const processedData = lodash_sortedUniq__WEBPACK_IMPORTED_MODULE_3___default()(values.sort((a, b) => a - b));
|
|
9709
9960
|
const step = processedData[1] - processedData[0];
|
|
9710
9961
|
return [domain[0], domain[1] + step];
|
|
9711
9962
|
}
|
|
@@ -9721,7 +9972,7 @@ function isDomainComponent(component) {
|
|
|
9721
9972
|
};
|
|
9722
9973
|
let role = getRole(component);
|
|
9723
9974
|
if (role === "portal") {
|
|
9724
|
-
const children =
|
|
9975
|
+
const children = react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(component.props.children);
|
|
9725
9976
|
role = children.length ? getRole(children[0]) : "";
|
|
9726
9977
|
}
|
|
9727
9978
|
const whitelist = ["area", "axis", "bar", "boxplot", "candlestick", "errorbar", "group", "histogram", "line", "pie", "scatter", "stack", "voronoi"];
|
|
@@ -9752,20 +10003,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9752
10003
|
/* harmony export */ "getScopedEvents": function() { return /* binding */ getScopedEvents; },
|
|
9753
10004
|
/* harmony export */ "omitGlobalEvents": function() { return /* binding */ omitGlobalEvents; }
|
|
9754
10005
|
/* harmony export */ });
|
|
9755
|
-
/* harmony import */ var
|
|
9756
|
-
/* harmony import */ var
|
|
9757
|
-
/* harmony import */ var
|
|
9758
|
-
/* harmony import */ var
|
|
9759
|
-
/* harmony import */ var
|
|
9760
|
-
/* harmony import */ var
|
|
9761
|
-
/* harmony import */ var
|
|
9762
|
-
/* harmony import */ var
|
|
10006
|
+
/* 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");
|
|
10007
|
+
/* harmony import */ var lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0__);
|
|
10008
|
+
/* 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");
|
|
10009
|
+
/* harmony import */ var lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_pickBy__WEBPACK_IMPORTED_MODULE_1__);
|
|
10010
|
+
/* 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");
|
|
10011
|
+
/* harmony import */ var lodash_omitBy__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_omitBy__WEBPACK_IMPORTED_MODULE_2__);
|
|
10012
|
+
/* 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");
|
|
10013
|
+
/* harmony import */ var lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_uniq__WEBPACK_IMPORTED_MODULE_3__);
|
|
9763
10014
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
9764
10015
|
|
|
9765
10016
|
|
|
9766
10017
|
|
|
9767
10018
|
|
|
9768
|
-
/* eslint-disable no-use-before-define */
|
|
9769
10019
|
|
|
9770
10020
|
const GLOBAL_EVENT_REGEX = /^onGlobal(.*)$/;
|
|
9771
10021
|
|
|
@@ -9813,11 +10063,10 @@ getScopedEvents) {
|
|
|
9813
10063
|
*/
|
|
9814
10064
|
const getAllEvents = () => {
|
|
9815
10065
|
// Mandatory usage: `getEvents.bind(this)`
|
|
9816
|
-
|
|
10066
|
+
|
|
9817
10067
|
if (Array.isArray(this.componentEvents)) {
|
|
9818
10068
|
return Array.isArray(props.events) ? this.componentEvents.concat(...props.events) : this.componentEvents;
|
|
9819
10069
|
}
|
|
9820
|
-
/* eslint-enable no-invalid-this */
|
|
9821
10070
|
return props.events;
|
|
9822
10071
|
};
|
|
9823
10072
|
const allEvents = getAllEvents();
|
|
@@ -9837,12 +10086,12 @@ getScopedEvents) {
|
|
|
9837
10086
|
*/
|
|
9838
10087
|
// eslint-disable-next-line max-params
|
|
9839
10088
|
function getScopedEvents(events, namespace, childType, baseProps) {
|
|
9840
|
-
if (
|
|
10089
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
9841
10090
|
return {};
|
|
9842
10091
|
}
|
|
9843
10092
|
|
|
9844
10093
|
// Mandatory usage: `getScopedEvents.bind(this)`
|
|
9845
|
-
|
|
10094
|
+
|
|
9846
10095
|
const newBaseProps = baseProps || this.baseProps;
|
|
9847
10096
|
// returns the original base props or base state of a given target element
|
|
9848
10097
|
const getTargetProps = (identifier, type) => {
|
|
@@ -9851,7 +10100,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
9851
10100
|
target,
|
|
9852
10101
|
key
|
|
9853
10102
|
} = identifier;
|
|
9854
|
-
// eslint-disable-next-line no-invalid-this
|
|
9855
10103
|
const baseType = type === "props" ? newBaseProps : this.state || {};
|
|
9856
10104
|
const base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
9857
10105
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
@@ -9878,7 +10126,6 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
9878
10126
|
|
|
9879
10127
|
// returns the state object with mutated props applied for a single key
|
|
9880
10128
|
const getMutationObject = (key, childName) => {
|
|
9881
|
-
// eslint-disable-next-line no-invalid-this
|
|
9882
10129
|
const baseState = this.state || {};
|
|
9883
10130
|
if (!(0,_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(eventReturn.mutation)) {
|
|
9884
10131
|
return baseState;
|
|
@@ -9951,11 +10198,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
9951
10198
|
// into a state mutation, and calls setState
|
|
9952
10199
|
// eslint-disable-next-line max-params
|
|
9953
10200
|
const onEvent = (evt, childProps, eventKey, eventName) => {
|
|
9954
|
-
// eslint-disable-next-line no-invalid-this
|
|
9955
10201
|
const eventReturn = events[eventName](evt, childProps, eventKey, this);
|
|
9956
|
-
if (!
|
|
10202
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(eventReturn)) {
|
|
9957
10203
|
const callbacks = compileCallbacks(eventReturn);
|
|
9958
|
-
// eslint-disable-next-line no-invalid-this
|
|
9959
10204
|
this.setState(parseEventReturn(eventReturn, eventKey), callbacks);
|
|
9960
10205
|
}
|
|
9961
10206
|
};
|
|
@@ -9985,7 +10230,7 @@ function getPartialEvents(events, eventKey, childProps) {
|
|
|
9985
10230
|
// eslint-disable-next-line max-params
|
|
9986
10231
|
function getEventState(eventKey, namespace, childType) {
|
|
9987
10232
|
// Mandatory usage: `getEventState.bind(this)`
|
|
9988
|
-
|
|
10233
|
+
|
|
9989
10234
|
const state = this.state || {};
|
|
9990
10235
|
if (!childType) {
|
|
9991
10236
|
return eventKey === "parent" ? state[eventKey] && state[eventKey][namespace] || state[eventKey] : state[eventKey] && state[eventKey][namespace];
|
|
@@ -10015,7 +10260,7 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
10015
10260
|
const childState = baseState[childName];
|
|
10016
10261
|
const mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
10017
10262
|
memo[childName] = mutation ? mutation : childState;
|
|
10018
|
-
return
|
|
10263
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
10019
10264
|
}, {});
|
|
10020
10265
|
}
|
|
10021
10266
|
|
|
@@ -10051,7 +10296,7 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
10051
10296
|
} else {
|
|
10052
10297
|
// use keys from both state and props so that elements not intially included in baseProps
|
|
10053
10298
|
// will be used. (i.e. labels)
|
|
10054
|
-
const targets =
|
|
10299
|
+
const targets = lodash_uniq__WEBPACK_IMPORTED_MODULE_3___default()(Object.keys(keyProps).concat(Object.keys(keyState)));
|
|
10055
10300
|
memo[eventKey] = targets.reduce((m, target) => {
|
|
10056
10301
|
const identifier = {
|
|
10057
10302
|
eventKey,
|
|
@@ -10060,10 +10305,10 @@ function getExternalMutations(mutations, baseProps, baseState, childName) {
|
|
|
10060
10305
|
};
|
|
10061
10306
|
const mutation = getExternalMutation(mutations, keyProps[target], keyState[target], identifier);
|
|
10062
10307
|
m[target] = mutation !== undefined ? Object.assign({}, keyState[target], mutation) : keyState[target];
|
|
10063
|
-
return
|
|
10308
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(m, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
10064
10309
|
}, {});
|
|
10065
10310
|
}
|
|
10066
|
-
return
|
|
10311
|
+
return lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(memo, v => !lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(v));
|
|
10067
10312
|
}, {});
|
|
10068
10313
|
}
|
|
10069
10314
|
|
|
@@ -10095,11 +10340,11 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
10095
10340
|
}
|
|
10096
10341
|
// find any mutation objects that match the target
|
|
10097
10342
|
const targetMutations = scopedMutations.filter(m => filterMutations(m, "target"));
|
|
10098
|
-
if (
|
|
10343
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(targetMutations)) {
|
|
10099
10344
|
return undefined;
|
|
10100
10345
|
}
|
|
10101
10346
|
const keyMutations = targetMutations.filter(m => filterMutations(m, "eventKey"));
|
|
10102
|
-
if (
|
|
10347
|
+
if (lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(keyMutations)) {
|
|
10103
10348
|
return undefined;
|
|
10104
10349
|
}
|
|
10105
10350
|
return keyMutations.reduce((memo, curr) => {
|
|
@@ -10125,8 +10370,8 @@ function getGlobalEventNameFromKey(key) {
|
|
|
10125
10370
|
const match = key.match(GLOBAL_EVENT_REGEX);
|
|
10126
10371
|
return match && match[1] && match[1].toLowerCase();
|
|
10127
10372
|
}
|
|
10128
|
-
const getGlobalEvents = events =>
|
|
10129
|
-
const omitGlobalEvents = events =>
|
|
10373
|
+
const getGlobalEvents = events => lodash_pickBy__WEBPACK_IMPORTED_MODULE_1___default()(events, (_, key) => GLOBAL_EVENT_REGEX.test(key));
|
|
10374
|
+
const omitGlobalEvents = events => lodash_omitBy__WEBPACK_IMPORTED_MODULE_2___default()(events, (_, key) => GLOBAL_EVENT_REGEX.test(key));
|
|
10130
10375
|
const emulateReactEvent = event => Object.assign(event, {
|
|
10131
10376
|
nativeEvent: event
|
|
10132
10377
|
});
|
|
@@ -10167,41 +10412,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10167
10412
|
/* harmony export */ "reduceChildren": function() { return /* binding */ reduceChildren; },
|
|
10168
10413
|
/* harmony export */ "scalePoint": function() { return /* binding */ scalePoint; }
|
|
10169
10414
|
/* harmony export */ });
|
|
10170
|
-
/* harmony import */ var
|
|
10171
|
-
/* harmony import */ var
|
|
10172
|
-
/* harmony import */ var
|
|
10173
|
-
/* harmony import */ var
|
|
10174
|
-
/* harmony import */ var
|
|
10175
|
-
/* harmony import */ var
|
|
10176
|
-
/* harmony import */ var
|
|
10177
|
-
/* harmony import */ var
|
|
10178
|
-
|
|
10415
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
10416
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
10417
|
+
/* 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");
|
|
10418
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
10419
|
+
/* 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");
|
|
10420
|
+
/* harmony import */ var lodash_property__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_property__WEBPACK_IMPORTED_MODULE_2__);
|
|
10421
|
+
/* 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");
|
|
10422
|
+
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_3__);
|
|
10179
10423
|
|
|
10180
10424
|
|
|
10181
|
-
/* eslint-disable no-use-before-define */
|
|
10182
10425
|
|
|
10183
|
-
// Private Functions
|
|
10184
10426
|
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10427
|
+
/**
|
|
10428
|
+
* Determine the range of a cartesian axis
|
|
10429
|
+
*/
|
|
10430
|
+
function getCartesianRange(options) {
|
|
10431
|
+
const vertical = options.axis !== "x";
|
|
10189
10432
|
if (vertical) {
|
|
10190
|
-
return [
|
|
10433
|
+
return [options.height - options.padding.bottom, options.padding.top];
|
|
10191
10434
|
}
|
|
10192
|
-
return [padding.left,
|
|
10435
|
+
return [options.padding.left, options.width - options.padding.right];
|
|
10193
10436
|
}
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10437
|
+
|
|
10438
|
+
/**
|
|
10439
|
+
* Determine the range of a polar axis in radians
|
|
10440
|
+
*/
|
|
10441
|
+
function getPolarRange(options) {
|
|
10442
|
+
if (options.axis === "x") {
|
|
10443
|
+
const startAngle = degreesToRadians(options.startAngle || 0);
|
|
10444
|
+
const endAngle = degreesToRadians(options.endAngle || 360);
|
|
10198
10445
|
return [startAngle, endAngle];
|
|
10199
10446
|
}
|
|
10200
|
-
return [
|
|
10447
|
+
return [options.innerRadius || 0, getRadius({
|
|
10448
|
+
height: options.height,
|
|
10449
|
+
width: options.width,
|
|
10450
|
+
padding: options.padding
|
|
10451
|
+
})];
|
|
10201
10452
|
}
|
|
10202
10453
|
|
|
10203
|
-
// Exported Functions
|
|
10204
|
-
|
|
10205
10454
|
/**
|
|
10206
10455
|
* Creates an object composed of the inverted keys and values of object.
|
|
10207
10456
|
* If object contains duplicate values, subsequent values overwrite property assignments of previous values.
|
|
@@ -10238,8 +10487,11 @@ function omit(originalObject, ks) {
|
|
|
10238
10487
|
}
|
|
10239
10488
|
return newObject;
|
|
10240
10489
|
}
|
|
10490
|
+
|
|
10491
|
+
/**
|
|
10492
|
+
* Coalesce the x and y values from a data point
|
|
10493
|
+
*/
|
|
10241
10494
|
function getPoint(datum) {
|
|
10242
|
-
const exists = val => val !== undefined;
|
|
10243
10495
|
const {
|
|
10244
10496
|
_x,
|
|
10245
10497
|
_x1,
|
|
@@ -10250,16 +10502,20 @@ function getPoint(datum) {
|
|
|
10250
10502
|
_y0,
|
|
10251
10503
|
_voronoiY
|
|
10252
10504
|
} = datum;
|
|
10253
|
-
const defaultX =
|
|
10254
|
-
const defaultY =
|
|
10505
|
+
const defaultX = _x1 ?? _x;
|
|
10506
|
+
const defaultY = _y1 ?? _y;
|
|
10255
10507
|
const point = {
|
|
10256
|
-
x:
|
|
10257
|
-
x0:
|
|
10258
|
-
y:
|
|
10259
|
-
y0:
|
|
10508
|
+
x: _voronoiX ?? defaultX,
|
|
10509
|
+
x0: _x0 ?? _x,
|
|
10510
|
+
y: _voronoiY ?? defaultY,
|
|
10511
|
+
y0: _y0 ?? _y
|
|
10260
10512
|
};
|
|
10261
|
-
return
|
|
10513
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, point, datum);
|
|
10262
10514
|
}
|
|
10515
|
+
|
|
10516
|
+
/**
|
|
10517
|
+
* Scale a point based on the origin, direction, and given scale function
|
|
10518
|
+
*/
|
|
10263
10519
|
function scalePoint(props, datum) {
|
|
10264
10520
|
const {
|
|
10265
10521
|
scale,
|
|
@@ -10282,11 +10538,11 @@ function scalePoint(props, datum) {
|
|
|
10282
10538
|
y0: polar ? -y0 * Math.sin(x0) + origin.x : y0
|
|
10283
10539
|
};
|
|
10284
10540
|
}
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10541
|
+
|
|
10542
|
+
/**
|
|
10543
|
+
* Returns a padding value from a number or partial padding values
|
|
10544
|
+
*/
|
|
10545
|
+
function getPadding(padding) {
|
|
10290
10546
|
const paddingVal = typeof padding === "number" ? padding : 0;
|
|
10291
10547
|
const paddingObj = typeof padding === "object" ? padding : {};
|
|
10292
10548
|
return {
|
|
@@ -10296,6 +10552,10 @@ function getPadding(props, name) {
|
|
|
10296
10552
|
right: paddingObj.right || paddingVal
|
|
10297
10553
|
};
|
|
10298
10554
|
}
|
|
10555
|
+
|
|
10556
|
+
/**
|
|
10557
|
+
* Returns true if the component is defined as a tooltip
|
|
10558
|
+
*/
|
|
10299
10559
|
function isTooltip(component) {
|
|
10300
10560
|
const labelRole = component && component.type && component.type.role;
|
|
10301
10561
|
return labelRole === "tooltip";
|
|
@@ -10310,8 +10570,8 @@ function getDefaultStyles(props, role) {
|
|
|
10310
10570
|
return defaultStyles;
|
|
10311
10571
|
}
|
|
10312
10572
|
const tooltipStyle = theme.tooltip && theme.tooltip.style || {};
|
|
10313
|
-
const labelStyle =
|
|
10314
|
-
return
|
|
10573
|
+
const labelStyle = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, tooltipStyle, defaultStyles.labels);
|
|
10574
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, {
|
|
10315
10575
|
labels: labelStyle
|
|
10316
10576
|
}, defaultStyles);
|
|
10317
10577
|
}
|
|
@@ -10319,7 +10579,7 @@ function getStyles(style, defaultStyles) {
|
|
|
10319
10579
|
const width = "100%";
|
|
10320
10580
|
const height = "100%";
|
|
10321
10581
|
if (!style) {
|
|
10322
|
-
return
|
|
10582
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
10323
10583
|
parent: {
|
|
10324
10584
|
height,
|
|
10325
10585
|
width
|
|
@@ -10335,14 +10595,18 @@ function getStyles(style, defaultStyles) {
|
|
|
10335
10595
|
const defaultLabels = defaultStyles && defaultStyles.labels || {};
|
|
10336
10596
|
const defaultData = defaultStyles && defaultStyles.data || {};
|
|
10337
10597
|
return {
|
|
10338
|
-
parent:
|
|
10598
|
+
parent: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, parent, defaultParent, {
|
|
10339
10599
|
width,
|
|
10340
10600
|
height
|
|
10341
10601
|
}),
|
|
10342
|
-
labels:
|
|
10343
|
-
data:
|
|
10602
|
+
labels: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, labels, defaultLabels),
|
|
10603
|
+
data: lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, data, defaultData)
|
|
10344
10604
|
};
|
|
10345
10605
|
}
|
|
10606
|
+
|
|
10607
|
+
/**
|
|
10608
|
+
* Returns the value of a prop or accessor function with the given props
|
|
10609
|
+
*/
|
|
10346
10610
|
function evaluateProp(prop, props) {
|
|
10347
10611
|
return isFunction(prop) ? prop(props) : prop;
|
|
10348
10612
|
}
|
|
@@ -10364,19 +10628,28 @@ function degreesToRadians(degrees) {
|
|
|
10364
10628
|
function radiansToDegrees(radians) {
|
|
10365
10629
|
return typeof radians === "number" ? radians / (Math.PI / 180) : radians;
|
|
10366
10630
|
}
|
|
10367
|
-
|
|
10631
|
+
|
|
10632
|
+
/**
|
|
10633
|
+
* Get the maximum radius that will fit in the container
|
|
10634
|
+
*/
|
|
10635
|
+
function getRadius(options) {
|
|
10636
|
+
const {
|
|
10637
|
+
width,
|
|
10638
|
+
height,
|
|
10639
|
+
padding
|
|
10640
|
+
} = options;
|
|
10368
10641
|
const {
|
|
10369
10642
|
left,
|
|
10370
10643
|
right,
|
|
10371
10644
|
top,
|
|
10372
10645
|
bottom
|
|
10373
|
-
} =
|
|
10374
|
-
const {
|
|
10375
|
-
width,
|
|
10376
|
-
height
|
|
10377
|
-
} = props;
|
|
10646
|
+
} = padding;
|
|
10378
10647
|
return Math.min(width - left - right, height - top - bottom) / 2;
|
|
10379
10648
|
}
|
|
10649
|
+
|
|
10650
|
+
/**
|
|
10651
|
+
* Returns the origin for a polar chart within the padded area
|
|
10652
|
+
*/
|
|
10380
10653
|
function getPolarOrigin(props) {
|
|
10381
10654
|
const {
|
|
10382
10655
|
width,
|
|
@@ -10387,7 +10660,7 @@ function getPolarOrigin(props) {
|
|
|
10387
10660
|
bottom,
|
|
10388
10661
|
left,
|
|
10389
10662
|
right
|
|
10390
|
-
} = getPadding(props);
|
|
10663
|
+
} = getPadding(props.padding);
|
|
10391
10664
|
const radius = Math.min(width - left - right, height - top - bottom) / 2;
|
|
10392
10665
|
const offsetWidth = width / 2 + left - right;
|
|
10393
10666
|
const offsetHeight = height / 2 + top - bottom;
|
|
@@ -10396,13 +10669,30 @@ function getPolarOrigin(props) {
|
|
|
10396
10669
|
y: offsetHeight + radius > height ? radius + top - bottom : offsetHeight
|
|
10397
10670
|
};
|
|
10398
10671
|
}
|
|
10672
|
+
|
|
10673
|
+
/**
|
|
10674
|
+
* Determine the range of an axis based on the given props
|
|
10675
|
+
*/
|
|
10399
10676
|
function getRange(props, axis) {
|
|
10400
10677
|
if (props.range && props.range[axis]) {
|
|
10401
10678
|
return props.range[axis];
|
|
10402
10679
|
} else if (props.range && Array.isArray(props.range)) {
|
|
10403
10680
|
return props.range;
|
|
10404
10681
|
}
|
|
10405
|
-
return props.polar ? getPolarRange(
|
|
10682
|
+
return props.polar ? getPolarRange({
|
|
10683
|
+
axis,
|
|
10684
|
+
innerRadius: props.innerRadius,
|
|
10685
|
+
startAngle: props.startAngle,
|
|
10686
|
+
endAngle: props.endAngle,
|
|
10687
|
+
height: props.height,
|
|
10688
|
+
width: props.width,
|
|
10689
|
+
padding: getPadding(props.padding)
|
|
10690
|
+
}) : getCartesianRange({
|
|
10691
|
+
axis,
|
|
10692
|
+
height: props.height,
|
|
10693
|
+
width: props.width,
|
|
10694
|
+
padding: getPadding(props.padding)
|
|
10695
|
+
});
|
|
10406
10696
|
}
|
|
10407
10697
|
|
|
10408
10698
|
/**
|
|
@@ -10434,7 +10724,7 @@ function createAccessor(key) {
|
|
|
10434
10724
|
return x => x;
|
|
10435
10725
|
}
|
|
10436
10726
|
// otherwise, assume it is an array index, property key or path (_.property handles all three)
|
|
10437
|
-
return
|
|
10727
|
+
return lodash_property__WEBPACK_IMPORTED_MODULE_2___default()(key);
|
|
10438
10728
|
}
|
|
10439
10729
|
function modifyProps(props, fallbackProps, role) {
|
|
10440
10730
|
const theme = props.theme && props.theme[role] ? props.theme[role] : {};
|
|
@@ -10443,7 +10733,7 @@ function modifyProps(props, fallbackProps, role) {
|
|
|
10443
10733
|
const defaultObject = horizontal === undefined ? {} : {
|
|
10444
10734
|
horizontal
|
|
10445
10735
|
};
|
|
10446
|
-
return
|
|
10736
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()(defaultObject, props, themeProps, fallbackProps);
|
|
10447
10737
|
}
|
|
10448
10738
|
|
|
10449
10739
|
/**
|
|
@@ -10530,10 +10820,10 @@ initialMemo, combine) {
|
|
|
10530
10820
|
const childRole = child.type && child.type.role;
|
|
10531
10821
|
const childName = child.props.name || `${childRole}-${names[index]}`;
|
|
10532
10822
|
if (child.props && child.props.children) {
|
|
10533
|
-
const childProps = Object.assign({}, child.props,
|
|
10534
|
-
const nestedChildren = child.type && child.type.role === "stack" && isFunction(child.type.getChildren) ? child.type.getChildren(childProps) :
|
|
10535
|
-
const nestedChildProps = Object.assign({}, c.props,
|
|
10536
|
-
return /*#__PURE__*/
|
|
10823
|
+
const childProps = Object.assign({}, child.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(parentProps, sharedProps));
|
|
10824
|
+
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 => {
|
|
10825
|
+
const nestedChildProps = Object.assign({}, c.props, lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(childProps, sharedProps));
|
|
10826
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(c, nestedChildProps);
|
|
10537
10827
|
});
|
|
10538
10828
|
const childNames = nestedChildren.map((c, i) => `${childName}-${i}`);
|
|
10539
10829
|
const nestedResults = traverseChildren(nestedChildren, childNames, child);
|
|
@@ -10547,7 +10837,7 @@ initialMemo, combine) {
|
|
|
10547
10837
|
return newMemo;
|
|
10548
10838
|
}, initialMemo);
|
|
10549
10839
|
};
|
|
10550
|
-
const validChildren = children.filter(
|
|
10840
|
+
const validChildren = children.filter(react__WEBPACK_IMPORTED_MODULE_0__.isValidElement);
|
|
10551
10841
|
const childNames = validChildren.map((c, i) => i);
|
|
10552
10842
|
return traverseChildren(validChildren, childNames);
|
|
10553
10843
|
}
|
|
@@ -10567,10 +10857,10 @@ function isHorizontal(props) {
|
|
|
10567
10857
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
10568
10858
|
return memo || childProps.horizontal;
|
|
10569
10859
|
}
|
|
10570
|
-
return traverseChildren(
|
|
10860
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(childProps.children));
|
|
10571
10861
|
}, false);
|
|
10572
10862
|
};
|
|
10573
|
-
return traverseChildren(
|
|
10863
|
+
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(props.children));
|
|
10574
10864
|
}
|
|
10575
10865
|
|
|
10576
10866
|
/***/ }),
|
|
@@ -10643,11 +10933,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10643
10933
|
/* harmony export */ "getProps": function() { return /* binding */ getProps; },
|
|
10644
10934
|
/* harmony export */ "getText": function() { return /* binding */ getText; }
|
|
10645
10935
|
/* harmony export */ });
|
|
10936
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
10646
10937
|
/* 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");
|
|
10647
10938
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
10648
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
10649
10939
|
|
|
10650
|
-
|
|
10940
|
+
|
|
10651
10941
|
|
|
10652
10942
|
// Private Functions
|
|
10653
10943
|
|
|
@@ -10892,11 +11182,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10892
11182
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10893
11183
|
/* harmony export */ "warn": function() { return /* binding */ warn; }
|
|
10894
11184
|
/* harmony export */ });
|
|
10895
|
-
/* global console */
|
|
11185
|
+
/* global console process */
|
|
10896
11186
|
/* eslint-disable no-console */
|
|
10897
11187
|
|
|
10898
|
-
// TODO: Use "warning" npm module like React is switching to.
|
|
10899
11188
|
function warn(message) {
|
|
11189
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
11190
|
+
// @ts-ignore - Webpack DefinePlugin will replace process.env.NODE_ENV
|
|
10900
11191
|
if (true) {
|
|
10901
11192
|
if (console && console.warn) {
|
|
10902
11193
|
console.warn(message);
|
|
@@ -10967,7 +11258,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10967
11258
|
/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./collection */ "../../victory-core/es/victory-util/collection.js");
|
|
10968
11259
|
/* harmony import */ var victory_vendor_d3_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-vendor/d3-scale */ "../../victory-vendor/es/d3-scale.js");
|
|
10969
11260
|
|
|
10970
|
-
/* eslint-disable no-use-before-define */
|
|
10971
11261
|
|
|
10972
11262
|
|
|
10973
11263
|
|
|
@@ -11190,13 +11480,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11190
11480
|
/* harmony export */ "approximateTextSize": function() { return /* binding */ approximateTextSize; },
|
|
11191
11481
|
/* harmony export */ "convertLengthToPixels": function() { return /* binding */ convertLengthToPixels; }
|
|
11192
11482
|
/* harmony export */ });
|
|
11193
|
-
/* harmony import */ var
|
|
11194
|
-
/* harmony import */ var
|
|
11195
|
-
/* harmony import */ var
|
|
11196
|
-
/* harmony import */ var
|
|
11197
|
-
|
|
11198
|
-
// http://www.pearsonified.com/2012/01/characters-per-line.php
|
|
11483
|
+
/* 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");
|
|
11484
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
11485
|
+
/* 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");
|
|
11486
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_1__);
|
|
11487
|
+
// http://www.pearsonified.com/2012/01/characters-per-line.php
|
|
11199
11488
|
/* eslint-disable no-magic-numbers */
|
|
11489
|
+
|
|
11490
|
+
|
|
11491
|
+
|
|
11200
11492
|
// Based on measuring specific character widths
|
|
11201
11493
|
// as in the following example https://bl.ocks.org/tophtucker/62f93a4658387bb61e4510c37e2e97cf
|
|
11202
11494
|
// For new fonts: pull gist, open index.html locally, add font files (if not generic), enter font name in `font-family` input
|
|
@@ -11375,7 +11667,7 @@ const convertLengthToPixels = (length, fontSize) => {
|
|
|
11375
11667
|
};
|
|
11376
11668
|
const _prepareParams = (inputStyle, index) => {
|
|
11377
11669
|
const lineStyle = Array.isArray(inputStyle) ? inputStyle[index] : inputStyle;
|
|
11378
|
-
const style =
|
|
11670
|
+
const style = lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, lineStyle, defaultStyle);
|
|
11379
11671
|
return Object.assign({}, style, {
|
|
11380
11672
|
fontFamily: style.fontFamily,
|
|
11381
11673
|
letterSpacing: typeof style.letterSpacing === "number" ? style.letterSpacing : convertLengthToPixels(String(style.letterSpacing), style.fontSize),
|
|
@@ -11423,7 +11715,7 @@ const _approximateDimensionsInternal = (text, style) => {
|
|
|
11423
11715
|
height: heightWithRotate * coefficients.heightOverlapCoef
|
|
11424
11716
|
};
|
|
11425
11717
|
};
|
|
11426
|
-
const _getMeasurementContainer =
|
|
11718
|
+
const _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()(() => {
|
|
11427
11719
|
const element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
11428
11720
|
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
11429
11721
|
element.setAttribute("width", "300");
|
|
@@ -11444,7 +11736,7 @@ const styleToKeyComponent = style => {
|
|
|
11444
11736
|
}
|
|
11445
11737
|
return `${style.angle}:${style.fontFamily}:${style.fontSize}:${style.letterSpacing}:${style.lineHeight}`;
|
|
11446
11738
|
};
|
|
11447
|
-
const _measureDimensionsInternal =
|
|
11739
|
+
const _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_1___default()((text, style) => {
|
|
11448
11740
|
let containerElement = _getMeasurementContainer();
|
|
11449
11741
|
if (!containerElement.isConnected) {
|
|
11450
11742
|
_getMeasurementContainer.cache.clear?.();
|
|
@@ -11614,12 +11906,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11614
11906
|
/* harmony export */ "getInitialTransitionState": function() { return /* binding */ getInitialTransitionState; },
|
|
11615
11907
|
/* harmony export */ "getTransitionPropsFactory": function() { return /* binding */ getTransitionPropsFactory; }
|
|
11616
11908
|
/* harmony export */ });
|
|
11617
|
-
/* harmony import */ var
|
|
11618
|
-
/* harmony import */ var
|
|
11909
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
11910
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
11619
11911
|
/* 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");
|
|
11620
11912
|
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_1__);
|
|
11621
|
-
/* harmony import */ var
|
|
11622
|
-
/* harmony import */ var
|
|
11913
|
+
/* 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");
|
|
11914
|
+
/* harmony import */ var lodash_identity__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_identity__WEBPACK_IMPORTED_MODULE_2__);
|
|
11623
11915
|
|
|
11624
11916
|
|
|
11625
11917
|
|
|
@@ -11710,13 +12002,13 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
11710
12002
|
const getTransitionsFromChildren = (old, next) => {
|
|
11711
12003
|
return old.map((child, idx) => {
|
|
11712
12004
|
if (child && child.props && child.props.children && next[idx]) {
|
|
11713
|
-
return getTransitionsFromChildren(
|
|
12005
|
+
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));
|
|
11714
12006
|
}
|
|
11715
12007
|
// get Transition entering and exiting nodes
|
|
11716
12008
|
return getTransition(child, next[idx]);
|
|
11717
12009
|
});
|
|
11718
12010
|
};
|
|
11719
|
-
const childrenTransitions = getTransitionsFromChildren(
|
|
12011
|
+
const childrenTransitions = getTransitionsFromChildren(react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(oldChildren), react__WEBPACK_IMPORTED_MODULE_0___default().Children.toArray(nextChildren));
|
|
11720
12012
|
return {
|
|
11721
12013
|
nodesWillExit,
|
|
11722
12014
|
nodesWillEnter,
|
|
@@ -11730,7 +12022,7 @@ function getInitialTransitionState(oldChildren, nextChildren) {
|
|
|
11730
12022
|
};
|
|
11731
12023
|
}
|
|
11732
12024
|
function getInitialChildProps(animate, data) {
|
|
11733
|
-
const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (
|
|
12025
|
+
const after = animate.onEnter && animate.onEnter.after ? animate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11734
12026
|
return {
|
|
11735
12027
|
data: data.map((datum, idx) => Object.assign({}, datum, after(datum, idx, data)))
|
|
11736
12028
|
};
|
|
@@ -11747,7 +12039,7 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
11747
12039
|
data
|
|
11748
12040
|
};
|
|
11749
12041
|
}
|
|
11750
|
-
const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (
|
|
12042
|
+
const before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11751
12043
|
// If nodes need to exit, transform them with the provided onLoad.before function.
|
|
11752
12044
|
const newData = data.map((datum, idx) => {
|
|
11753
12045
|
return Object.assign({}, datum, before(datum, idx, data));
|
|
@@ -11758,8 +12050,6 @@ function getChildBeforeLoad(animate, child, data, cb) {
|
|
|
11758
12050
|
clipWidth: 0
|
|
11759
12051
|
};
|
|
11760
12052
|
}
|
|
11761
|
-
|
|
11762
|
-
// eslint-disable-next-line max-params
|
|
11763
12053
|
function getChildOnLoad(animate, data, cb) {
|
|
11764
12054
|
const newAnimate = Object.assign({}, animate, {
|
|
11765
12055
|
onEnd: cb
|
|
@@ -11771,7 +12061,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
11771
12061
|
data
|
|
11772
12062
|
};
|
|
11773
12063
|
}
|
|
11774
|
-
const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (
|
|
12064
|
+
const after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11775
12065
|
// If nodes need to exit, transform them with the provided onLoad.after function.
|
|
11776
12066
|
newData = data.map((datum, idx) => {
|
|
11777
12067
|
return Object.assign({}, datum, after(datum, idx, data));
|
|
@@ -11782,7 +12072,7 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
11782
12072
|
};
|
|
11783
12073
|
}
|
|
11784
12074
|
|
|
11785
|
-
// eslint-disable-next-line max-params
|
|
12075
|
+
// eslint-disable-next-line max-params
|
|
11786
12076
|
function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
11787
12077
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
11788
12078
|
// transition for all children to have the same duration, delay, etc.
|
|
@@ -11793,7 +12083,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
11793
12083
|
// After the exit transition occurs, trigger the animations for
|
|
11794
12084
|
// nodes that are neither exiting nor entering.
|
|
11795
12085
|
animate.onEnd = cb;
|
|
11796
|
-
const before = animate.onExit && animate.onExit.before ? animate.onExit.before : (
|
|
12086
|
+
const before = animate.onExit && animate.onExit.before ? animate.onExit.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11797
12087
|
// If nodes need to exit, transform them with the provided onExit.before function.
|
|
11798
12088
|
newData = data.map((datum, idx) => {
|
|
11799
12089
|
const key = (datum.key || idx).toString();
|
|
@@ -11806,7 +12096,7 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
11806
12096
|
};
|
|
11807
12097
|
}
|
|
11808
12098
|
|
|
11809
|
-
// eslint-disable-next-line max-params
|
|
12099
|
+
// eslint-disable-next-line max-params
|
|
11810
12100
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
11811
12101
|
let newAnimate = animate;
|
|
11812
12102
|
let newData = data;
|
|
@@ -11816,7 +12106,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
11816
12106
|
newAnimate = Object.assign({}, animate, {
|
|
11817
12107
|
onEnd: cb
|
|
11818
12108
|
});
|
|
11819
|
-
const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (
|
|
12109
|
+
const before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11820
12110
|
// We want the entering nodes to be included in the transition target
|
|
11821
12111
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
11822
12112
|
// so perform the `onEnter.before` transformation on each node.
|
|
@@ -11831,7 +12121,7 @@ function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
|
11831
12121
|
};
|
|
11832
12122
|
}
|
|
11833
12123
|
|
|
11834
|
-
// eslint-disable-next-line max-params
|
|
12124
|
+
// eslint-disable-next-line max-params
|
|
11835
12125
|
function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
11836
12126
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
11837
12127
|
// transition for all children to have the same duration, delay, etc.
|
|
@@ -11843,7 +12133,7 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
11843
12133
|
// domain should encompass the nodes that will now enter. So perform
|
|
11844
12134
|
// the `onEnter.after` transformation on each node.
|
|
11845
12135
|
newAnimate.onEnd = cb;
|
|
11846
|
-
const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (
|
|
12136
|
+
const after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_2___default());
|
|
11847
12137
|
newData = data.map((datum, idx) => {
|
|
11848
12138
|
const key = getDatumKey(datum, idx);
|
|
11849
12139
|
return enteringNodes[key] ? Object.assign({}, datum, after(datum, idx, data)) : datum;
|
|
@@ -11938,8 +12228,6 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
11938
12228
|
}
|
|
11939
12229
|
return {};
|
|
11940
12230
|
};
|
|
11941
|
-
|
|
11942
|
-
// eslint-disable-next-line max-statements, complexity, max-len
|
|
11943
12231
|
return function getTransitionProps(child, index) {
|
|
11944
12232
|
const data = getChildData(child) || [];
|
|
11945
12233
|
const animate = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, props.animate, child.props.animate);
|