victory-chart 36.0.0 → 36.1.0
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/dist/victory-chart.js +309 -330
- package/package.json +6 -6
package/dist/victory-chart.js
CHANGED
|
@@ -14802,9 +14802,7 @@ var options = {
|
|
|
14802
14802
|
}]
|
|
14803
14803
|
};
|
|
14804
14804
|
|
|
14805
|
-
var VictoryAxis =
|
|
14806
|
-
/*#__PURE__*/
|
|
14807
|
-
function (_React$Component) {
|
|
14805
|
+
var VictoryAxis = /*#__PURE__*/function (_React$Component) {
|
|
14808
14806
|
_inherits(VictoryAxis, _React$Component);
|
|
14809
14807
|
|
|
14810
14808
|
function VictoryAxis() {
|
|
@@ -15376,9 +15374,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
15376
15374
|
|
|
15377
15375
|
|
|
15378
15376
|
|
|
15379
|
-
var VictoryAnimation =
|
|
15380
|
-
/*#__PURE__*/
|
|
15381
|
-
function (_React$Component) {
|
|
15377
|
+
var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
15382
15378
|
_inherits(VictoryAnimation, _React$Component);
|
|
15383
15379
|
|
|
15384
15380
|
function VictoryAnimation(props, context) {
|
|
@@ -15662,9 +15658,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
15662
15658
|
|
|
15663
15659
|
|
|
15664
15660
|
|
|
15665
|
-
var VictoryContainer =
|
|
15666
|
-
/*#__PURE__*/
|
|
15667
|
-
function (_React$Component) {
|
|
15661
|
+
var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
15668
15662
|
_inherits(VictoryContainer, _React$Component);
|
|
15669
15663
|
|
|
15670
15664
|
function VictoryContainer(props) {
|
|
@@ -16610,9 +16604,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
16610
16604
|
|
|
16611
16605
|
|
|
16612
16606
|
|
|
16613
|
-
var Portal =
|
|
16614
|
-
/*#__PURE__*/
|
|
16615
|
-
function (_React$Component) {
|
|
16607
|
+
var Portal = /*#__PURE__*/function (_React$Component) {
|
|
16616
16608
|
_inherits(Portal, _React$Component);
|
|
16617
16609
|
|
|
16618
16610
|
function Portal(props) {
|
|
@@ -16731,9 +16723,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
16731
16723
|
|
|
16732
16724
|
|
|
16733
16725
|
|
|
16734
|
-
var VictoryPortal =
|
|
16735
|
-
/*#__PURE__*/
|
|
16736
|
-
function (_React$Component) {
|
|
16726
|
+
var VictoryPortal = /*#__PURE__*/function (_React$Component) {
|
|
16737
16727
|
_inherits(VictoryPortal, _React$Component);
|
|
16738
16728
|
|
|
16739
16729
|
function VictoryPortal() {
|
|
@@ -17995,9 +17985,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
17995
17985
|
|
|
17996
17986
|
|
|
17997
17987
|
|
|
17998
|
-
var VictoryTransition =
|
|
17999
|
-
/*#__PURE__*/
|
|
18000
|
-
function (_React$Component) {
|
|
17988
|
+
var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
18001
17989
|
_inherits(VictoryTransition, _React$Component);
|
|
18002
17990
|
|
|
18003
17991
|
function VictoryTransition(props, context) {
|
|
@@ -18298,365 +18286,362 @@ var defaultComponents = [{
|
|
|
18298
18286
|
name: "labels"
|
|
18299
18287
|
}];
|
|
18300
18288
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (WrappedComponent, options) {
|
|
18301
|
-
return (
|
|
18302
|
-
|
|
18303
|
-
function (_WrappedComponent) {
|
|
18304
|
-
_inherits(addEvents, _WrappedComponent);
|
|
18289
|
+
return /*#__PURE__*/function (_WrappedComponent) {
|
|
18290
|
+
_inherits(addEvents, _WrappedComponent);
|
|
18305
18291
|
|
|
18306
|
-
|
|
18307
|
-
|
|
18292
|
+
function addEvents(props) {
|
|
18293
|
+
var _this;
|
|
18308
18294
|
|
|
18309
|
-
|
|
18295
|
+
_classCallCheck(this, addEvents);
|
|
18310
18296
|
|
|
18311
|
-
|
|
18312
|
-
|
|
18313
|
-
|
|
18314
|
-
|
|
18297
|
+
_this = _possibleConstructorReturn(this, (addEvents.__proto__ || Object.getPrototypeOf(addEvents)).call(this, props));
|
|
18298
|
+
var getScopedEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
18299
|
+
var boundGetEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getEvents.bind(_assertThisInitialized(_this));
|
|
18300
|
+
_this.state = {};
|
|
18315
18301
|
|
|
18316
|
-
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
|
|
18320
|
-
_this.getEventState = _events__WEBPACK_IMPORTED_MODULE_11__.getEventState.bind(_assertThisInitialized(_this));
|
|
18302
|
+
_this.getEvents = function (p, target, eventKey) {
|
|
18303
|
+
return boundGetEvents(p, target, eventKey, getScopedEvents);
|
|
18304
|
+
};
|
|
18321
18305
|
|
|
18322
|
-
|
|
18306
|
+
_this.getEventState = _events__WEBPACK_IMPORTED_MODULE_11__.getEventState.bind(_assertThisInitialized(_this));
|
|
18323
18307
|
|
|
18324
|
-
|
|
18308
|
+
var calculatedValues = _this.getCalculatedValues(props);
|
|
18325
18309
|
|
|
18326
|
-
|
|
18327
|
-
_this.calculatedState = _this.getStateChanges(props);
|
|
18328
|
-
_this.globalEvents = {};
|
|
18329
|
-
_this.prevGlobalEventKeys = [];
|
|
18330
|
-
_this.boundGlobalEvents = {};
|
|
18331
|
-
return _this;
|
|
18332
|
-
}
|
|
18310
|
+
_this.cacheValues(calculatedValues);
|
|
18333
18311
|
|
|
18334
|
-
|
|
18335
|
-
|
|
18336
|
-
|
|
18337
|
-
|
|
18338
|
-
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
if (animating || newMutation) {
|
|
18342
|
-
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
18343
|
-
this.externalMutations = externalMutations;
|
|
18344
|
-
this.applyExternalMutations(nextProps, externalMutations);
|
|
18345
|
-
return true;
|
|
18346
|
-
}
|
|
18312
|
+
_this.externalMutations = _this.getExternalMutations(props);
|
|
18313
|
+
_this.calculatedState = _this.getStateChanges(props);
|
|
18314
|
+
_this.globalEvents = {};
|
|
18315
|
+
_this.prevGlobalEventKeys = [];
|
|
18316
|
+
_this.boundGlobalEvents = {};
|
|
18317
|
+
return _this;
|
|
18318
|
+
}
|
|
18347
18319
|
|
|
18348
|
-
|
|
18320
|
+
_createClass(addEvents, [{
|
|
18321
|
+
key: "shouldComponentUpdate",
|
|
18322
|
+
value: function shouldComponentUpdate(nextProps) {
|
|
18323
|
+
var externalMutations = this.getExternalMutations(nextProps);
|
|
18324
|
+
var animating = this.props.animating || this.props.animate;
|
|
18325
|
+
var newMutation = !react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(externalMutations, this.externalMutations);
|
|
18349
18326
|
|
|
18350
|
-
|
|
18351
|
-
|
|
18352
|
-
|
|
18353
|
-
|
|
18327
|
+
if (animating || newMutation) {
|
|
18328
|
+
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
18329
|
+
this.externalMutations = externalMutations;
|
|
18330
|
+
this.applyExternalMutations(nextProps, externalMutations);
|
|
18331
|
+
return true;
|
|
18332
|
+
}
|
|
18354
18333
|
|
|
18355
|
-
|
|
18356
|
-
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
18357
|
-
return true;
|
|
18358
|
-
}
|
|
18334
|
+
var calculatedState = this.getStateChanges(nextProps);
|
|
18359
18335
|
|
|
18360
|
-
|
|
18336
|
+
if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.calculatedState, calculatedState)) {
|
|
18337
|
+
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
18338
|
+
return true;
|
|
18361
18339
|
}
|
|
18362
|
-
}, {
|
|
18363
|
-
key: "componentDidMount",
|
|
18364
|
-
value: function componentDidMount() {
|
|
18365
|
-
var _this2 = this;
|
|
18366
|
-
|
|
18367
|
-
var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
|
|
18368
18340
|
|
|
18369
|
-
|
|
18370
|
-
|
|
18371
|
-
|
|
18372
|
-
this.prevGlobalEventKeys = globalEventKeys;
|
|
18341
|
+
if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.props, nextProps)) {
|
|
18342
|
+
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
18343
|
+
return true;
|
|
18373
18344
|
}
|
|
18374
|
-
}, {
|
|
18375
|
-
key: "componentDidUpdate",
|
|
18376
|
-
value: function componentDidUpdate(prevProps) {
|
|
18377
|
-
var _this3 = this;
|
|
18378
18345
|
|
|
18379
|
-
|
|
18380
|
-
|
|
18346
|
+
return false;
|
|
18347
|
+
}
|
|
18348
|
+
}, {
|
|
18349
|
+
key: "componentDidMount",
|
|
18350
|
+
value: function componentDidMount() {
|
|
18351
|
+
var _this2 = this;
|
|
18381
18352
|
|
|
18382
|
-
|
|
18353
|
+
var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
|
|
18383
18354
|
|
|
18384
|
-
|
|
18355
|
+
globalEventKeys.forEach(function (key) {
|
|
18356
|
+
return _this2.addGlobalListener(key);
|
|
18357
|
+
});
|
|
18358
|
+
this.prevGlobalEventKeys = globalEventKeys;
|
|
18359
|
+
}
|
|
18360
|
+
}, {
|
|
18361
|
+
key: "componentDidUpdate",
|
|
18362
|
+
value: function componentDidUpdate(prevProps) {
|
|
18363
|
+
var _this3 = this;
|
|
18385
18364
|
|
|
18386
|
-
|
|
18387
|
-
|
|
18388
|
-
});
|
|
18365
|
+
var calculatedState = this.getStateChanges(prevProps);
|
|
18366
|
+
this.calculatedState = calculatedState;
|
|
18389
18367
|
|
|
18390
|
-
|
|
18368
|
+
var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
|
|
18391
18369
|
|
|
18392
|
-
|
|
18393
|
-
return _this3.addGlobalListener(key);
|
|
18394
|
-
});
|
|
18395
|
-
this.prevGlobalEventKeys = globalEventKeys;
|
|
18396
|
-
}
|
|
18397
|
-
}, {
|
|
18398
|
-
key: "componentWillUnmount",
|
|
18399
|
-
value: function componentWillUnmount() {
|
|
18400
|
-
var _this4 = this;
|
|
18370
|
+
var removedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(this.prevGlobalEventKeys, globalEventKeys);
|
|
18401
18371
|
|
|
18402
|
-
|
|
18403
|
-
|
|
18404
|
-
|
|
18405
|
-
}
|
|
18406
|
-
}, {
|
|
18407
|
-
key: "addGlobalListener",
|
|
18408
|
-
value: function addGlobalListener(key) {
|
|
18409
|
-
var _this5 = this;
|
|
18410
|
-
|
|
18411
|
-
var boundListener = function (event) {
|
|
18412
|
-
var listener = _this5.globalEvents[key];
|
|
18413
|
-
return listener && listener(_events__WEBPACK_IMPORTED_MODULE_11__.emulateReactEvent(event));
|
|
18414
|
-
};
|
|
18372
|
+
removedGlobalEventKeys.forEach(function (key) {
|
|
18373
|
+
return _this3.removeGlobalListener(key);
|
|
18374
|
+
});
|
|
18415
18375
|
|
|
18416
|
-
|
|
18417
|
-
window.addEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), boundListener);
|
|
18418
|
-
}
|
|
18419
|
-
}, {
|
|
18420
|
-
key: "removeGlobalListener",
|
|
18421
|
-
value: function removeGlobalListener(key) {
|
|
18422
|
-
window.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
|
|
18423
|
-
} // compile all state changes from own and parent state. Order doesn't matter, as any state
|
|
18424
|
-
// state change should trigger a re-render
|
|
18425
|
-
|
|
18426
|
-
}, {
|
|
18427
|
-
key: "getStateChanges",
|
|
18428
|
-
value: function getStateChanges(props) {
|
|
18429
|
-
var _this6 = this;
|
|
18430
|
-
|
|
18431
|
-
if (!this.hasEvents) {
|
|
18432
|
-
return {};
|
|
18433
|
-
}
|
|
18376
|
+
var addedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(globalEventKeys, this.prevGlobalEventKeys);
|
|
18434
18377
|
|
|
18435
|
-
|
|
18436
|
-
|
|
18378
|
+
addedGlobalEventKeys.forEach(function (key) {
|
|
18379
|
+
return _this3.addGlobalListener(key);
|
|
18380
|
+
});
|
|
18381
|
+
this.prevGlobalEventKeys = globalEventKeys;
|
|
18382
|
+
}
|
|
18383
|
+
}, {
|
|
18384
|
+
key: "componentWillUnmount",
|
|
18385
|
+
value: function componentWillUnmount() {
|
|
18386
|
+
var _this4 = this;
|
|
18437
18387
|
|
|
18438
|
-
|
|
18439
|
-
|
|
18388
|
+
this.prevGlobalEventKeys.forEach(function (key) {
|
|
18389
|
+
return _this4.removeGlobalListener(key);
|
|
18390
|
+
});
|
|
18391
|
+
}
|
|
18392
|
+
}, {
|
|
18393
|
+
key: "addGlobalListener",
|
|
18394
|
+
value: function addGlobalListener(key) {
|
|
18395
|
+
var _this5 = this;
|
|
18396
|
+
|
|
18397
|
+
var boundListener = function (event) {
|
|
18398
|
+
var listener = _this5.globalEvents[key];
|
|
18399
|
+
return listener && listener(_events__WEBPACK_IMPORTED_MODULE_11__.emulateReactEvent(event));
|
|
18400
|
+
};
|
|
18440
18401
|
|
|
18441
|
-
|
|
18442
|
-
|
|
18443
|
-
|
|
18444
|
-
|
|
18445
|
-
|
|
18446
|
-
|
|
18447
|
-
|
|
18448
|
-
|
|
18449
|
-
|
|
18450
|
-
|
|
18451
|
-
|
|
18452
|
-
|
|
18453
|
-
|
|
18454
|
-
|
|
18455
|
-
|
|
18456
|
-
|
|
18457
|
-
|
|
18458
|
-
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
18459
|
-
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
18460
|
-
memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
18461
|
-
return memo;
|
|
18462
|
-
}, []);
|
|
18463
|
-
var compiledCallbacks = callbacks.length ? function () {
|
|
18464
|
-
callbacks.forEach(function (c) {
|
|
18465
|
-
return c();
|
|
18466
|
-
});
|
|
18467
|
-
} : undefined;
|
|
18468
|
-
this.setState(externalMutations, compiledCallbacks);
|
|
18469
|
-
}
|
|
18402
|
+
this.boundGlobalEvents[key] = boundListener;
|
|
18403
|
+
window.addEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), boundListener);
|
|
18404
|
+
}
|
|
18405
|
+
}, {
|
|
18406
|
+
key: "removeGlobalListener",
|
|
18407
|
+
value: function removeGlobalListener(key) {
|
|
18408
|
+
window.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
|
|
18409
|
+
} // compile all state changes from own and parent state. Order doesn't matter, as any state
|
|
18410
|
+
// state change should trigger a re-render
|
|
18411
|
+
|
|
18412
|
+
}, {
|
|
18413
|
+
key: "getStateChanges",
|
|
18414
|
+
value: function getStateChanges(props) {
|
|
18415
|
+
var _this6 = this;
|
|
18416
|
+
|
|
18417
|
+
if (!this.hasEvents) {
|
|
18418
|
+
return {};
|
|
18470
18419
|
}
|
|
18471
|
-
}, {
|
|
18472
|
-
key: "getCalculatedValues",
|
|
18473
|
-
value: function getCalculatedValues(props) {
|
|
18474
|
-
var sharedEvents = props.sharedEvents;
|
|
18475
|
-
var components = WrappedComponent.expectedComponents;
|
|
18476
|
-
var componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
18477
|
-
var getSharedEventState = sharedEvents && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
|
|
18478
|
-
return undefined;
|
|
18479
|
-
};
|
|
18480
|
-
var baseProps = this.getBaseProps(props, getSharedEventState);
|
|
18481
18420
|
|
|
18482
|
-
|
|
18483
|
-
|
|
18484
|
-
});
|
|
18421
|
+
var getState = function (key, type) {
|
|
18422
|
+
var result = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
|
|
18485
18423
|
|
|
18486
|
-
|
|
18487
|
-
|
|
18488
|
-
return {
|
|
18489
|
-
componentEvents: componentEvents,
|
|
18490
|
-
getSharedEventState: getSharedEventState,
|
|
18491
|
-
baseProps: baseProps,
|
|
18492
|
-
dataKeys: dataKeys,
|
|
18493
|
-
hasEvents: hasEvents,
|
|
18494
|
-
events: events
|
|
18495
|
-
};
|
|
18496
|
-
}
|
|
18497
|
-
}, {
|
|
18498
|
-
key: "getExternalMutations",
|
|
18499
|
-
value: function getExternalMutations(props) {
|
|
18500
|
-
var sharedEvents = props.sharedEvents,
|
|
18501
|
-
externalEventMutations = props.externalEventMutations;
|
|
18502
|
-
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_11__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
|
|
18503
|
-
}
|
|
18504
|
-
}, {
|
|
18505
|
-
key: "cacheValues",
|
|
18506
|
-
value: function cacheValues(obj) {
|
|
18507
|
-
var _this7 = this;
|
|
18424
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
|
|
18425
|
+
};
|
|
18508
18426
|
|
|
18509
|
-
|
|
18510
|
-
|
|
18511
|
-
|
|
18427
|
+
options = options || {};
|
|
18428
|
+
var components = options.components || defaultComponents;
|
|
18429
|
+
var stateChanges = components.map(function (component) {
|
|
18430
|
+
if (!props.standalone && component.name === "parent") {
|
|
18431
|
+
// don't check for changes on parent props for non-standalone components
|
|
18432
|
+
return undefined;
|
|
18433
|
+
} else {
|
|
18434
|
+
return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
|
|
18435
|
+
return getState(key, component.name);
|
|
18436
|
+
}).filter(Boolean);
|
|
18437
|
+
}
|
|
18438
|
+
}).filter(Boolean);
|
|
18439
|
+
return stateChanges;
|
|
18440
|
+
}
|
|
18441
|
+
}, {
|
|
18442
|
+
key: "applyExternalMutations",
|
|
18443
|
+
value: function applyExternalMutations(props, externalMutations) {
|
|
18444
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
18445
|
+
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
18446
|
+
memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
18447
|
+
return memo;
|
|
18448
|
+
}, []);
|
|
18449
|
+
var compiledCallbacks = callbacks.length ? function () {
|
|
18450
|
+
callbacks.forEach(function (c) {
|
|
18451
|
+
return c();
|
|
18452
|
+
});
|
|
18453
|
+
} : undefined;
|
|
18454
|
+
this.setState(externalMutations, compiledCallbacks);
|
|
18512
18455
|
}
|
|
18513
|
-
}
|
|
18514
|
-
|
|
18515
|
-
|
|
18516
|
-
|
|
18517
|
-
|
|
18518
|
-
|
|
18456
|
+
}
|
|
18457
|
+
}, {
|
|
18458
|
+
key: "getCalculatedValues",
|
|
18459
|
+
value: function getCalculatedValues(props) {
|
|
18460
|
+
var sharedEvents = props.sharedEvents;
|
|
18461
|
+
var components = WrappedComponent.expectedComponents;
|
|
18462
|
+
var componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
18463
|
+
var getSharedEventState = sharedEvents && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
|
|
18464
|
+
return undefined;
|
|
18465
|
+
};
|
|
18466
|
+
var baseProps = this.getBaseProps(props, getSharedEventState);
|
|
18519
18467
|
|
|
18520
|
-
|
|
18468
|
+
var dataKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(baseProps).filter(function (key) {
|
|
18469
|
+
return key !== "parent";
|
|
18470
|
+
});
|
|
18521
18471
|
|
|
18522
|
-
|
|
18523
|
-
|
|
18472
|
+
var hasEvents = props.events || props.sharedEvents || componentEvents;
|
|
18473
|
+
var events = this.getAllEvents(props);
|
|
18474
|
+
return {
|
|
18475
|
+
componentEvents: componentEvents,
|
|
18476
|
+
getSharedEventState: getSharedEventState,
|
|
18477
|
+
baseProps: baseProps,
|
|
18478
|
+
dataKeys: dataKeys,
|
|
18479
|
+
hasEvents: hasEvents,
|
|
18480
|
+
events: events
|
|
18481
|
+
};
|
|
18482
|
+
}
|
|
18483
|
+
}, {
|
|
18484
|
+
key: "getExternalMutations",
|
|
18485
|
+
value: function getExternalMutations(props) {
|
|
18486
|
+
var sharedEvents = props.sharedEvents,
|
|
18487
|
+
externalEventMutations = props.externalEventMutations;
|
|
18488
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_11__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
|
|
18489
|
+
}
|
|
18490
|
+
}, {
|
|
18491
|
+
key: "cacheValues",
|
|
18492
|
+
value: function cacheValues(obj) {
|
|
18493
|
+
var _this7 = this;
|
|
18524
18494
|
|
|
18525
|
-
|
|
18495
|
+
lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(obj).forEach(function (key) {
|
|
18496
|
+
_this7[key] = obj[key];
|
|
18497
|
+
});
|
|
18498
|
+
}
|
|
18499
|
+
}, {
|
|
18500
|
+
key: "getBaseProps",
|
|
18501
|
+
value: function getBaseProps(props, getSharedEventState) {
|
|
18502
|
+
getSharedEventState = getSharedEventState || this.getSharedEventState;
|
|
18503
|
+
var sharedParentState = getSharedEventState("parent", "parent");
|
|
18504
|
+
var parentState = this.getEventState("parent", "parent");
|
|
18526
18505
|
|
|
18527
|
-
|
|
18528
|
-
}
|
|
18529
|
-
}, {
|
|
18530
|
-
key: "getAllEvents",
|
|
18531
|
-
value: function getAllEvents(props) {
|
|
18532
|
-
if (Array.isArray(this.componentEvents)) {
|
|
18533
|
-
var _componentEvents;
|
|
18506
|
+
var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentState, sharedParentState);
|
|
18534
18507
|
|
|
18535
|
-
|
|
18536
|
-
|
|
18508
|
+
var parentPropsList = baseParentProps.parentControlledProps;
|
|
18509
|
+
var parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_4___default()(baseParentProps, parentPropsList) : {};
|
|
18537
18510
|
|
|
18538
|
-
|
|
18539
|
-
}
|
|
18540
|
-
}, {
|
|
18541
|
-
key: "getComponentProps",
|
|
18542
|
-
value: function getComponentProps(component, type, index) {
|
|
18543
|
-
var name = this.props.name || WrappedComponent.role;
|
|
18544
|
-
var key = this.dataKeys && this.dataKeys[index] || index;
|
|
18545
|
-
var id = "".concat(name, "-").concat(type, "-").concat(key);
|
|
18546
|
-
var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
|
|
18547
|
-
|
|
18548
|
-
if (!baseProps && !this.hasEvents) {
|
|
18549
|
-
return undefined;
|
|
18550
|
-
}
|
|
18511
|
+
var modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentProps, props);
|
|
18551
18512
|
|
|
18552
|
-
|
|
18553
|
-
|
|
18513
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
|
|
18514
|
+
}
|
|
18515
|
+
}, {
|
|
18516
|
+
key: "getAllEvents",
|
|
18517
|
+
value: function getAllEvents(props) {
|
|
18518
|
+
if (Array.isArray(this.componentEvents)) {
|
|
18519
|
+
var _componentEvents;
|
|
18554
18520
|
|
|
18555
|
-
|
|
18556
|
-
|
|
18557
|
-
key: id
|
|
18558
|
-
}, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
|
|
18559
|
-
id: id
|
|
18560
|
-
});
|
|
18521
|
+
return Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
|
|
18522
|
+
}
|
|
18561
18523
|
|
|
18562
|
-
|
|
18524
|
+
return props.events;
|
|
18525
|
+
}
|
|
18526
|
+
}, {
|
|
18527
|
+
key: "getComponentProps",
|
|
18528
|
+
value: function getComponentProps(component, type, index) {
|
|
18529
|
+
var name = this.props.name || WrappedComponent.role;
|
|
18530
|
+
var key = this.dataKeys && this.dataKeys[index] || index;
|
|
18531
|
+
var id = "".concat(name, "-").concat(type, "-").concat(key);
|
|
18532
|
+
var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
|
|
18533
|
+
|
|
18534
|
+
if (!baseProps && !this.hasEvents) {
|
|
18535
|
+
return undefined;
|
|
18536
|
+
}
|
|
18563
18537
|
|
|
18564
|
-
|
|
18565
|
-
|
|
18566
|
-
});
|
|
18567
|
-
}
|
|
18538
|
+
if (this.hasEvents) {
|
|
18539
|
+
var baseEvents = this.getEvents(this.props, type, key);
|
|
18568
18540
|
|
|
18569
|
-
|
|
18541
|
+
var componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
|
|
18570
18542
|
index: index,
|
|
18571
18543
|
key: id
|
|
18572
|
-
}, component.props, baseProps, {
|
|
18544
|
+
}, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
|
|
18573
18545
|
id: id
|
|
18574
18546
|
});
|
|
18575
|
-
}
|
|
18576
|
-
}, {
|
|
18577
|
-
key: "renderContainer",
|
|
18578
|
-
value: function renderContainer(component, children) {
|
|
18579
|
-
var isContainer = component.type && component.type.role === "container";
|
|
18580
|
-
var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
|
|
18581
|
-
|
|
18582
|
-
if (parentProps.events) {
|
|
18583
|
-
this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEvents(parentProps.events);
|
|
18584
|
-
parentProps.events = _events__WEBPACK_IMPORTED_MODULE_11__.omitGlobalEvents(parentProps.events);
|
|
18585
|
-
}
|
|
18586
18547
|
|
|
18587
|
-
|
|
18548
|
+
var events = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _events__WEBPACK_IMPORTED_MODULE_11__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
|
|
18549
|
+
|
|
18550
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_7___default()({}, componentProps, {
|
|
18551
|
+
events: events
|
|
18552
|
+
});
|
|
18588
18553
|
}
|
|
18589
|
-
}, {
|
|
18590
|
-
key: "animateComponent",
|
|
18591
|
-
value: function animateComponent(props, defaultAnimationWhitelist) {
|
|
18592
|
-
var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
|
|
18593
|
-
return react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__.default, {
|
|
18594
|
-
animate: props.animate,
|
|
18595
|
-
animationWhitelist: animationWhitelist
|
|
18596
|
-
}, react__WEBPACK_IMPORTED_MODULE_9___default().createElement(this.constructor, props));
|
|
18597
|
-
} // Used by `VictoryLine` and `VictoryArea`
|
|
18598
|
-
|
|
18599
|
-
}, {
|
|
18600
|
-
key: "renderContinuousData",
|
|
18601
|
-
value: function renderContinuousData(props) {
|
|
18602
|
-
var _this8 = this;
|
|
18603
|
-
|
|
18604
|
-
var dataComponent = props.dataComponent,
|
|
18605
|
-
labelComponent = props.labelComponent,
|
|
18606
|
-
groupComponent = props.groupComponent;
|
|
18607
|
-
|
|
18608
|
-
var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_3___default()(this.dataKeys, "all");
|
|
18609
|
-
|
|
18610
|
-
var labelComponents = dataKeys.reduce(function (memo, key) {
|
|
18611
|
-
var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
|
|
18612
|
-
|
|
18613
|
-
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
18614
|
-
memo = memo.concat(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
|
|
18615
|
-
}
|
|
18616
18554
|
|
|
18617
|
-
|
|
18618
|
-
|
|
18619
|
-
|
|
18620
|
-
|
|
18621
|
-
|
|
18555
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
|
|
18556
|
+
index: index,
|
|
18557
|
+
key: id
|
|
18558
|
+
}, component.props, baseProps, {
|
|
18559
|
+
id: id
|
|
18560
|
+
});
|
|
18561
|
+
}
|
|
18562
|
+
}, {
|
|
18563
|
+
key: "renderContainer",
|
|
18564
|
+
value: function renderContainer(component, children) {
|
|
18565
|
+
var isContainer = component.type && component.type.role === "container";
|
|
18566
|
+
var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
|
|
18567
|
+
|
|
18568
|
+
if (parentProps.events) {
|
|
18569
|
+
this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEvents(parentProps.events);
|
|
18570
|
+
parentProps.events = _events__WEBPACK_IMPORTED_MODULE_11__.omitGlobalEvents(parentProps.events);
|
|
18622
18571
|
}
|
|
18623
|
-
}, {
|
|
18624
|
-
key: "renderData",
|
|
18625
|
-
value: function renderData(props) {
|
|
18626
|
-
var _this9 = this;
|
|
18627
|
-
|
|
18628
|
-
var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
|
|
18629
|
-
var dataComponent = props.dataComponent,
|
|
18630
|
-
labelComponent = props.labelComponent,
|
|
18631
|
-
groupComponent = props.groupComponent;
|
|
18632
|
-
var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
|
|
18633
|
-
var dataProps = _this9.getComponentProps(dataComponent, "data", index);
|
|
18634
|
-
|
|
18635
|
-
if (shouldRenderDatum(dataProps.datum)) {
|
|
18636
|
-
validDataComponents.push(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps));
|
|
18637
|
-
}
|
|
18638
18572
|
|
|
18639
|
-
|
|
18640
|
-
|
|
18641
|
-
|
|
18642
|
-
|
|
18573
|
+
return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(component, parentProps, children);
|
|
18574
|
+
}
|
|
18575
|
+
}, {
|
|
18576
|
+
key: "animateComponent",
|
|
18577
|
+
value: function animateComponent(props, defaultAnimationWhitelist) {
|
|
18578
|
+
var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
|
|
18579
|
+
return react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__.default, {
|
|
18580
|
+
animate: props.animate,
|
|
18581
|
+
animationWhitelist: animationWhitelist
|
|
18582
|
+
}, react__WEBPACK_IMPORTED_MODULE_9___default().createElement(this.constructor, props));
|
|
18583
|
+
} // Used by `VictoryLine` and `VictoryArea`
|
|
18584
|
+
|
|
18585
|
+
}, {
|
|
18586
|
+
key: "renderContinuousData",
|
|
18587
|
+
value: function renderContinuousData(props) {
|
|
18588
|
+
var _this8 = this;
|
|
18589
|
+
|
|
18590
|
+
var dataComponent = props.dataComponent,
|
|
18591
|
+
labelComponent = props.labelComponent,
|
|
18592
|
+
groupComponent = props.groupComponent;
|
|
18593
|
+
|
|
18594
|
+
var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_3___default()(this.dataKeys, "all");
|
|
18595
|
+
|
|
18596
|
+
var labelComponents = dataKeys.reduce(function (memo, key) {
|
|
18597
|
+
var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
|
|
18598
|
+
|
|
18599
|
+
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
18600
|
+
memo = memo.concat(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
|
|
18601
|
+
}
|
|
18643
18602
|
|
|
18644
|
-
|
|
18645
|
-
|
|
18646
|
-
|
|
18603
|
+
return memo;
|
|
18604
|
+
}, []);
|
|
18605
|
+
var dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
18606
|
+
var children = [react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
|
|
18607
|
+
return this.renderContainer(groupComponent, children);
|
|
18608
|
+
}
|
|
18609
|
+
}, {
|
|
18610
|
+
key: "renderData",
|
|
18611
|
+
value: function renderData(props) {
|
|
18612
|
+
var _this9 = this;
|
|
18613
|
+
|
|
18614
|
+
var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
|
|
18615
|
+
var dataComponent = props.dataComponent,
|
|
18616
|
+
labelComponent = props.labelComponent,
|
|
18617
|
+
groupComponent = props.groupComponent;
|
|
18618
|
+
var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
|
|
18619
|
+
var dataProps = _this9.getComponentProps(dataComponent, "data", index);
|
|
18620
|
+
|
|
18621
|
+
if (shouldRenderDatum(dataProps.datum)) {
|
|
18622
|
+
validDataComponents.push(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps));
|
|
18623
|
+
}
|
|
18647
18624
|
|
|
18648
|
-
|
|
18649
|
-
|
|
18625
|
+
return validDataComponents;
|
|
18626
|
+
}, []);
|
|
18627
|
+
var labelComponents = this.dataKeys.map(function (_dataKey, index) {
|
|
18628
|
+
var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
|
|
18650
18629
|
|
|
18651
|
-
|
|
18630
|
+
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
18631
|
+
return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps);
|
|
18632
|
+
}
|
|
18652
18633
|
|
|
18653
|
-
return
|
|
18654
|
-
}
|
|
18655
|
-
|
|
18634
|
+
return undefined;
|
|
18635
|
+
}).filter(Boolean);
|
|
18636
|
+
|
|
18637
|
+
var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
|
|
18638
|
+
|
|
18639
|
+
return this.renderContainer(groupComponent, children);
|
|
18640
|
+
}
|
|
18641
|
+
}]);
|
|
18656
18642
|
|
|
18657
|
-
|
|
18658
|
-
|
|
18659
|
-
);
|
|
18643
|
+
return addEvents;
|
|
18644
|
+
}(WrappedComponent);
|
|
18660
18645
|
});
|
|
18661
18646
|
|
|
18662
18647
|
/***/ }),
|
|
@@ -22573,9 +22558,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
22573
22558
|
|
|
22574
22559
|
|
|
22575
22560
|
|
|
22576
|
-
var Timer =
|
|
22577
|
-
/*#__PURE__*/
|
|
22578
|
-
function () {
|
|
22561
|
+
var Timer = /*#__PURE__*/function () {
|
|
22579
22562
|
function Timer() {
|
|
22580
22563
|
_classCallCheck(this, Timer);
|
|
22581
22564
|
|
|
@@ -24115,9 +24098,7 @@ var options = {
|
|
|
24115
24098
|
}]
|
|
24116
24099
|
};
|
|
24117
24100
|
|
|
24118
|
-
var VictoryPolarAxis =
|
|
24119
|
-
/*#__PURE__*/
|
|
24120
|
-
function (_React$Component) {
|
|
24101
|
+
var VictoryPolarAxis = /*#__PURE__*/function (_React$Component) {
|
|
24121
24102
|
_inherits(VictoryPolarAxis, _React$Component);
|
|
24122
24103
|
|
|
24123
24104
|
function VictoryPolarAxis() {
|
|
@@ -24447,9 +24428,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
24447
24428
|
|
|
24448
24429
|
|
|
24449
24430
|
|
|
24450
|
-
var VictorySharedEvents =
|
|
24451
|
-
/*#__PURE__*/
|
|
24452
|
-
function (_React$Component) {
|
|
24431
|
+
var VictorySharedEvents = /*#__PURE__*/function (_React$Component) {
|
|
24453
24432
|
_inherits(VictorySharedEvents, _React$Component);
|
|
24454
24433
|
|
|
24455
24434
|
function VictorySharedEvents(props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-chart",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.1.0",
|
|
4
4
|
"description": "Chart Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"lodash": "^4.17.19",
|
|
23
23
|
"prop-types": "^15.5.8",
|
|
24
24
|
"react-fast-compare": "^2.0.0",
|
|
25
|
-
"victory-axis": "^36.
|
|
26
|
-
"victory-core": "^36.
|
|
27
|
-
"victory-polar-axis": "^36.
|
|
28
|
-
"victory-shared-events": "^36.
|
|
25
|
+
"victory-axis": "^36.1.0",
|
|
26
|
+
"victory-core": "^36.1.0",
|
|
27
|
+
"victory-polar-axis": "^36.1.0",
|
|
28
|
+
"victory-shared-events": "^36.1.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": "^16.6.0 || ^17.0.0"
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"version": "yarn run nps build-libs && nps build-dists"
|
|
35
35
|
},
|
|
36
36
|
"sideEffects": false,
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "038cd9b70d9ce54ac6b861014165583760734c99"
|
|
38
38
|
}
|