victory-pie 36.0.1 → 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-pie.js +307 -324
- package/es/victory-pie.js +1 -3
- package/lib/victory-pie.js +1 -3
- package/package.json +3 -3
package/dist/victory-pie.js
CHANGED
|
@@ -534,9 +534,7 @@ var fallbackProps = {
|
|
|
534
534
|
labelPosition: "centroid"
|
|
535
535
|
};
|
|
536
536
|
|
|
537
|
-
var VictoryPie =
|
|
538
|
-
/*#__PURE__*/
|
|
539
|
-
function (_React$Component) {
|
|
537
|
+
var VictoryPie = /*#__PURE__*/function (_React$Component) {
|
|
540
538
|
_inherits(VictoryPie, _React$Component);
|
|
541
539
|
|
|
542
540
|
function VictoryPie() {
|
|
@@ -14530,9 +14528,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
14530
14528
|
|
|
14531
14529
|
|
|
14532
14530
|
|
|
14533
|
-
var VictoryAnimation =
|
|
14534
|
-
/*#__PURE__*/
|
|
14535
|
-
function (_React$Component) {
|
|
14531
|
+
var VictoryAnimation = /*#__PURE__*/function (_React$Component) {
|
|
14536
14532
|
_inherits(VictoryAnimation, _React$Component);
|
|
14537
14533
|
|
|
14538
14534
|
function VictoryAnimation(props, context) {
|
|
@@ -14816,9 +14812,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
14816
14812
|
|
|
14817
14813
|
|
|
14818
14814
|
|
|
14819
|
-
var VictoryContainer =
|
|
14820
|
-
/*#__PURE__*/
|
|
14821
|
-
function (_React$Component) {
|
|
14815
|
+
var VictoryContainer = /*#__PURE__*/function (_React$Component) {
|
|
14822
14816
|
_inherits(VictoryContainer, _React$Component);
|
|
14823
14817
|
|
|
14824
14818
|
function VictoryContainer(props) {
|
|
@@ -15764,9 +15758,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
15764
15758
|
|
|
15765
15759
|
|
|
15766
15760
|
|
|
15767
|
-
var Portal =
|
|
15768
|
-
/*#__PURE__*/
|
|
15769
|
-
function (_React$Component) {
|
|
15761
|
+
var Portal = /*#__PURE__*/function (_React$Component) {
|
|
15770
15762
|
_inherits(Portal, _React$Component);
|
|
15771
15763
|
|
|
15772
15764
|
function Portal(props) {
|
|
@@ -15885,9 +15877,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
15885
15877
|
|
|
15886
15878
|
|
|
15887
15879
|
|
|
15888
|
-
var VictoryPortal =
|
|
15889
|
-
/*#__PURE__*/
|
|
15890
|
-
function (_React$Component) {
|
|
15880
|
+
var VictoryPortal = /*#__PURE__*/function (_React$Component) {
|
|
15891
15881
|
_inherits(VictoryPortal, _React$Component);
|
|
15892
15882
|
|
|
15893
15883
|
function VictoryPortal() {
|
|
@@ -16779,9 +16769,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
16779
16769
|
|
|
16780
16770
|
|
|
16781
16771
|
|
|
16782
|
-
var VictoryTransition =
|
|
16783
|
-
/*#__PURE__*/
|
|
16784
|
-
function (_React$Component) {
|
|
16772
|
+
var VictoryTransition = /*#__PURE__*/function (_React$Component) {
|
|
16785
16773
|
_inherits(VictoryTransition, _React$Component);
|
|
16786
16774
|
|
|
16787
16775
|
function VictoryTransition(props, context) {
|
|
@@ -17082,365 +17070,362 @@ var defaultComponents = [{
|
|
|
17082
17070
|
name: "labels"
|
|
17083
17071
|
}];
|
|
17084
17072
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (WrappedComponent, options) {
|
|
17085
|
-
return (
|
|
17086
|
-
|
|
17087
|
-
function (_WrappedComponent) {
|
|
17088
|
-
_inherits(addEvents, _WrappedComponent);
|
|
17073
|
+
return /*#__PURE__*/function (_WrappedComponent) {
|
|
17074
|
+
_inherits(addEvents, _WrappedComponent);
|
|
17089
17075
|
|
|
17090
|
-
|
|
17091
|
-
|
|
17076
|
+
function addEvents(props) {
|
|
17077
|
+
var _this;
|
|
17092
17078
|
|
|
17093
|
-
|
|
17079
|
+
_classCallCheck(this, addEvents);
|
|
17094
17080
|
|
|
17095
|
-
|
|
17096
|
-
|
|
17097
|
-
|
|
17098
|
-
|
|
17081
|
+
_this = _possibleConstructorReturn(this, (addEvents.__proto__ || Object.getPrototypeOf(addEvents)).call(this, props));
|
|
17082
|
+
var getScopedEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getScopedEvents.bind(_assertThisInitialized(_this));
|
|
17083
|
+
var boundGetEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getEvents.bind(_assertThisInitialized(_this));
|
|
17084
|
+
_this.state = {};
|
|
17099
17085
|
|
|
17100
|
-
|
|
17101
|
-
|
|
17102
|
-
|
|
17103
|
-
|
|
17104
|
-
_this.getEventState = _events__WEBPACK_IMPORTED_MODULE_11__.getEventState.bind(_assertThisInitialized(_this));
|
|
17086
|
+
_this.getEvents = function (p, target, eventKey) {
|
|
17087
|
+
return boundGetEvents(p, target, eventKey, getScopedEvents);
|
|
17088
|
+
};
|
|
17105
17089
|
|
|
17106
|
-
|
|
17090
|
+
_this.getEventState = _events__WEBPACK_IMPORTED_MODULE_11__.getEventState.bind(_assertThisInitialized(_this));
|
|
17107
17091
|
|
|
17108
|
-
|
|
17092
|
+
var calculatedValues = _this.getCalculatedValues(props);
|
|
17109
17093
|
|
|
17110
|
-
|
|
17111
|
-
_this.calculatedState = _this.getStateChanges(props);
|
|
17112
|
-
_this.globalEvents = {};
|
|
17113
|
-
_this.prevGlobalEventKeys = [];
|
|
17114
|
-
_this.boundGlobalEvents = {};
|
|
17115
|
-
return _this;
|
|
17116
|
-
}
|
|
17094
|
+
_this.cacheValues(calculatedValues);
|
|
17117
17095
|
|
|
17118
|
-
|
|
17119
|
-
|
|
17120
|
-
|
|
17121
|
-
|
|
17122
|
-
|
|
17123
|
-
|
|
17124
|
-
|
|
17125
|
-
if (animating || newMutation) {
|
|
17126
|
-
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
17127
|
-
this.externalMutations = externalMutations;
|
|
17128
|
-
this.applyExternalMutations(nextProps, externalMutations);
|
|
17129
|
-
return true;
|
|
17130
|
-
}
|
|
17096
|
+
_this.externalMutations = _this.getExternalMutations(props);
|
|
17097
|
+
_this.calculatedState = _this.getStateChanges(props);
|
|
17098
|
+
_this.globalEvents = {};
|
|
17099
|
+
_this.prevGlobalEventKeys = [];
|
|
17100
|
+
_this.boundGlobalEvents = {};
|
|
17101
|
+
return _this;
|
|
17102
|
+
}
|
|
17131
17103
|
|
|
17132
|
-
|
|
17104
|
+
_createClass(addEvents, [{
|
|
17105
|
+
key: "shouldComponentUpdate",
|
|
17106
|
+
value: function shouldComponentUpdate(nextProps) {
|
|
17107
|
+
var externalMutations = this.getExternalMutations(nextProps);
|
|
17108
|
+
var animating = this.props.animating || this.props.animate;
|
|
17109
|
+
var newMutation = !react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(externalMutations, this.externalMutations);
|
|
17110
|
+
|
|
17111
|
+
if (animating || newMutation) {
|
|
17112
|
+
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
17113
|
+
this.externalMutations = externalMutations;
|
|
17114
|
+
this.applyExternalMutations(nextProps, externalMutations);
|
|
17115
|
+
return true;
|
|
17116
|
+
}
|
|
17133
17117
|
|
|
17134
|
-
|
|
17135
|
-
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
17136
|
-
return true;
|
|
17137
|
-
}
|
|
17118
|
+
var calculatedState = this.getStateChanges(nextProps);
|
|
17138
17119
|
|
|
17139
|
-
|
|
17140
|
-
|
|
17141
|
-
|
|
17142
|
-
|
|
17120
|
+
if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.calculatedState, calculatedState)) {
|
|
17121
|
+
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
17122
|
+
return true;
|
|
17123
|
+
}
|
|
17143
17124
|
|
|
17144
|
-
|
|
17125
|
+
if (!react_fast_compare__WEBPACK_IMPORTED_MODULE_10___default()(this.props, nextProps)) {
|
|
17126
|
+
this.cacheValues(this.getCalculatedValues(nextProps));
|
|
17127
|
+
return true;
|
|
17145
17128
|
}
|
|
17146
|
-
}, {
|
|
17147
|
-
key: "componentDidMount",
|
|
17148
|
-
value: function componentDidMount() {
|
|
17149
|
-
var _this2 = this;
|
|
17150
17129
|
|
|
17151
|
-
|
|
17130
|
+
return false;
|
|
17131
|
+
}
|
|
17132
|
+
}, {
|
|
17133
|
+
key: "componentDidMount",
|
|
17134
|
+
value: function componentDidMount() {
|
|
17135
|
+
var _this2 = this;
|
|
17152
17136
|
|
|
17153
|
-
|
|
17154
|
-
return _this2.addGlobalListener(key);
|
|
17155
|
-
});
|
|
17156
|
-
this.prevGlobalEventKeys = globalEventKeys;
|
|
17157
|
-
}
|
|
17158
|
-
}, {
|
|
17159
|
-
key: "componentDidUpdate",
|
|
17160
|
-
value: function componentDidUpdate(prevProps) {
|
|
17161
|
-
var _this3 = this;
|
|
17137
|
+
var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
|
|
17162
17138
|
|
|
17163
|
-
|
|
17164
|
-
|
|
17139
|
+
globalEventKeys.forEach(function (key) {
|
|
17140
|
+
return _this2.addGlobalListener(key);
|
|
17141
|
+
});
|
|
17142
|
+
this.prevGlobalEventKeys = globalEventKeys;
|
|
17143
|
+
}
|
|
17144
|
+
}, {
|
|
17145
|
+
key: "componentDidUpdate",
|
|
17146
|
+
value: function componentDidUpdate(prevProps) {
|
|
17147
|
+
var _this3 = this;
|
|
17165
17148
|
|
|
17166
|
-
|
|
17149
|
+
var calculatedState = this.getStateChanges(prevProps);
|
|
17150
|
+
this.calculatedState = calculatedState;
|
|
17167
17151
|
|
|
17168
|
-
|
|
17152
|
+
var globalEventKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(this.globalEvents);
|
|
17169
17153
|
|
|
17170
|
-
|
|
17171
|
-
return _this3.removeGlobalListener(key);
|
|
17172
|
-
});
|
|
17154
|
+
var removedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(this.prevGlobalEventKeys, globalEventKeys);
|
|
17173
17155
|
|
|
17174
|
-
|
|
17156
|
+
removedGlobalEventKeys.forEach(function (key) {
|
|
17157
|
+
return _this3.removeGlobalListener(key);
|
|
17158
|
+
});
|
|
17175
17159
|
|
|
17176
|
-
|
|
17177
|
-
return _this3.addGlobalListener(key);
|
|
17178
|
-
});
|
|
17179
|
-
this.prevGlobalEventKeys = globalEventKeys;
|
|
17180
|
-
}
|
|
17181
|
-
}, {
|
|
17182
|
-
key: "componentWillUnmount",
|
|
17183
|
-
value: function componentWillUnmount() {
|
|
17184
|
-
var _this4 = this;
|
|
17160
|
+
var addedGlobalEventKeys = lodash_difference__WEBPACK_IMPORTED_MODULE_0___default()(globalEventKeys, this.prevGlobalEventKeys);
|
|
17185
17161
|
|
|
17186
|
-
|
|
17187
|
-
|
|
17188
|
-
|
|
17189
|
-
|
|
17190
|
-
}
|
|
17191
|
-
|
|
17192
|
-
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
var boundListener = function (event) {
|
|
17196
|
-
var listener = _this5.globalEvents[key];
|
|
17197
|
-
return listener && listener(_events__WEBPACK_IMPORTED_MODULE_11__.emulateReactEvent(event));
|
|
17198
|
-
};
|
|
17162
|
+
addedGlobalEventKeys.forEach(function (key) {
|
|
17163
|
+
return _this3.addGlobalListener(key);
|
|
17164
|
+
});
|
|
17165
|
+
this.prevGlobalEventKeys = globalEventKeys;
|
|
17166
|
+
}
|
|
17167
|
+
}, {
|
|
17168
|
+
key: "componentWillUnmount",
|
|
17169
|
+
value: function componentWillUnmount() {
|
|
17170
|
+
var _this4 = this;
|
|
17199
17171
|
|
|
17200
|
-
|
|
17201
|
-
|
|
17202
|
-
}
|
|
17203
|
-
}
|
|
17204
|
-
|
|
17205
|
-
|
|
17206
|
-
|
|
17207
|
-
|
|
17208
|
-
// state change should trigger a re-render
|
|
17209
|
-
|
|
17210
|
-
}, {
|
|
17211
|
-
key: "getStateChanges",
|
|
17212
|
-
value: function getStateChanges(props) {
|
|
17213
|
-
var _this6 = this;
|
|
17214
|
-
|
|
17215
|
-
if (!this.hasEvents) {
|
|
17216
|
-
return {};
|
|
17217
|
-
}
|
|
17172
|
+
this.prevGlobalEventKeys.forEach(function (key) {
|
|
17173
|
+
return _this4.removeGlobalListener(key);
|
|
17174
|
+
});
|
|
17175
|
+
}
|
|
17176
|
+
}, {
|
|
17177
|
+
key: "addGlobalListener",
|
|
17178
|
+
value: function addGlobalListener(key) {
|
|
17179
|
+
var _this5 = this;
|
|
17218
17180
|
|
|
17219
|
-
|
|
17220
|
-
|
|
17181
|
+
var boundListener = function (event) {
|
|
17182
|
+
var listener = _this5.globalEvents[key];
|
|
17183
|
+
return listener && listener(_events__WEBPACK_IMPORTED_MODULE_11__.emulateReactEvent(event));
|
|
17184
|
+
};
|
|
17221
17185
|
|
|
17222
|
-
|
|
17223
|
-
|
|
17186
|
+
this.boundGlobalEvents[key] = boundListener;
|
|
17187
|
+
window.addEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), boundListener);
|
|
17188
|
+
}
|
|
17189
|
+
}, {
|
|
17190
|
+
key: "removeGlobalListener",
|
|
17191
|
+
value: function removeGlobalListener(key) {
|
|
17192
|
+
window.removeEventListener(_events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEventNameFromKey(key), this.boundGlobalEvents[key]);
|
|
17193
|
+
} // compile all state changes from own and parent state. Order doesn't matter, as any state
|
|
17194
|
+
// state change should trigger a re-render
|
|
17224
17195
|
|
|
17225
|
-
|
|
17226
|
-
|
|
17227
|
-
|
|
17228
|
-
|
|
17229
|
-
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
|
|
17233
|
-
return getState(key, component.name);
|
|
17234
|
-
}).filter(Boolean);
|
|
17235
|
-
}
|
|
17236
|
-
}).filter(Boolean);
|
|
17237
|
-
return stateChanges;
|
|
17238
|
-
}
|
|
17239
|
-
}, {
|
|
17240
|
-
key: "applyExternalMutations",
|
|
17241
|
-
value: function applyExternalMutations(props, externalMutations) {
|
|
17242
|
-
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
17243
|
-
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
17244
|
-
memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
17245
|
-
return memo;
|
|
17246
|
-
}, []);
|
|
17247
|
-
var compiledCallbacks = callbacks.length ? function () {
|
|
17248
|
-
callbacks.forEach(function (c) {
|
|
17249
|
-
return c();
|
|
17250
|
-
});
|
|
17251
|
-
} : undefined;
|
|
17252
|
-
this.setState(externalMutations, compiledCallbacks);
|
|
17253
|
-
}
|
|
17196
|
+
}, {
|
|
17197
|
+
key: "getStateChanges",
|
|
17198
|
+
value: function getStateChanges(props) {
|
|
17199
|
+
var _this6 = this;
|
|
17200
|
+
|
|
17201
|
+
if (!this.hasEvents) {
|
|
17202
|
+
return {};
|
|
17254
17203
|
}
|
|
17255
|
-
}, {
|
|
17256
|
-
key: "getCalculatedValues",
|
|
17257
|
-
value: function getCalculatedValues(props) {
|
|
17258
|
-
var sharedEvents = props.sharedEvents;
|
|
17259
|
-
var components = WrappedComponent.expectedComponents;
|
|
17260
|
-
var componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
17261
|
-
var getSharedEventState = sharedEvents && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
|
|
17262
|
-
return undefined;
|
|
17263
|
-
};
|
|
17264
|
-
var baseProps = this.getBaseProps(props, getSharedEventState);
|
|
17265
17204
|
|
|
17266
|
-
|
|
17267
|
-
|
|
17268
|
-
});
|
|
17205
|
+
var getState = function (key, type) {
|
|
17206
|
+
var result = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _this6.getEventState(key, type), _this6.getSharedEventState(key, type));
|
|
17269
17207
|
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
return {
|
|
17273
|
-
componentEvents: componentEvents,
|
|
17274
|
-
getSharedEventState: getSharedEventState,
|
|
17275
|
-
baseProps: baseProps,
|
|
17276
|
-
dataKeys: dataKeys,
|
|
17277
|
-
hasEvents: hasEvents,
|
|
17278
|
-
events: events
|
|
17279
|
-
};
|
|
17280
|
-
}
|
|
17281
|
-
}, {
|
|
17282
|
-
key: "getExternalMutations",
|
|
17283
|
-
value: function getExternalMutations(props) {
|
|
17284
|
-
var sharedEvents = props.sharedEvents,
|
|
17285
|
-
externalEventMutations = props.externalEventMutations;
|
|
17286
|
-
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_11__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
|
|
17287
|
-
}
|
|
17288
|
-
}, {
|
|
17289
|
-
key: "cacheValues",
|
|
17290
|
-
value: function cacheValues(obj) {
|
|
17291
|
-
var _this7 = this;
|
|
17208
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(result) ? undefined : result;
|
|
17209
|
+
};
|
|
17292
17210
|
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
|
|
17211
|
+
options = options || {};
|
|
17212
|
+
var components = options.components || defaultComponents;
|
|
17213
|
+
var stateChanges = components.map(function (component) {
|
|
17214
|
+
if (!props.standalone && component.name === "parent") {
|
|
17215
|
+
// don't check for changes on parent props for non-standalone components
|
|
17216
|
+
return undefined;
|
|
17217
|
+
} else {
|
|
17218
|
+
return component.index !== undefined ? getState(component.index, component.name) : _this6.dataKeys.map(function (key) {
|
|
17219
|
+
return getState(key, component.name);
|
|
17220
|
+
}).filter(Boolean);
|
|
17221
|
+
}
|
|
17222
|
+
}).filter(Boolean);
|
|
17223
|
+
return stateChanges;
|
|
17224
|
+
}
|
|
17225
|
+
}, {
|
|
17226
|
+
key: "applyExternalMutations",
|
|
17227
|
+
value: function applyExternalMutations(props, externalMutations) {
|
|
17228
|
+
if (!lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalMutations)) {
|
|
17229
|
+
var callbacks = props.externalEventMutations.reduce(function (memo, mutation) {
|
|
17230
|
+
memo = lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(mutation.callback) ? memo.concat(mutation.callback) : memo;
|
|
17231
|
+
return memo;
|
|
17232
|
+
}, []);
|
|
17233
|
+
var compiledCallbacks = callbacks.length ? function () {
|
|
17234
|
+
callbacks.forEach(function (c) {
|
|
17235
|
+
return c();
|
|
17236
|
+
});
|
|
17237
|
+
} : undefined;
|
|
17238
|
+
this.setState(externalMutations, compiledCallbacks);
|
|
17296
17239
|
}
|
|
17297
|
-
}
|
|
17298
|
-
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
|
|
17240
|
+
}
|
|
17241
|
+
}, {
|
|
17242
|
+
key: "getCalculatedValues",
|
|
17243
|
+
value: function getCalculatedValues(props) {
|
|
17244
|
+
var sharedEvents = props.sharedEvents;
|
|
17245
|
+
var components = WrappedComponent.expectedComponents;
|
|
17246
|
+
var componentEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getComponentEvents(props, components);
|
|
17247
|
+
var getSharedEventState = sharedEvents && lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(sharedEvents.getEventState) ? sharedEvents.getEventState : function () {
|
|
17248
|
+
return undefined;
|
|
17249
|
+
};
|
|
17250
|
+
var baseProps = this.getBaseProps(props, getSharedEventState);
|
|
17303
17251
|
|
|
17304
|
-
|
|
17252
|
+
var dataKeys = lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(baseProps).filter(function (key) {
|
|
17253
|
+
return key !== "parent";
|
|
17254
|
+
});
|
|
17305
17255
|
|
|
17306
|
-
|
|
17307
|
-
|
|
17256
|
+
var hasEvents = props.events || props.sharedEvents || componentEvents;
|
|
17257
|
+
var events = this.getAllEvents(props);
|
|
17258
|
+
return {
|
|
17259
|
+
componentEvents: componentEvents,
|
|
17260
|
+
getSharedEventState: getSharedEventState,
|
|
17261
|
+
baseProps: baseProps,
|
|
17262
|
+
dataKeys: dataKeys,
|
|
17263
|
+
hasEvents: hasEvents,
|
|
17264
|
+
events: events
|
|
17265
|
+
};
|
|
17266
|
+
}
|
|
17267
|
+
}, {
|
|
17268
|
+
key: "getExternalMutations",
|
|
17269
|
+
value: function getExternalMutations(props) {
|
|
17270
|
+
var sharedEvents = props.sharedEvents,
|
|
17271
|
+
externalEventMutations = props.externalEventMutations;
|
|
17272
|
+
return lodash_isEmpty__WEBPACK_IMPORTED_MODULE_2___default()(externalEventMutations) || sharedEvents ? undefined : _events__WEBPACK_IMPORTED_MODULE_11__.getExternalMutations(externalEventMutations, this.baseProps, this.state);
|
|
17273
|
+
}
|
|
17274
|
+
}, {
|
|
17275
|
+
key: "cacheValues",
|
|
17276
|
+
value: function cacheValues(obj) {
|
|
17277
|
+
var _this7 = this;
|
|
17308
17278
|
|
|
17309
|
-
|
|
17279
|
+
lodash_keys__WEBPACK_IMPORTED_MODULE_6___default()(obj).forEach(function (key) {
|
|
17280
|
+
_this7[key] = obj[key];
|
|
17281
|
+
});
|
|
17282
|
+
}
|
|
17283
|
+
}, {
|
|
17284
|
+
key: "getBaseProps",
|
|
17285
|
+
value: function getBaseProps(props, getSharedEventState) {
|
|
17286
|
+
getSharedEventState = getSharedEventState || this.getSharedEventState;
|
|
17287
|
+
var sharedParentState = getSharedEventState("parent", "parent");
|
|
17288
|
+
var parentState = this.getEventState("parent", "parent");
|
|
17310
17289
|
|
|
17311
|
-
|
|
17312
|
-
}
|
|
17313
|
-
}, {
|
|
17314
|
-
key: "getAllEvents",
|
|
17315
|
-
value: function getAllEvents(props) {
|
|
17316
|
-
if (Array.isArray(this.componentEvents)) {
|
|
17317
|
-
var _componentEvents;
|
|
17290
|
+
var baseParentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentState, sharedParentState);
|
|
17318
17291
|
|
|
17319
|
-
|
|
17320
|
-
|
|
17292
|
+
var parentPropsList = baseParentProps.parentControlledProps;
|
|
17293
|
+
var parentProps = parentPropsList ? lodash_pick__WEBPACK_IMPORTED_MODULE_4___default()(baseParentProps, parentPropsList) : {};
|
|
17321
17294
|
|
|
17322
|
-
|
|
17323
|
-
}
|
|
17324
|
-
}, {
|
|
17325
|
-
key: "getComponentProps",
|
|
17326
|
-
value: function getComponentProps(component, type, index) {
|
|
17327
|
-
var name = this.props.name || WrappedComponent.role;
|
|
17328
|
-
var key = this.dataKeys && this.dataKeys[index] || index;
|
|
17329
|
-
var id = "".concat(name, "-").concat(type, "-").concat(key);
|
|
17330
|
-
var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
|
|
17331
|
-
|
|
17332
|
-
if (!baseProps && !this.hasEvents) {
|
|
17333
|
-
return undefined;
|
|
17334
|
-
}
|
|
17295
|
+
var modifiedProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, parentProps, props);
|
|
17335
17296
|
|
|
17336
|
-
|
|
17337
|
-
|
|
17297
|
+
return lodash_isFunction__WEBPACK_IMPORTED_MODULE_5___default()(WrappedComponent.getBaseProps) ? WrappedComponent.getBaseProps(modifiedProps) : {};
|
|
17298
|
+
}
|
|
17299
|
+
}, {
|
|
17300
|
+
key: "getAllEvents",
|
|
17301
|
+
value: function getAllEvents(props) {
|
|
17302
|
+
if (Array.isArray(this.componentEvents)) {
|
|
17303
|
+
var _componentEvents;
|
|
17338
17304
|
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
key: id
|
|
17342
|
-
}, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
|
|
17343
|
-
id: id
|
|
17344
|
-
});
|
|
17305
|
+
return Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents;
|
|
17306
|
+
}
|
|
17345
17307
|
|
|
17346
|
-
|
|
17308
|
+
return props.events;
|
|
17309
|
+
}
|
|
17310
|
+
}, {
|
|
17311
|
+
key: "getComponentProps",
|
|
17312
|
+
value: function getComponentProps(component, type, index) {
|
|
17313
|
+
var name = this.props.name || WrappedComponent.role;
|
|
17314
|
+
var key = this.dataKeys && this.dataKeys[index] || index;
|
|
17315
|
+
var id = "".concat(name, "-").concat(type, "-").concat(key);
|
|
17316
|
+
var baseProps = this.baseProps[key] && this.baseProps[key][type] || this.baseProps[key];
|
|
17317
|
+
|
|
17318
|
+
if (!baseProps && !this.hasEvents) {
|
|
17319
|
+
return undefined;
|
|
17320
|
+
}
|
|
17347
17321
|
|
|
17348
|
-
|
|
17349
|
-
|
|
17350
|
-
});
|
|
17351
|
-
}
|
|
17322
|
+
if (this.hasEvents) {
|
|
17323
|
+
var baseEvents = this.getEvents(this.props, type, key);
|
|
17352
17324
|
|
|
17353
|
-
|
|
17325
|
+
var componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
|
|
17354
17326
|
index: index,
|
|
17355
17327
|
key: id
|
|
17356
|
-
}, component.props, baseProps, {
|
|
17328
|
+
}, this.getEventState(key, type), this.getSharedEventState(key, type), component.props, baseProps, {
|
|
17357
17329
|
id: id
|
|
17358
17330
|
});
|
|
17359
|
-
}
|
|
17360
|
-
}, {
|
|
17361
|
-
key: "renderContainer",
|
|
17362
|
-
value: function renderContainer(component, children) {
|
|
17363
|
-
var isContainer = component.type && component.type.role === "container";
|
|
17364
|
-
var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
|
|
17365
|
-
|
|
17366
|
-
if (parentProps.events) {
|
|
17367
|
-
this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEvents(parentProps.events);
|
|
17368
|
-
parentProps.events = _events__WEBPACK_IMPORTED_MODULE_11__.omitGlobalEvents(parentProps.events);
|
|
17369
|
-
}
|
|
17370
17331
|
|
|
17371
|
-
|
|
17332
|
+
var events = lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({}, _events__WEBPACK_IMPORTED_MODULE_11__.getPartialEvents(baseEvents, key, componentProps), componentProps.events);
|
|
17333
|
+
|
|
17334
|
+
return lodash_assign__WEBPACK_IMPORTED_MODULE_7___default()({}, componentProps, {
|
|
17335
|
+
events: events
|
|
17336
|
+
});
|
|
17372
17337
|
}
|
|
17373
|
-
}, {
|
|
17374
|
-
key: "animateComponent",
|
|
17375
|
-
value: function animateComponent(props, defaultAnimationWhitelist) {
|
|
17376
|
-
var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
|
|
17377
|
-
return react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__.default, {
|
|
17378
|
-
animate: props.animate,
|
|
17379
|
-
animationWhitelist: animationWhitelist
|
|
17380
|
-
}, react__WEBPACK_IMPORTED_MODULE_9___default().createElement(this.constructor, props));
|
|
17381
|
-
} // Used by `VictoryLine` and `VictoryArea`
|
|
17382
|
-
|
|
17383
|
-
}, {
|
|
17384
|
-
key: "renderContinuousData",
|
|
17385
|
-
value: function renderContinuousData(props) {
|
|
17386
|
-
var _this8 = this;
|
|
17387
|
-
|
|
17388
|
-
var dataComponent = props.dataComponent,
|
|
17389
|
-
labelComponent = props.labelComponent,
|
|
17390
|
-
groupComponent = props.groupComponent;
|
|
17391
|
-
|
|
17392
|
-
var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_3___default()(this.dataKeys, "all");
|
|
17393
|
-
|
|
17394
|
-
var labelComponents = dataKeys.reduce(function (memo, key) {
|
|
17395
|
-
var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
|
|
17396
|
-
|
|
17397
|
-
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
17398
|
-
memo = memo.concat(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
|
|
17399
|
-
}
|
|
17400
17338
|
|
|
17401
|
-
|
|
17402
|
-
|
|
17403
|
-
|
|
17404
|
-
|
|
17405
|
-
|
|
17339
|
+
return lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({
|
|
17340
|
+
index: index,
|
|
17341
|
+
key: id
|
|
17342
|
+
}, component.props, baseProps, {
|
|
17343
|
+
id: id
|
|
17344
|
+
});
|
|
17345
|
+
}
|
|
17346
|
+
}, {
|
|
17347
|
+
key: "renderContainer",
|
|
17348
|
+
value: function renderContainer(component, children) {
|
|
17349
|
+
var isContainer = component.type && component.type.role === "container";
|
|
17350
|
+
var parentProps = isContainer ? this.getComponentProps(component, "parent", "parent") : {};
|
|
17351
|
+
|
|
17352
|
+
if (parentProps.events) {
|
|
17353
|
+
this.globalEvents = _events__WEBPACK_IMPORTED_MODULE_11__.getGlobalEvents(parentProps.events);
|
|
17354
|
+
parentProps.events = _events__WEBPACK_IMPORTED_MODULE_11__.omitGlobalEvents(parentProps.events);
|
|
17406
17355
|
}
|
|
17407
|
-
}, {
|
|
17408
|
-
key: "renderData",
|
|
17409
|
-
value: function renderData(props) {
|
|
17410
|
-
var _this9 = this;
|
|
17411
|
-
|
|
17412
|
-
var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
|
|
17413
|
-
var dataComponent = props.dataComponent,
|
|
17414
|
-
labelComponent = props.labelComponent,
|
|
17415
|
-
groupComponent = props.groupComponent;
|
|
17416
|
-
var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
|
|
17417
|
-
var dataProps = _this9.getComponentProps(dataComponent, "data", index);
|
|
17418
|
-
|
|
17419
|
-
if (shouldRenderDatum(dataProps.datum)) {
|
|
17420
|
-
validDataComponents.push(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps));
|
|
17421
|
-
}
|
|
17422
17356
|
|
|
17423
|
-
|
|
17424
|
-
|
|
17425
|
-
|
|
17426
|
-
|
|
17357
|
+
return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(component, parentProps, children);
|
|
17358
|
+
}
|
|
17359
|
+
}, {
|
|
17360
|
+
key: "animateComponent",
|
|
17361
|
+
value: function animateComponent(props, defaultAnimationWhitelist) {
|
|
17362
|
+
var animationWhitelist = props.animate && props.animate.animationWhitelist ? props.animate.animationWhitelist : defaultAnimationWhitelist;
|
|
17363
|
+
return react__WEBPACK_IMPORTED_MODULE_9___default().createElement(_victory_transition_victory_transition__WEBPACK_IMPORTED_MODULE_12__.default, {
|
|
17364
|
+
animate: props.animate,
|
|
17365
|
+
animationWhitelist: animationWhitelist
|
|
17366
|
+
}, react__WEBPACK_IMPORTED_MODULE_9___default().createElement(this.constructor, props));
|
|
17367
|
+
} // Used by `VictoryLine` and `VictoryArea`
|
|
17427
17368
|
|
|
17428
|
-
|
|
17429
|
-
|
|
17430
|
-
|
|
17369
|
+
}, {
|
|
17370
|
+
key: "renderContinuousData",
|
|
17371
|
+
value: function renderContinuousData(props) {
|
|
17372
|
+
var _this8 = this;
|
|
17431
17373
|
|
|
17432
|
-
|
|
17433
|
-
|
|
17374
|
+
var dataComponent = props.dataComponent,
|
|
17375
|
+
labelComponent = props.labelComponent,
|
|
17376
|
+
groupComponent = props.groupComponent;
|
|
17434
17377
|
|
|
17435
|
-
|
|
17378
|
+
var dataKeys = lodash_without__WEBPACK_IMPORTED_MODULE_3___default()(this.dataKeys, "all");
|
|
17436
17379
|
|
|
17437
|
-
|
|
17438
|
-
|
|
17439
|
-
|
|
17380
|
+
var labelComponents = dataKeys.reduce(function (memo, key) {
|
|
17381
|
+
var labelProps = _this8.getComponentProps(labelComponent, "labels", key);
|
|
17382
|
+
|
|
17383
|
+
if (labelProps && labelProps.text !== undefined && labelProps.text !== null) {
|
|
17384
|
+
memo = memo.concat(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps));
|
|
17385
|
+
}
|
|
17386
|
+
|
|
17387
|
+
return memo;
|
|
17388
|
+
}, []);
|
|
17389
|
+
var dataProps = this.getComponentProps(dataComponent, "data", "all");
|
|
17390
|
+
var children = [react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps)].concat(_toConsumableArray(labelComponents));
|
|
17391
|
+
return this.renderContainer(groupComponent, children);
|
|
17392
|
+
}
|
|
17393
|
+
}, {
|
|
17394
|
+
key: "renderData",
|
|
17395
|
+
value: function renderData(props) {
|
|
17396
|
+
var _this9 = this;
|
|
17397
|
+
|
|
17398
|
+
var shouldRenderDatum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datumHasXandY;
|
|
17399
|
+
var dataComponent = props.dataComponent,
|
|
17400
|
+
labelComponent = props.labelComponent,
|
|
17401
|
+
groupComponent = props.groupComponent;
|
|
17402
|
+
var dataComponents = this.dataKeys.reduce(function (validDataComponents, _dataKey, index) {
|
|
17403
|
+
var dataProps = _this9.getComponentProps(dataComponent, "data", index);
|
|
17404
|
+
|
|
17405
|
+
if (shouldRenderDatum(dataProps.datum)) {
|
|
17406
|
+
validDataComponents.push(react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(dataComponent, dataProps));
|
|
17407
|
+
}
|
|
17408
|
+
|
|
17409
|
+
return validDataComponents;
|
|
17410
|
+
}, []);
|
|
17411
|
+
var labelComponents = this.dataKeys.map(function (_dataKey, index) {
|
|
17412
|
+
var labelProps = _this9.getComponentProps(labelComponent, "labels", index);
|
|
17413
|
+
|
|
17414
|
+
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
17415
|
+
return react__WEBPACK_IMPORTED_MODULE_9___default().cloneElement(labelComponent, labelProps);
|
|
17416
|
+
}
|
|
17417
|
+
|
|
17418
|
+
return undefined;
|
|
17419
|
+
}).filter(Boolean);
|
|
17420
|
+
|
|
17421
|
+
var children = _toConsumableArray(dataComponents).concat(_toConsumableArray(labelComponents));
|
|
17422
|
+
|
|
17423
|
+
return this.renderContainer(groupComponent, children);
|
|
17424
|
+
}
|
|
17425
|
+
}]);
|
|
17440
17426
|
|
|
17441
|
-
|
|
17442
|
-
|
|
17443
|
-
);
|
|
17427
|
+
return addEvents;
|
|
17428
|
+
}(WrappedComponent);
|
|
17444
17429
|
});
|
|
17445
17430
|
|
|
17446
17431
|
/***/ }),
|
|
@@ -20271,9 +20256,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
20271
20256
|
|
|
20272
20257
|
|
|
20273
20258
|
|
|
20274
|
-
var Timer =
|
|
20275
|
-
/*#__PURE__*/
|
|
20276
|
-
function () {
|
|
20259
|
+
var Timer = /*#__PURE__*/function () {
|
|
20277
20260
|
function Timer() {
|
|
20278
20261
|
_classCallCheck(this, Timer);
|
|
20279
20262
|
|
package/es/victory-pie.js
CHANGED
|
@@ -29,9 +29,7 @@ var fallbackProps = {
|
|
|
29
29
|
labelPosition: "centroid"
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
var VictoryPie =
|
|
33
|
-
/*#__PURE__*/
|
|
34
|
-
function (_React$Component) {
|
|
32
|
+
var VictoryPie = /*#__PURE__*/function (_React$Component) {
|
|
35
33
|
_inherits(VictoryPie, _React$Component);
|
|
36
34
|
|
|
37
35
|
function VictoryPie() {
|
package/lib/victory-pie.js
CHANGED
|
@@ -42,9 +42,7 @@ var fallbackProps = {
|
|
|
42
42
|
labelPosition: "centroid"
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
var VictoryPie =
|
|
46
|
-
/*#__PURE__*/
|
|
47
|
-
function (_React$Component) {
|
|
45
|
+
var VictoryPie = /*#__PURE__*/function (_React$Component) {
|
|
48
46
|
_inherits(VictoryPie, _React$Component);
|
|
49
47
|
|
|
50
48
|
function VictoryPie() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-pie",
|
|
3
|
-
"version": "36.0
|
|
3
|
+
"version": "36.1.0",
|
|
4
4
|
"description": "Pie Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"d3-shape": "^1.0.0",
|
|
23
23
|
"lodash": "^4.17.19",
|
|
24
24
|
"prop-types": "^15.5.8",
|
|
25
|
-
"victory-core": "^36.
|
|
25
|
+
"victory-core": "^36.1.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.6.0 || ^17.0.0"
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"version": "yarn run nps build-libs && nps build-dists"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "038cd9b70d9ce54ac6b861014165583760734c99"
|
|
35
35
|
}
|