victory-box-plot 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 +8 -0
- package/dist/victory-box-plot.js +181 -154
- package/dist/victory-box-plot.min.js +1 -1
- package/es/helper-methods.d.ts +1 -1
- package/es/helper-methods.js +22 -20
- package/es/victory-box-plot.d.ts +7 -4
- package/lib/helper-methods.d.ts +1 -1
- package/lib/helper-methods.js +21 -21
- package/lib/victory-box-plot.d.ts +7 -4
- package/package.json +4 -4
- package/src/helper-methods.tsx +9 -5
- package/src/victory-box-plot.tsx +2 -0
package/dist/victory-box-plot.js
CHANGED
|
@@ -213,13 +213,14 @@ var getLabelStyle = function (props, styleObject, namespace) {
|
|
|
213
213
|
return lodash_defaults__WEBPACK_IMPORTED_MODULE_6___default()({}, tooltipTheme.style, baseStyle);
|
|
214
214
|
};
|
|
215
215
|
|
|
216
|
-
var getStyles = function (props
|
|
216
|
+
var getStyles = function (props) {
|
|
217
|
+
var styleObject = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
218
|
+
|
|
217
219
|
if (props.disableInlineStyles) {
|
|
218
220
|
return {};
|
|
219
221
|
}
|
|
220
222
|
|
|
221
223
|
var style = props.style || {};
|
|
222
|
-
styleObject = styleObject || {};
|
|
223
224
|
var parentStyles = {
|
|
224
225
|
height: "100%",
|
|
225
226
|
width: "100%"
|
|
@@ -510,24 +511,25 @@ var isDatumOutOfBounds = function (datum, domain) {
|
|
|
510
511
|
return yOutOfBounds || xOutOfBounds;
|
|
511
512
|
};
|
|
512
513
|
|
|
513
|
-
var getBaseProps = function (
|
|
514
|
-
var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_11__.modifyProps(
|
|
515
|
-
|
|
516
|
-
var
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
514
|
+
var getBaseProps = function (initialProps, fallbackProps) {
|
|
515
|
+
var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_11__.modifyProps(initialProps, fallbackProps, "boxplot");
|
|
516
|
+
|
|
517
|
+
var props = lodash_assign__WEBPACK_IMPORTED_MODULE_5___default()({}, modifiedProps, getCalculatedValues(modifiedProps));
|
|
518
|
+
|
|
519
|
+
var groupComponent = props.groupComponent,
|
|
520
|
+
width = props.width,
|
|
521
|
+
height = props.height,
|
|
522
|
+
padding = props.padding,
|
|
523
|
+
standalone = props.standalone,
|
|
524
|
+
theme = props.theme,
|
|
525
|
+
events = props.events,
|
|
526
|
+
sharedEvents = props.sharedEvents,
|
|
527
|
+
scale = props.scale,
|
|
528
|
+
horizontal = props.horizontal,
|
|
529
|
+
data = props.data,
|
|
530
|
+
style = props.style,
|
|
531
|
+
domain = props.domain,
|
|
532
|
+
name = props.name;
|
|
531
533
|
var initialChildProps = {
|
|
532
534
|
parent: {
|
|
533
535
|
domain: domain,
|
|
@@ -7889,12 +7891,12 @@ var interpolateFunction = function (a, b) {
|
|
|
7889
7891
|
* differs in that it uses our custom interpolators when interpolating the value of each property in
|
|
7890
7892
|
* an object. This allows the correct interpolation of nested objects, including styles
|
|
7891
7893
|
*
|
|
7892
|
-
* @param {any}
|
|
7893
|
-
* @param {any}
|
|
7894
|
+
* @param {any} startValue - Start value.
|
|
7895
|
+
* @param {any} endValue - End value.
|
|
7894
7896
|
* @returns {Function} An interpolation function.
|
|
7895
7897
|
*/
|
|
7896
7898
|
|
|
7897
|
-
var interpolateObject = function (
|
|
7899
|
+
var interpolateObject = function (startValue, endValue) {
|
|
7898
7900
|
var interpolateTypes = function (x, y) {
|
|
7899
7901
|
if (x === y || !isInterpolatable(x) || !isInterpolatable(y)) {
|
|
7900
7902
|
return interpolateImmediate(x, y);
|
|
@@ -7919,6 +7921,8 @@ var interpolateObject = function (a, b) {
|
|
|
7919
7921
|
|
|
7920
7922
|
var i = {};
|
|
7921
7923
|
var c = {};
|
|
7924
|
+
var a = startValue;
|
|
7925
|
+
var b = endValue;
|
|
7922
7926
|
var k;
|
|
7923
7927
|
|
|
7924
7928
|
if (a === null || typeof a !== "object") {
|
|
@@ -8086,8 +8090,8 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
|
8086
8090
|
step can generate imprecise values, sometimes greater than 1
|
|
8087
8091
|
if this happens set the state to 1 and return, cancelling the timer
|
|
8088
8092
|
*/
|
|
8089
|
-
|
|
8090
|
-
var step =
|
|
8093
|
+
var animationDuration = duration !== undefined ? duration : _this.props.duration;
|
|
8094
|
+
var step = animationDuration ? elapsed / animationDuration : 1;
|
|
8091
8095
|
|
|
8092
8096
|
if (step >= 1) {
|
|
8093
8097
|
_this.setState({
|
|
@@ -8703,8 +8707,7 @@ var getStyles = function (style, props) {
|
|
|
8703
8707
|
}
|
|
8704
8708
|
|
|
8705
8709
|
var getSingleStyle = function (s) {
|
|
8706
|
-
|
|
8707
|
-
var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s, props);
|
|
8710
|
+
var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles, props);
|
|
8708
8711
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, baseStyles, {
|
|
8709
8712
|
fontSize: getFontSize(baseStyles)
|
|
8710
8713
|
});
|
|
@@ -8908,22 +8911,19 @@ var getInlineXOffset = function (calculatedProps, textElements, index) {
|
|
|
8908
8911
|
switch (textAnchor) {
|
|
8909
8912
|
case "start":
|
|
8910
8913
|
return widths.reduce(function (memo, width, i) {
|
|
8911
|
-
|
|
8912
|
-
return memo;
|
|
8914
|
+
return i < index ? memo + width : memo;
|
|
8913
8915
|
}, 0);
|
|
8914
8916
|
|
|
8915
8917
|
case "end":
|
|
8916
8918
|
return widths.reduce(function (memo, width, i) {
|
|
8917
|
-
|
|
8918
|
-
return memo;
|
|
8919
|
+
return i > index ? memo - width : memo;
|
|
8919
8920
|
}, 0);
|
|
8920
8921
|
|
|
8921
8922
|
default:
|
|
8922
8923
|
// middle
|
|
8923
8924
|
return widths.reduce(function (memo, width, i) {
|
|
8924
8925
|
var offsetWidth = i < index ? width : 0;
|
|
8925
|
-
|
|
8926
|
-
return memo;
|
|
8926
|
+
return i === index ? memo + width / 2 : memo + offsetWidth;
|
|
8927
8927
|
}, centerOffset);
|
|
8928
8928
|
}
|
|
8929
8929
|
};
|
|
@@ -9055,7 +9055,7 @@ var getCalculatedProps = function (props) {
|
|
|
9055
9055
|
verticalAnchor: verticalAnchor,
|
|
9056
9056
|
dx: dx,
|
|
9057
9057
|
dy: dy,
|
|
9058
|
-
originalDy: props.dy,
|
|
9058
|
+
originalDy: _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.dy, props),
|
|
9059
9059
|
transform: transform,
|
|
9060
9060
|
x: x,
|
|
9061
9061
|
y: y
|
|
@@ -9125,8 +9125,8 @@ var defaultProps = {
|
|
|
9125
9125
|
// Magic number from d3.
|
|
9126
9126
|
lineHeight: 1
|
|
9127
9127
|
};
|
|
9128
|
-
var VictoryLabel = function (
|
|
9129
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
9128
|
+
var VictoryLabel = function (initialProps) {
|
|
9129
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
9130
9130
|
|
|
9131
9131
|
if (props.text === null || props.text === undefined) {
|
|
9132
9132
|
return null;
|
|
@@ -9147,7 +9147,7 @@ var VictoryLabel = function (props) {
|
|
|
9147
9147
|
fontSize: currentStyle.fontSize || defaultStyles.fontSize,
|
|
9148
9148
|
capHeight: capHeightPx,
|
|
9149
9149
|
text: line,
|
|
9150
|
-
//
|
|
9150
|
+
// TODO: This looks like a bug:
|
|
9151
9151
|
textSize: _victory_util_textsize__WEBPACK_IMPORTED_MODULE_12__.approximateTextSize(line, currentStyle),
|
|
9152
9152
|
lineHeight: currentLineHeight,
|
|
9153
9153
|
backgroundPadding: getSingleValue(backgroundPadding, i)
|
|
@@ -9561,8 +9561,8 @@ var defaultProps = {
|
|
|
9561
9561
|
role: "presentation",
|
|
9562
9562
|
shapeRendering: "auto"
|
|
9563
9563
|
};
|
|
9564
|
-
var Border = function (
|
|
9565
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
9564
|
+
var Border = function (initialProps) {
|
|
9565
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
9566
9566
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.rectComponent, _objectSpread(_objectSpread({}, props.events), {}, {
|
|
9567
9567
|
"aria-label": props.ariaLabel,
|
|
9568
9568
|
style: props.style,
|
|
@@ -9653,8 +9653,8 @@ var defaultProps = {
|
|
|
9653
9653
|
role: "presentation",
|
|
9654
9654
|
shapeRendering: "auto"
|
|
9655
9655
|
};
|
|
9656
|
-
var LineSegment = function (
|
|
9657
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
9656
|
+
var LineSegment = function (initialProps) {
|
|
9657
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
9658
9658
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.lineComponent, _objectSpread(_objectSpread({}, props.events), {}, {
|
|
9659
9659
|
"aria-label": props.ariaLabel,
|
|
9660
9660
|
style: props.style,
|
|
@@ -9961,23 +9961,22 @@ var defaultProps = {
|
|
|
9961
9961
|
role: "presentation",
|
|
9962
9962
|
shapeRendering: "auto"
|
|
9963
9963
|
};
|
|
9964
|
-
var Whisker = function (
|
|
9965
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
9966
|
-
var
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
tabIndex = _props.tabIndex;
|
|
9964
|
+
var Whisker = function (initialProps) {
|
|
9965
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
9966
|
+
var ariaLabel = props.ariaLabel,
|
|
9967
|
+
groupComponent = props.groupComponent,
|
|
9968
|
+
lineComponent = props.lineComponent,
|
|
9969
|
+
events = props.events,
|
|
9970
|
+
className = props.className,
|
|
9971
|
+
majorWhisker = props.majorWhisker,
|
|
9972
|
+
minorWhisker = props.minorWhisker,
|
|
9973
|
+
transform = props.transform,
|
|
9974
|
+
clipPath = props.clipPath,
|
|
9975
|
+
role = props.role,
|
|
9976
|
+
shapeRendering = props.shapeRendering,
|
|
9977
|
+
style = props.style,
|
|
9978
|
+
desc = props.desc,
|
|
9979
|
+
tabIndex = props.tabIndex;
|
|
9981
9980
|
|
|
9982
9981
|
var baseProps = _objectSpread(_objectSpread({}, events), {}, {
|
|
9983
9982
|
style: style,
|
|
@@ -11144,8 +11143,7 @@ function addEvents(WrappedComponent) {
|
|
|
11144
11143
|
value: function applyExternalMutations(props, externalMutations) {
|
|
11145
11144
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5___default()(externalMutations)) {
|
|
11146
11145
|
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
11147
|
-
|
|
11148
|
-
return memo;
|
|
11146
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
11149
11147
|
}, []);
|
|
11150
11148
|
var compiledCallbacks = callbacks.length ? function () {
|
|
11151
11149
|
callbacks.forEach(function (c) {
|
|
@@ -11200,8 +11198,8 @@ function addEvents(WrappedComponent) {
|
|
|
11200
11198
|
}, {
|
|
11201
11199
|
key: "getBaseProps",
|
|
11202
11200
|
value: function getBaseProps(props, getSharedEventState) {
|
|
11203
|
-
|
|
11204
|
-
var sharedParentState =
|
|
11201
|
+
var getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
|
|
11202
|
+
var sharedParentState = getSharedEventStateFunction("parent", "parent");
|
|
11205
11203
|
var parentState = this.getEventState("parent", "parent");
|
|
11206
11204
|
|
|
11207
11205
|
var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({}, parentState, sharedParentState);
|
|
@@ -11236,13 +11234,15 @@ function addEvents(WrappedComponent) {
|
|
|
11236
11234
|
return undefined;
|
|
11237
11235
|
}
|
|
11238
11236
|
|
|
11237
|
+
var currentProps = component && typeof component === "object" && "props" in component ? component.props : undefined;
|
|
11238
|
+
|
|
11239
11239
|
if (this.hasEvents) {
|
|
11240
11240
|
var baseEvents = this.getEvents(this.props, type, key);
|
|
11241
11241
|
|
|
11242
11242
|
var componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({
|
|
11243
11243
|
index: index,
|
|
11244
11244
|
key: id
|
|
11245
|
-
}, this.getEventState(key, type), this.getSharedEventState(key, type),
|
|
11245
|
+
}, this.getEventState(key, type), this.getSharedEventState(key, type), currentProps, baseProps, {
|
|
11246
11246
|
id: id
|
|
11247
11247
|
});
|
|
11248
11248
|
|
|
@@ -11256,7 +11256,7 @@ function addEvents(WrappedComponent) {
|
|
|
11256
11256
|
return lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({
|
|
11257
11257
|
index: index,
|
|
11258
11258
|
key: id
|
|
11259
|
-
},
|
|
11259
|
+
}, currentProps, baseProps, {
|
|
11260
11260
|
id: id
|
|
11261
11261
|
});
|
|
11262
11262
|
}
|
|
@@ -11298,13 +11298,15 @@ function addEvents(WrappedComponent) {
|
|
|
11298
11298
|
var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_0___default()(this.dataKeys, "all");
|
|
11299
11299
|
|
|
11300
11300
|
var labelComponents = dataKeys.reduce(function (memo, key) {
|
|
11301
|
+
var newMemo = memo;
|
|
11302
|
+
|
|
11301
11303
|
var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
|
|
11302
11304
|
|
|
11303
11305
|
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
11304
|
-
|
|
11306
|
+
newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
|
|
11305
11307
|
}
|
|
11306
11308
|
|
|
11307
|
-
return
|
|
11309
|
+
return newMemo;
|
|
11308
11310
|
}, []);
|
|
11309
11311
|
var dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
11310
11312
|
var children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
|
|
@@ -11703,12 +11705,14 @@ function sortData(dataset, sortKey) {
|
|
|
11703
11705
|
} // Ensures previous VictoryLine api for sortKey prop stays consistent
|
|
11704
11706
|
|
|
11705
11707
|
|
|
11708
|
+
var formattedSortKey = sortKey;
|
|
11709
|
+
|
|
11706
11710
|
if (sortKey === "x" || sortKey === "y") {
|
|
11707
|
-
|
|
11711
|
+
formattedSortKey = "_".concat(sortKey);
|
|
11708
11712
|
}
|
|
11709
11713
|
|
|
11710
11714
|
var order = sortOrder === "ascending" ? "asc" : "desc";
|
|
11711
|
-
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset,
|
|
11715
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
|
|
11712
11716
|
} // This method will remove data points that break certain scales. (log scale only)
|
|
11713
11717
|
|
|
11714
11718
|
|
|
@@ -11899,7 +11903,10 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
11899
11903
|
return [];
|
|
11900
11904
|
}
|
|
11901
11905
|
|
|
11902
|
-
var defaultKeys = ["x", "y", "y0"];
|
|
11906
|
+
var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
|
|
11907
|
+
// but we need to figure out why changing it causes regressions in tests.
|
|
11908
|
+
// eslint-disable-next-line no-param-reassign
|
|
11909
|
+
|
|
11903
11910
|
expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
|
|
11904
11911
|
|
|
11905
11912
|
var createAccessor = function (name) {
|
|
@@ -11924,13 +11931,13 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
11924
11931
|
|
|
11925
11932
|
var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
|
|
11926
11933
|
// eslint-disable-line complexity
|
|
11927
|
-
|
|
11934
|
+
var parsedDatum = parseDatum(datum);
|
|
11928
11935
|
var fallbackValues = {
|
|
11929
11936
|
x: index,
|
|
11930
|
-
y:
|
|
11937
|
+
y: parsedDatum
|
|
11931
11938
|
};
|
|
11932
11939
|
var processedValues = expectedKeys.reduce(function (memo, type) {
|
|
11933
|
-
var processedValue = accessor[type](
|
|
11940
|
+
var processedValue = accessor[type](parsedDatum);
|
|
11934
11941
|
var value = processedValue !== undefined ? processedValue : fallbackValues[type];
|
|
11935
11942
|
|
|
11936
11943
|
if (value !== undefined) {
|
|
@@ -11945,7 +11952,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
11945
11952
|
return memo;
|
|
11946
11953
|
}, {});
|
|
11947
11954
|
|
|
11948
|
-
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues,
|
|
11955
|
+
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
|
|
11949
11956
|
|
|
11950
11957
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
|
|
11951
11958
|
dataArr.push(formattedDatum);
|
|
@@ -12056,8 +12063,8 @@ function getStringsFromData(props, axis) {
|
|
|
12056
12063
|
}, []);
|
|
12057
12064
|
var sortedData = sortData(data, props.sortKey, props.sortOrder);
|
|
12058
12065
|
var dataStrings = sortedData.reduce(function (dataArr, datum) {
|
|
12059
|
-
|
|
12060
|
-
dataArr.push(accessor(
|
|
12066
|
+
var parsedDatum = parseDatum(datum);
|
|
12067
|
+
dataArr.push(accessor(parsedDatum));
|
|
12061
12068
|
return dataArr;
|
|
12062
12069
|
}, []).filter(function (datum) {
|
|
12063
12070
|
return typeof datum === "string";
|
|
@@ -12423,18 +12430,18 @@ function padDomain(domain, props, axis) {
|
|
|
12423
12430
|
|
|
12424
12431
|
|
|
12425
12432
|
function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
|
|
12426
|
-
|
|
12427
|
-
|
|
12433
|
+
var getDomainFromDataFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
|
|
12434
|
+
var formatDomainFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
|
|
12428
12435
|
return function (props, axis) {
|
|
12429
12436
|
var propsDomain = getDomainFromProps(props, axis);
|
|
12430
12437
|
|
|
12431
12438
|
if (propsDomain) {
|
|
12432
|
-
return
|
|
12439
|
+
return formatDomainFn(propsDomain, props, axis);
|
|
12433
12440
|
}
|
|
12434
12441
|
|
|
12435
12442
|
var categories = _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
12436
|
-
var domain = categories ? getDomainFromCategories(props, axis, categories) :
|
|
12437
|
-
return domain ?
|
|
12443
|
+
var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
|
|
12444
|
+
return domain ? formatDomainFn(domain, props, axis) : undefined;
|
|
12438
12445
|
};
|
|
12439
12446
|
}
|
|
12440
12447
|
/**
|
|
@@ -12467,27 +12474,27 @@ function getDomain(props, axis) {
|
|
|
12467
12474
|
*/
|
|
12468
12475
|
|
|
12469
12476
|
function getDomainFromCategories(props, axis, categories) {
|
|
12470
|
-
|
|
12477
|
+
var categoriesArray = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
12471
12478
|
var polar = props.polar,
|
|
12472
12479
|
_props$startAngle = props.startAngle,
|
|
12473
12480
|
startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle,
|
|
12474
12481
|
_props$endAngle = props.endAngle,
|
|
12475
12482
|
endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
|
|
12476
12483
|
|
|
12477
|
-
if (!
|
|
12484
|
+
if (!categoriesArray) {
|
|
12478
12485
|
return undefined;
|
|
12479
12486
|
}
|
|
12480
12487
|
|
|
12481
12488
|
var minDomain = getMinFromProps(props, axis);
|
|
12482
12489
|
var maxDomain = getMaxFromProps(props, axis);
|
|
12483
|
-
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(
|
|
12490
|
+
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categoriesArray) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
|
|
12484
12491
|
var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function (memo, string, index) {
|
|
12485
12492
|
memo[string] = index + 1;
|
|
12486
12493
|
return memo;
|
|
12487
12494
|
}, {});
|
|
12488
|
-
var categoryValues = stringMap ?
|
|
12495
|
+
var categoryValues = stringMap ? categoriesArray.map(function (value) {
|
|
12489
12496
|
return stringMap[value];
|
|
12490
|
-
}) :
|
|
12497
|
+
}) : categoriesArray;
|
|
12491
12498
|
var min = minDomain !== undefined ? minDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMinValue(categoryValues);
|
|
12492
12499
|
var max = maxDomain !== undefined ? maxDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMaxValue(categoryValues);
|
|
12493
12500
|
var categoryDomain = getDomainFromMinMax(min, max);
|
|
@@ -12502,7 +12509,7 @@ function getDomainFromCategories(props, axis, categories) {
|
|
|
12502
12509
|
*/
|
|
12503
12510
|
|
|
12504
12511
|
function getDomainFromData(props, axis, dataset) {
|
|
12505
|
-
|
|
12512
|
+
var datasetArray = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
|
|
12506
12513
|
var polar = props.polar,
|
|
12507
12514
|
_props$startAngle2 = props.startAngle,
|
|
12508
12515
|
startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2,
|
|
@@ -12511,14 +12518,14 @@ function getDomainFromData(props, axis, dataset) {
|
|
|
12511
12518
|
var minDomain = getMinFromProps(props, axis);
|
|
12512
12519
|
var maxDomain = getMaxFromProps(props, axis);
|
|
12513
12520
|
|
|
12514
|
-
if (
|
|
12521
|
+
if (datasetArray.length < 1) {
|
|
12515
12522
|
return minDomain !== undefined && maxDomain !== undefined ? getDomainFromMinMax(minDomain, maxDomain) : undefined;
|
|
12516
12523
|
}
|
|
12517
12524
|
|
|
12518
|
-
var min = minDomain !== undefined ? minDomain : getExtremeFromData(
|
|
12519
|
-
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(
|
|
12525
|
+
var min = minDomain !== undefined ? minDomain : getExtremeFromData(datasetArray, axis, "min");
|
|
12526
|
+
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
|
|
12520
12527
|
var domain = getDomainFromMinMax(min, max);
|
|
12521
|
-
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(
|
|
12528
|
+
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
|
|
12522
12529
|
}
|
|
12523
12530
|
/**
|
|
12524
12531
|
* Returns a domain in the form of a two element array given a min and max value.
|
|
@@ -12831,14 +12838,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
12831
12838
|
// eslint-disable-next-line no-invalid-this
|
|
12832
12839
|
|
|
12833
12840
|
|
|
12834
|
-
|
|
12841
|
+
var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
|
|
12835
12842
|
|
|
12836
12843
|
var getTargetProps = function (identifier, type) {
|
|
12837
12844
|
var childName = identifier.childName,
|
|
12838
12845
|
target = identifier.target,
|
|
12839
12846
|
key = identifier.key; // eslint-disable-next-line no-invalid-this
|
|
12840
12847
|
|
|
12841
|
-
var baseType = type === "props" ?
|
|
12848
|
+
var baseType = type === "props" ? newBaseProps : _this2.state || {};
|
|
12842
12849
|
var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
12843
12850
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
12844
12851
|
}; // Returns the state object with the mutation caused by a given eventReturn
|
|
@@ -12926,8 +12933,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
12926
12933
|
|
|
12927
12934
|
var parseEventReturn = function (eventReturn, eventKey) {
|
|
12928
12935
|
return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
|
|
12929
|
-
|
|
12930
|
-
return memo;
|
|
12936
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
|
|
12931
12937
|
}, {}) : parseEvent(eventReturn, eventKey);
|
|
12932
12938
|
};
|
|
12933
12939
|
|
|
@@ -13013,9 +13019,10 @@ function getEventState(eventKey, namespace, childType) {
|
|
|
13013
13019
|
*/
|
|
13014
13020
|
// eslint-disable-next-line max-params
|
|
13015
13021
|
|
|
13016
|
-
function getExternalMutationsWithChildren(mutations
|
|
13017
|
-
baseProps =
|
|
13018
|
-
baseState =
|
|
13022
|
+
function getExternalMutationsWithChildren(mutations) {
|
|
13023
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
13024
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
13025
|
+
var childNames = arguments.length > 3 ? arguments[3] : undefined;
|
|
13019
13026
|
return childNames.reduce(function (memo, childName) {
|
|
13020
13027
|
var childState = baseState[childName];
|
|
13021
13028
|
var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
@@ -13037,9 +13044,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
13037
13044
|
*/
|
|
13038
13045
|
// eslint-disable-next-line max-params
|
|
13039
13046
|
|
|
13040
|
-
function getExternalMutations(mutations
|
|
13041
|
-
baseProps =
|
|
13042
|
-
baseState =
|
|
13047
|
+
function getExternalMutations(mutations) {
|
|
13048
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
13049
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
13050
|
+
var childName = arguments.length > 3 ? arguments[3] : undefined;
|
|
13043
13051
|
|
|
13044
13052
|
var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
|
|
13045
13053
|
|
|
@@ -13105,8 +13113,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
13105
13113
|
return false;
|
|
13106
13114
|
};
|
|
13107
13115
|
|
|
13108
|
-
|
|
13109
|
-
var scopedMutations = mutations;
|
|
13116
|
+
var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
|
|
13110
13117
|
|
|
13111
13118
|
if (identifier.childName) {
|
|
13112
13119
|
scopedMutations = mutations.filter(function (m) {
|
|
@@ -13145,13 +13152,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
13145
13152
|
|
|
13146
13153
|
function getComponentEvents(props, components) {
|
|
13147
13154
|
var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
|
|
13148
|
-
var _memo;
|
|
13149
|
-
|
|
13150
13155
|
var component = props[componentName];
|
|
13151
13156
|
var defaultEvents = component && component.type && component.type.defaultEvents;
|
|
13152
13157
|
var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
|
|
13153
|
-
|
|
13154
|
-
return memo;
|
|
13158
|
+
return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
|
|
13155
13159
|
}, []);
|
|
13156
13160
|
return events && events.length ? events : undefined;
|
|
13157
13161
|
}
|
|
@@ -13509,6 +13513,7 @@ function reduceChildren(children, iteratee) {
|
|
|
13509
13513
|
|
|
13510
13514
|
var traverseChildren = function (childArray, names, parent) {
|
|
13511
13515
|
return childArray.reduce(function (memo, child, index) {
|
|
13516
|
+
var newMemo = memo;
|
|
13512
13517
|
var childRole = child.type && child.type.role;
|
|
13513
13518
|
var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
|
|
13514
13519
|
|
|
@@ -13526,16 +13531,16 @@ function reduceChildren(children, iteratee) {
|
|
|
13526
13531
|
});
|
|
13527
13532
|
|
|
13528
13533
|
var nestedResults = traverseChildren(nestedChildren, _childNames, child);
|
|
13529
|
-
|
|
13534
|
+
newMemo = combine(newMemo, nestedResults);
|
|
13530
13535
|
} else {
|
|
13531
13536
|
var result = iteratee(child, childName, parent);
|
|
13532
13537
|
|
|
13533
13538
|
if (result) {
|
|
13534
|
-
|
|
13539
|
+
newMemo = combine(newMemo, result);
|
|
13535
13540
|
}
|
|
13536
13541
|
}
|
|
13537
13542
|
|
|
13538
|
-
return
|
|
13543
|
+
return newMemo;
|
|
13539
13544
|
}, initialMemo);
|
|
13540
13545
|
};
|
|
13541
13546
|
|
|
@@ -13561,8 +13566,7 @@ function isHorizontal(props) {
|
|
|
13561
13566
|
var childProps = child.props || {};
|
|
13562
13567
|
|
|
13563
13568
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
13564
|
-
|
|
13565
|
-
return memo;
|
|
13569
|
+
return memo || childProps.horizontal;
|
|
13566
13570
|
}
|
|
13567
13571
|
|
|
13568
13572
|
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
|
|
@@ -13615,11 +13619,13 @@ function isMap(x) {
|
|
|
13615
13619
|
}
|
|
13616
13620
|
function shallowToJS(x, whitelist) {
|
|
13617
13621
|
return isIterable(x) ? x.reduce(function (result, curr, key) {
|
|
13622
|
+
var newCurr = curr;
|
|
13623
|
+
|
|
13618
13624
|
if (whitelist && whitelist[key]) {
|
|
13619
|
-
|
|
13625
|
+
newCurr = shallowToJS(curr);
|
|
13620
13626
|
}
|
|
13621
13627
|
|
|
13622
|
-
result[key] =
|
|
13628
|
+
result[key] = newCurr;
|
|
13623
13629
|
return result;
|
|
13624
13630
|
}, isList(x) ? [] : {}) : x;
|
|
13625
13631
|
}
|
|
@@ -13647,12 +13653,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13647
13653
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
13648
13654
|
|
|
13649
13655
|
|
|
13650
|
-
/* eslint-disable no-use-before-define */
|
|
13651
|
-
|
|
13652
13656
|
|
|
13653
13657
|
// Private Functions
|
|
13654
|
-
function getVerticalAnchor(props
|
|
13655
|
-
datum =
|
|
13658
|
+
function getVerticalAnchor(props) {
|
|
13659
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
13656
13660
|
var sign = datum._y >= 0 ? 1 : -1;
|
|
13657
13661
|
var labelStyle = props.style && props.style.labels || {};
|
|
13658
13662
|
|
|
@@ -13665,8 +13669,8 @@ function getVerticalAnchor(props, datum) {
|
|
|
13665
13669
|
return "middle";
|
|
13666
13670
|
}
|
|
13667
13671
|
|
|
13668
|
-
function getTextAnchor(props
|
|
13669
|
-
datum =
|
|
13672
|
+
function getTextAnchor(props) {
|
|
13673
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
13670
13674
|
var style = props.style,
|
|
13671
13675
|
horizontal = props.horizontal;
|
|
13672
13676
|
var sign = datum._y >= 0 ? 1 : -1;
|
|
@@ -13681,14 +13685,14 @@ function getTextAnchor(props, datum) {
|
|
|
13681
13685
|
return sign >= 0 ? "start" : "end";
|
|
13682
13686
|
}
|
|
13683
13687
|
|
|
13684
|
-
function getAngle(props
|
|
13685
|
-
datum =
|
|
13688
|
+
function getAngle(props) {
|
|
13689
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
13686
13690
|
var labelStyle = props.style && props.style.labels || {};
|
|
13687
13691
|
return datum.angle === undefined ? labelStyle.angle : datum.angle;
|
|
13688
13692
|
}
|
|
13689
13693
|
|
|
13690
|
-
function getPadding(props
|
|
13691
|
-
datum =
|
|
13694
|
+
function getPadding(props) {
|
|
13695
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
13692
13696
|
var horizontal = props.horizontal,
|
|
13693
13697
|
style = props.style;
|
|
13694
13698
|
var labelStyle = style.labels || {};
|
|
@@ -13767,8 +13771,9 @@ function getPolarOrientation(degrees) {
|
|
|
13767
13771
|
} // Exported Functions
|
|
13768
13772
|
|
|
13769
13773
|
|
|
13770
|
-
function getText(props
|
|
13771
|
-
datum =
|
|
13774
|
+
function getText(props) {
|
|
13775
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
13776
|
+
var index = arguments.length > 2 ? arguments[2] : undefined;
|
|
13772
13777
|
|
|
13773
13778
|
if (datum.label !== undefined) {
|
|
13774
13779
|
return datum.label;
|
|
@@ -14928,11 +14933,10 @@ var Timer = /*#__PURE__*/function () {
|
|
|
14928
14933
|
}, {
|
|
14929
14934
|
key: "subscribe",
|
|
14930
14935
|
value: function subscribe(callback, duration) {
|
|
14931
|
-
duration = this.shouldAnimate ? duration : 0;
|
|
14932
14936
|
var subscriptionID = this.subscribers.push({
|
|
14933
14937
|
startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
|
|
14934
14938
|
callback: callback,
|
|
14935
|
-
duration: duration
|
|
14939
|
+
duration: this.shouldAnimate ? duration : 0
|
|
14936
14940
|
});
|
|
14937
14941
|
this.activeSubscriptions++;
|
|
14938
14942
|
this.start();
|
|
@@ -15119,36 +15123,38 @@ function getInitialChildProps(animate, data) {
|
|
|
15119
15123
|
|
|
15120
15124
|
|
|
15121
15125
|
function getChildBeforeLoad(animate, child, data, cb) {
|
|
15122
|
-
|
|
15126
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
15123
15127
|
onEnd: cb
|
|
15124
15128
|
});
|
|
15125
15129
|
|
|
15126
|
-
if (
|
|
15130
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
15127
15131
|
return {
|
|
15128
|
-
animate:
|
|
15132
|
+
animate: newAnimate,
|
|
15129
15133
|
data: data
|
|
15130
15134
|
};
|
|
15131
15135
|
}
|
|
15132
15136
|
|
|
15133
|
-
var before =
|
|
15137
|
+
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.
|
|
15134
15138
|
|
|
15135
|
-
|
|
15139
|
+
var newData = data.map(function (datum, idx) {
|
|
15136
15140
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
|
|
15137
15141
|
});
|
|
15138
15142
|
return {
|
|
15139
|
-
animate:
|
|
15140
|
-
data:
|
|
15143
|
+
animate: newAnimate,
|
|
15144
|
+
data: newData,
|
|
15141
15145
|
clipWidth: 0
|
|
15142
15146
|
};
|
|
15143
15147
|
} // eslint-disable-next-line max-params
|
|
15144
15148
|
|
|
15145
15149
|
|
|
15146
15150
|
function getChildOnLoad(animate, data, cb) {
|
|
15147
|
-
|
|
15151
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
15148
15152
|
onEnd: cb
|
|
15149
15153
|
});
|
|
15150
15154
|
|
|
15151
|
-
|
|
15155
|
+
var newData = data;
|
|
15156
|
+
|
|
15157
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
15152
15158
|
return {
|
|
15153
15159
|
animate: animate,
|
|
15154
15160
|
data: data
|
|
@@ -15157,12 +15163,12 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
15157
15163
|
|
|
15158
15164
|
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.
|
|
15159
15165
|
|
|
15160
|
-
|
|
15166
|
+
newData = data.map(function (datum, idx) {
|
|
15161
15167
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
|
|
15162
15168
|
});
|
|
15163
15169
|
return {
|
|
15164
|
-
animate:
|
|
15165
|
-
data:
|
|
15170
|
+
animate: newAnimate,
|
|
15171
|
+
data: newData
|
|
15166
15172
|
};
|
|
15167
15173
|
} // eslint-disable-next-line max-params, max-len
|
|
15168
15174
|
|
|
@@ -15171,7 +15177,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
15171
15177
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
15172
15178
|
// transition for all children to have the same duration, delay, etc.
|
|
15173
15179
|
var onExit = animate && animate.onExit;
|
|
15174
|
-
|
|
15180
|
+
|
|
15181
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
|
|
15182
|
+
|
|
15183
|
+
var newData = data;
|
|
15175
15184
|
|
|
15176
15185
|
if (exitingNodes) {
|
|
15177
15186
|
// After the exit transition occurs, trigger the animations for
|
|
@@ -15179,39 +15188,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
15179
15188
|
animate.onEnd = cb;
|
|
15180
15189
|
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.
|
|
15181
15190
|
|
|
15182
|
-
|
|
15191
|
+
newData = data.map(function (datum, idx) {
|
|
15183
15192
|
var key = (datum.key || idx).toString();
|
|
15184
15193
|
return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
15185
15194
|
});
|
|
15186
15195
|
}
|
|
15187
15196
|
|
|
15188
15197
|
return {
|
|
15189
|
-
animate:
|
|
15190
|
-
data:
|
|
15198
|
+
animate: newAnimate,
|
|
15199
|
+
data: newData
|
|
15191
15200
|
};
|
|
15192
15201
|
} // eslint-disable-next-line max-params,max-len
|
|
15193
15202
|
|
|
15194
15203
|
|
|
15195
15204
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
15205
|
+
var newAnimate = animate;
|
|
15206
|
+
var newData = data;
|
|
15207
|
+
|
|
15196
15208
|
if (enteringNodes) {
|
|
15197
15209
|
// Perform a normal animation here, except - when it finishes - trigger
|
|
15198
15210
|
// the transition for entering nodes.
|
|
15199
|
-
|
|
15211
|
+
newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
15200
15212
|
onEnd: cb
|
|
15201
15213
|
});
|
|
15202
15214
|
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
|
|
15203
15215
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
15204
15216
|
// so perform the `onEnter.before` transformation on each node.
|
|
15205
15217
|
|
|
15206
|
-
|
|
15218
|
+
newData = data.map(function (datum, idx) {
|
|
15207
15219
|
var key = (datum.key || idx).toString();
|
|
15208
15220
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
15209
15221
|
});
|
|
15210
15222
|
}
|
|
15211
15223
|
|
|
15212
15224
|
return {
|
|
15213
|
-
animate:
|
|
15214
|
-
data:
|
|
15225
|
+
animate: newAnimate,
|
|
15226
|
+
data: newData
|
|
15215
15227
|
};
|
|
15216
15228
|
} // eslint-disable-next-line max-params, max-len
|
|
15217
15229
|
|
|
@@ -15220,23 +15232,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
15220
15232
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
15221
15233
|
// transition for all children to have the same duration, delay, etc.
|
|
15222
15234
|
var onEnter = animate && animate.onEnter;
|
|
15223
|
-
|
|
15235
|
+
|
|
15236
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
|
|
15237
|
+
|
|
15238
|
+
var newData = data;
|
|
15224
15239
|
|
|
15225
15240
|
if (enteringNodes) {
|
|
15226
15241
|
// Old nodes have been transitioned to their new values, and the
|
|
15227
15242
|
// domain should encompass the nodes that will now enter. So perform
|
|
15228
15243
|
// the `onEnter.after` transformation on each node.
|
|
15229
|
-
|
|
15230
|
-
var after =
|
|
15231
|
-
|
|
15244
|
+
newAnimate.onEnd = cb;
|
|
15245
|
+
var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
|
|
15246
|
+
newData = data.map(function (datum, idx) {
|
|
15232
15247
|
var key = getDatumKey(datum, idx);
|
|
15233
15248
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
|
|
15234
15249
|
});
|
|
15235
15250
|
}
|
|
15236
15251
|
|
|
15237
15252
|
return {
|
|
15238
|
-
animate:
|
|
15239
|
-
data:
|
|
15253
|
+
animate: newAnimate,
|
|
15254
|
+
data: newData
|
|
15240
15255
|
};
|
|
15241
15256
|
}
|
|
15242
15257
|
/**
|
|
@@ -15402,6 +15417,7 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
15402
15417
|
"use strict";
|
|
15403
15418
|
__webpack_require__.r(__webpack_exports__);
|
|
15404
15419
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15420
|
+
/* harmony export */ "assert": () => (/* binding */ assert),
|
|
15405
15421
|
/* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
|
|
15406
15422
|
/* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
|
|
15407
15423
|
/* harmony export */ });
|
|
@@ -15482,6 +15498,18 @@ var testIfSafeProp = function (key) {
|
|
|
15482
15498
|
if (doesPropStartWith(key) || isExactMatch(key)) return true;
|
|
15483
15499
|
return false;
|
|
15484
15500
|
};
|
|
15501
|
+
/**
|
|
15502
|
+
* Asserts that value is not null or undefined, throwing an error if it is.
|
|
15503
|
+
* @param value The value to assert
|
|
15504
|
+
* @param message The error message to throw
|
|
15505
|
+
*/
|
|
15506
|
+
|
|
15507
|
+
|
|
15508
|
+
function assert(value, message) {
|
|
15509
|
+
if (value === undefined || value === null) {
|
|
15510
|
+
throw new Error(message);
|
|
15511
|
+
}
|
|
15512
|
+
}
|
|
15485
15513
|
/**
|
|
15486
15514
|
* getSafeUserProps - function that takes in a props object and removes any
|
|
15487
15515
|
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
@@ -15491,7 +15519,6 @@ var testIfSafeProp = function (key) {
|
|
|
15491
15519
|
* @returns {Object}: object containing remaining acceptable props
|
|
15492
15520
|
*/
|
|
15493
15521
|
|
|
15494
|
-
|
|
15495
15522
|
var getSafeUserProps = function (props) {
|
|
15496
15523
|
var propsToFilter = _objectSpread({}, props);
|
|
15497
15524
|
|