victory-chart 36.8.2 → 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 +6 -0
- package/dist/victory-chart.js +213 -217
- package/dist/victory-chart.min.js +1 -1
- package/es/helper-methods.d.ts +1 -1
- package/es/helper-methods.js +16 -18
- package/lib/helper-methods.d.ts +1 -1
- package/lib/helper-methods.js +18 -18
- package/package.json +5 -5
- package/src/helper-methods.tsx +14 -14
package/dist/victory-chart.js
CHANGED
|
@@ -121,12 +121,11 @@ function getStyles(props) {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
function getCalculatedProps(
|
|
125
|
-
var style = getStyles(
|
|
126
|
-
props = victory_core__WEBPACK_IMPORTED_MODULE_4__.modifyProps(
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
polar = _props.polar;
|
|
124
|
+
function getCalculatedProps(initialProps, childComponents) {
|
|
125
|
+
var style = getStyles(initialProps);
|
|
126
|
+
var props = victory_core__WEBPACK_IMPORTED_MODULE_4__.modifyProps(initialProps, fallbackProps, "chart");
|
|
127
|
+
var horizontal = props.horizontal,
|
|
128
|
+
polar = props.polar;
|
|
130
129
|
var allStrings = victory_core__WEBPACK_IMPORTED_MODULE_5__.getStringsFromChildren(props, childComponents);
|
|
131
130
|
var categories = victory_core__WEBPACK_IMPORTED_MODULE_5__.getCategories(props, childComponents, allStrings);
|
|
132
131
|
var stringMap = createStringMap(props, childComponents, allStrings);
|
|
@@ -165,23 +164,22 @@ function getCalculatedProps(props, childComponents) {
|
|
|
165
164
|
};
|
|
166
165
|
}
|
|
167
166
|
function getChildren(props, childComponents, calculatedProps) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
var baseStyle =
|
|
167
|
+
var children = childComponents || getChildComponents(props);
|
|
168
|
+
var newCalculatedProps = calculatedProps || getCalculatedProps(props, children);
|
|
169
|
+
var baseStyle = newCalculatedProps.style.parent;
|
|
171
170
|
var height = props.height,
|
|
172
171
|
polar = props.polar,
|
|
173
172
|
theme = props.theme,
|
|
174
173
|
width = props.width;
|
|
175
|
-
var
|
|
176
|
-
|
|
177
|
-
horizontal = _calculatedProps.horizontal;
|
|
174
|
+
var origin = newCalculatedProps.origin,
|
|
175
|
+
horizontal = newCalculatedProps.horizontal;
|
|
178
176
|
var parentName = props.name || "chart";
|
|
179
|
-
return
|
|
177
|
+
return children.filter((react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement)).map(function (child, index) {
|
|
180
178
|
var role = child.type && child.type.role;
|
|
181
179
|
var style = Array.isArray(child.props.style) ? child.props.style : lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, child.props.style, {
|
|
182
180
|
parent: baseStyle
|
|
183
181
|
});
|
|
184
|
-
var childProps = getChildProps(child, props,
|
|
182
|
+
var childProps = getChildProps(child, props, newCalculatedProps);
|
|
185
183
|
var name = child.props.name || "".concat(parentName, "-").concat(role, "-").concat(index);
|
|
186
184
|
|
|
187
185
|
var newProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({
|
|
@@ -193,7 +191,7 @@ function getChildren(props, childComponents, calculatedProps) {
|
|
|
193
191
|
style: style,
|
|
194
192
|
name: name,
|
|
195
193
|
origin: polar ? origin : undefined,
|
|
196
|
-
padding:
|
|
194
|
+
padding: newCalculatedProps.padding,
|
|
197
195
|
key: "".concat(name, "-key-").concat(index),
|
|
198
196
|
standalone: false
|
|
199
197
|
}, childProps);
|
|
@@ -221,9 +219,9 @@ var getChildComponents = function (props, defaultAxes) {
|
|
|
221
219
|
};
|
|
222
220
|
|
|
223
221
|
var getDomain = function (props, axis, childComponents) {
|
|
224
|
-
|
|
225
|
-
var domain = victory_core__WEBPACK_IMPORTED_MODULE_5__.getDomain(props, axis,
|
|
226
|
-
var axisComponent = victory_core__WEBPACK_IMPORTED_MODULE_3__.getAxisComponent(
|
|
222
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_2___default().Children.toArray(props.children);
|
|
223
|
+
var domain = victory_core__WEBPACK_IMPORTED_MODULE_5__.getDomain(props, axis, children);
|
|
224
|
+
var axisComponent = victory_core__WEBPACK_IMPORTED_MODULE_3__.getAxisComponent(children, axis);
|
|
227
225
|
var invertDomain = axisComponent && axisComponent.props && axisComponent.props.invertAxis;
|
|
228
226
|
return invertDomain ? domain.concat().reverse() : domain;
|
|
229
227
|
};
|
|
@@ -423,7 +421,7 @@ var VictoryChartImpl = function (initialProps) {
|
|
|
423
421
|
}, [setAnimationState, previousProps, propsWithDefaults]);
|
|
424
422
|
|
|
425
423
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_0___default()(events)) {
|
|
426
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_16__
|
|
424
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(victory_shared_events__WEBPACK_IMPORTED_MODULE_16__.VictorySharedEvents, {
|
|
427
425
|
container: container,
|
|
428
426
|
eventKey: eventKey,
|
|
429
427
|
events: events,
|
|
@@ -7785,9 +7783,9 @@ var getStyleObject = function (props) {
|
|
|
7785
7783
|
return generalAxisStyle && specificAxisStyle ? mergeStyles() : specificAxisStyle || generalAxisStyle;
|
|
7786
7784
|
};
|
|
7787
7785
|
|
|
7788
|
-
var getStyles = function (props
|
|
7786
|
+
var getStyles = function (props) {
|
|
7787
|
+
var styleObject = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7789
7788
|
var style = props.style || {};
|
|
7790
|
-
styleObject = styleObject || {};
|
|
7791
7789
|
var parentStyleProps = {
|
|
7792
7790
|
height: "100%",
|
|
7793
7791
|
width: "100%"
|
|
@@ -8244,8 +8242,8 @@ var getCalculatedValues = function (props) {
|
|
|
8244
8242
|
};
|
|
8245
8243
|
};
|
|
8246
8244
|
|
|
8247
|
-
var getBaseProps = function (
|
|
8248
|
-
props = victory_core__WEBPACK_IMPORTED_MODULE_2__.modifyProps(
|
|
8245
|
+
var getBaseProps = function (initialProps, fallbackProps) {
|
|
8246
|
+
var props = victory_core__WEBPACK_IMPORTED_MODULE_2__.modifyProps(initialProps, fallbackProps);
|
|
8249
8247
|
var calculatedValues = getCalculatedValues(props);
|
|
8250
8248
|
var axis = calculatedValues.axis,
|
|
8251
8249
|
style = calculatedValues.style,
|
|
@@ -8258,14 +8256,13 @@ var getBaseProps = function (props, fallbackProps) {
|
|
|
8258
8256
|
domain = calculatedValues.domain,
|
|
8259
8257
|
stringTicks = calculatedValues.stringTicks;
|
|
8260
8258
|
var otherAxis = axis === "x" ? "y" : "x";
|
|
8261
|
-
var
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
horizontal = _props.horizontal;
|
|
8259
|
+
var width = props.width,
|
|
8260
|
+
height = props.height,
|
|
8261
|
+
standalone = props.standalone,
|
|
8262
|
+
theme = props.theme,
|
|
8263
|
+
polar = props.polar,
|
|
8264
|
+
padding = props.padding,
|
|
8265
|
+
horizontal = props.horizontal;
|
|
8269
8266
|
|
|
8270
8267
|
var _getLayoutProps = getLayoutProps(props, calculatedValues),
|
|
8271
8268
|
globalTransform = _getLayoutProps.globalTransform,
|
|
@@ -8799,12 +8796,12 @@ var interpolateFunction = function (a, b) {
|
|
|
8799
8796
|
* differs in that it uses our custom interpolators when interpolating the value of each property in
|
|
8800
8797
|
* an object. This allows the correct interpolation of nested objects, including styles
|
|
8801
8798
|
*
|
|
8802
|
-
* @param {any}
|
|
8803
|
-
* @param {any}
|
|
8799
|
+
* @param {any} startValue - Start value.
|
|
8800
|
+
* @param {any} endValue - End value.
|
|
8804
8801
|
* @returns {Function} An interpolation function.
|
|
8805
8802
|
*/
|
|
8806
8803
|
|
|
8807
|
-
var interpolateObject = function (
|
|
8804
|
+
var interpolateObject = function (startValue, endValue) {
|
|
8808
8805
|
var interpolateTypes = function (x, y) {
|
|
8809
8806
|
if (x === y || !isInterpolatable(x) || !isInterpolatable(y)) {
|
|
8810
8807
|
return interpolateImmediate(x, y);
|
|
@@ -8829,6 +8826,8 @@ var interpolateObject = function (a, b) {
|
|
|
8829
8826
|
|
|
8830
8827
|
var i = {};
|
|
8831
8828
|
var c = {};
|
|
8829
|
+
var a = startValue;
|
|
8830
|
+
var b = endValue;
|
|
8832
8831
|
var k;
|
|
8833
8832
|
|
|
8834
8833
|
if (a === null || typeof a !== "object") {
|
|
@@ -8996,8 +8995,8 @@ var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
|
8996
8995
|
step can generate imprecise values, sometimes greater than 1
|
|
8997
8996
|
if this happens set the state to 1 and return, cancelling the timer
|
|
8998
8997
|
*/
|
|
8999
|
-
|
|
9000
|
-
var step =
|
|
8998
|
+
var animationDuration = duration !== undefined ? duration : _this.props.duration;
|
|
8999
|
+
var step = animationDuration ? elapsed / animationDuration : 1;
|
|
9001
9000
|
|
|
9002
9001
|
if (step >= 1) {
|
|
9003
9002
|
_this.setState({
|
|
@@ -9613,8 +9612,7 @@ var getStyles = function (style, props) {
|
|
|
9613
9612
|
}
|
|
9614
9613
|
|
|
9615
9614
|
var getSingleStyle = function (s) {
|
|
9616
|
-
|
|
9617
|
-
var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s, props);
|
|
9615
|
+
var baseStyles = _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateStyle(s ? lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, s, defaultStyles) : defaultStyles, props);
|
|
9618
9616
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({}, baseStyles, {
|
|
9619
9617
|
fontSize: getFontSize(baseStyles)
|
|
9620
9618
|
});
|
|
@@ -9818,22 +9816,19 @@ var getInlineXOffset = function (calculatedProps, textElements, index) {
|
|
|
9818
9816
|
switch (textAnchor) {
|
|
9819
9817
|
case "start":
|
|
9820
9818
|
return widths.reduce(function (memo, width, i) {
|
|
9821
|
-
|
|
9822
|
-
return memo;
|
|
9819
|
+
return i < index ? memo + width : memo;
|
|
9823
9820
|
}, 0);
|
|
9824
9821
|
|
|
9825
9822
|
case "end":
|
|
9826
9823
|
return widths.reduce(function (memo, width, i) {
|
|
9827
|
-
|
|
9828
|
-
return memo;
|
|
9824
|
+
return i > index ? memo - width : memo;
|
|
9829
9825
|
}, 0);
|
|
9830
9826
|
|
|
9831
9827
|
default:
|
|
9832
9828
|
// middle
|
|
9833
9829
|
return widths.reduce(function (memo, width, i) {
|
|
9834
9830
|
var offsetWidth = i < index ? width : 0;
|
|
9835
|
-
|
|
9836
|
-
return memo;
|
|
9831
|
+
return i === index ? memo + width / 2 : memo + offsetWidth;
|
|
9837
9832
|
}, centerOffset);
|
|
9838
9833
|
}
|
|
9839
9834
|
};
|
|
@@ -10035,8 +10030,8 @@ var defaultProps = {
|
|
|
10035
10030
|
// Magic number from d3.
|
|
10036
10031
|
lineHeight: 1
|
|
10037
10032
|
};
|
|
10038
|
-
var VictoryLabel = function (
|
|
10039
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
10033
|
+
var VictoryLabel = function (initialProps) {
|
|
10034
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
10040
10035
|
|
|
10041
10036
|
if (props.text === null || props.text === undefined) {
|
|
10042
10037
|
return null;
|
|
@@ -10057,7 +10052,7 @@ var VictoryLabel = function (props) {
|
|
|
10057
10052
|
fontSize: currentStyle.fontSize || defaultStyles.fontSize,
|
|
10058
10053
|
capHeight: capHeightPx,
|
|
10059
10054
|
text: line,
|
|
10060
|
-
//
|
|
10055
|
+
// TODO: This looks like a bug:
|
|
10061
10056
|
textSize: _victory_util_textsize__WEBPACK_IMPORTED_MODULE_12__.approximateTextSize(line, currentStyle),
|
|
10062
10057
|
lineHeight: currentLineHeight,
|
|
10063
10058
|
backgroundPadding: getSingleValue(backgroundPadding, i)
|
|
@@ -10497,8 +10492,8 @@ var defaultProps = {
|
|
|
10497
10492
|
role: "presentation",
|
|
10498
10493
|
shapeRendering: "auto"
|
|
10499
10494
|
};
|
|
10500
|
-
var Arc = function (
|
|
10501
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
10495
|
+
var Arc = function (initialProps) {
|
|
10496
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
10502
10497
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.pathComponent, _objectSpread(_objectSpread({}, props.events), {}, {
|
|
10503
10498
|
"aria-label": props.ariaLabel,
|
|
10504
10499
|
d: getArcPath(props),
|
|
@@ -10578,8 +10573,8 @@ var defaultProps = {
|
|
|
10578
10573
|
role: "presentation",
|
|
10579
10574
|
shapeRendering: "auto"
|
|
10580
10575
|
};
|
|
10581
|
-
var Background = function (
|
|
10582
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
10576
|
+
var Background = function (initialProps) {
|
|
10577
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
10583
10578
|
return props.polar ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.circleComponent, _objectSpread(_objectSpread({}, props.events), {}, {
|
|
10584
10579
|
style: props.style,
|
|
10585
10580
|
role: props.role,
|
|
@@ -10735,8 +10730,8 @@ var defaultProps = {
|
|
|
10735
10730
|
role: "presentation",
|
|
10736
10731
|
shapeRendering: "auto"
|
|
10737
10732
|
};
|
|
10738
|
-
var LineSegment = function (
|
|
10739
|
-
props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps),
|
|
10733
|
+
var LineSegment = function (initialProps) {
|
|
10734
|
+
var props = evaluateProps(_objectSpread(_objectSpread({}, defaultProps), initialProps));
|
|
10740
10735
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.lineComponent, _objectSpread(_objectSpread({}, props.events), {}, {
|
|
10741
10736
|
"aria-label": props.ariaLabel,
|
|
10742
10737
|
style: props.style,
|
|
@@ -12163,8 +12158,7 @@ function addEvents(WrappedComponent) {
|
|
|
12163
12158
|
value: function applyExternalMutations(props, externalMutations) {
|
|
12164
12159
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_5___default()(externalMutations)) {
|
|
12165
12160
|
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
12166
|
-
|
|
12167
|
-
return memo;
|
|
12161
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_4___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
12168
12162
|
}, []);
|
|
12169
12163
|
var compiledCallbacks = callbacks.length ? function () {
|
|
12170
12164
|
callbacks.forEach(function (c) {
|
|
@@ -12219,8 +12213,8 @@ function addEvents(WrappedComponent) {
|
|
|
12219
12213
|
}, {
|
|
12220
12214
|
key: "getBaseProps",
|
|
12221
12215
|
value: function getBaseProps(props, getSharedEventState) {
|
|
12222
|
-
|
|
12223
|
-
var sharedParentState =
|
|
12216
|
+
var getSharedEventStateFunction = getSharedEventState || this.getSharedEventState.bind(this);
|
|
12217
|
+
var sharedParentState = getSharedEventStateFunction("parent", "parent");
|
|
12224
12218
|
var parentState = this.getEventState("parent", "parent");
|
|
12225
12219
|
|
|
12226
12220
|
var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({}, parentState, sharedParentState);
|
|
@@ -12319,13 +12313,15 @@ function addEvents(WrappedComponent) {
|
|
|
12319
12313
|
var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_0___default()(this.dataKeys, "all");
|
|
12320
12314
|
|
|
12321
12315
|
var labelComponents = dataKeys.reduce(function (memo, key) {
|
|
12316
|
+
var newMemo = memo;
|
|
12317
|
+
|
|
12322
12318
|
var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
|
|
12323
12319
|
|
|
12324
12320
|
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
12325
|
-
|
|
12321
|
+
newMemo = newMemo.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
|
|
12326
12322
|
}
|
|
12327
12323
|
|
|
12328
|
-
return
|
|
12324
|
+
return newMemo;
|
|
12329
12325
|
}, []);
|
|
12330
12326
|
var dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
12331
12327
|
var children = [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
|
|
@@ -12471,11 +12467,11 @@ function getAxis(props) {
|
|
|
12471
12467
|
*/
|
|
12472
12468
|
|
|
12473
12469
|
function findAxisComponents(childComponents, predicate) {
|
|
12474
|
-
|
|
12470
|
+
var predicateFunction = predicate || (lodash_identity__WEBPACK_IMPORTED_MODULE_9___default());
|
|
12475
12471
|
|
|
12476
12472
|
var findAxes = function (children) {
|
|
12477
12473
|
return children.reduce(function (memo, child) {
|
|
12478
|
-
if (child.type && child.type.role === "axis" &&
|
|
12474
|
+
if (child.type && child.type.role === "axis" && predicateFunction(child)) {
|
|
12479
12475
|
return memo.concat(child);
|
|
12480
12476
|
} else if (child.props && child.props.children) {
|
|
12481
12477
|
return memo.concat(findAxes(react__WEBPACK_IMPORTED_MODULE_12___default().Children.toArray(child.props.children)));
|
|
@@ -13219,12 +13215,14 @@ function sortData(dataset, sortKey) {
|
|
|
13219
13215
|
} // Ensures previous VictoryLine api for sortKey prop stays consistent
|
|
13220
13216
|
|
|
13221
13217
|
|
|
13218
|
+
var formattedSortKey = sortKey;
|
|
13219
|
+
|
|
13222
13220
|
if (sortKey === "x" || sortKey === "y") {
|
|
13223
|
-
|
|
13221
|
+
formattedSortKey = "_".concat(sortKey);
|
|
13224
13222
|
}
|
|
13225
13223
|
|
|
13226
13224
|
var order = sortOrder === "ascending" ? "asc" : "desc";
|
|
13227
|
-
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset,
|
|
13225
|
+
return lodash_orderBy__WEBPACK_IMPORTED_MODULE_5___default()(dataset, formattedSortKey, order);
|
|
13228
13226
|
} // This method will remove data points that break certain scales. (log scale only)
|
|
13229
13227
|
|
|
13230
13228
|
|
|
@@ -13415,7 +13413,10 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
13415
13413
|
return [];
|
|
13416
13414
|
}
|
|
13417
13415
|
|
|
13418
|
-
var defaultKeys = ["x", "y", "y0"];
|
|
13416
|
+
var defaultKeys = ["x", "y", "y0"]; // TODO: We shouldn’t mutate the expectedKeys param here,
|
|
13417
|
+
// but we need to figure out why changing it causes regressions in tests.
|
|
13418
|
+
// eslint-disable-next-line no-param-reassign
|
|
13419
|
+
|
|
13419
13420
|
expectedKeys = Array.isArray(expectedKeys) ? expectedKeys : defaultKeys;
|
|
13420
13421
|
|
|
13421
13422
|
var createAccessor = function (name) {
|
|
@@ -13440,13 +13441,13 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
13440
13441
|
|
|
13441
13442
|
var data = preformattedData ? dataset : dataset.reduce(function (dataArr, datum, index) {
|
|
13442
13443
|
// eslint-disable-line complexity
|
|
13443
|
-
|
|
13444
|
+
var parsedDatum = parseDatum(datum);
|
|
13444
13445
|
var fallbackValues = {
|
|
13445
13446
|
x: index,
|
|
13446
|
-
y:
|
|
13447
|
+
y: parsedDatum
|
|
13447
13448
|
};
|
|
13448
13449
|
var processedValues = expectedKeys.reduce(function (memo, type) {
|
|
13449
|
-
var processedValue = accessor[type](
|
|
13450
|
+
var processedValue = accessor[type](parsedDatum);
|
|
13450
13451
|
var value = processedValue !== undefined ? processedValue : fallbackValues[type];
|
|
13451
13452
|
|
|
13452
13453
|
if (value !== undefined) {
|
|
@@ -13461,7 +13462,7 @@ function formatData(dataset, props, expectedKeys) {
|
|
|
13461
13462
|
return memo;
|
|
13462
13463
|
}, {});
|
|
13463
13464
|
|
|
13464
|
-
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues,
|
|
13465
|
+
var formattedDatum = lodash_assign__WEBPACK_IMPORTED_MODULE_12___default()({}, processedValues, parsedDatum);
|
|
13465
13466
|
|
|
13466
13467
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_4___default()(formattedDatum)) {
|
|
13467
13468
|
dataArr.push(formattedDatum);
|
|
@@ -13572,8 +13573,8 @@ function getStringsFromData(props, axis) {
|
|
|
13572
13573
|
}, []);
|
|
13573
13574
|
var sortedData = sortData(data, props.sortKey, props.sortOrder);
|
|
13574
13575
|
var dataStrings = sortedData.reduce(function (dataArr, datum) {
|
|
13575
|
-
|
|
13576
|
-
dataArr.push(accessor(
|
|
13576
|
+
var parsedDatum = parseDatum(datum);
|
|
13577
|
+
dataArr.push(accessor(parsedDatum));
|
|
13577
13578
|
return dataArr;
|
|
13578
13579
|
}, []).filter(function (datum) {
|
|
13579
13580
|
return typeof datum === "string";
|
|
@@ -13817,18 +13818,18 @@ function padDomain(domain, props, axis) {
|
|
|
13817
13818
|
|
|
13818
13819
|
|
|
13819
13820
|
function createDomainFunction(getDomainFromDataFunction, formatDomainFunction) {
|
|
13820
|
-
|
|
13821
|
-
|
|
13821
|
+
var getDomainFromDataFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(getDomainFromDataFunction) ? getDomainFromDataFunction : getDomainFromData;
|
|
13822
|
+
var formatDomainFn = lodash_isFunction__WEBPACK_IMPORTED_MODULE_2___default()(formatDomainFunction) ? formatDomainFunction : formatDomain;
|
|
13822
13823
|
return function (props, axis) {
|
|
13823
13824
|
var propsDomain = getDomainFromProps(props, axis);
|
|
13824
13825
|
|
|
13825
13826
|
if (propsDomain) {
|
|
13826
|
-
return
|
|
13827
|
+
return formatDomainFn(propsDomain, props, axis);
|
|
13827
13828
|
}
|
|
13828
13829
|
|
|
13829
13830
|
var categories = _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
13830
|
-
var domain = categories ? getDomainFromCategories(props, axis, categories) :
|
|
13831
|
-
return domain ?
|
|
13831
|
+
var domain = categories ? getDomainFromCategories(props, axis, categories) : getDomainFromDataFn(props, axis);
|
|
13832
|
+
return domain ? formatDomainFn(domain, props, axis) : undefined;
|
|
13832
13833
|
};
|
|
13833
13834
|
}
|
|
13834
13835
|
/**
|
|
@@ -13861,27 +13862,27 @@ function getDomain(props, axis) {
|
|
|
13861
13862
|
*/
|
|
13862
13863
|
|
|
13863
13864
|
function getDomainFromCategories(props, axis, categories) {
|
|
13864
|
-
|
|
13865
|
+
var categoriesArray = categories || _data__WEBPACK_IMPORTED_MODULE_10__.getCategories(props, axis);
|
|
13865
13866
|
var polar = props.polar,
|
|
13866
13867
|
_props$startAngle = props.startAngle,
|
|
13867
13868
|
startAngle = _props$startAngle === void 0 ? 0 : _props$startAngle,
|
|
13868
13869
|
_props$endAngle = props.endAngle,
|
|
13869
13870
|
endAngle = _props$endAngle === void 0 ? 360 : _props$endAngle;
|
|
13870
13871
|
|
|
13871
|
-
if (!
|
|
13872
|
+
if (!categoriesArray) {
|
|
13872
13873
|
return undefined;
|
|
13873
13874
|
}
|
|
13874
13875
|
|
|
13875
13876
|
var minDomain = getMinFromProps(props, axis);
|
|
13876
13877
|
var maxDomain = getMaxFromProps(props, axis);
|
|
13877
|
-
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(
|
|
13878
|
+
var stringArray = _collection__WEBPACK_IMPORTED_MODULE_8__.containsStrings(categoriesArray) ? _data__WEBPACK_IMPORTED_MODULE_10__.getStringsFromCategories(props, axis) : [];
|
|
13878
13879
|
var stringMap = stringArray.length === 0 ? null : stringArray.reduce(function (memo, string, index) {
|
|
13879
13880
|
memo[string] = index + 1;
|
|
13880
13881
|
return memo;
|
|
13881
13882
|
}, {});
|
|
13882
|
-
var categoryValues = stringMap ?
|
|
13883
|
+
var categoryValues = stringMap ? categoriesArray.map(function (value) {
|
|
13883
13884
|
return stringMap[value];
|
|
13884
|
-
}) :
|
|
13885
|
+
}) : categoriesArray;
|
|
13885
13886
|
var min = minDomain !== undefined ? minDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMinValue(categoryValues);
|
|
13886
13887
|
var max = maxDomain !== undefined ? maxDomain : _collection__WEBPACK_IMPORTED_MODULE_8__.getMaxValue(categoryValues);
|
|
13887
13888
|
var categoryDomain = getDomainFromMinMax(min, max);
|
|
@@ -13896,7 +13897,7 @@ function getDomainFromCategories(props, axis, categories) {
|
|
|
13896
13897
|
*/
|
|
13897
13898
|
|
|
13898
13899
|
function getDomainFromData(props, axis, dataset) {
|
|
13899
|
-
|
|
13900
|
+
var datasetArray = dataset || _data__WEBPACK_IMPORTED_MODULE_10__.getData(props);
|
|
13900
13901
|
var polar = props.polar,
|
|
13901
13902
|
_props$startAngle2 = props.startAngle,
|
|
13902
13903
|
startAngle = _props$startAngle2 === void 0 ? 0 : _props$startAngle2,
|
|
@@ -13905,14 +13906,14 @@ function getDomainFromData(props, axis, dataset) {
|
|
|
13905
13906
|
var minDomain = getMinFromProps(props, axis);
|
|
13906
13907
|
var maxDomain = getMaxFromProps(props, axis);
|
|
13907
13908
|
|
|
13908
|
-
if (
|
|
13909
|
+
if (datasetArray.length < 1) {
|
|
13909
13910
|
return minDomain !== undefined && maxDomain !== undefined ? getDomainFromMinMax(minDomain, maxDomain) : undefined;
|
|
13910
13911
|
}
|
|
13911
13912
|
|
|
13912
|
-
var min = minDomain !== undefined ? minDomain : getExtremeFromData(
|
|
13913
|
-
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(
|
|
13913
|
+
var min = minDomain !== undefined ? minDomain : getExtremeFromData(datasetArray, axis, "min");
|
|
13914
|
+
var max = maxDomain !== undefined ? maxDomain : getExtremeFromData(datasetArray, axis, "max");
|
|
13914
13915
|
var domain = getDomainFromMinMax(min, max);
|
|
13915
|
-
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(
|
|
13916
|
+
return polar && axis === "x" && Math.abs(startAngle - endAngle) === 360 ? getSymmetricDomain(domain, getFlatData(datasetArray, axis)) : domain;
|
|
13916
13917
|
}
|
|
13917
13918
|
/**
|
|
13918
13919
|
* Returns a domain in the form of a two element array given a min and max value.
|
|
@@ -14225,14 +14226,14 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
14225
14226
|
// eslint-disable-next-line no-invalid-this
|
|
14226
14227
|
|
|
14227
14228
|
|
|
14228
|
-
|
|
14229
|
+
var newBaseProps = baseProps || this.baseProps; // returns the original base props or base state of a given target element
|
|
14229
14230
|
|
|
14230
14231
|
var getTargetProps = function (identifier, type) {
|
|
14231
14232
|
var childName = identifier.childName,
|
|
14232
14233
|
target = identifier.target,
|
|
14233
14234
|
key = identifier.key; // eslint-disable-next-line no-invalid-this
|
|
14234
14235
|
|
|
14235
|
-
var baseType = type === "props" ?
|
|
14236
|
+
var baseType = type === "props" ? newBaseProps : _this2.state || {};
|
|
14236
14237
|
var base = childName === undefined || childName === null || !baseType[childName] ? baseType : baseType[childName];
|
|
14237
14238
|
return key === "parent" ? base.parent : base[key] && base[key][target];
|
|
14238
14239
|
}; // Returns the state object with the mutation caused by a given eventReturn
|
|
@@ -14320,8 +14321,7 @@ function getScopedEvents(events, namespace, childType, baseProps) {
|
|
|
14320
14321
|
|
|
14321
14322
|
var parseEventReturn = function (eventReturn, eventKey) {
|
|
14322
14323
|
return Array.isArray(eventReturn) ? eventReturn.reduce(function (memo, props) {
|
|
14323
|
-
|
|
14324
|
-
return memo;
|
|
14324
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, memo, parseEvent(props, eventKey));
|
|
14325
14325
|
}, {}) : parseEvent(eventReturn, eventKey);
|
|
14326
14326
|
};
|
|
14327
14327
|
|
|
@@ -14407,9 +14407,10 @@ function getEventState(eventKey, namespace, childType) {
|
|
|
14407
14407
|
*/
|
|
14408
14408
|
// eslint-disable-next-line max-params
|
|
14409
14409
|
|
|
14410
|
-
function getExternalMutationsWithChildren(mutations
|
|
14411
|
-
baseProps =
|
|
14412
|
-
baseState =
|
|
14410
|
+
function getExternalMutationsWithChildren(mutations) {
|
|
14411
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
14412
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
14413
|
+
var childNames = arguments.length > 3 ? arguments[3] : undefined;
|
|
14413
14414
|
return childNames.reduce(function (memo, childName) {
|
|
14414
14415
|
var childState = baseState[childName];
|
|
14415
14416
|
var mutation = getExternalMutations(mutations, baseProps[childName], baseState[childName], childName);
|
|
@@ -14431,9 +14432,10 @@ function getExternalMutationsWithChildren(mutations, baseProps, baseState, child
|
|
|
14431
14432
|
*/
|
|
14432
14433
|
// eslint-disable-next-line max-params
|
|
14433
14434
|
|
|
14434
|
-
function getExternalMutations(mutations
|
|
14435
|
-
baseProps =
|
|
14436
|
-
baseState =
|
|
14435
|
+
function getExternalMutations(mutations) {
|
|
14436
|
+
var baseProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
14437
|
+
var baseState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
14438
|
+
var childName = arguments.length > 3 ? arguments[3] : undefined;
|
|
14437
14439
|
|
|
14438
14440
|
var eventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_0___default()(baseProps);
|
|
14439
14441
|
|
|
@@ -14499,8 +14501,7 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
14499
14501
|
return false;
|
|
14500
14502
|
};
|
|
14501
14503
|
|
|
14502
|
-
|
|
14503
|
-
var scopedMutations = mutations;
|
|
14504
|
+
var scopedMutations = Array.isArray(mutations) ? mutations : [mutations];
|
|
14504
14505
|
|
|
14505
14506
|
if (identifier.childName) {
|
|
14506
14507
|
scopedMutations = mutations.filter(function (m) {
|
|
@@ -14539,13 +14540,10 @@ function getExternalMutation(mutations, baseProps, baseState, identifier) {
|
|
|
14539
14540
|
|
|
14540
14541
|
function getComponentEvents(props, components) {
|
|
14541
14542
|
var events = Array.isArray(components) && components.reduce(function (memo, componentName) {
|
|
14542
|
-
var _memo;
|
|
14543
|
-
|
|
14544
14543
|
var component = props[componentName];
|
|
14545
14544
|
var defaultEvents = component && component.type && component.type.defaultEvents;
|
|
14546
14545
|
var componentEvents = lodash_isFunction__WEBPACK_IMPORTED_MODULE_6___default()(defaultEvents) ? defaultEvents(component.props) : defaultEvents;
|
|
14547
|
-
|
|
14548
|
-
return memo;
|
|
14546
|
+
return Array.isArray(componentEvents) ? memo.concat.apply(memo, _toConsumableArray(componentEvents)) : memo;
|
|
14549
14547
|
}, []);
|
|
14550
14548
|
return events && events.length ? events : undefined;
|
|
14551
14549
|
}
|
|
@@ -14903,6 +14901,7 @@ function reduceChildren(children, iteratee) {
|
|
|
14903
14901
|
|
|
14904
14902
|
var traverseChildren = function (childArray, names, parent) {
|
|
14905
14903
|
return childArray.reduce(function (memo, child, index) {
|
|
14904
|
+
var newMemo = memo;
|
|
14906
14905
|
var childRole = child.type && child.type.role;
|
|
14907
14906
|
var childName = child.props.name || "".concat(childRole, "-").concat(names[index]);
|
|
14908
14907
|
|
|
@@ -14920,16 +14919,16 @@ function reduceChildren(children, iteratee) {
|
|
|
14920
14919
|
});
|
|
14921
14920
|
|
|
14922
14921
|
var nestedResults = traverseChildren(nestedChildren, _childNames, child);
|
|
14923
|
-
|
|
14922
|
+
newMemo = combine(newMemo, nestedResults);
|
|
14924
14923
|
} else {
|
|
14925
14924
|
var result = iteratee(child, childName, parent);
|
|
14926
14925
|
|
|
14927
14926
|
if (result) {
|
|
14928
|
-
|
|
14927
|
+
newMemo = combine(newMemo, result);
|
|
14929
14928
|
}
|
|
14930
14929
|
}
|
|
14931
14930
|
|
|
14932
|
-
return
|
|
14931
|
+
return newMemo;
|
|
14933
14932
|
}, initialMemo);
|
|
14934
14933
|
};
|
|
14935
14934
|
|
|
@@ -14955,8 +14954,7 @@ function isHorizontal(props) {
|
|
|
14955
14954
|
var childProps = child.props || {};
|
|
14956
14955
|
|
|
14957
14956
|
if (memo || childProps.horizontal || !childProps.children) {
|
|
14958
|
-
|
|
14959
|
-
return memo;
|
|
14957
|
+
return memo || childProps.horizontal;
|
|
14960
14958
|
}
|
|
14961
14959
|
|
|
14962
14960
|
return traverseChildren(react__WEBPACK_IMPORTED_MODULE_6___default().Children.toArray(childProps.children));
|
|
@@ -15191,11 +15189,13 @@ function isMap(x) {
|
|
|
15191
15189
|
}
|
|
15192
15190
|
function shallowToJS(x, whitelist) {
|
|
15193
15191
|
return isIterable(x) ? x.reduce(function (result, curr, key) {
|
|
15192
|
+
var newCurr = curr;
|
|
15193
|
+
|
|
15194
15194
|
if (whitelist && whitelist[key]) {
|
|
15195
|
-
|
|
15195
|
+
newCurr = shallowToJS(curr);
|
|
15196
15196
|
}
|
|
15197
15197
|
|
|
15198
|
-
result[key] =
|
|
15198
|
+
result[key] = newCurr;
|
|
15199
15199
|
return result;
|
|
15200
15200
|
}, isList(x) ? [] : {}) : x;
|
|
15201
15201
|
}
|
|
@@ -15223,12 +15223,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15223
15223
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "../../victory-core/es/victory-util/helpers.js");
|
|
15224
15224
|
|
|
15225
15225
|
|
|
15226
|
-
/* eslint-disable no-use-before-define */
|
|
15227
|
-
|
|
15228
15226
|
|
|
15229
15227
|
// Private Functions
|
|
15230
|
-
function getVerticalAnchor(props
|
|
15231
|
-
datum =
|
|
15228
|
+
function getVerticalAnchor(props) {
|
|
15229
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15232
15230
|
var sign = datum._y >= 0 ? 1 : -1;
|
|
15233
15231
|
var labelStyle = props.style && props.style.labels || {};
|
|
15234
15232
|
|
|
@@ -15241,8 +15239,8 @@ function getVerticalAnchor(props, datum) {
|
|
|
15241
15239
|
return "middle";
|
|
15242
15240
|
}
|
|
15243
15241
|
|
|
15244
|
-
function getTextAnchor(props
|
|
15245
|
-
datum =
|
|
15242
|
+
function getTextAnchor(props) {
|
|
15243
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15246
15244
|
var style = props.style,
|
|
15247
15245
|
horizontal = props.horizontal;
|
|
15248
15246
|
var sign = datum._y >= 0 ? 1 : -1;
|
|
@@ -15257,14 +15255,14 @@ function getTextAnchor(props, datum) {
|
|
|
15257
15255
|
return sign >= 0 ? "start" : "end";
|
|
15258
15256
|
}
|
|
15259
15257
|
|
|
15260
|
-
function getAngle(props
|
|
15261
|
-
datum =
|
|
15258
|
+
function getAngle(props) {
|
|
15259
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15262
15260
|
var labelStyle = props.style && props.style.labels || {};
|
|
15263
15261
|
return datum.angle === undefined ? labelStyle.angle : datum.angle;
|
|
15264
15262
|
}
|
|
15265
15263
|
|
|
15266
|
-
function getPadding(props
|
|
15267
|
-
datum =
|
|
15264
|
+
function getPadding(props) {
|
|
15265
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15268
15266
|
var horizontal = props.horizontal,
|
|
15269
15267
|
style = props.style;
|
|
15270
15268
|
var labelStyle = style.labels || {};
|
|
@@ -15343,8 +15341,9 @@ function getPolarOrientation(degrees) {
|
|
|
15343
15341
|
} // Exported Functions
|
|
15344
15342
|
|
|
15345
15343
|
|
|
15346
|
-
function getText(props
|
|
15347
|
-
datum =
|
|
15344
|
+
function getText(props) {
|
|
15345
|
+
var datum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
15346
|
+
var index = arguments.length > 2 ? arguments[2] : undefined;
|
|
15348
15347
|
|
|
15349
15348
|
if (datum.label !== undefined) {
|
|
15350
15349
|
return datum.label;
|
|
@@ -16504,11 +16503,10 @@ var Timer = /*#__PURE__*/function () {
|
|
|
16504
16503
|
}, {
|
|
16505
16504
|
key: "subscribe",
|
|
16506
16505
|
value: function subscribe(callback, duration) {
|
|
16507
|
-
duration = this.shouldAnimate ? duration : 0;
|
|
16508
16506
|
var subscriptionID = this.subscribers.push({
|
|
16509
16507
|
startTime: (0,victory_vendor_d3_timer__WEBPACK_IMPORTED_MODULE_0__.now)(),
|
|
16510
16508
|
callback: callback,
|
|
16511
|
-
duration: duration
|
|
16509
|
+
duration: this.shouldAnimate ? duration : 0
|
|
16512
16510
|
});
|
|
16513
16511
|
this.activeSubscriptions++;
|
|
16514
16512
|
this.start();
|
|
@@ -16695,36 +16693,38 @@ function getInitialChildProps(animate, data) {
|
|
|
16695
16693
|
|
|
16696
16694
|
|
|
16697
16695
|
function getChildBeforeLoad(animate, child, data, cb) {
|
|
16698
|
-
|
|
16696
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
16699
16697
|
onEnd: cb
|
|
16700
16698
|
});
|
|
16701
16699
|
|
|
16702
|
-
if (
|
|
16700
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
16703
16701
|
return {
|
|
16704
|
-
animate:
|
|
16702
|
+
animate: newAnimate,
|
|
16705
16703
|
data: data
|
|
16706
16704
|
};
|
|
16707
16705
|
}
|
|
16708
16706
|
|
|
16709
|
-
var before =
|
|
16707
|
+
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.
|
|
16710
16708
|
|
|
16711
|
-
|
|
16709
|
+
var newData = data.map(function (datum, idx) {
|
|
16712
16710
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data));
|
|
16713
16711
|
});
|
|
16714
16712
|
return {
|
|
16715
|
-
animate:
|
|
16716
|
-
data:
|
|
16713
|
+
animate: newAnimate,
|
|
16714
|
+
data: newData,
|
|
16717
16715
|
clipWidth: 0
|
|
16718
16716
|
};
|
|
16719
16717
|
} // eslint-disable-next-line max-params
|
|
16720
16718
|
|
|
16721
16719
|
|
|
16722
16720
|
function getChildOnLoad(animate, data, cb) {
|
|
16723
|
-
|
|
16721
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
16724
16722
|
onEnd: cb
|
|
16725
16723
|
});
|
|
16726
16724
|
|
|
16727
|
-
|
|
16725
|
+
var newData = data;
|
|
16726
|
+
|
|
16727
|
+
if (newAnimate && newAnimate.onLoad && !newAnimate.onLoad.duration) {
|
|
16728
16728
|
return {
|
|
16729
16729
|
animate: animate,
|
|
16730
16730
|
data: data
|
|
@@ -16733,12 +16733,12 @@ function getChildOnLoad(animate, data, cb) {
|
|
|
16733
16733
|
|
|
16734
16734
|
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.
|
|
16735
16735
|
|
|
16736
|
-
|
|
16736
|
+
newData = data.map(function (datum, idx) {
|
|
16737
16737
|
return lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data));
|
|
16738
16738
|
});
|
|
16739
16739
|
return {
|
|
16740
|
-
animate:
|
|
16741
|
-
data:
|
|
16740
|
+
animate: newAnimate,
|
|
16741
|
+
data: newData
|
|
16742
16742
|
};
|
|
16743
16743
|
} // eslint-disable-next-line max-params, max-len
|
|
16744
16744
|
|
|
@@ -16747,7 +16747,10 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
16747
16747
|
// Whether or not _this_ child has exiting nodes, we want the exit-
|
|
16748
16748
|
// transition for all children to have the same duration, delay, etc.
|
|
16749
16749
|
var onExit = animate && animate.onExit;
|
|
16750
|
-
|
|
16750
|
+
|
|
16751
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onExit);
|
|
16752
|
+
|
|
16753
|
+
var newData = data;
|
|
16751
16754
|
|
|
16752
16755
|
if (exitingNodes) {
|
|
16753
16756
|
// After the exit transition occurs, trigger the animations for
|
|
@@ -16755,39 +16758,42 @@ function getChildPropsOnExit(animate, child, data, exitingNodes, cb) {
|
|
|
16755
16758
|
animate.onEnd = cb;
|
|
16756
16759
|
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.
|
|
16757
16760
|
|
|
16758
|
-
|
|
16761
|
+
newData = data.map(function (datum, idx) {
|
|
16759
16762
|
var key = (datum.key || idx).toString();
|
|
16760
16763
|
return exitingNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
16761
16764
|
});
|
|
16762
16765
|
}
|
|
16763
16766
|
|
|
16764
16767
|
return {
|
|
16765
|
-
animate:
|
|
16766
|
-
data:
|
|
16768
|
+
animate: newAnimate,
|
|
16769
|
+
data: newData
|
|
16767
16770
|
};
|
|
16768
16771
|
} // eslint-disable-next-line max-params,max-len
|
|
16769
16772
|
|
|
16770
16773
|
|
|
16771
16774
|
function getChildPropsBeforeEnter(animate, child, data, enteringNodes, cb) {
|
|
16775
|
+
var newAnimate = animate;
|
|
16776
|
+
var newData = data;
|
|
16777
|
+
|
|
16772
16778
|
if (enteringNodes) {
|
|
16773
16779
|
// Perform a normal animation here, except - when it finishes - trigger
|
|
16774
16780
|
// the transition for entering nodes.
|
|
16775
|
-
|
|
16781
|
+
newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, {
|
|
16776
16782
|
onEnd: cb
|
|
16777
16783
|
});
|
|
16778
16784
|
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
|
|
16779
16785
|
// domain. However, we may not want these nodes to be displayed initially,
|
|
16780
16786
|
// so perform the `onEnter.before` transformation on each node.
|
|
16781
16787
|
|
|
16782
|
-
|
|
16788
|
+
newData = data.map(function (datum, idx) {
|
|
16783
16789
|
var key = (datum.key || idx).toString();
|
|
16784
16790
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, before(datum, idx, data)) : datum;
|
|
16785
16791
|
});
|
|
16786
16792
|
}
|
|
16787
16793
|
|
|
16788
16794
|
return {
|
|
16789
|
-
animate:
|
|
16790
|
-
data:
|
|
16795
|
+
animate: newAnimate,
|
|
16796
|
+
data: newData
|
|
16791
16797
|
};
|
|
16792
16798
|
} // eslint-disable-next-line max-params, max-len
|
|
16793
16799
|
|
|
@@ -16796,23 +16802,26 @@ function getChildPropsOnEnter(animate, data, enteringNodes, cb) {
|
|
|
16796
16802
|
// Whether or not _this_ child has entering nodes, we want the entering-
|
|
16797
16803
|
// transition for all children to have the same duration, delay, etc.
|
|
16798
16804
|
var onEnter = animate && animate.onEnter;
|
|
16799
|
-
|
|
16805
|
+
|
|
16806
|
+
var newAnimate = lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, animate, onEnter);
|
|
16807
|
+
|
|
16808
|
+
var newData = data;
|
|
16800
16809
|
|
|
16801
16810
|
if (enteringNodes) {
|
|
16802
16811
|
// Old nodes have been transitioned to their new values, and the
|
|
16803
16812
|
// domain should encompass the nodes that will now enter. So perform
|
|
16804
16813
|
// the `onEnter.after` transformation on each node.
|
|
16805
|
-
|
|
16806
|
-
var after =
|
|
16807
|
-
|
|
16814
|
+
newAnimate.onEnd = cb;
|
|
16815
|
+
var after = newAnimate.onEnter && newAnimate.onEnter.after ? newAnimate.onEnter.after : (lodash_identity__WEBPACK_IMPORTED_MODULE_1___default());
|
|
16816
|
+
newData = data.map(function (datum, idx) {
|
|
16808
16817
|
var key = getDatumKey(datum, idx);
|
|
16809
16818
|
return enteringNodes[key] ? lodash_assign__WEBPACK_IMPORTED_MODULE_3___default()({}, datum, after(datum, idx, data)) : datum;
|
|
16810
16819
|
});
|
|
16811
16820
|
}
|
|
16812
16821
|
|
|
16813
16822
|
return {
|
|
16814
|
-
animate:
|
|
16815
|
-
data:
|
|
16823
|
+
animate: newAnimate,
|
|
16824
|
+
data: newData
|
|
16816
16825
|
};
|
|
16817
16826
|
}
|
|
16818
16827
|
/**
|
|
@@ -16978,6 +16987,7 @@ function getTransitionPropsFactory(props, state, setState) {
|
|
|
16978
16987
|
"use strict";
|
|
16979
16988
|
__webpack_require__.r(__webpack_exports__);
|
|
16980
16989
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
16990
|
+
/* harmony export */ "assert": () => (/* binding */ assert),
|
|
16981
16991
|
/* harmony export */ "getSafeUserProps": () => (/* binding */ getSafeUserProps),
|
|
16982
16992
|
/* harmony export */ "withSafeUserProps": () => (/* binding */ withSafeUserProps)
|
|
16983
16993
|
/* harmony export */ });
|
|
@@ -17058,6 +17068,18 @@ var testIfSafeProp = function (key) {
|
|
|
17058
17068
|
if (doesPropStartWith(key) || isExactMatch(key)) return true;
|
|
17059
17069
|
return false;
|
|
17060
17070
|
};
|
|
17071
|
+
/**
|
|
17072
|
+
* Asserts that value is not null or undefined, throwing an error if it is.
|
|
17073
|
+
* @param value The value to assert
|
|
17074
|
+
* @param message The error message to throw
|
|
17075
|
+
*/
|
|
17076
|
+
|
|
17077
|
+
|
|
17078
|
+
function assert(value, message) {
|
|
17079
|
+
if (value === undefined || value === null) {
|
|
17080
|
+
throw new Error(message);
|
|
17081
|
+
}
|
|
17082
|
+
}
|
|
17061
17083
|
/**
|
|
17062
17084
|
* getSafeUserProps - function that takes in a props object and removes any
|
|
17063
17085
|
* key-value entries that do not match filter strings in the USER_PROPS_SAFELIST
|
|
@@ -17067,7 +17089,6 @@ var testIfSafeProp = function (key) {
|
|
|
17067
17089
|
* @returns {Object}: object containing remaining acceptable props
|
|
17068
17090
|
*/
|
|
17069
17091
|
|
|
17070
|
-
|
|
17071
17092
|
var getSafeUserProps = function (props) {
|
|
17072
17093
|
var propsToFilter = _objectSpread({}, props);
|
|
17073
17094
|
|
|
@@ -17270,12 +17291,13 @@ function getDataFromChildren(props, childComponents) {
|
|
|
17270
17291
|
var childProps = lodash_assign__WEBPACK_IMPORTED_MODULE_8___default()({}, child.props, parentProps);
|
|
17271
17292
|
|
|
17272
17293
|
var childData;
|
|
17294
|
+
var childElement = child;
|
|
17273
17295
|
|
|
17274
17296
|
if (!_data__WEBPACK_IMPORTED_MODULE_12__.isDataComponent(child)) {
|
|
17275
17297
|
return null;
|
|
17276
17298
|
} else if (child.type && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(child.type.getData)) {
|
|
17277
|
-
|
|
17278
|
-
childData =
|
|
17299
|
+
childElement = parent ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(child, parent.props) : child;
|
|
17300
|
+
childData = childElement.type.getData(childProps);
|
|
17279
17301
|
} else {
|
|
17280
17302
|
childData = _data__WEBPACK_IMPORTED_MODULE_12__.getData(childProps);
|
|
17281
17303
|
}
|
|
@@ -17306,17 +17328,16 @@ function getData(props, childComponents) {
|
|
|
17306
17328
|
return _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
|
|
17307
17329
|
}
|
|
17308
17330
|
|
|
17309
|
-
|
|
17310
|
-
return getDataFromChildren(props, childComponents);
|
|
17331
|
+
return getDataFromChildren(props, childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children));
|
|
17311
17332
|
}
|
|
17312
17333
|
function getWidth(props, groupLength, seriesLength) {
|
|
17313
17334
|
var datasets = props.datasets,
|
|
17314
17335
|
horizontal = props.horizontal;
|
|
17315
17336
|
var range = horizontal ? _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "y") : _helpers__WEBPACK_IMPORTED_MODULE_11__.getRange(props, "x");
|
|
17316
17337
|
var extent = Math.abs(range[1] - range[0]);
|
|
17317
|
-
|
|
17318
|
-
|
|
17319
|
-
var bars =
|
|
17338
|
+
var seriesLengthValue = seriesLength !== undefined ? seriesLength : Array.isArray(datasets[0]) && datasets[0].length || 1;
|
|
17339
|
+
var groupLengthValue = groupLength || datasets.length;
|
|
17340
|
+
var bars = groupLengthValue * seriesLengthValue;
|
|
17320
17341
|
var barRatio = 0.5;
|
|
17321
17342
|
return Math.round(barRatio * extent / bars);
|
|
17322
17343
|
}
|
|
@@ -17408,9 +17429,9 @@ function getDomainFromChildren(props, axis, childComponents) {
|
|
|
17408
17429
|
return [min, max];
|
|
17409
17430
|
}
|
|
17410
17431
|
function getDomain(props, axis, childComponents) {
|
|
17411
|
-
|
|
17432
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
|
|
17412
17433
|
var propsDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromProps(props, axis);
|
|
17413
|
-
var domainPadding = getDefaultDomainPadding(props, axis,
|
|
17434
|
+
var domainPadding = getDefaultDomainPadding(props, axis, children);
|
|
17414
17435
|
var domain;
|
|
17415
17436
|
|
|
17416
17437
|
if (propsDomain) {
|
|
@@ -17420,7 +17441,7 @@ function getDomain(props, axis, childComponents) {
|
|
|
17420
17441
|
var maxDomain = _domain__WEBPACK_IMPORTED_MODULE_13__.getMaxFromProps(props, axis);
|
|
17421
17442
|
var dataset = (props.data || props.y) && _data__WEBPACK_IMPORTED_MODULE_12__.getData(props);
|
|
17422
17443
|
var dataDomain = dataset ? _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromData(props, axis, dataset) : [];
|
|
17423
|
-
var childDomain = getDomainFromChildren(props, axis,
|
|
17444
|
+
var childDomain = getDomainFromChildren(props, axis, children);
|
|
17424
17445
|
var min = minDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMinValue([].concat(_toConsumableArray(dataDomain), _toConsumableArray(childDomain)));
|
|
17425
17446
|
var max = maxDomain || _collection__WEBPACK_IMPORTED_MODULE_14__.getMaxValue([].concat(_toConsumableArray(dataDomain), _toConsumableArray(childDomain)));
|
|
17426
17447
|
domain = _domain__WEBPACK_IMPORTED_MODULE_13__.getDomainFromMinMax(min, max);
|
|
@@ -17582,10 +17603,10 @@ function getCategoryAndAxisStringsFromChildren(props, axis, childComponents) {
|
|
|
17582
17603
|
return lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(categoryStrings), _toConsumableArray(axisStrings))));
|
|
17583
17604
|
}
|
|
17584
17605
|
function getStringsFromChildren(props, childComponents) {
|
|
17585
|
-
|
|
17586
|
-
var xStrings = getCategoryAndAxisStringsFromChildren(props, "x",
|
|
17587
|
-
var yStrings = getCategoryAndAxisStringsFromChildren(props, "y",
|
|
17588
|
-
var dataStrings = getStringsFromData(
|
|
17606
|
+
var children = childComponents || react__WEBPACK_IMPORTED_MODULE_9___default().Children.toArray(props.children);
|
|
17607
|
+
var xStrings = getCategoryAndAxisStringsFromChildren(props, "x", children);
|
|
17608
|
+
var yStrings = getCategoryAndAxisStringsFromChildren(props, "y", children);
|
|
17609
|
+
var dataStrings = getStringsFromData(children);
|
|
17589
17610
|
return {
|
|
17590
17611
|
x: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(xStrings), _toConsumableArray(dataStrings.x)))),
|
|
17591
17612
|
y: lodash_uniq__WEBPACK_IMPORTED_MODULE_4___default()(lodash_flatten__WEBPACK_IMPORTED_MODULE_6___default()([].concat(_toConsumableArray(yStrings), _toConsumableArray(dataStrings.y))))
|
|
@@ -17728,13 +17749,14 @@ var getScale = function (props) {
|
|
|
17728
17749
|
scale.domain(domain);
|
|
17729
17750
|
return scale;
|
|
17730
17751
|
};
|
|
17731
|
-
var getStyles = function (props
|
|
17752
|
+
var getStyles = function (props) {
|
|
17753
|
+
var styleObject = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17754
|
+
|
|
17732
17755
|
if (props.disableInlineStyles) {
|
|
17733
17756
|
return {};
|
|
17734
17757
|
}
|
|
17735
17758
|
|
|
17736
17759
|
var style = props.style || {};
|
|
17737
|
-
styleObject = styleObject || {};
|
|
17738
17760
|
var parentStyleProps = {
|
|
17739
17761
|
height: "auto",
|
|
17740
17762
|
width: "100%"
|
|
@@ -17977,10 +17999,11 @@ var getAxisProps = function (modifiedProps, calculatedValues) {
|
|
|
17977
17999
|
};
|
|
17978
18000
|
};
|
|
17979
18001
|
|
|
17980
|
-
var getCalculatedValues = function (
|
|
17981
|
-
props = lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({
|
|
18002
|
+
var getCalculatedValues = function (initialProps) {
|
|
18003
|
+
var props = lodash_assign__WEBPACK_IMPORTED_MODULE_2___default()({
|
|
17982
18004
|
polar: true
|
|
17983
|
-
},
|
|
18005
|
+
}, initialProps);
|
|
18006
|
+
|
|
17984
18007
|
var defaultStyles = getStyleObject(props);
|
|
17985
18008
|
var style = getStyles(props, defaultStyles);
|
|
17986
18009
|
var padding = victory_core__WEBPACK_IMPORTED_MODULE_3__.getPadding(props);
|
|
@@ -18011,19 +18034,18 @@ var getCalculatedValues = function (props) {
|
|
|
18011
18034
|
};
|
|
18012
18035
|
};
|
|
18013
18036
|
|
|
18014
|
-
var getBaseProps = function (
|
|
18015
|
-
props = victory_core__WEBPACK_IMPORTED_MODULE_4__.modifyProps(
|
|
18037
|
+
var getBaseProps = function (initialProps, fallbackProps) {
|
|
18038
|
+
var props = victory_core__WEBPACK_IMPORTED_MODULE_4__.modifyProps(initialProps, fallbackProps);
|
|
18016
18039
|
var calculatedValues = getCalculatedValues(props);
|
|
18017
18040
|
var style = calculatedValues.style,
|
|
18018
18041
|
scale = calculatedValues.scale,
|
|
18019
18042
|
ticks = calculatedValues.ticks,
|
|
18020
18043
|
domain = calculatedValues.domain;
|
|
18021
|
-
var
|
|
18022
|
-
|
|
18023
|
-
|
|
18024
|
-
|
|
18025
|
-
|
|
18026
|
-
name = _props.name;
|
|
18044
|
+
var width = props.width,
|
|
18045
|
+
height = props.height,
|
|
18046
|
+
standalone = props.standalone,
|
|
18047
|
+
theme = props.theme,
|
|
18048
|
+
name = props.name;
|
|
18027
18049
|
var axisProps = getAxisProps(props, calculatedValues);
|
|
18028
18050
|
var axisLabelProps = getAxisLabelProps(props, calculatedValues);
|
|
18029
18051
|
var initialChildProps = {
|
|
@@ -18306,7 +18328,7 @@ var VictoryPolarAxis = (0,victory_core__WEBPACK_IMPORTED_MODULE_10__.addEvents)(
|
|
|
18306
18328
|
"use strict";
|
|
18307
18329
|
__webpack_require__.r(__webpack_exports__);
|
|
18308
18330
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
18309
|
-
/* harmony export */ "
|
|
18331
|
+
/* harmony export */ "VictorySharedEvents": () => (/* binding */ VictorySharedEvents)
|
|
18310
18332
|
/* harmony export */ });
|
|
18311
18333
|
/* 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");
|
|
18312
18334
|
/* harmony import */ var lodash_difference__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_difference__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -18324,12 +18346,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18324
18346
|
/* harmony import */ var lodash_assign__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_6__);
|
|
18325
18347
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "react");
|
|
18326
18348
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__);
|
|
18327
|
-
/* 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");
|
|
18328
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_12__);
|
|
18329
18349
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/events.js");
|
|
18330
18350
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
18331
|
-
/* harmony import */ var
|
|
18332
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
18351
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/timer-context.js");
|
|
18333
18352
|
/* 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");
|
|
18334
18353
|
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_8__);
|
|
18335
18354
|
/* 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");
|
|
@@ -18386,11 +18405,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
18386
18405
|
|
|
18387
18406
|
|
|
18388
18407
|
|
|
18389
|
-
// DISCLAIMER:
|
|
18390
|
-
// This file is not currently tested, and it is first on the list of files
|
|
18391
|
-
// to refactor in our current refactoring effort. Please do not make changes
|
|
18392
|
-
// to this file without manual testing and/or refactoring and adding tests.
|
|
18393
|
-
|
|
18394
18408
|
var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
18395
18409
|
_inherits(VictorySharedEvents, _React$Component);
|
|
18396
18410
|
|
|
@@ -18402,14 +18416,21 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
18402
18416
|
_classCallCheck(this, VictorySharedEvents);
|
|
18403
18417
|
|
|
18404
18418
|
_this = _super.call(this, props);
|
|
18405
|
-
_this.
|
|
18419
|
+
_this.getScopedEvents = void 0;
|
|
18420
|
+
_this.getEventState = void 0;
|
|
18421
|
+
_this.baseProps = void 0;
|
|
18422
|
+
_this.sharedEventsCache = void 0;
|
|
18423
|
+
_this.globalEvents = void 0;
|
|
18424
|
+
_this.prevGlobalEventKeys = void 0;
|
|
18425
|
+
_this.boundGlobalEvents = void 0;
|
|
18406
18426
|
_this.getScopedEvents = victory_core__WEBPACK_IMPORTED_MODULE_10__.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
18407
18427
|
_this.getEventState = victory_core__WEBPACK_IMPORTED_MODULE_10__.getEventState.bind(_assertThisInitialized(_this));
|
|
18408
|
-
_this.
|
|
18428
|
+
_this.state = _this.state || {};
|
|
18409
18429
|
_this.sharedEventsCache = {};
|
|
18410
18430
|
_this.globalEvents = {};
|
|
18411
18431
|
_this.prevGlobalEventKeys = [];
|
|
18412
18432
|
_this.boundGlobalEvents = {};
|
|
18433
|
+
_this.baseProps = _this.getBaseProps(props);
|
|
18413
18434
|
return _this;
|
|
18414
18435
|
}
|
|
18415
18436
|
|
|
@@ -18500,8 +18521,7 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
18500
18521
|
value: function applyExternalMutations(props, externalMutations) {
|
|
18501
18522
|
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_3___default()(externalMutations)) {
|
|
18502
18523
|
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
18503
|
-
|
|
18504
|
-
return memo;
|
|
18524
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
18505
18525
|
}, []);
|
|
18506
18526
|
var compiledCallbacks = callbacks.length ? function () {
|
|
18507
18527
|
callbacks.forEach(function (c) {
|
|
@@ -18624,9 +18644,9 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
18624
18644
|
var _this7 = this;
|
|
18625
18645
|
|
|
18626
18646
|
var children = this.getNewChildren(props, baseProps);
|
|
18627
|
-
var parents = Array.isArray(events)
|
|
18647
|
+
var parents = Array.isArray(events) ? events.filter(function (event) {
|
|
18628
18648
|
return event.target === "parent";
|
|
18629
|
-
});
|
|
18649
|
+
}) : [];
|
|
18630
18650
|
var sharedEvents = parents.length > 0 ? {
|
|
18631
18651
|
events: parents,
|
|
18632
18652
|
// partially apply childName (null) and baseProps,
|
|
@@ -18672,33 +18692,9 @@ var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
|
18672
18692
|
|
|
18673
18693
|
return VictorySharedEvents;
|
|
18674
18694
|
}((react__WEBPACK_IMPORTED_MODULE_7___default().Component));
|
|
18675
|
-
|
|
18676
18695
|
VictorySharedEvents.displayName = "VictorySharedEvents";
|
|
18677
18696
|
VictorySharedEvents.role = "shared-event-wrapper";
|
|
18678
|
-
VictorySharedEvents.
|
|
18679
|
-
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)]),
|
|
18680
|
-
container: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node),
|
|
18681
|
-
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)]),
|
|
18682
|
-
events: prop_types__WEBPACK_IMPORTED_MODULE_12___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape({
|
|
18683
|
-
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)]),
|
|
18684
|
-
eventHandlers: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().object),
|
|
18685
|
-
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)]),
|
|
18686
|
-
target: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string)
|
|
18687
|
-
})),
|
|
18688
|
-
externalEventMutations: prop_types__WEBPACK_IMPORTED_MODULE_12___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape({
|
|
18689
|
-
callback: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func),
|
|
18690
|
-
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)]),
|
|
18691
|
-
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)]),
|
|
18692
|
-
mutation: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().func),
|
|
18693
|
-
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)])
|
|
18694
|
-
})),
|
|
18695
|
-
groupComponent: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node)
|
|
18696
|
-
};
|
|
18697
|
-
VictorySharedEvents.defaultProps = {
|
|
18698
|
-
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_7___default().createElement("g", null)
|
|
18699
|
-
};
|
|
18700
|
-
VictorySharedEvents.contextType = victory_core__WEBPACK_IMPORTED_MODULE_14__["default"];
|
|
18701
|
-
|
|
18697
|
+
VictorySharedEvents.contextType = victory_core__WEBPACK_IMPORTED_MODULE_12__["default"];
|
|
18702
18698
|
|
|
18703
18699
|
/***/ }),
|
|
18704
18700
|
|