victory-stack 36.8.1 → 36.8.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 +12 -0
- package/dist/victory-stack.js +170 -171
- package/dist/victory-stack.min.js +1 -1
- package/es/helper-methods.d.ts +2 -2
- package/es/helper-methods.js +26 -28
- package/es/victory-stack.d.ts +1 -0
- package/es/victory-stack.js +10 -9
- package/lib/helper-methods.d.ts +2 -2
- package/lib/helper-methods.js +30 -28
- package/lib/victory-stack.d.ts +1 -0
- package/lib/victory-stack.js +11 -9
- package/package.json +3 -3
- package/src/helper-methods.tsx +32 -24
- package/src/victory-stack.tsx +11 -9
package/dist/victory-stack.js
CHANGED
|
@@ -88,13 +88,13 @@ function fillData(props, datasets) {
|
|
|
88
88
|
var indexOffset = 0;
|
|
89
89
|
var isDate = dataset[0] && dataset[0]._x instanceof Date;
|
|
90
90
|
var filledInData = xArr.map(function (x, index) {
|
|
91
|
-
|
|
91
|
+
var parsedX = Number(x);
|
|
92
92
|
var datum = dataset[index - indexOffset];
|
|
93
93
|
|
|
94
94
|
if (datum) {
|
|
95
95
|
var x1 = isDate ? datum._x.getTime() : datum._x;
|
|
96
96
|
|
|
97
|
-
if (x1 ===
|
|
97
|
+
if (x1 === parsedX) {
|
|
98
98
|
return datum;
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -102,21 +102,21 @@ function fillData(props, datasets) {
|
|
|
102
102
|
|
|
103
103
|
var _y = fillInMissingData ? 0 : null;
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
parsedX = isDate ? new Date(parsedX) : parsedX;
|
|
106
106
|
return {
|
|
107
|
-
x:
|
|
107
|
+
x: parsedX,
|
|
108
108
|
y: _y,
|
|
109
|
-
_x:
|
|
109
|
+
_x: parsedX,
|
|
110
110
|
_y: _y
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
var y = fillInMissingData ? 0 : null;
|
|
115
|
-
|
|
115
|
+
parsedX = isDate ? new Date(parsedX) : parsedX;
|
|
116
116
|
return {
|
|
117
|
-
x:
|
|
117
|
+
x: parsedX,
|
|
118
118
|
y: y,
|
|
119
|
-
_x:
|
|
119
|
+
_x: parsedX,
|
|
120
120
|
_y: y
|
|
121
121
|
};
|
|
122
122
|
});
|
|
@@ -180,14 +180,14 @@ function stackData(props, childComponents) {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
function getCalculatedProps(
|
|
184
|
-
|
|
183
|
+
function getCalculatedProps(initialProps, childComponents) {
|
|
184
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_3___default().Children.toArray(initialProps.children);
|
|
185
185
|
var role = "stack";
|
|
186
|
-
props = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(
|
|
186
|
+
var props = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(initialProps, fallbackProps, role);
|
|
187
187
|
var style = victory_core__WEBPACK_IMPORTED_MODULE_5__.getStyle(props.theme, props.style, role);
|
|
188
|
-
var categories = props.categories || victory_core__WEBPACK_IMPORTED_MODULE_5__.getCategories(props,
|
|
189
|
-
var datasets = props.datasets || stackData(props,
|
|
190
|
-
var
|
|
188
|
+
var categories = props.categories || victory_core__WEBPACK_IMPORTED_MODULE_5__.getCategories(props, children);
|
|
189
|
+
var datasets = props.datasets || stackData(props, children);
|
|
190
|
+
var clonedChildren = children.map(function (c, i) {
|
|
191
191
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().cloneElement(c, {
|
|
192
192
|
data: datasets[i]
|
|
193
193
|
});
|
|
@@ -195,10 +195,10 @@ function getCalculatedProps(props, childComponents) {
|
|
|
195
195
|
var domain = {
|
|
196
196
|
x: victory_core__WEBPACK_IMPORTED_MODULE_5__.getDomain(lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, props, {
|
|
197
197
|
categories: categories
|
|
198
|
-
}), "x",
|
|
198
|
+
}), "x", clonedChildren),
|
|
199
199
|
y: victory_core__WEBPACK_IMPORTED_MODULE_5__.getDomain(lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, props, {
|
|
200
200
|
categories: categories
|
|
201
|
-
}), "y",
|
|
201
|
+
}), "y", clonedChildren)
|
|
202
202
|
};
|
|
203
203
|
var range = props.range || {
|
|
204
204
|
x: victory_core__WEBPACK_IMPORTED_MODULE_6__.getRange(props, "x"),
|
|
@@ -212,9 +212,8 @@ function getCalculatedProps(props, childComponents) {
|
|
|
212
212
|
x: baseScale.x.domain(domain.x).range(props.horizontal ? range.y : range.x),
|
|
213
213
|
y: baseScale.y.domain(domain.y).range(props.horizontal ? range.x : range.y)
|
|
214
214
|
};
|
|
215
|
-
var
|
|
216
|
-
|
|
217
|
-
horizontal = _props.horizontal;
|
|
215
|
+
var colorScale = props.colorScale,
|
|
216
|
+
horizontal = props.horizontal;
|
|
218
217
|
return {
|
|
219
218
|
datasets: datasets,
|
|
220
219
|
categories: categories,
|
|
@@ -300,18 +299,17 @@ function getColorScale(props, child) {
|
|
|
300
299
|
return props.theme ? colorScaleOptions || props.theme.props.colorScale : colorScaleOptions;
|
|
301
300
|
}
|
|
302
301
|
|
|
303
|
-
function getChildren(
|
|
304
|
-
props = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
var
|
|
308
|
-
|
|
309
|
-
var childProps = getChildProps(props, calculatedProps);
|
|
302
|
+
function getChildren(initialProps, childComponents, calculatedProps) {
|
|
303
|
+
var props = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(initialProps, fallbackProps, "stack");
|
|
304
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_3___default().Children.toArray(props.children);
|
|
305
|
+
var newCalculatedProps = calculatedProps || getCalculatedProps(props, children);
|
|
306
|
+
var datasets = newCalculatedProps.datasets;
|
|
307
|
+
var childProps = getChildProps(props, newCalculatedProps);
|
|
310
308
|
var parentName = props.name || "stack";
|
|
311
|
-
return
|
|
309
|
+
return children.map(function (child, index) {
|
|
312
310
|
var role = child.type && child.type.role;
|
|
313
311
|
var data = datasets[index];
|
|
314
|
-
var style = victory_core__WEBPACK_IMPORTED_MODULE_5__.getChildStyle(child, index,
|
|
312
|
+
var style = victory_core__WEBPACK_IMPORTED_MODULE_5__.getChildStyle(child, index, newCalculatedProps);
|
|
315
313
|
var labels = props.labels ? getLabels(props, datasets, index) : child.props.labels;
|
|
316
314
|
var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
|
|
317
315
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().cloneElement(child, lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({
|
|
@@ -395,16 +393,17 @@ var defaultProps = {
|
|
|
395
393
|
};
|
|
396
394
|
|
|
397
395
|
var VictoryStackBase = function (initialProps) {
|
|
398
|
-
// eslint-disable-next-line no-use-before-define
|
|
399
396
|
var role = VictoryStack.role;
|
|
400
|
-
|
|
397
|
+
var propsWithDefaults = react__WEBPACK_IMPORTED_MODULE_3___default().useMemo(function () {
|
|
398
|
+
return _objectSpread(_objectSpread({}, defaultProps), initialProps);
|
|
399
|
+
}, [initialProps]);
|
|
401
400
|
|
|
402
401
|
var _Hooks$useAnimationSt = victory_core__WEBPACK_IMPORTED_MODULE_7__.useAnimationState(),
|
|
403
402
|
setAnimationState = _Hooks$useAnimationSt.setAnimationState,
|
|
404
403
|
getAnimationProps = _Hooks$useAnimationSt.getAnimationProps,
|
|
405
404
|
getProps = _Hooks$useAnimationSt.getProps;
|
|
406
405
|
|
|
407
|
-
var props = getProps(
|
|
406
|
+
var props = getProps(propsWithDefaults);
|
|
408
407
|
var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_8__.modifyProps(props, fallbackProps, role);
|
|
409
408
|
var eventKey = modifiedProps.eventKey,
|
|
410
409
|
containerComponent = modifiedProps.containerComponent,
|
|
@@ -458,8 +457,8 @@ var VictoryStackBase = function (initialProps) {
|
|
|
458
457
|
return {};
|
|
459
458
|
}, [standalone, domain, scale, width, height, theme, style, horizontal, polar, name]);
|
|
460
459
|
var userProps = react__WEBPACK_IMPORTED_MODULE_3___default().useMemo(function () {
|
|
461
|
-
return victory_core__WEBPACK_IMPORTED_MODULE_10__.getSafeUserProps(
|
|
462
|
-
}, [
|
|
460
|
+
return victory_core__WEBPACK_IMPORTED_MODULE_10__.getSafeUserProps(propsWithDefaults);
|
|
461
|
+
}, [propsWithDefaults]);
|
|
463
462
|
var container = react__WEBPACK_IMPORTED_MODULE_3___default().useMemo(function () {
|
|
464
463
|
if (standalone) {
|
|
465
464
|
var defaultContainerProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, containerComponent.props, containerProps, userProps);
|
|
@@ -472,18 +471,18 @@ var VictoryStackBase = function (initialProps) {
|
|
|
472
471
|
var events = react__WEBPACK_IMPORTED_MODULE_3___default().useMemo(function () {
|
|
473
472
|
return victory_core__WEBPACK_IMPORTED_MODULE_11__.getAllEvents(props);
|
|
474
473
|
}, [props]);
|
|
475
|
-
var previousProps = victory_core__WEBPACK_IMPORTED_MODULE_12__.usePreviousProps(
|
|
474
|
+
var previousProps = victory_core__WEBPACK_IMPORTED_MODULE_12__.usePreviousProps(propsWithDefaults);
|
|
476
475
|
react__WEBPACK_IMPORTED_MODULE_3___default().useEffect(function () {
|
|
477
476
|
// This is called before dismount to keep state in sync
|
|
478
477
|
return function () {
|
|
479
|
-
if (
|
|
480
|
-
setAnimationState(previousProps,
|
|
478
|
+
if (propsWithDefaults.animate) {
|
|
479
|
+
setAnimationState(previousProps, propsWithDefaults);
|
|
481
480
|
}
|
|
482
481
|
};
|
|
483
|
-
}, [setAnimationState, previousProps,
|
|
482
|
+
}, [setAnimationState, previousProps, propsWithDefaults]);
|
|
484
483
|
|
|
485
484
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
486
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_13__
|
|
485
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_13__.VictorySharedEvents, {
|
|
487
486
|
container: container,
|
|
488
487
|
eventKey: eventKey,
|
|
489
488
|
events: events,
|
|
@@ -8744,11 +8743,11 @@ function getAxis(props) {
|
|
|
8744
8743
|
*/
|
|
8745
8744
|
|
|
8746
8745
|
function findAxisComponents(childComponents, predicate) {
|
|
8747
|
-
|
|
8746
|
+
var predicateFunction = predicate || (lodash_identity__WEBPACK_IMPORTED_MODULE_9___default());
|
|
8748
8747
|
|
|
8749
8748
|
var findAxes = function (children) {
|
|
8750
8749
|
return children.reduce(function (memo, child) {
|
|
8751
|
-
if (child.type && child.type.role === "axis" &&
|
|
8750
|
+
if (child.type && child.type.role === "axis" && predicateFunction(child)) {
|
|
8752
8751
|
return memo.concat(child);
|
|
8753
8752
|
} else if (child.props && child.props.children) {
|
|
8754
8753
|
return memo.concat(findAxes(react__WEBPACK_IMPORTED_MODULE_12___default().Children.toArray(child.props.children)));
|
|
@@ -9492,12 +9491,14 @@ function sortData(dataset, sortKey) {
|
|
|
9492
9491
|
} // Ensures previous VictoryLine api for sortKey prop stays consistent
|
|
9493
9492
|
|
|
9494
9493
|
|
|
9494
|
+
var formattedSortKey = sortKey;
|
|
9495
|
+
|
|
9495
9496
|
if (sortKey === "x" || sortKey === "y") {
|
|
9496
|
-
|
|
9497
|
+
formattedSortKey = "_".concat(sortKey);
|
|
9497
9498
|
}
|
|
9498
9499
|
|
|
9499
9500
|
var order = sortOrder === "ascending" ? "asc" : "desc";
|
|
9500
|
-
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset,
|
|
9501
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
|
|
9501
9502
|
} // This method will remove data points that break certain scales. (log scale only)
|
|
9502
9503
|
|
|
9503
9504
|
|
|
@@ -9688,7 +9689,10 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9688
9689
|
return [];
|
|
9689
9690
|
}
|
|
9690
9691
|
|
|
9691
|
-
var defaultKeys = ["x", "y", "y0"];
|
|
9692
|
+
var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
|
|
9693
|
+
// but we need to figure out why changing it causes regressions in tests.
|
|
9694
|
+
// eslint-disable-next-line no-param-reassign
|
|
9695
|
+
|
|
9692
9696
|
expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
|
|
9693
9697
|
|
|
9694
9698
|
var createAccessor = function (name) {
|
|
@@ -9713,13 +9717,13 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9713
9717
|
|
|
9714
9718
|
var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
|
|
9715
9719
|
// eslint-disable-line complexity
|
|
9716
|
-
|
|
9720
|
+
var parsedDatum = parseDatum(datum);
|
|
9717
9721
|
var fallbackValues = {
|
|
9718
9722
|
x: index,
|
|
9719
|
-
y:
|
|
9723
|
+
y: parsedDatum
|
|
9720
9724
|
};
|
|
9721
9725
|
var processedValues = expectedKeys.reduce(function (memo, type) {
|
|
9722
|
-
var processedValue = accessor[type](
|
|
9726
|
+
var processedValue = accessor[type](parsedDatum);
|
|
9723
9727
|
var value = processedValue !== undefined ? processedValue : fallbackValues[type];
|
|
9724
9728
|
|
|
9725
9729
|
if (value !== undefined) {
|
|
@@ -9734,7 +9738,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
9734
9738
|
return memo;
|
|
9735
9739
|
}, {});
|
|
9736
9740
|
|
|
9737
|
-
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues,
|
|
9741
|
+
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
|
|
9738
9742
|
|
|
9739
9743
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
|
|
9740
9744
|
dataArr.push(formattedDatum);
|
|
@@ -9845,8 +9849,8 @@ function getStringsFromData(props, axis) {
|
|
|
9845
9849
|
}, []);
|
|
9846
9850
|
var sortedData = sortData(data, props.sortKey, props.sortOrder);
|
|
9847
9851
|
var dataStrings = sortedData.reduce(function (dataArr, datum) {
|
|
9848
|
-
|
|
9849
|
-
dataArr.push(accessor(
|
|
9852
|
+
var parsedDatum = parseDatum(datum);
|
|
9853
|
+
dataArr.push(accessor(parsedDatum));
|
|
9850
9854
|
return dataArr;
|
|
9851
9855
|
}, []).filter(function (datum) {
|
|
9852
9856
|
return typeof datum === "string";
|
|
@@ -10090,18 +10094,18 @@ function padDomain(domain, props, axis) {
|
|
|
10090
10094
|
|
|
10091
10095
|
|
|
10092
10096
|
function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
|
|
10093
|
-
|
|
10094
|
-
|
|
10097
|
+
var getDomainFromDataFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
|
|
10098
|
+
var formatDomainFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
|
|
10095
10099
|
return function (props, axis) {
|
|
10096
10100
|
var propsDomain = getDomainFromProps(props, axis);
|
|
10097
10101
|
|
|
10098
10102
|
if (propsDomain) {
|
|
10099
|
-
return
|
|
10103
|
+
return formatDomainFn(propsDomain, props, axis);
|
|
10100
10104
|
}
|
|
10101
10105
|
|
|
10102
10106
|
var categories = _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
10103
|
-
var domain = categories ? getDomainFromCategories(props, axis, categories) :
|
|
10104
|
-
return domain ?
|
|
10107
|
+
var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
|
|
10108
|
+
return domain ? formatDomainFn(domain, props, axis) : undefined;
|
|
10105
10109
|
};
|
|
10106
10110
|
}
|
|
10107
10111
|
/**
|
|
@@ -10134,27 +10138,27 @@ function getDomain(props, axis) {
|
|
|
10134
10138
|
*/
|
|
10135
10139
|
|
|
10136
10140
|
function getDomainFromCategories(props, axis, categories) {
|
|
10137
|
-
|
|
10141
|
+
var categoriesArray = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
10138
10142
|
var polar = props.polar,
|
|
10139
10143
|
_props$startAngle = props.startAngle,
|
|
10140
10144
|
startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle,
|
|
10141
10145
|
_props$endAngle = props.endAngle,
|
|
10142
10146
|
endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
|
|
10143
10147
|
|
|
10144
|
-
if (!
|
|
10148
|
+
if (!categoriesArray) {
|
|
10145
10149
|
return undefined;
|
|
10146
10150
|
}
|
|
10147
10151
|
|
|
10148
10152
|
var minDomain = getMinFromProps(props, axis);
|
|
10149
10153
|
var maxDomain = getMaxFromProps(props, axis);
|
|
10150
|
-
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(
|
|
10154
|
+
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categoriesArray) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
|
|
10151
10155
|
var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function (memo, string, index) {
|
|
10152
10156
|
memo[string] = index + 1;
|
|
10153
10157
|
return memo;
|
|
10154
10158
|
}, {});
|
|
10155
|
-
var categoryValues = stringMap ?
|
|
10159
|
+
var categoryValues = stringMap ? categoriesArray.map(function (value) {
|
|
10156
10160
|
return stringMap[value];
|
|
10157
|
-
}) :
|
|
10161
|
+
}) : categoriesArray;
|
|
10158
10162
|
var min = minDomain !== undefined ? minDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMinValue(categoryValues);
|
|
10159
10163
|
var max = maxDomain !== undefined ? maxDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMaxValue(categoryValues);
|
|
10160
10164
|
var categoryDomain = getDomainFromMinMax(min, max);
|
|
@@ -10169,7 +10173,7 @@ function getDomainFromCategories(props, axis, categories) {
|
|
|
10169
10173
|
*/
|
|
10170
10174
|
|
|
10171
10175
|
function getDomainFromData(props, axis, dataset) {
|
|
10172
|
-
|
|
10176
|
+
var datasetArray = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
|
|
10173
10177
|
var polar = props.polar,
|
|
10174
10178
|
_props$startAngle2 = props.startAngle,
|
|
10175
10179
|
startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2,
|
|
@@ -10178,14 +10182,14 @@ function getDomainFromData(props, axis, dataset) {
|
|
|
10178
10182
|
var minDomain = getMinFromProps(props, axis);
|
|
10179
10183
|
var maxDomain = getMaxFromProps(props, axis);
|
|
10180
10184
|
|
|
10181
|
-
if (
|
|
10185
|
+
if (datasetArray.length < 1) {
|
|
10182
10186
|
return minDomain !== undefined && maxDomain !== undefined ? getDomainFromMinMax(minDomain, maxDomain) : undefined;
|
|
10183
10187
|
}
|
|
10184
10188
|
|
|
10185
|
-
var min = minDomain !== undefined ? minDomain : getExtremeFromData(
|
|
10186
|
-
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(
|
|
10189
|
+
var min = minDomain !== undefined ? minDomain : getExtremeFromData(datasetArray, axis, "min");
|
|
10190
|
+
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
|
|
10187
10191
|
var domain = getDomainFromMinMax(min, max);
|
|
10188
|
-
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(
|
|
10192
|
+
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
|
|
10189
10193
|
}
|
|
10190
10194
|
/**
|
|
10191
10195
|
* Returns a domain in the form of a two element array given a min and max value.
|
|
@@ -10498,14 +10502,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10498
10502
|
// eslint-disable-next-line no-invalid-this
|
|
10499
10503
|
|
|
10500
10504
|
|
|
10501
|
-
|
|
10505
|
+
var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
|
|
10502
10506
|
|
|
10503
10507
|
var getTargetProps = function (identifier, type) {
|
|
10504
10508
|
var childName = identifier.childName,
|
|
10505
10509
|
target = identifier.target,
|
|
10506
10510
|
key = identifier.key; // eslint-disable-next-line no-invalid-this
|
|
10507
10511
|
|
|
10508
|
-
var baseType = type === "props" ?
|
|
10512
|
+
var baseType = type === "props" ? newBaseProps : _this2.state || {};
|
|
10509
10513
|
var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
10510
10514
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
10511
10515
|
}; // Returns the state object with the mutation caused by a given eventReturn
|
|
@@ -10593,8 +10597,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
10593
10597
|
|
|
10594
10598
|
var parseEventReturn = function (eventReturn, eventKey) {
|
|
10595
10599
|
return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
|
|
10596
|
-
|
|
10597
|
-
return memo;
|
|
10600
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
|
|
10598
10601
|
}, {}) : parseEvent(eventReturn, eventKey);
|
|
10599
10602
|
};
|
|
10600
10603
|
|
|
@@ -10680,9 +10683,10 @@ function getEventState(eventKey, namespace, childType) {
|
|
|
10680
10683
|
*/
|
|
10681
10684
|
// eslint-disable-next-line max-params
|
|
10682
10685
|
|
|
10683
|
-
function getExternalMutationsWithChildren(mutations
|
|
10684
|
-
baseProps =
|
|
10685
|
-
baseState =
|
|
10686
|
+
function getExternalMutationsWithChildren(mutations) {
|
|
10687
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10688
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10689
|
+
var childNames = arguments.length > 3 ? arguments[3] : undefined;
|
|
10686
10690
|
return childNames.reduce(function (memo, childName) {
|
|
10687
10691
|
var childState = baseState[childName];
|
|
10688
10692
|
var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
@@ -10704,9 +10708,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
10704
10708
|
*/
|
|
10705
10709
|
// eslint-disable-next-line max-params
|
|
10706
10710
|
|
|
10707
|
-
function getExternalMutations(mutations
|
|
10708
|
-
baseProps =
|
|
10709
|
-
baseState =
|
|
10711
|
+
function getExternalMutations(mutations) {
|
|
10712
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10713
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10714
|
+
var childName = arguments.length > 3 ? arguments[3] : undefined;
|
|
10710
10715
|
|
|
10711
10716
|
var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
|
|
10712
10717
|
|
|
@@ -10772,8 +10777,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
10772
10777
|
return false;
|
|
10773
10778
|
};
|
|
10774
10779
|
|
|
10775
|
-
|
|
10776
|
-
var scopedMutations = mutations;
|
|
10780
|
+
var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
|
|
10777
10781
|
|
|
10778
10782
|
if (identifier.childName) {
|
|
10779
10783
|
scopedMutations = mutations.filter(function (m) {
|
|
@@ -10812,13 +10816,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
10812
10816
|
|
|
10813
10817
|
function getComponentEvents(props, components) {
|
|
10814
10818
|
var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
|
|
10815
|
-
var _memo;
|
|
10816
|
-
|
|
10817
10819
|
var component = props[componentName];
|
|
10818
10820
|
var defaultEvents = component && component.type && component.type.defaultEvents;
|
|
10819
10821
|
var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
|
|
10820
|
-
|
|
10821
|
-
return memo;
|
|
10822
|
+
return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
|
|
10822
10823
|
}, []);
|
|
10823
10824
|
return events && events.length ? events : undefined;
|
|
10824
10825
|
}
|
|
@@ -11176,6 +11177,7 @@ function reduceChildren(children, iteratee) {
|
|
|
11176
11177
|
|
|
11177
11178
|
var traverseChildren = function (childArray, names, parent) {
|
|
11178
11179
|
return childArray.reduce(function (memo, child, index) {
|
|
11180
|
+
var newMemo = memo;
|
|
11179
11181
|
var childRole = child.type && child.type.role;
|
|
11180
11182
|
var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
|
|
11181
11183
|
|
|
@@ -11193,16 +11195,16 @@ function reduceChildren(children, iteratee) {
|
|
|
11193
11195
|
});
|
|
11194
11196
|
|
|
11195
11197
|
var nestedResults = traverseChildren(nestedChildren, _childNames, child);
|
|
11196
|
-
|
|
11198
|
+
newMemo = combine(newMemo, nestedResults);
|
|
11197
11199
|
} else {
|
|
11198
11200
|
var result = iteratee(child, childName, parent);
|
|
11199
11201
|
|
|
11200
11202
|
if (result) {
|
|
11201
|
-
|
|
11203
|
+
newMemo = combine(newMemo, result);
|
|
11202
11204
|
}
|
|
11203
11205
|
}
|
|
11204
11206
|
|
|
11205
|
-
return
|
|
11207
|
+
return newMemo;
|
|
11206
11208
|
}, initialMemo);
|
|
11207
11209
|
};
|
|
11208
11210
|
|
|
@@ -11228,8 +11230,7 @@ function isHorizontal(props) {
|
|
|
11228
11230
|
var childProps = child.props || {};
|
|
11229
11231
|
|
|
11230
11232
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
11231
|
-
|
|
11232
|
-
return memo;
|
|
11233
|
+
return memo || childProps.horizontal;
|
|
11233
11234
|
}
|
|
11234
11235
|
|
|
11235
11236
|
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
|
|
@@ -11464,11 +11465,13 @@ function isMap(x) {
|
|
|
11464
11465
|
}
|
|
11465
11466
|
function shallowToJS(x, whitelist) {
|
|
11466
11467
|
return isIterable(x) ? x.reduce(function (result, curr, key) {
|
|
11468
|
+
var newCurr = curr;
|
|
11469
|
+
|
|
11467
11470
|
if (whitelist && whitelist[key]) {
|
|
11468
|
-
|
|
11471
|
+
newCurr = shallowToJS(curr);
|
|
11469
11472
|
}
|
|
11470
11473
|
|
|
11471
|
-
result[key] =
|
|
11474
|
+
result[key] = newCurr;
|
|
11472
11475
|
return result;
|
|
11473
11476
|
}, isList(x) ? [] : {}) : x;
|
|
11474
11477
|
}
|
|
@@ -12115,11 +12118,10 @@ var Timer = /*#__PURE__*/function () {
|
|
|
12115
12118
|
}, {
|
|
12116
12119
|
key: "subscribe",
|
|
12117
12120
|
value: function subscribe(callback, duration) {
|
|
12118
|
-
duration = this.shouldAnimate ? duration : 0;
|
|
12119
12121
|
var subscriptionID = this.subscribers.push({
|
|
12120
12122
|
startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
|
|
12121
12123
|
callback: callback,
|
|
12122
|
-
duration: duration
|
|
12124
|
+
duration: this.shouldAnimate ? duration : 0
|
|
12123
12125
|
});
|
|
12124
12126
|
this.activeSubscriptions++;
|
|
12125
12127
|
this.start();
|
|
@@ -12306,36 +12308,38 @@ function getInitialChildProps(animate, data) {
|
|
|
12306
12308
|
|
|
12307
12309
|
|
|
12308
12310
|
function getChildBeforeLoad(animate, child, data, cb) {
|
|
12309
|
-
|
|
12311
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
12310
12312
|
onEnd: cb
|
|
12311
12313
|
});
|
|
12312
12314
|
|
|
12313
|
-
if (
|
|
12315
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
12314
12316
|
return {
|
|
12315
|
-
animate:
|
|
12317
|
+
animate: newAnimate,
|
|
12316
12318
|
data: data
|
|
12317
12319
|
};
|
|
12318
12320
|
}
|
|
12319
12321
|
|
|
12320
|
-
var before =
|
|
12322
|
+
var before = newAnimate.onLoad && newAnimate.onLoad.before ? newAnimate.onLoad.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // If nodes need to exit, transform them with the provided onLoad.before function.
|
|
12321
12323
|
|
|
12322
|
-
|
|
12324
|
+
var newData = data.map(function (datum, idx) {
|
|
12323
12325
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
|
|
12324
12326
|
});
|
|
12325
12327
|
return {
|
|
12326
|
-
animate:
|
|
12327
|
-
data:
|
|
12328
|
+
animate: newAnimate,
|
|
12329
|
+
data: newData,
|
|
12328
12330
|
clipWidth: 0
|
|
12329
12331
|
};
|
|
12330
12332
|
} // eslint-disable-next-line max-params
|
|
12331
12333
|
|
|
12332
12334
|
|
|
12333
12335
|
function getChildOnLoad(animate, data, cb) {
|
|
12334
|
-
|
|
12336
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
12335
12337
|
onEnd: cb
|
|
12336
12338
|
});
|
|
12337
12339
|
|
|
12338
|
-
|
|
12340
|
+
var newData = data;
|
|
12341
|
+
|
|
12342
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
12339
12343
|
return {
|
|
12340
12344
|
animate: animate,
|
|
12341
12345
|
data: data
|
|
@@ -12344,12 +12348,12 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
12344
12348
|
|
|
12345
12349
|
var after = animate.onLoad && animate.onLoad.after ? animate.onLoad.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // If nodes need to exit, transform them with the provided onLoad.after function.
|
|
12346
12350
|
|
|
12347
|
-
|
|
12351
|
+
newData = data.map(function (datum, idx) {
|
|
12348
12352
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
|
|
12349
12353
|
});
|
|
12350
12354
|
return {
|
|
12351
|
-
animate:
|
|
12352
|
-
data:
|
|
12355
|
+
animate: newAnimate,
|
|
12356
|
+
data: newData
|
|
12353
12357
|
};
|
|
12354
12358
|
} // eslint-disable-next-line max-params, max-len
|
|
12355
12359
|
|
|
@@ -12358,7 +12362,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
12358
12362
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
12359
12363
|
// transition for all children to have the same duration, delay, etc.
|
|
12360
12364
|
var onExit = animate && animate.onExit;
|
|
12361
|
-
|
|
12365
|
+
|
|
12366
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
|
|
12367
|
+
|
|
12368
|
+
var newData = data;
|
|
12362
12369
|
|
|
12363
12370
|
if (exitingNodes) {
|
|
12364
12371
|
// After the exit transition occurs, trigger the animations for
|
|
@@ -12366,39 +12373,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
12366
12373
|
animate.onEnd = cb;
|
|
12367
12374
|
var before = animate.onExit && animate.onExit.before ? animate.onExit.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // If nodes need to exit, transform them with the provided onExit.before function.
|
|
12368
12375
|
|
|
12369
|
-
|
|
12376
|
+
newData = data.map(function (datum, idx) {
|
|
12370
12377
|
var key = (datum.key || idx).toString();
|
|
12371
12378
|
return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
12372
12379
|
});
|
|
12373
12380
|
}
|
|
12374
12381
|
|
|
12375
12382
|
return {
|
|
12376
|
-
animate:
|
|
12377
|
-
data:
|
|
12383
|
+
animate: newAnimate,
|
|
12384
|
+
data: newData
|
|
12378
12385
|
};
|
|
12379
12386
|
} // eslint-disable-next-line max-params,max-len
|
|
12380
12387
|
|
|
12381
12388
|
|
|
12382
12389
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
12390
|
+
var newAnimate = animate;
|
|
12391
|
+
var newData = data;
|
|
12392
|
+
|
|
12383
12393
|
if (enteringNodes) {
|
|
12384
12394
|
// Perform a normal animation here, except - when it finishes - trigger
|
|
12385
12395
|
// the transition for entering nodes.
|
|
12386
|
-
|
|
12396
|
+
newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
12387
12397
|
onEnd: cb
|
|
12388
12398
|
});
|
|
12389
12399
|
var before = animate.onEnter && animate.onEnter.before ? animate.onEnter.before : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default()); // We want the entering nodes to be included in the transition target
|
|
12390
12400
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
12391
12401
|
// so perform the `onEnter.before` transformation on each node.
|
|
12392
12402
|
|
|
12393
|
-
|
|
12403
|
+
newData = data.map(function (datum, idx) {
|
|
12394
12404
|
var key = (datum.key || idx).toString();
|
|
12395
12405
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
12396
12406
|
});
|
|
12397
12407
|
}
|
|
12398
12408
|
|
|
12399
12409
|
return {
|
|
12400
|
-
animate:
|
|
12401
|
-
data:
|
|
12410
|
+
animate: newAnimate,
|
|
12411
|
+
data: newData
|
|
12402
12412
|
};
|
|
12403
12413
|
} // eslint-disable-next-line max-params, max-len
|
|
12404
12414
|
|
|
@@ -12407,23 +12417,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
12407
12417
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
12408
12418
|
// transition for all children to have the same duration, delay, etc.
|
|
12409
12419
|
var onEnter = animate && animate.onEnter;
|
|
12410
|
-
|
|
12420
|
+
|
|
12421
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
|
|
12422
|
+
|
|
12423
|
+
var newData = data;
|
|
12411
12424
|
|
|
12412
12425
|
if (enteringNodes) {
|
|
12413
12426
|
// Old nodes have been transitioned to their new values, and the
|
|
12414
12427
|
// domain should encompass the nodes that will now enter. So perform
|
|
12415
12428
|
// the `onEnter.after` transformation on each node.
|
|
12416
|
-
|
|
12417
|
-
var after =
|
|
12418
|
-
|
|
12429
|
+
newAnimate.onEnd = cb;
|
|
12430
|
+
var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
|
|
12431
|
+
newData = data.map(function (datum, idx) {
|
|
12419
12432
|
var key = getDatumKey(datum, idx);
|
|
12420
12433
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
|
|
12421
12434
|
});
|
|
12422
12435
|
}
|
|
12423
12436
|
|
|
12424
12437
|
return {
|
|
12425
|
-
animate:
|
|
12426
|
-
data:
|
|
12438
|
+
animate: newAnimate,
|
|
12439
|
+
data: newData
|
|
12427
12440
|
};
|
|
12428
12441
|
}
|
|
12429
12442
|
/**
|
|
@@ -12589,6 +12602,7 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
12589
12602
|
"use strict";
|
|
12590
12603
|
__webpack_require__.r(__webpack_exports__);
|
|
12591
12604
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12605
|
+
/* harmony export */ "assert": () => (/* binding */ assert),
|
|
12592
12606
|
/* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
|
|
12593
12607
|
/* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
|
|
12594
12608
|
/* harmony export */ });
|
|
@@ -12669,6 +12683,18 @@ var testIfSafeProp = function (key) {
|
|
|
12669
12683
|
if (doesPropStartWith(key) || isExactMatch(key)) return true;
|
|
12670
12684
|
return false;
|
|
12671
12685
|
};
|
|
12686
|
+
/**
|
|
12687
|
+
* Asserts that value is not null or undefined, throwing an error if it is.
|
|
12688
|
+
* @param value The value to assert
|
|
12689
|
+
* @param message The error message to throw
|
|
12690
|
+
*/
|
|
12691
|
+
|
|
12692
|
+
|
|
12693
|
+
function assert(value, message) {
|
|
12694
|
+
if (value === undefined || value === null) {
|
|
12695
|
+
throw new Error(message);
|
|
12696
|
+
}
|
|
12697
|
+
}
|
|
12672
12698
|
/**
|
|
12673
12699
|
* getSafeUserProps - function that takes in a props object and removes any
|
|
12674
12700
|
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
@@ -12678,7 +12704,6 @@ var testIfSafeProp = function (key) {
|
|
|
12678
12704
|
* @returns {Object}: object containing remaining acceptable props
|
|
12679
12705
|
*/
|
|
12680
12706
|
|
|
12681
|
-
|
|
12682
12707
|
var getSafeUserProps = function (props) {
|
|
12683
12708
|
var propsToFilter = _objectSpread({}, props);
|
|
12684
12709
|
|
|
@@ -12881,12 +12906,13 @@ function getDataFromChildren(props, childComponents) {
|
|
|
12881
12906
|
var childProps = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, child.props, parentProps);
|
|
12882
12907
|
|
|
12883
12908
|
var childData;
|
|
12909
|
+
var childElement = child;
|
|
12884
12910
|
|
|
12885
12911
|
if (!_data__WEBPACK_IMPORTED_MODULE_12__.isDataComponent(child)) {
|
|
12886
12912
|
return null;
|
|
12887
12913
|
} else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(child.type.getData)) {
|
|
12888
|
-
|
|
12889
|
-
childData =
|
|
12914
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(child, parent.props) : child;
|
|
12915
|
+
childData = childElement.type.getData(childProps);
|
|
12890
12916
|
} else {
|
|
12891
12917
|
childData = _data__WEBPACK_IMPORTED_MODULE_12__.getData(childProps);
|
|
12892
12918
|
}
|
|
@@ -12917,17 +12943,16 @@ function getData(props, childComponents) {
|
|
|
12917
12943
|
return _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
|
|
12918
12944
|
}
|
|
12919
12945
|
|
|
12920
|
-
|
|
12921
|
-
return getDataFromChildren(props, childComponents);
|
|
12946
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children));
|
|
12922
12947
|
}
|
|
12923
12948
|
function getWidth(props, groupLength, seriesLength) {
|
|
12924
12949
|
var datasets = props.datasets,
|
|
12925
12950
|
horizontal = props.horizontal;
|
|
12926
12951
|
var range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "x");
|
|
12927
12952
|
var extent = Math.abs(range[1] - range[0]);
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
var bars =
|
|
12953
|
+
var seriesLengthValue = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
|
|
12954
|
+
var groupLengthValue = groupLength || datasets.length;
|
|
12955
|
+
var bars = groupLengthValue * seriesLengthValue;
|
|
12931
12956
|
var barRatio = 0.5;
|
|
12932
12957
|
return Math.round(barRatio * extent / bars);
|
|
12933
12958
|
}
|
|
@@ -13019,9 +13044,9 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
13019
13044
|
return [min, max];
|
|
13020
13045
|
}
|
|
13021
13046
|
function getDomain(props, axis, childComponents) {
|
|
13022
|
-
|
|
13047
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
|
|
13023
13048
|
var propsDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromProps(props, axis);
|
|
13024
|
-
var domainPadding = getDefaultDomainPadding(props, axis,
|
|
13049
|
+
var domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
13025
13050
|
var domain;
|
|
13026
13051
|
|
|
13027
13052
|
if (propsDomain) {
|
|
@@ -13031,7 +13056,7 @@ function getDomain(props, axis, childComponents) {
|
|
|
13031
13056
|
var maxDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getMaxFromProps(props, axis);
|
|
13032
13057
|
var dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
|
|
13033
13058
|
var dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromData(props, axis, dataset) : [];
|
|
13034
|
-
var childDomain = getDomainFromChildren(props, axis,
|
|
13059
|
+
var childDomain = getDomainFromChildren(props, axis, children);
|
|
13035
13060
|
var min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMinValue([].concat(_toConsumableArray(dataDomain), _toConsumableArray(childDomain)));
|
|
13036
13061
|
var max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMaxValue([].concat(_toConsumableArray(dataDomain), _toConsumableArray(childDomain)));
|
|
13037
13062
|
domain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromMinMax(min, max);
|
|
@@ -13193,10 +13218,10 @@ function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
|
13193
13218
|
return lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(categoryStrings), _toConsumableArray(axisStrings))));
|
|
13194
13219
|
}
|
|
13195
13220
|
function getStringsFromChildren(props, childComponents) {
|
|
13196
|
-
|
|
13197
|
-
var xStrings = getCategoryAndAxisStringsFromChildren(props, "x",
|
|
13198
|
-
var yStrings = getCategoryAndAxisStringsFromChildren(props, "y",
|
|
13199
|
-
var dataStrings = getStringsFromData(
|
|
13221
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
|
|
13222
|
+
var xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
13223
|
+
var yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
13224
|
+
var dataStrings = getStringsFromData(children);
|
|
13200
13225
|
return {
|
|
13201
13226
|
x: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(xStrings), _toConsumableArray(dataStrings.x)))),
|
|
13202
13227
|
y: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(yStrings), _toConsumableArray(dataStrings.y))))
|
|
@@ -13226,7 +13251,7 @@ function getCategories(props, childComponents, allStrings) {
|
|
|
13226
13251
|
"use strict";
|
|
13227
13252
|
__webpack_require__.r(__webpack_exports__);
|
|
13228
13253
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13229
|
-
/* harmony export */ "
|
|
13254
|
+
/* harmony export */ "VictorySharedEvents": () => (/* binding */ VictorySharedEvents)
|
|
13230
13255
|
/* harmony export */ });
|
|
13231
13256
|
/* harmony import */ var lodash_difference__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/difference */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/difference.js");
|
|
13232
13257
|
/* harmony import */ var lodash_difference__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_difference__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -13244,12 +13269,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13244
13269
|
/* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_6__);
|
|
13245
13270
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "react");
|
|
13246
13271
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__);
|
|
13247
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! prop-types */ "../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js");
|
|
13248
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_12__);
|
|
13249
13272
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/events.js");
|
|
13250
13273
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
13251
|
-
/* harmony import */ var
|
|
13252
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
13274
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
13253
13275
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react-fast-compare */ "../../../node_modules/.pnpm/react-fast-compare@3.2.0/node_modules/react-fast-compare/index.js");
|
|
13254
13276
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_8__);
|
|
13255
13277
|
/* harmony import */ var json_stringify_safe__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! json-stringify-safe */ "../../../node_modules/.pnpm/json-stringify-safe@5.0.1/node_modules/json-stringify-safe/stringify.js");
|
|
@@ -13306,11 +13328,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
13306
13328
|
|
|
13307
13329
|
|
|
13308
13330
|
|
|
13309
|
-
// DISCLAIMER:
|
|
13310
|
-
// This file is not currently tested, and it is first on the list of files
|
|
13311
|
-
// to refactor in our current refactoring effort. Please do not make changes
|
|
13312
|
-
// to this file without manual testing and/or refactoring and adding tests.
|
|
13313
|
-
|
|
13314
13331
|
var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
13315
13332
|
_inherits(VictorySharedEvents, _React$Component);
|
|
13316
13333
|
|
|
@@ -13322,14 +13339,21 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13322
13339
|
_classCallCheck(this, VictorySharedEvents);
|
|
13323
13340
|
|
|
13324
13341
|
_this = _super.call(this, props);
|
|
13325
|
-
_this.
|
|
13342
|
+
_this.getScopedEvents = void 0;
|
|
13343
|
+
_this.getEventState = void 0;
|
|
13344
|
+
_this.baseProps = void 0;
|
|
13345
|
+
_this.sharedEventsCache = void 0;
|
|
13346
|
+
_this.globalEvents = void 0;
|
|
13347
|
+
_this.prevGlobalEventKeys = void 0;
|
|
13348
|
+
_this.boundGlobalEvents = void 0;
|
|
13326
13349
|
_this.getScopedEvents = victory_core__WEBPACK_IMPORTED_MODULE_10__.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
13327
13350
|
_this.getEventState = victory_core__WEBPACK_IMPORTED_MODULE_10__.getEventState.bind(_assertThisInitialized(_this));
|
|
13328
|
-
_this.
|
|
13351
|
+
_this.state = _this.state || {};
|
|
13329
13352
|
_this.sharedEventsCache = {};
|
|
13330
13353
|
_this.globalEvents = {};
|
|
13331
13354
|
_this.prevGlobalEventKeys = [];
|
|
13332
13355
|
_this.boundGlobalEvents = {};
|
|
13356
|
+
_this.baseProps = _this.getBaseProps(props);
|
|
13333
13357
|
return _this;
|
|
13334
13358
|
}
|
|
13335
13359
|
|
|
@@ -13420,8 +13444,7 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13420
13444
|
value: function applyExternalMutations(props, externalMutations) {
|
|
13421
13445
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_3___default()(externalMutations)) {
|
|
13422
13446
|
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
13423
|
-
|
|
13424
|
-
return memo;
|
|
13447
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
13425
13448
|
}, []);
|
|
13426
13449
|
var compiledCallbacks = callbacks.length ? function () {
|
|
13427
13450
|
callbacks.forEach(function (c) {
|
|
@@ -13544,9 +13567,9 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13544
13567
|
var _this7 = this;
|
|
13545
13568
|
|
|
13546
13569
|
var children = this.getNewChildren(props, baseProps);
|
|
13547
|
-
var parents = Array.isArray(events)
|
|
13570
|
+
var parents = Array.isArray(events) ? events.filter(function (event) {
|
|
13548
13571
|
return event.target === "parent";
|
|
13549
|
-
});
|
|
13572
|
+
}) : [];
|
|
13550
13573
|
var sharedEvents = parents.length > 0 ? {
|
|
13551
13574
|
events: parents,
|
|
13552
13575
|
// partially apply childName (null) and baseProps,
|
|
@@ -13592,33 +13615,9 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
13592
13615
|
|
|
13593
13616
|
return VictorySharedEvents;
|
|
13594
13617
|
}((react__WEBPACK_IMPORTED_MODULE_7___default().Component));
|
|
13595
|
-
|
|
13596
13618
|
VictorySharedEvents.displayName = "VictorySharedEvents";
|
|
13597
13619
|
VictorySharedEvents.role = "shared-event-wrapper";
|
|
13598
|
-
VictorySharedEvents.
|
|
13599
|
-
children: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_12___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_12___default().node)), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node)]),
|
|
13600
|
-
container: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node),
|
|
13601
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func), victory_core__WEBPACK_IMPORTED_MODULE_13__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_13__.integer, victory_core__WEBPACK_IMPORTED_MODULE_13__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string)]),
|
|
13602
|
-
events: prop_types__WEBPACK_IMPORTED_MODULE_12___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape({
|
|
13603
|
-
childName: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().array)]),
|
|
13604
|
-
eventHandlers: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().object),
|
|
13605
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func), victory_core__WEBPACK_IMPORTED_MODULE_13__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_13__.integer, victory_core__WEBPACK_IMPORTED_MODULE_13__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string)]),
|
|
13606
|
-
target: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string)
|
|
13607
|
-
})),
|
|
13608
|
-
externalEventMutations: prop_types__WEBPACK_IMPORTED_MODULE_12___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape({
|
|
13609
|
-
callback: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func),
|
|
13610
|
-
childName: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().array)]),
|
|
13611
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().array), victory_core__WEBPACK_IMPORTED_MODULE_13__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_13__.integer, victory_core__WEBPACK_IMPORTED_MODULE_13__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string)]),
|
|
13612
|
-
mutation: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func),
|
|
13613
|
-
target: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().array)])
|
|
13614
|
-
})),
|
|
13615
|
-
groupComponent: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node)
|
|
13616
|
-
};
|
|
13617
|
-
VictorySharedEvents.defaultProps = {
|
|
13618
|
-
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_7___default().createElement("g", null)
|
|
13619
|
-
};
|
|
13620
|
-
VictorySharedEvents.contextType = victory_core__WEBPACK_IMPORTED_MODULE_14__["default"];
|
|
13621
|
-
|
|
13620
|
+
VictorySharedEvents.contextType = victory_core__WEBPACK_IMPORTED_MODULE_12__["default"];
|
|
13622
13621
|
|
|
13623
13622
|
/***/ }),
|
|
13624
13623
|
|