victory-pie 36.2.2 → 36.4.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 +16278 -16643
- package/dist/victory-pie.min.js +1 -1
- package/es/helper-methods.js +1 -1
- package/es/index.d.ts +1 -0
- package/es/slice.js +7 -5
- package/es/victory-pie.js +144 -169
- package/lib/helper-methods.js +4 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +4 -4
- package/lib/slice.js +10 -6
- package/lib/victory-pie.js +144 -168
- package/package.json +4 -4
- package/src/helper-methods.js +1 -1
- package/src/index.d.ts +1 -0
- package/src/slice.js +1 -1
- package/src/victory-pie.js +7 -2
package/lib/victory-pie.js
CHANGED
|
@@ -21,13 +21,23 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
21
21
|
|
|
22
22
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23
23
|
|
|
24
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
+
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
|
|
30
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
+
|
|
32
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
27
33
|
|
|
28
34
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
35
|
|
|
30
|
-
function
|
|
36
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
+
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
+
|
|
40
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
41
|
|
|
32
42
|
var fallbackProps = {
|
|
33
43
|
endAngle: 360,
|
|
@@ -42,21 +52,21 @@ var fallbackProps = {
|
|
|
42
52
|
labelPosition: "centroid"
|
|
43
53
|
};
|
|
44
54
|
|
|
45
|
-
var VictoryPie =
|
|
46
|
-
/*#__PURE__*/
|
|
47
|
-
function (_React$Component) {
|
|
55
|
+
var VictoryPie = /*#__PURE__*/function (_React$Component) {
|
|
48
56
|
_inherits(VictoryPie, _React$Component);
|
|
49
57
|
|
|
58
|
+
var _super = _createSuper(VictoryPie);
|
|
59
|
+
|
|
50
60
|
function VictoryPie() {
|
|
51
61
|
_classCallCheck(this, VictoryPie);
|
|
52
62
|
|
|
53
|
-
return
|
|
63
|
+
return _super.apply(this, arguments);
|
|
54
64
|
}
|
|
55
65
|
|
|
56
66
|
_createClass(VictoryPie, [{
|
|
57
67
|
key: "shouldAnimate",
|
|
58
|
-
// Overridden in victory-native
|
|
59
|
-
|
|
68
|
+
value: // Overridden in victory-native
|
|
69
|
+
function shouldAnimate() {
|
|
60
70
|
return Boolean(this.props.animate);
|
|
61
71
|
}
|
|
62
72
|
}, {
|
|
@@ -72,179 +82,145 @@ function (_React$Component) {
|
|
|
72
82
|
}
|
|
73
83
|
|
|
74
84
|
var children = this.renderData(props);
|
|
75
|
-
|
|
85
|
+
|
|
86
|
+
var container = /*#__PURE__*/_react.default.cloneElement(props.containerComponent, _victoryCore.UserProps.getSafeUserProps(props));
|
|
87
|
+
|
|
88
|
+
return props.standalone ? this.renderContainer(container, children) : children;
|
|
76
89
|
}
|
|
77
90
|
}]);
|
|
78
91
|
|
|
79
92
|
return VictoryPie;
|
|
80
93
|
}(_react.default.Component);
|
|
81
94
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
onExit: {
|
|
106
|
-
duration: 500,
|
|
107
|
-
before: function () {
|
|
108
|
-
return {
|
|
109
|
-
_y: 0,
|
|
110
|
-
label: " "
|
|
111
|
-
};
|
|
112
|
-
}
|
|
95
|
+
_defineProperty(VictoryPie, "animationWhitelist", ["data", "endAngle", "height", "innerRadius", "cornerRadius", "padAngle", "padding", "colorScale", "startAngle", "style", "width"]);
|
|
96
|
+
|
|
97
|
+
_defineProperty(VictoryPie, "displayName", "VictoryPie");
|
|
98
|
+
|
|
99
|
+
_defineProperty(VictoryPie, "role", "pie");
|
|
100
|
+
|
|
101
|
+
_defineProperty(VictoryPie, "defaultTransitions", {
|
|
102
|
+
onExit: {
|
|
103
|
+
duration: 500,
|
|
104
|
+
before: function () {
|
|
105
|
+
return {
|
|
106
|
+
_y: 0,
|
|
107
|
+
label: " "
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
onEnter: {
|
|
112
|
+
duration: 500,
|
|
113
|
+
before: function () {
|
|
114
|
+
return {
|
|
115
|
+
_y: 0,
|
|
116
|
+
label: " "
|
|
117
|
+
};
|
|
113
118
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
label: " "
|
|
120
|
-
};
|
|
121
|
-
},
|
|
122
|
-
after: function (datum) {
|
|
123
|
-
return {
|
|
124
|
-
y_: datum._y,
|
|
125
|
-
label: datum.label
|
|
126
|
-
};
|
|
127
|
-
}
|
|
119
|
+
after: function (datum) {
|
|
120
|
+
return {
|
|
121
|
+
y_: datum._y,
|
|
122
|
+
label: datum.label
|
|
123
|
+
};
|
|
128
124
|
}
|
|
129
125
|
}
|
|
130
126
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
eventKey: _propTypes.default.oneOfType([_propTypes.default.func, _victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer, _victoryCore.PropTypes.nonNegative]), _propTypes.default.string]),
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
width: _victoryCore.PropTypes.nonNegative,
|
|
193
|
-
x: _propTypes.default.oneOfType([_propTypes.default.func, _victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer, _victoryCore.PropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
194
|
-
y: _propTypes.default.oneOfType([_propTypes.default.func, _victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer, _victoryCore.PropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)])
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
Object.defineProperty(VictoryPie, "defaultProps", {
|
|
198
|
-
configurable: true,
|
|
199
|
-
enumerable: true,
|
|
200
|
-
writable: true,
|
|
201
|
-
value: {
|
|
202
|
-
data: [{
|
|
203
|
-
x: "A",
|
|
204
|
-
y: 1
|
|
205
|
-
}, {
|
|
206
|
-
x: "B",
|
|
207
|
-
y: 2
|
|
208
|
-
}, {
|
|
209
|
-
x: "C",
|
|
210
|
-
y: 3
|
|
211
|
-
}, {
|
|
212
|
-
x: "D",
|
|
213
|
-
y: 1
|
|
214
|
-
}, {
|
|
215
|
-
x: "E",
|
|
216
|
-
y: 2
|
|
217
|
-
}],
|
|
218
|
-
standalone: true,
|
|
219
|
-
dataComponent: _react.default.createElement(_slice.default, null),
|
|
220
|
-
labelComponent: _react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
221
|
-
containerComponent: _react.default.createElement(_victoryCore.VictoryContainer, null),
|
|
222
|
-
groupComponent: _react.default.createElement("g", null),
|
|
223
|
-
sortOrder: "ascending",
|
|
224
|
-
theme: _victoryCore.VictoryTheme.grayscale
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
Object.defineProperty(VictoryPie, "getBaseProps", {
|
|
228
|
-
configurable: true,
|
|
229
|
-
enumerable: true,
|
|
230
|
-
writable: true,
|
|
231
|
-
value: function (props) {
|
|
232
|
-
return (0, _helperMethods.getBaseProps)(props, fallbackProps);
|
|
233
|
-
}
|
|
127
|
+
|
|
128
|
+
_defineProperty(VictoryPie, "propTypes", {
|
|
129
|
+
animate: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]),
|
|
130
|
+
colorScale: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.oneOf(["grayscale", "qualitative", "heatmap", "warm", "cool", "red", "green", "blue"])]),
|
|
131
|
+
containerComponent: _propTypes.default.element,
|
|
132
|
+
cornerRadius: _propTypes.default.oneOfType([_victoryCore.PropTypes.nonNegative, _propTypes.default.func]),
|
|
133
|
+
data: _propTypes.default.array,
|
|
134
|
+
dataComponent: _propTypes.default.element,
|
|
135
|
+
disableInlineStyes: _propTypes.default.bool,
|
|
136
|
+
endAngle: _propTypes.default.number,
|
|
137
|
+
eventKey: _propTypes.default.oneOfType([_propTypes.default.func, _victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer, _victoryCore.PropTypes.nonNegative]), _propTypes.default.string]),
|
|
138
|
+
events: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
139
|
+
target: _propTypes.default.oneOf(["data", "labels", "parent"]),
|
|
140
|
+
eventKey: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.func, _victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer, _victoryCore.PropTypes.nonNegative]), _propTypes.default.string]),
|
|
141
|
+
eventHandlers: _propTypes.default.object
|
|
142
|
+
})),
|
|
143
|
+
externalEventMutations: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
144
|
+
callback: _propTypes.default.function,
|
|
145
|
+
childName: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]),
|
|
146
|
+
eventKey: _propTypes.default.oneOfType([_propTypes.default.array, _victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer, _victoryCore.PropTypes.nonNegative]), _propTypes.default.string]),
|
|
147
|
+
mutation: _propTypes.default.function,
|
|
148
|
+
target: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array])
|
|
149
|
+
})),
|
|
150
|
+
groupComponent: _propTypes.default.element,
|
|
151
|
+
height: _victoryCore.PropTypes.nonNegative,
|
|
152
|
+
innerRadius: _propTypes.default.oneOfType([_victoryCore.PropTypes.nonNegative, _propTypes.default.func]),
|
|
153
|
+
labelComponent: _propTypes.default.element,
|
|
154
|
+
labelPlacement: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.oneOf(["parallel", "perpendicular", "vertical"])]),
|
|
155
|
+
labelPosition: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.oneOf(["startAngle", "centroid", "endAngle"])]),
|
|
156
|
+
labelRadius: _propTypes.default.oneOfType([_victoryCore.PropTypes.nonNegative, _propTypes.default.func]),
|
|
157
|
+
labels: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.array]),
|
|
158
|
+
name: _propTypes.default.string,
|
|
159
|
+
origin: _propTypes.default.shape({
|
|
160
|
+
x: _victoryCore.PropTypes.nonNegative,
|
|
161
|
+
y: _victoryCore.PropTypes.nonNegative
|
|
162
|
+
}),
|
|
163
|
+
padAngle: _propTypes.default.oneOfType([_victoryCore.PropTypes.nonNegative, _propTypes.default.func]),
|
|
164
|
+
padding: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
165
|
+
top: _propTypes.default.number,
|
|
166
|
+
bottom: _propTypes.default.number,
|
|
167
|
+
left: _propTypes.default.number,
|
|
168
|
+
right: _propTypes.default.number
|
|
169
|
+
})]),
|
|
170
|
+
radius: _propTypes.default.oneOfType([_victoryCore.PropTypes.nonNegative, _propTypes.default.func]),
|
|
171
|
+
sharedEvents: _propTypes.default.shape({
|
|
172
|
+
events: _propTypes.default.array,
|
|
173
|
+
getEventState: _propTypes.default.func
|
|
174
|
+
}),
|
|
175
|
+
sortKey: _propTypes.default.oneOfType([_propTypes.default.func, _victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer, _victoryCore.PropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
176
|
+
sortOrder: _propTypes.default.oneOf(["ascending", "descending"]),
|
|
177
|
+
standalone: _propTypes.default.bool,
|
|
178
|
+
startAngle: _propTypes.default.number,
|
|
179
|
+
style: _propTypes.default.shape({
|
|
180
|
+
parent: _propTypes.default.object,
|
|
181
|
+
data: _propTypes.default.object,
|
|
182
|
+
labels: _propTypes.default.object
|
|
183
|
+
}),
|
|
184
|
+
theme: _propTypes.default.object,
|
|
185
|
+
width: _victoryCore.PropTypes.nonNegative,
|
|
186
|
+
x: _propTypes.default.oneOfType([_propTypes.default.func, _victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer, _victoryCore.PropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]),
|
|
187
|
+
y: _propTypes.default.oneOfType([_propTypes.default.func, _victoryCore.PropTypes.allOfType([_victoryCore.PropTypes.integer, _victoryCore.PropTypes.nonNegative]), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)])
|
|
234
188
|
});
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
189
|
+
|
|
190
|
+
_defineProperty(VictoryPie, "defaultProps", {
|
|
191
|
+
data: [{
|
|
192
|
+
x: "A",
|
|
193
|
+
y: 1
|
|
194
|
+
}, {
|
|
195
|
+
x: "B",
|
|
196
|
+
y: 2
|
|
197
|
+
}, {
|
|
198
|
+
x: "C",
|
|
199
|
+
y: 3
|
|
200
|
+
}, {
|
|
201
|
+
x: "D",
|
|
202
|
+
y: 1
|
|
203
|
+
}, {
|
|
204
|
+
x: "E",
|
|
205
|
+
y: 2
|
|
206
|
+
}],
|
|
207
|
+
standalone: true,
|
|
208
|
+
dataComponent: /*#__PURE__*/_react.default.createElement(_slice.default, null),
|
|
209
|
+
labelComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryLabel, null),
|
|
210
|
+
containerComponent: /*#__PURE__*/_react.default.createElement(_victoryCore.VictoryContainer, null),
|
|
211
|
+
groupComponent: /*#__PURE__*/_react.default.createElement("g", null),
|
|
212
|
+
sortOrder: "ascending",
|
|
213
|
+
theme: _victoryCore.VictoryTheme.grayscale
|
|
240
214
|
});
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
writable: true,
|
|
245
|
-
value: ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]
|
|
215
|
+
|
|
216
|
+
_defineProperty(VictoryPie, "getBaseProps", function (props) {
|
|
217
|
+
return (0, _helperMethods.getBaseProps)(props, fallbackProps);
|
|
246
218
|
});
|
|
247
219
|
|
|
220
|
+
_defineProperty(VictoryPie, "getData", _victoryCore.Data.getData);
|
|
221
|
+
|
|
222
|
+
_defineProperty(VictoryPie, "expectedComponents", ["dataComponent", "labelComponent", "groupComponent", "containerComponent"]);
|
|
223
|
+
|
|
248
224
|
var _default = (0, _victoryCore.addEvents)(VictoryPie);
|
|
249
225
|
|
|
250
226
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "victory-pie",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.4.0",
|
|
4
4
|
"description": "Pie Component for Victory",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data visualization",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"author": "Formidable",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"d3-shape": "^1.0.0",
|
|
23
22
|
"lodash": "^4.17.19",
|
|
24
23
|
"prop-types": "^15.5.8",
|
|
25
|
-
"victory-core": "^36.
|
|
24
|
+
"victory-core": "^36.4.0",
|
|
25
|
+
"victory-vendor": "^36.4.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": "2e05481eeb34f9801a90023a131a21aa7deff082"
|
|
35
35
|
}
|
package/src/helper-methods.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*eslint no-magic-numbers: ["error", { "ignore": [-1, 0, 1, 2, 45, 90, 135, 180, 225, 270, 315, 360] }]*/
|
|
2
2
|
import { assign, defaults, isFunction, isPlainObject, isNil } from "lodash";
|
|
3
|
-
import * as d3Shape from "d3-shape";
|
|
3
|
+
import * as d3Shape from "victory-vendor/d3-shape";
|
|
4
4
|
|
|
5
5
|
import { Helpers, Data, Style } from "victory-core";
|
|
6
6
|
|
package/src/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export interface SliceProps extends VictoryCommonProps {
|
|
|
42
42
|
};
|
|
43
43
|
sliceEndAngle?: SliceNumberOrCallback<SliceProps, "sliceEndAngle">;
|
|
44
44
|
sliceStartAngle?: SliceNumberOrCallback<SliceProps, "sliceStartAngle">;
|
|
45
|
+
style?: VictoryStyleInterface;
|
|
45
46
|
tabIndex?: NumberOrCallback;
|
|
46
47
|
}
|
|
47
48
|
|
package/src/slice.js
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { Helpers, CommonProps, Path } from "victory-core";
|
|
4
4
|
import { defaults, isFunction, assign } from "lodash";
|
|
5
|
-
import * as d3Shape from "d3-shape";
|
|
5
|
+
import * as d3Shape from "victory-vendor/d3-shape";
|
|
6
6
|
|
|
7
7
|
const getPath = (props) => {
|
|
8
8
|
const { slice, radius, innerRadius, cornerRadius } = props;
|
package/src/victory-pie.js
CHANGED
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
PropTypes as CustomPropTypes,
|
|
9
9
|
VictoryContainer,
|
|
10
10
|
VictoryLabel,
|
|
11
|
-
VictoryTheme
|
|
11
|
+
VictoryTheme,
|
|
12
|
+
UserProps
|
|
12
13
|
} from "victory-core";
|
|
13
14
|
import Slice from "./slice";
|
|
14
15
|
import { getBaseProps } from "./helper-methods";
|
|
@@ -255,8 +256,12 @@ class VictoryPie extends React.Component {
|
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
const children = this.renderData(props);
|
|
259
|
+
const container = React.cloneElement(
|
|
260
|
+
props.containerComponent,
|
|
261
|
+
UserProps.getSafeUserProps(props)
|
|
262
|
+
);
|
|
258
263
|
return props.standalone
|
|
259
|
-
? this.renderContainer(
|
|
264
|
+
? this.renderContainer(container, children)
|
|
260
265
|
: children;
|
|
261
266
|
}
|
|
262
267
|
}
|