victory-errorbar 36.8.2 → 36.8.4
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-errorbar.js +171 -148
- package/dist/victory-errorbar.min.js +1 -1
- package/es/error-bar.js +5 -7
- package/es/helper-methods.d.ts +1 -1
- package/es/helper-methods.js +28 -27
- package/es/victory-errorbar.d.ts +1 -0
- package/lib/error-bar.js +5 -7
- package/lib/helper-methods.d.ts +1 -1
- package/lib/helper-methods.js +27 -28
- package/lib/victory-errorbar.d.ts +1 -0
- package/package.json +2 -2
- package/src/error-bar.tsx +4 -2
- package/src/helper-methods.tsx +11 -7
package/dist/victory-errorbar.js
CHANGED
|
@@ -143,14 +143,12 @@ var defaultProps = {
|
|
|
143
143
|
role: "presentation",
|
|
144
144
|
shapeRendering: "auto"
|
|
145
145
|
};
|
|
146
|
-
var ErrorBar = function (
|
|
147
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
148
|
-
var
|
|
149
|
-
groupComponent = _props.groupComponent;
|
|
146
|
+
var ErrorBar = function (initialProps) {
|
|
147
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
148
|
+
var groupComponent = props.groupComponent;
|
|
150
149
|
var userProps = victory_core__WEBPACK_IMPORTED_MODULE_4__.getSafeUserProps(props);
|
|
151
|
-
var
|
|
152
|
-
|
|
153
|
-
ariaLabel = _props2.ariaLabel;
|
|
150
|
+
var tabIndex = props.tabIndex,
|
|
151
|
+
ariaLabel = props.ariaLabel;
|
|
154
152
|
var error = calculateError(props);
|
|
155
153
|
var children = [error.right ? renderBorder(props, error, "right") : null, error.left ? renderBorder(props, error, "left") : null, error.bottom ? renderBorder(props, error, "bottom") : null, error.top ? renderBorder(props, error, "top") : null, error.right ? renderCross(props, error, "right") : null, error.left ? renderCross(props, error, "left") : null, error.bottom ? renderCross(props, error, "bottom") : null, error.top ? renderCross(props, error, "top") : null].filter(Boolean);
|
|
156
154
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(groupComponent, _objectSpread({
|
|
@@ -354,29 +352,30 @@ var getLabelProps = function (dataProps, text, style) {
|
|
|
354
352
|
return lodash_defaults__WEBPACK_IMPORTED_MODULE_2___default()({}, labelProps, victory_core__WEBPACK_IMPORTED_MODULE_6__.omit(tooltipTheme, ["style"]));
|
|
355
353
|
};
|
|
356
354
|
|
|
357
|
-
var getBaseProps = function (
|
|
358
|
-
var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(
|
|
359
|
-
|
|
360
|
-
var
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
355
|
+
var getBaseProps = function (initialProps, fallbackProps) {
|
|
356
|
+
var modifiedProps = victory_core__WEBPACK_IMPORTED_MODULE_6__.modifyProps(initialProps, fallbackProps, "errorbar");
|
|
357
|
+
|
|
358
|
+
var props = lodash_assign__WEBPACK_IMPORTED_MODULE_1___default()({}, modifiedProps, getCalculatedValues(modifiedProps));
|
|
359
|
+
|
|
360
|
+
var borderWidth = props.borderWidth,
|
|
361
|
+
data = props.data,
|
|
362
|
+
domain = props.domain,
|
|
363
|
+
events = props.events,
|
|
364
|
+
groupComponent = props.groupComponent,
|
|
365
|
+
height = props.height,
|
|
366
|
+
horizontal = props.horizontal,
|
|
367
|
+
labels = props.labels,
|
|
368
|
+
name = props.name,
|
|
369
|
+
origin = props.origin,
|
|
370
|
+
padding = props.padding,
|
|
371
|
+
polar = props.polar,
|
|
372
|
+
scale = props.scale,
|
|
373
|
+
sharedEvents = props.sharedEvents,
|
|
374
|
+
standalone = props.standalone,
|
|
375
|
+
style = props.style,
|
|
376
|
+
theme = props.theme,
|
|
377
|
+
width = props.width,
|
|
378
|
+
disableInlineStyles = props.disableInlineStyles;
|
|
380
379
|
var initialChildProps = {
|
|
381
380
|
parent: {
|
|
382
381
|
data: data,
|
|
@@ -403,13 +402,13 @@ var getBaseProps = function (props, fallbackProps) {
|
|
|
403
402
|
x = _Helpers$scalePoint.x,
|
|
404
403
|
y = _Helpers$scalePoint.y;
|
|
405
404
|
|
|
406
|
-
|
|
407
|
-
var errorX = getErrors(props,
|
|
408
|
-
var errorY = getErrors(props,
|
|
405
|
+
var formattedDatum = formatDataFromDomain(datum, domain);
|
|
406
|
+
var errorX = getErrors(props, formattedDatum, "x");
|
|
407
|
+
var errorY = getErrors(props, formattedDatum, "y");
|
|
409
408
|
var dataProps = {
|
|
410
409
|
borderWidth: borderWidth,
|
|
411
410
|
data: data,
|
|
412
|
-
datum:
|
|
411
|
+
datum: formattedDatum,
|
|
413
412
|
errorX: horizontal ? errorY : errorX,
|
|
414
413
|
errorY: horizontal ? errorX : errorY,
|
|
415
414
|
groupComponent: groupComponent,
|
|
@@ -7345,12 +7344,12 @@ var interpolateFunction = function (a, b) {
|
|
|
7345
7344
|
* differs in that it uses our custom interpolators when interpolating the value of each property in
|
|
7346
7345
|
* an object. This allows the correct interpolation of nested objects, including styles
|
|
7347
7346
|
*
|
|
7348
|
-
* @param {any}
|
|
7349
|
-
* @param {any}
|
|
7347
|
+
* @param {any} startValue - Start value.
|
|
7348
|
+
* @param {any} endValue - End value.
|
|
7350
7349
|
* @returns {Function} An interpolation function.
|
|
7351
7350
|
*/
|
|
7352
7351
|
|
|
7353
|
-
var interpolateObject = function (
|
|
7352
|
+
var interpolateObject = function (startValue, endValue) {
|
|
7354
7353
|
var interpolateTypes = function (x, y) {
|
|
7355
7354
|
if (x === y || !isInterpolatable(x) || !isInterpolatable(y)) {
|
|
7356
7355
|
return interpolateImmediate(x, y);
|
|
@@ -7375,6 +7374,8 @@ var interpolateObject = function (a, b) {
|
|
|
7375
7374
|
|
|
7376
7375
|
var i = {};
|
|
7377
7376
|
var c = {};
|
|
7377
|
+
var a = startValue;
|
|
7378
|
+
var b = endValue;
|
|
7378
7379
|
var k;
|
|
7379
7380
|
|
|
7380
7381
|
if (a === null || typeof a !== "object") {
|
|
@@ -7542,8 +7543,8 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
|
7542
7543
|
step can generate imprecise values, sometimes greater than 1
|
|
7543
7544
|
if this happens set the state to 1 and return, cancelling the timer
|
|
7544
7545
|
*/
|
|
7545
|
-
|
|
7546
|
-
var step =
|
|
7546
|
+
var animationDuration = duration !== undefined ? duration : _this.props.duration;
|
|
7547
|
+
var step = animationDuration ? elapsed / animationDuration : 1;
|
|
7547
7548
|
|
|
7548
7549
|
if (step >= 1) {
|
|
7549
7550
|
_this.setState({
|
|
@@ -8159,8 +8160,7 @@ var getStyles = function (style, props) {
|
|
|
8159
8160
|
}
|
|
8160
8161
|
|
|
8161
8162
|
var getSingleStyle = function (s) {
|
|
8162
|
-
|
|
8163
|
-
var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s, props);
|
|
8163
|
+
var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles, props);
|
|
8164
8164
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, baseStyles, {
|
|
8165
8165
|
fontSize: getFontSize(baseStyles)
|
|
8166
8166
|
});
|
|
@@ -8364,22 +8364,19 @@ var getInlineXOffset = function (calculatedProps, textElements, index) {
|
|
|
8364
8364
|
switch (textAnchor) {
|
|
8365
8365
|
case "start":
|
|
8366
8366
|
return widths.reduce(function (memo, width, i) {
|
|
8367
|
-
|
|
8368
|
-
return memo;
|
|
8367
|
+
return i < index ? memo + width : memo;
|
|
8369
8368
|
}, 0);
|
|
8370
8369
|
|
|
8371
8370
|
case "end":
|
|
8372
8371
|
return widths.reduce(function (memo, width, i) {
|
|
8373
|
-
|
|
8374
|
-
return memo;
|
|
8372
|
+
return i > index ? memo - width : memo;
|
|
8375
8373
|
}, 0);
|
|
8376
8374
|
|
|
8377
8375
|
default:
|
|
8378
8376
|
// middle
|
|
8379
8377
|
return widths.reduce(function (memo, width, i) {
|
|
8380
8378
|
var offsetWidth = i < index ? width : 0;
|
|
8381
|
-
|
|
8382
|
-
return memo;
|
|
8379
|
+
return i === index ? memo + width / 2 : memo + offsetWidth;
|
|
8383
8380
|
}, centerOffset);
|
|
8384
8381
|
}
|
|
8385
8382
|
};
|
|
@@ -8581,8 +8578,8 @@ var defaultProps = {
|
|
|
8581
8578
|
// Magic number from d3.
|
|
8582
8579
|
lineHeight: 1
|
|
8583
8580
|
};
|
|
8584
|
-
var VictoryLabel = function (
|
|
8585
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
8581
|
+
var VictoryLabel = function (initialProps) {
|
|
8582
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
8586
8583
|
|
|
8587
8584
|
if (props.text === null || props.text === undefined) {
|
|
8588
8585
|
return null;
|
|
@@ -8603,7 +8600,7 @@ var VictoryLabel = function (props) {
|
|
|
8603
8600
|
fontSize: currentStyle.fontSize || defaultStyles.fontSize,
|
|
8604
8601
|
capHeight: capHeightPx,
|
|
8605
8602
|
text: line,
|
|
8606
|
-
//
|
|
8603
|
+
// TODO: This looks like a bug:
|
|
8607
8604
|
textSize: _victory_util_textsize__WEBPACK_IMPORTED_MODULE_12__.approximateTextSize(line, currentStyle),
|
|
8608
8605
|
lineHeight: currentLineHeight,
|
|
8609
8606
|
backgroundPadding: getSingleValue(backgroundPadding, i)
|
|
@@ -10296,8 +10293,7 @@ function addEvents(WrappedComponent) {
|
|
|
10296
10293
|
value: function applyExternalMutations(props, externalMutations) {
|
|
10297
10294
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5___default()(externalMutations)) {
|
|
10298
10295
|
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
10299
|
-
|
|
10300
|
-
return memo;
|
|
10296
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
10301
10297
|
}, []);
|
|
10302
10298
|
var compiledCallbacks = callbacks.length ? function () {
|
|
10303
10299
|
callbacks.forEach(function (c) {
|
|
@@ -10352,8 +10348,8 @@ function addEvents(WrappedComponent) {
|
|
|
10352
10348
|
}, {
|
|
10353
10349
|
key: "getBaseProps",
|
|
10354
10350
|
value: function getBaseProps(props, getSharedEventState) {
|
|
10355
|
-
|
|
10356
|
-
var sharedParentState =
|
|
10351
|
+
var getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
|
|
10352
|
+
var sharedParentState = getSharedEventStateFunction("parent", "parent");
|
|
10357
10353
|
var parentState = this.getEventState("parent", "parent");
|
|
10358
10354
|
|
|
10359
10355
|
var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({}, parentState, sharedParentState);
|
|
@@ -10452,13 +10448,15 @@ function addEvents(WrappedComponent) {
|
|
|
10452
10448
|
var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_0___default()(this.dataKeys, "all");
|
|
10453
10449
|
|
|
10454
10450
|
var labelComponents = dataKeys.reduce(function (memo, key) {
|
|
10451
|
+
var newMemo = memo;
|
|
10452
|
+
|
|
10455
10453
|
var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
|
|
10456
10454
|
|
|
10457
10455
|
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
10458
|
-
|
|
10456
|
+
newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
|
|
10459
10457
|
}
|
|
10460
10458
|
|
|
10461
|
-
return
|
|
10459
|
+
return newMemo;
|
|
10462
10460
|
}, []);
|
|
10463
10461
|
var dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
10464
10462
|
var children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
|
|
@@ -10857,12 +10855,14 @@ function sortData(dataset, sortKey) {
|
|
|
10857
10855
|
} // Ensures previous VictoryLine api for sortKey prop stays consistent
|
|
10858
10856
|
|
|
10859
10857
|
|
|
10858
|
+
var formattedSortKey = sortKey;
|
|
10859
|
+
|
|
10860
10860
|
if (sortKey === "x" || sortKey === "y") {
|
|
10861
|
-
|
|
10861
|
+
formattedSortKey = "_".concat(sortKey);
|
|
10862
10862
|
}
|
|
10863
10863
|
|
|
10864
10864
|
var order = sortOrder === "ascending" ? "asc" : "desc";
|
|
10865
|
-
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset,
|
|
10865
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
|
|
10866
10866
|
} // This method will remove data points that break certain scales. (log scale only)
|
|
10867
10867
|
|
|
10868
10868
|
|
|
@@ -11053,7 +11053,10 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
11053
11053
|
return [];
|
|
11054
11054
|
}
|
|
11055
11055
|
|
|
11056
|
-
var defaultKeys = ["x", "y", "y0"];
|
|
11056
|
+
var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
|
|
11057
|
+
// but we need to figure out why changing it causes regressions in tests.
|
|
11058
|
+
// eslint-disable-next-line no-param-reassign
|
|
11059
|
+
|
|
11057
11060
|
expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
|
|
11058
11061
|
|
|
11059
11062
|
var createAccessor = function (name) {
|
|
@@ -11078,13 +11081,13 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
11078
11081
|
|
|
11079
11082
|
var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
|
|
11080
11083
|
// eslint-disable-line complexity
|
|
11081
|
-
|
|
11084
|
+
var parsedDatum = parseDatum(datum);
|
|
11082
11085
|
var fallbackValues = {
|
|
11083
11086
|
x: index,
|
|
11084
|
-
y:
|
|
11087
|
+
y: parsedDatum
|
|
11085
11088
|
};
|
|
11086
11089
|
var processedValues = expectedKeys.reduce(function (memo, type) {
|
|
11087
|
-
var processedValue = accessor[type](
|
|
11090
|
+
var processedValue = accessor[type](parsedDatum);
|
|
11088
11091
|
var value = processedValue !== undefined ? processedValue : fallbackValues[type];
|
|
11089
11092
|
|
|
11090
11093
|
if (value !== undefined) {
|
|
@@ -11099,7 +11102,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
11099
11102
|
return memo;
|
|
11100
11103
|
}, {});
|
|
11101
11104
|
|
|
11102
|
-
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues,
|
|
11105
|
+
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
|
|
11103
11106
|
|
|
11104
11107
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
|
|
11105
11108
|
dataArr.push(formattedDatum);
|
|
@@ -11210,8 +11213,8 @@ function getStringsFromData(props, axis) {
|
|
|
11210
11213
|
}, []);
|
|
11211
11214
|
var sortedData = sortData(data, props.sortKey, props.sortOrder);
|
|
11212
11215
|
var dataStrings = sortedData.reduce(function (dataArr, datum) {
|
|
11213
|
-
|
|
11214
|
-
dataArr.push(accessor(
|
|
11216
|
+
var parsedDatum = parseDatum(datum);
|
|
11217
|
+
dataArr.push(accessor(parsedDatum));
|
|
11215
11218
|
return dataArr;
|
|
11216
11219
|
}, []).filter(function (datum) {
|
|
11217
11220
|
return typeof datum === "string";
|
|
@@ -11577,18 +11580,18 @@ function padDomain(domain, props, axis) {
|
|
|
11577
11580
|
|
|
11578
11581
|
|
|
11579
11582
|
function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
|
|
11580
|
-
|
|
11581
|
-
|
|
11583
|
+
var getDomainFromDataFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
|
|
11584
|
+
var formatDomainFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
|
|
11582
11585
|
return function (props, axis) {
|
|
11583
11586
|
var propsDomain = getDomainFromProps(props, axis);
|
|
11584
11587
|
|
|
11585
11588
|
if (propsDomain) {
|
|
11586
|
-
return
|
|
11589
|
+
return formatDomainFn(propsDomain, props, axis);
|
|
11587
11590
|
}
|
|
11588
11591
|
|
|
11589
11592
|
var categories = _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
11590
|
-
var domain = categories ? getDomainFromCategories(props, axis, categories) :
|
|
11591
|
-
return domain ?
|
|
11593
|
+
var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
|
|
11594
|
+
return domain ? formatDomainFn(domain, props, axis) : undefined;
|
|
11592
11595
|
};
|
|
11593
11596
|
}
|
|
11594
11597
|
/**
|
|
@@ -11621,27 +11624,27 @@ function getDomain(props, axis) {
|
|
|
11621
11624
|
*/
|
|
11622
11625
|
|
|
11623
11626
|
function getDomainFromCategories(props, axis, categories) {
|
|
11624
|
-
|
|
11627
|
+
var categoriesArray = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
11625
11628
|
var polar = props.polar,
|
|
11626
11629
|
_props$startAngle = props.startAngle,
|
|
11627
11630
|
startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle,
|
|
11628
11631
|
_props$endAngle = props.endAngle,
|
|
11629
11632
|
endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
|
|
11630
11633
|
|
|
11631
|
-
if (!
|
|
11634
|
+
if (!categoriesArray) {
|
|
11632
11635
|
return undefined;
|
|
11633
11636
|
}
|
|
11634
11637
|
|
|
11635
11638
|
var minDomain = getMinFromProps(props, axis);
|
|
11636
11639
|
var maxDomain = getMaxFromProps(props, axis);
|
|
11637
|
-
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(
|
|
11640
|
+
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categoriesArray) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
|
|
11638
11641
|
var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function (memo, string, index) {
|
|
11639
11642
|
memo[string] = index + 1;
|
|
11640
11643
|
return memo;
|
|
11641
11644
|
}, {});
|
|
11642
|
-
var categoryValues = stringMap ?
|
|
11645
|
+
var categoryValues = stringMap ? categoriesArray.map(function (value) {
|
|
11643
11646
|
return stringMap[value];
|
|
11644
|
-
}) :
|
|
11647
|
+
}) : categoriesArray;
|
|
11645
11648
|
var min = minDomain !== undefined ? minDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMinValue(categoryValues);
|
|
11646
11649
|
var max = maxDomain !== undefined ? maxDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMaxValue(categoryValues);
|
|
11647
11650
|
var categoryDomain = getDomainFromMinMax(min, max);
|
|
@@ -11656,7 +11659,7 @@ function getDomainFromCategories(props, axis, categories) {
|
|
|
11656
11659
|
*/
|
|
11657
11660
|
|
|
11658
11661
|
function getDomainFromData(props, axis, dataset) {
|
|
11659
|
-
|
|
11662
|
+
var datasetArray = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
|
|
11660
11663
|
var polar = props.polar,
|
|
11661
11664
|
_props$startAngle2 = props.startAngle,
|
|
11662
11665
|
startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2,
|
|
@@ -11665,14 +11668,14 @@ function getDomainFromData(props, axis, dataset) {
|
|
|
11665
11668
|
var minDomain = getMinFromProps(props, axis);
|
|
11666
11669
|
var maxDomain = getMaxFromProps(props, axis);
|
|
11667
11670
|
|
|
11668
|
-
if (
|
|
11671
|
+
if (datasetArray.length < 1) {
|
|
11669
11672
|
return minDomain !== undefined && maxDomain !== undefined ? getDomainFromMinMax(minDomain, maxDomain) : undefined;
|
|
11670
11673
|
}
|
|
11671
11674
|
|
|
11672
|
-
var min = minDomain !== undefined ? minDomain : getExtremeFromData(
|
|
11673
|
-
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(
|
|
11675
|
+
var min = minDomain !== undefined ? minDomain : getExtremeFromData(datasetArray, axis, "min");
|
|
11676
|
+
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
|
|
11674
11677
|
var domain = getDomainFromMinMax(min, max);
|
|
11675
|
-
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(
|
|
11678
|
+
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
|
|
11676
11679
|
}
|
|
11677
11680
|
/**
|
|
11678
11681
|
* Returns a domain in the form of a two element array given a min and max value.
|
|
@@ -11985,14 +11988,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
11985
11988
|
// eslint-disable-next-line no-invalid-this
|
|
11986
11989
|
|
|
11987
11990
|
|
|
11988
|
-
|
|
11991
|
+
var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
|
|
11989
11992
|
|
|
11990
11993
|
var getTargetProps = function (identifier, type) {
|
|
11991
11994
|
var childName = identifier.childName,
|
|
11992
11995
|
target = identifier.target,
|
|
11993
11996
|
key = identifier.key; // eslint-disable-next-line no-invalid-this
|
|
11994
11997
|
|
|
11995
|
-
var baseType = type === "props" ?
|
|
11998
|
+
var baseType = type === "props" ? newBaseProps : _this2.state || {};
|
|
11996
11999
|
var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
11997
12000
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
11998
12001
|
}; // Returns the state object with the mutation caused by a given eventReturn
|
|
@@ -12009,9 +12012,9 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
12009
12012
|
}
|
|
12010
12013
|
|
|
12011
12014
|
if (eventReturn.eventKey === "all") {
|
|
12012
|
-
return
|
|
12015
|
+
return newBaseProps[childName] ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps[childName]), "parent") : lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps), "parent");
|
|
12013
12016
|
} else if (eventReturn.eventKey === undefined && eventKey === "parent") {
|
|
12014
|
-
return
|
|
12017
|
+
return newBaseProps[childName] ? lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps[childName]) : lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps);
|
|
12015
12018
|
}
|
|
12016
12019
|
|
|
12017
12020
|
return eventReturn.eventKey !== undefined ? eventReturn.eventKey : eventKey;
|
|
@@ -12036,7 +12039,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
12036
12039
|
key: key,
|
|
12037
12040
|
target: target
|
|
12038
12041
|
}, "state");
|
|
12039
|
-
var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState),
|
|
12042
|
+
var mutatedProps = eventReturn.mutation(lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, mutationTargetProps, mutationTargetState), newBaseProps);
|
|
12040
12043
|
var childState = baseState[childName] || {};
|
|
12041
12044
|
|
|
12042
12045
|
var filterState = function (state) {
|
|
@@ -12071,7 +12074,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
12071
12074
|
}; // returns an entire mutated state for all children
|
|
12072
12075
|
|
|
12073
12076
|
|
|
12074
|
-
var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(
|
|
12077
|
+
var allChildNames = childNames === "all" ? lodash_without__WEBPACK_IMPORTED_MODULE_5___default()(lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(newBaseProps), "parent") : childNames;
|
|
12075
12078
|
return Array.isArray(allChildNames) ? allChildNames.reduce(function (memo, childName) {
|
|
12076
12079
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()(memo, getReturnByChild(childName));
|
|
12077
12080
|
}, {}) : getReturnByChild(allChildNames);
|
|
@@ -12080,8 +12083,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
12080
12083
|
|
|
12081
12084
|
var parseEventReturn = function (eventReturn, eventKey) {
|
|
12082
12085
|
return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
|
|
12083
|
-
|
|
12084
|
-
return memo;
|
|
12086
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
|
|
12085
12087
|
}, {}) : parseEvent(eventReturn, eventKey);
|
|
12086
12088
|
};
|
|
12087
12089
|
|
|
@@ -12167,9 +12169,10 @@ function getEventState(eventKey, namespace, childType) {
|
|
|
12167
12169
|
*/
|
|
12168
12170
|
// eslint-disable-next-line max-params
|
|
12169
12171
|
|
|
12170
|
-
function getExternalMutationsWithChildren(mutations
|
|
12171
|
-
baseProps =
|
|
12172
|
-
baseState =
|
|
12172
|
+
function getExternalMutationsWithChildren(mutations) {
|
|
12173
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12174
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
12175
|
+
var childNames = arguments.length > 3 ? arguments[3] : undefined;
|
|
12173
12176
|
return childNames.reduce(function (memo, childName) {
|
|
12174
12177
|
var childState = baseState[childName];
|
|
12175
12178
|
var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
@@ -12191,9 +12194,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
12191
12194
|
*/
|
|
12192
12195
|
// eslint-disable-next-line max-params
|
|
12193
12196
|
|
|
12194
|
-
function getExternalMutations(mutations
|
|
12195
|
-
baseProps =
|
|
12196
|
-
baseState =
|
|
12197
|
+
function getExternalMutations(mutations) {
|
|
12198
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12199
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
12200
|
+
var childName = arguments.length > 3 ? arguments[3] : undefined;
|
|
12197
12201
|
|
|
12198
12202
|
var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
|
|
12199
12203
|
|
|
@@ -12259,8 +12263,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
12259
12263
|
return false;
|
|
12260
12264
|
};
|
|
12261
12265
|
|
|
12262
|
-
|
|
12263
|
-
var scopedMutations = mutations;
|
|
12266
|
+
var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
|
|
12264
12267
|
|
|
12265
12268
|
if (identifier.childName) {
|
|
12266
12269
|
scopedMutations = mutations.filter(function (m) {
|
|
@@ -12299,13 +12302,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
12299
12302
|
|
|
12300
12303
|
function getComponentEvents(props, components) {
|
|
12301
12304
|
var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
|
|
12302
|
-
var _memo;
|
|
12303
|
-
|
|
12304
12305
|
var component = props[componentName];
|
|
12305
12306
|
var defaultEvents = component && component.type && component.type.defaultEvents;
|
|
12306
12307
|
var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
|
|
12307
|
-
|
|
12308
|
-
return memo;
|
|
12308
|
+
return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
|
|
12309
12309
|
}, []);
|
|
12310
12310
|
return events && events.length ? events : undefined;
|
|
12311
12311
|
}
|
|
@@ -12663,6 +12663,7 @@ function reduceChildren(children, iteratee) {
|
|
|
12663
12663
|
|
|
12664
12664
|
var traverseChildren = function (childArray, names, parent) {
|
|
12665
12665
|
return childArray.reduce(function (memo, child, index) {
|
|
12666
|
+
var newMemo = memo;
|
|
12666
12667
|
var childRole = child.type && child.type.role;
|
|
12667
12668
|
var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
|
|
12668
12669
|
|
|
@@ -12680,16 +12681,16 @@ function reduceChildren(children, iteratee) {
|
|
|
12680
12681
|
});
|
|
12681
12682
|
|
|
12682
12683
|
var nestedResults = traverseChildren(nestedChildren, _childNames, child);
|
|
12683
|
-
|
|
12684
|
+
newMemo = combine(newMemo, nestedResults);
|
|
12684
12685
|
} else {
|
|
12685
12686
|
var result = iteratee(child, childName, parent);
|
|
12686
12687
|
|
|
12687
12688
|
if (result) {
|
|
12688
|
-
|
|
12689
|
+
newMemo = combine(newMemo, result);
|
|
12689
12690
|
}
|
|
12690
12691
|
}
|
|
12691
12692
|
|
|
12692
|
-
return
|
|
12693
|
+
return newMemo;
|
|
12693
12694
|
}, initialMemo);
|
|
12694
12695
|
};
|
|
12695
12696
|
|
|
@@ -12715,8 +12716,7 @@ function isHorizontal(props) {
|
|
|
12715
12716
|
var childProps = child.props || {};
|
|
12716
12717
|
|
|
12717
12718
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
12718
|
-
|
|
12719
|
-
return memo;
|
|
12719
|
+
return memo || childProps.horizontal;
|
|
12720
12720
|
}
|
|
12721
12721
|
|
|
12722
12722
|
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
|
|
@@ -12769,11 +12769,13 @@ function isMap(x) {
|
|
|
12769
12769
|
}
|
|
12770
12770
|
function shallowToJS(x, whitelist) {
|
|
12771
12771
|
return isIterable(x) ? x.reduce(function (result, curr, key) {
|
|
12772
|
+
var newCurr = curr;
|
|
12773
|
+
|
|
12772
12774
|
if (whitelist && whitelist[key]) {
|
|
12773
|
-
|
|
12775
|
+
newCurr = shallowToJS(curr);
|
|
12774
12776
|
}
|
|
12775
12777
|
|
|
12776
|
-
result[key] =
|
|
12778
|
+
result[key] = newCurr;
|
|
12777
12779
|
return result;
|
|
12778
12780
|
}, isList(x) ? [] : {}) : x;
|
|
12779
12781
|
}
|
|
@@ -12801,12 +12803,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12801
12803
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
12802
12804
|
|
|
12803
12805
|
|
|
12804
|
-
/* eslint-disable no-use-before-define */
|
|
12805
|
-
|
|
12806
12806
|
|
|
12807
12807
|
// Private Functions
|
|
12808
|
-
function getVerticalAnchor(props
|
|
12809
|
-
datum =
|
|
12808
|
+
function getVerticalAnchor(props) {
|
|
12809
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12810
12810
|
var sign = datum._y >= 0 ? 1 : -1;
|
|
12811
12811
|
var labelStyle = props.style && props.style.labels || {};
|
|
12812
12812
|
|
|
@@ -12819,8 +12819,8 @@ function getVerticalAnchor(props, datum) {
|
|
|
12819
12819
|
return "middle";
|
|
12820
12820
|
}
|
|
12821
12821
|
|
|
12822
|
-
function getTextAnchor(props
|
|
12823
|
-
datum =
|
|
12822
|
+
function getTextAnchor(props) {
|
|
12823
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12824
12824
|
var style = props.style,
|
|
12825
12825
|
horizontal = props.horizontal;
|
|
12826
12826
|
var sign = datum._y >= 0 ? 1 : -1;
|
|
@@ -12835,14 +12835,14 @@ function getTextAnchor(props, datum) {
|
|
|
12835
12835
|
return sign >= 0 ? "start" : "end";
|
|
12836
12836
|
}
|
|
12837
12837
|
|
|
12838
|
-
function getAngle(props
|
|
12839
|
-
datum =
|
|
12838
|
+
function getAngle(props) {
|
|
12839
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12840
12840
|
var labelStyle = props.style && props.style.labels || {};
|
|
12841
12841
|
return datum.angle === undefined ? labelStyle.angle : datum.angle;
|
|
12842
12842
|
}
|
|
12843
12843
|
|
|
12844
|
-
function getPadding(props
|
|
12845
|
-
datum =
|
|
12844
|
+
function getPadding(props) {
|
|
12845
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12846
12846
|
var horizontal = props.horizontal,
|
|
12847
12847
|
style = props.style;
|
|
12848
12848
|
var labelStyle = style.labels || {};
|
|
@@ -12921,8 +12921,9 @@ function getPolarOrientation(degrees) {
|
|
|
12921
12921
|
} // Exported Functions
|
|
12922
12922
|
|
|
12923
12923
|
|
|
12924
|
-
function getText(props
|
|
12925
|
-
datum =
|
|
12924
|
+
function getText(props) {
|
|
12925
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
12926
|
+
var index = arguments.length > 2 ? arguments[2] : undefined;
|
|
12926
12927
|
|
|
12927
12928
|
if (datum.label !== undefined) {
|
|
12928
12929
|
return datum.label;
|
|
@@ -14082,11 +14083,10 @@ var Timer = /*#__PURE__*/function () {
|
|
|
14082
14083
|
}, {
|
|
14083
14084
|
key: "subscribe",
|
|
14084
14085
|
value: function subscribe(callback, duration) {
|
|
14085
|
-
duration = this.shouldAnimate ? duration : 0;
|
|
14086
14086
|
var subscriptionID = this.subscribers.push({
|
|
14087
14087
|
startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
|
|
14088
14088
|
callback: callback,
|
|
14089
|
-
duration: duration
|
|
14089
|
+
duration: this.shouldAnimate ? duration : 0
|
|
14090
14090
|
});
|
|
14091
14091
|
this.activeSubscriptions++;
|
|
14092
14092
|
this.start();
|
|
@@ -14273,36 +14273,38 @@ function getInitialChildProps(animate, data) {
|
|
|
14273
14273
|
|
|
14274
14274
|
|
|
14275
14275
|
function getChildBeforeLoad(animate, child, data, cb) {
|
|
14276
|
-
|
|
14276
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
14277
14277
|
onEnd: cb
|
|
14278
14278
|
});
|
|
14279
14279
|
|
|
14280
|
-
if (
|
|
14280
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
14281
14281
|
return {
|
|
14282
|
-
animate:
|
|
14282
|
+
animate: newAnimate,
|
|
14283
14283
|
data: data
|
|
14284
14284
|
};
|
|
14285
14285
|
}
|
|
14286
14286
|
|
|
14287
|
-
var before =
|
|
14287
|
+
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.
|
|
14288
14288
|
|
|
14289
|
-
|
|
14289
|
+
var newData = data.map(function (datum, idx) {
|
|
14290
14290
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
|
|
14291
14291
|
});
|
|
14292
14292
|
return {
|
|
14293
|
-
animate:
|
|
14294
|
-
data:
|
|
14293
|
+
animate: newAnimate,
|
|
14294
|
+
data: newData,
|
|
14295
14295
|
clipWidth: 0
|
|
14296
14296
|
};
|
|
14297
14297
|
} // eslint-disable-next-line max-params
|
|
14298
14298
|
|
|
14299
14299
|
|
|
14300
14300
|
function getChildOnLoad(animate, data, cb) {
|
|
14301
|
-
|
|
14301
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
14302
14302
|
onEnd: cb
|
|
14303
14303
|
});
|
|
14304
14304
|
|
|
14305
|
-
|
|
14305
|
+
var newData = data;
|
|
14306
|
+
|
|
14307
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
14306
14308
|
return {
|
|
14307
14309
|
animate: animate,
|
|
14308
14310
|
data: data
|
|
@@ -14311,12 +14313,12 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
14311
14313
|
|
|
14312
14314
|
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.
|
|
14313
14315
|
|
|
14314
|
-
|
|
14316
|
+
newData = data.map(function (datum, idx) {
|
|
14315
14317
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
|
|
14316
14318
|
});
|
|
14317
14319
|
return {
|
|
14318
|
-
animate:
|
|
14319
|
-
data:
|
|
14320
|
+
animate: newAnimate,
|
|
14321
|
+
data: newData
|
|
14320
14322
|
};
|
|
14321
14323
|
} // eslint-disable-next-line max-params, max-len
|
|
14322
14324
|
|
|
@@ -14325,7 +14327,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
14325
14327
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
14326
14328
|
// transition for all children to have the same duration, delay, etc.
|
|
14327
14329
|
var onExit = animate && animate.onExit;
|
|
14328
|
-
|
|
14330
|
+
|
|
14331
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
|
|
14332
|
+
|
|
14333
|
+
var newData = data;
|
|
14329
14334
|
|
|
14330
14335
|
if (exitingNodes) {
|
|
14331
14336
|
// After the exit transition occurs, trigger the animations for
|
|
@@ -14333,39 +14338,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
14333
14338
|
animate.onEnd = cb;
|
|
14334
14339
|
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.
|
|
14335
14340
|
|
|
14336
|
-
|
|
14341
|
+
newData = data.map(function (datum, idx) {
|
|
14337
14342
|
var key = (datum.key || idx).toString();
|
|
14338
14343
|
return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
14339
14344
|
});
|
|
14340
14345
|
}
|
|
14341
14346
|
|
|
14342
14347
|
return {
|
|
14343
|
-
animate:
|
|
14344
|
-
data:
|
|
14348
|
+
animate: newAnimate,
|
|
14349
|
+
data: newData
|
|
14345
14350
|
};
|
|
14346
14351
|
} // eslint-disable-next-line max-params,max-len
|
|
14347
14352
|
|
|
14348
14353
|
|
|
14349
14354
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
14355
|
+
var newAnimate = animate;
|
|
14356
|
+
var newData = data;
|
|
14357
|
+
|
|
14350
14358
|
if (enteringNodes) {
|
|
14351
14359
|
// Perform a normal animation here, except - when it finishes - trigger
|
|
14352
14360
|
// the transition for entering nodes.
|
|
14353
|
-
|
|
14361
|
+
newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
14354
14362
|
onEnd: cb
|
|
14355
14363
|
});
|
|
14356
14364
|
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
|
|
14357
14365
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
14358
14366
|
// so perform the `onEnter.before` transformation on each node.
|
|
14359
14367
|
|
|
14360
|
-
|
|
14368
|
+
newData = data.map(function (datum, idx) {
|
|
14361
14369
|
var key = (datum.key || idx).toString();
|
|
14362
14370
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
14363
14371
|
});
|
|
14364
14372
|
}
|
|
14365
14373
|
|
|
14366
14374
|
return {
|
|
14367
|
-
animate:
|
|
14368
|
-
data:
|
|
14375
|
+
animate: newAnimate,
|
|
14376
|
+
data: newData
|
|
14369
14377
|
};
|
|
14370
14378
|
} // eslint-disable-next-line max-params, max-len
|
|
14371
14379
|
|
|
@@ -14374,23 +14382,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
14374
14382
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
14375
14383
|
// transition for all children to have the same duration, delay, etc.
|
|
14376
14384
|
var onEnter = animate && animate.onEnter;
|
|
14377
|
-
|
|
14385
|
+
|
|
14386
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
|
|
14387
|
+
|
|
14388
|
+
var newData = data;
|
|
14378
14389
|
|
|
14379
14390
|
if (enteringNodes) {
|
|
14380
14391
|
// Old nodes have been transitioned to their new values, and the
|
|
14381
14392
|
// domain should encompass the nodes that will now enter. So perform
|
|
14382
14393
|
// the `onEnter.after` transformation on each node.
|
|
14383
|
-
|
|
14384
|
-
var after =
|
|
14385
|
-
|
|
14394
|
+
newAnimate.onEnd = cb;
|
|
14395
|
+
var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
|
|
14396
|
+
newData = data.map(function (datum, idx) {
|
|
14386
14397
|
var key = getDatumKey(datum, idx);
|
|
14387
14398
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
|
|
14388
14399
|
});
|
|
14389
14400
|
}
|
|
14390
14401
|
|
|
14391
14402
|
return {
|
|
14392
|
-
animate:
|
|
14393
|
-
data:
|
|
14403
|
+
animate: newAnimate,
|
|
14404
|
+
data: newData
|
|
14394
14405
|
};
|
|
14395
14406
|
}
|
|
14396
14407
|
/**
|
|
@@ -14556,6 +14567,7 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
14556
14567
|
"use strict";
|
|
14557
14568
|
__webpack_require__.r(__webpack_exports__);
|
|
14558
14569
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14570
|
+
/* harmony export */ "assert": () => (/* binding */ assert),
|
|
14559
14571
|
/* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
|
|
14560
14572
|
/* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
|
|
14561
14573
|
/* harmony export */ });
|
|
@@ -14636,6 +14648,18 @@ var testIfSafeProp = function (key) {
|
|
|
14636
14648
|
if (doesPropStartWith(key) || isExactMatch(key)) return true;
|
|
14637
14649
|
return false;
|
|
14638
14650
|
};
|
|
14651
|
+
/**
|
|
14652
|
+
* Asserts that value is not null or undefined, throwing an error if it is.
|
|
14653
|
+
* @param value The value to assert
|
|
14654
|
+
* @param message The error message to throw
|
|
14655
|
+
*/
|
|
14656
|
+
|
|
14657
|
+
|
|
14658
|
+
function assert(value, message) {
|
|
14659
|
+
if (value === undefined || value === null) {
|
|
14660
|
+
throw new Error(message);
|
|
14661
|
+
}
|
|
14662
|
+
}
|
|
14639
14663
|
/**
|
|
14640
14664
|
* getSafeUserProps - function that takes in a props object and removes any
|
|
14641
14665
|
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
@@ -14645,7 +14669,6 @@ var testIfSafeProp = function (key) {
|
|
|
14645
14669
|
* @returns {Object}: object containing remaining acceptable props
|
|
14646
14670
|
*/
|
|
14647
14671
|
|
|
14648
|
-
|
|
14649
14672
|
var getSafeUserProps = function (props) {
|
|
14650
14673
|
var propsToFilter = _objectSpread({}, props);
|
|
14651
14674
|
|