victory-pie 36.4.1 → 36.5.2
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 +743 -704
- package/dist/victory-pie.min.js +1 -1
- package/es/helper-methods.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +2 -1
- package/es/slice.js +2 -1
- package/es/victory-pie.js +17 -25
- package/lib/helper-methods.js +2 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/slice.js +2 -1
- package/lib/victory-pie.js +17 -24
- package/package.json +5 -5
- package/src/helper-methods.js +16 -16
- package/src/index.d.ts +1 -1
- package/src/slice.js +6 -6
- package/src/victory-pie.js +41 -41
package/src/victory-pie.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
VictoryContainer,
|
|
10
10
|
VictoryLabel,
|
|
11
11
|
VictoryTheme,
|
|
12
|
-
UserProps
|
|
12
|
+
UserProps,
|
|
13
13
|
} from "victory-core";
|
|
14
14
|
import Slice from "./slice";
|
|
15
15
|
import { getBaseProps } from "./helper-methods";
|
|
@@ -32,9 +32,9 @@ const fallbackProps = {
|
|
|
32
32
|
"#737373",
|
|
33
33
|
"#525252",
|
|
34
34
|
"#252525",
|
|
35
|
-
"#000000"
|
|
35
|
+
"#000000",
|
|
36
36
|
],
|
|
37
|
-
labelPosition: "centroid"
|
|
37
|
+
labelPosition: "centroid",
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
class VictoryPie extends React.Component {
|
|
@@ -49,7 +49,7 @@ class VictoryPie extends React.Component {
|
|
|
49
49
|
"colorScale",
|
|
50
50
|
"startAngle",
|
|
51
51
|
"style",
|
|
52
|
-
"width"
|
|
52
|
+
"width",
|
|
53
53
|
];
|
|
54
54
|
|
|
55
55
|
static displayName = "VictoryPie";
|
|
@@ -59,16 +59,16 @@ class VictoryPie extends React.Component {
|
|
|
59
59
|
static defaultTransitions = {
|
|
60
60
|
onExit: {
|
|
61
61
|
duration: 500,
|
|
62
|
-
before: () => ({ _y: 0, label: " " })
|
|
62
|
+
before: () => ({ _y: 0, label: " " }),
|
|
63
63
|
},
|
|
64
64
|
onEnter: {
|
|
65
65
|
duration: 500,
|
|
66
66
|
before: () => ({ _y: 0, label: " " }),
|
|
67
67
|
after: (datum) => ({
|
|
68
68
|
y_: datum._y,
|
|
69
|
-
label: datum.label
|
|
70
|
-
})
|
|
71
|
-
}
|
|
69
|
+
label: datum.label,
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
static propTypes = {
|
|
@@ -83,13 +83,13 @@ class VictoryPie extends React.Component {
|
|
|
83
83
|
"cool",
|
|
84
84
|
"red",
|
|
85
85
|
"green",
|
|
86
|
-
"blue"
|
|
87
|
-
])
|
|
86
|
+
"blue",
|
|
87
|
+
]),
|
|
88
88
|
]),
|
|
89
89
|
containerComponent: PropTypes.element,
|
|
90
90
|
cornerRadius: PropTypes.oneOfType([
|
|
91
91
|
CustomPropTypes.nonNegative,
|
|
92
|
-
PropTypes.func
|
|
92
|
+
PropTypes.func,
|
|
93
93
|
]),
|
|
94
94
|
data: PropTypes.array,
|
|
95
95
|
dataComponent: PropTypes.element,
|
|
@@ -99,9 +99,9 @@ class VictoryPie extends React.Component {
|
|
|
99
99
|
PropTypes.func,
|
|
100
100
|
CustomPropTypes.allOfType([
|
|
101
101
|
CustomPropTypes.integer,
|
|
102
|
-
CustomPropTypes.nonNegative
|
|
102
|
+
CustomPropTypes.nonNegative,
|
|
103
103
|
]),
|
|
104
|
-
PropTypes.string
|
|
104
|
+
PropTypes.string,
|
|
105
105
|
]),
|
|
106
106
|
events: PropTypes.arrayOf(
|
|
107
107
|
PropTypes.shape({
|
|
@@ -111,12 +111,12 @@ class VictoryPie extends React.Component {
|
|
|
111
111
|
PropTypes.func,
|
|
112
112
|
CustomPropTypes.allOfType([
|
|
113
113
|
CustomPropTypes.integer,
|
|
114
|
-
CustomPropTypes.nonNegative
|
|
114
|
+
CustomPropTypes.nonNegative,
|
|
115
115
|
]),
|
|
116
|
-
PropTypes.string
|
|
116
|
+
PropTypes.string,
|
|
117
117
|
]),
|
|
118
|
-
eventHandlers: PropTypes.object
|
|
119
|
-
})
|
|
118
|
+
eventHandlers: PropTypes.object,
|
|
119
|
+
}),
|
|
120
120
|
),
|
|
121
121
|
externalEventMutations: PropTypes.arrayOf(
|
|
122
122
|
PropTypes.shape({
|
|
@@ -126,42 +126,42 @@ class VictoryPie extends React.Component {
|
|
|
126
126
|
PropTypes.array,
|
|
127
127
|
CustomPropTypes.allOfType([
|
|
128
128
|
CustomPropTypes.integer,
|
|
129
|
-
CustomPropTypes.nonNegative
|
|
129
|
+
CustomPropTypes.nonNegative,
|
|
130
130
|
]),
|
|
131
|
-
PropTypes.string
|
|
131
|
+
PropTypes.string,
|
|
132
132
|
]),
|
|
133
133
|
mutation: PropTypes.func,
|
|
134
|
-
target: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
|
|
135
|
-
})
|
|
134
|
+
target: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
135
|
+
}),
|
|
136
136
|
),
|
|
137
137
|
groupComponent: PropTypes.element,
|
|
138
138
|
height: CustomPropTypes.nonNegative,
|
|
139
139
|
innerRadius: PropTypes.oneOfType([
|
|
140
140
|
CustomPropTypes.nonNegative,
|
|
141
|
-
PropTypes.func
|
|
141
|
+
PropTypes.func,
|
|
142
142
|
]),
|
|
143
143
|
labelComponent: PropTypes.element,
|
|
144
144
|
labelPlacement: PropTypes.oneOfType([
|
|
145
145
|
PropTypes.func,
|
|
146
|
-
PropTypes.oneOf(["parallel", "perpendicular", "vertical"])
|
|
146
|
+
PropTypes.oneOf(["parallel", "perpendicular", "vertical"]),
|
|
147
147
|
]),
|
|
148
148
|
labelPosition: PropTypes.oneOfType([
|
|
149
149
|
PropTypes.func,
|
|
150
|
-
PropTypes.oneOf(["startAngle", "centroid", "endAngle"])
|
|
150
|
+
PropTypes.oneOf(["startAngle", "centroid", "endAngle"]),
|
|
151
151
|
]),
|
|
152
152
|
labelRadius: PropTypes.oneOfType([
|
|
153
153
|
CustomPropTypes.nonNegative,
|
|
154
|
-
PropTypes.func
|
|
154
|
+
PropTypes.func,
|
|
155
155
|
]),
|
|
156
156
|
labels: PropTypes.oneOfType([PropTypes.func, PropTypes.array]),
|
|
157
157
|
name: PropTypes.string,
|
|
158
158
|
origin: PropTypes.shape({
|
|
159
159
|
x: CustomPropTypes.nonNegative,
|
|
160
|
-
y: CustomPropTypes.nonNegative
|
|
160
|
+
y: CustomPropTypes.nonNegative,
|
|
161
161
|
}),
|
|
162
162
|
padAngle: PropTypes.oneOfType([
|
|
163
163
|
CustomPropTypes.nonNegative,
|
|
164
|
-
PropTypes.func
|
|
164
|
+
PropTypes.func,
|
|
165
165
|
]),
|
|
166
166
|
padding: PropTypes.oneOfType([
|
|
167
167
|
PropTypes.number,
|
|
@@ -169,22 +169,22 @@ class VictoryPie extends React.Component {
|
|
|
169
169
|
top: PropTypes.number,
|
|
170
170
|
bottom: PropTypes.number,
|
|
171
171
|
left: PropTypes.number,
|
|
172
|
-
right: PropTypes.number
|
|
173
|
-
})
|
|
172
|
+
right: PropTypes.number,
|
|
173
|
+
}),
|
|
174
174
|
]),
|
|
175
175
|
radius: PropTypes.oneOfType([CustomPropTypes.nonNegative, PropTypes.func]),
|
|
176
176
|
sharedEvents: PropTypes.shape({
|
|
177
177
|
events: PropTypes.array,
|
|
178
|
-
getEventState: PropTypes.func
|
|
178
|
+
getEventState: PropTypes.func,
|
|
179
179
|
}),
|
|
180
180
|
sortKey: PropTypes.oneOfType([
|
|
181
181
|
PropTypes.func,
|
|
182
182
|
CustomPropTypes.allOfType([
|
|
183
183
|
CustomPropTypes.integer,
|
|
184
|
-
CustomPropTypes.nonNegative
|
|
184
|
+
CustomPropTypes.nonNegative,
|
|
185
185
|
]),
|
|
186
186
|
PropTypes.string,
|
|
187
|
-
PropTypes.arrayOf(PropTypes.string)
|
|
187
|
+
PropTypes.arrayOf(PropTypes.string),
|
|
188
188
|
]),
|
|
189
189
|
sortOrder: PropTypes.oneOf(["ascending", "descending"]),
|
|
190
190
|
standalone: PropTypes.bool,
|
|
@@ -192,7 +192,7 @@ class VictoryPie extends React.Component {
|
|
|
192
192
|
style: PropTypes.shape({
|
|
193
193
|
parent: PropTypes.object,
|
|
194
194
|
data: PropTypes.object,
|
|
195
|
-
labels: PropTypes.object
|
|
195
|
+
labels: PropTypes.object,
|
|
196
196
|
}),
|
|
197
197
|
theme: PropTypes.object,
|
|
198
198
|
width: CustomPropTypes.nonNegative,
|
|
@@ -200,20 +200,20 @@ class VictoryPie extends React.Component {
|
|
|
200
200
|
PropTypes.func,
|
|
201
201
|
CustomPropTypes.allOfType([
|
|
202
202
|
CustomPropTypes.integer,
|
|
203
|
-
CustomPropTypes.nonNegative
|
|
203
|
+
CustomPropTypes.nonNegative,
|
|
204
204
|
]),
|
|
205
205
|
PropTypes.string,
|
|
206
|
-
PropTypes.arrayOf(PropTypes.string)
|
|
206
|
+
PropTypes.arrayOf(PropTypes.string),
|
|
207
207
|
]),
|
|
208
208
|
y: PropTypes.oneOfType([
|
|
209
209
|
PropTypes.func,
|
|
210
210
|
CustomPropTypes.allOfType([
|
|
211
211
|
CustomPropTypes.integer,
|
|
212
|
-
CustomPropTypes.nonNegative
|
|
212
|
+
CustomPropTypes.nonNegative,
|
|
213
213
|
]),
|
|
214
214
|
PropTypes.string,
|
|
215
|
-
PropTypes.arrayOf(PropTypes.string)
|
|
216
|
-
])
|
|
215
|
+
PropTypes.arrayOf(PropTypes.string),
|
|
216
|
+
]),
|
|
217
217
|
};
|
|
218
218
|
|
|
219
219
|
static defaultProps = {
|
|
@@ -222,7 +222,7 @@ class VictoryPie extends React.Component {
|
|
|
222
222
|
{ x: "B", y: 2 },
|
|
223
223
|
{ x: "C", y: 3 },
|
|
224
224
|
{ x: "D", y: 1 },
|
|
225
|
-
{ x: "E", y: 2 }
|
|
225
|
+
{ x: "E", y: 2 },
|
|
226
226
|
],
|
|
227
227
|
standalone: true,
|
|
228
228
|
dataComponent: <Slice />,
|
|
@@ -230,7 +230,7 @@ class VictoryPie extends React.Component {
|
|
|
230
230
|
containerComponent: <VictoryContainer />,
|
|
231
231
|
groupComponent: <g />,
|
|
232
232
|
sortOrder: "ascending",
|
|
233
|
-
theme: VictoryTheme.grayscale
|
|
233
|
+
theme: VictoryTheme.grayscale,
|
|
234
234
|
};
|
|
235
235
|
|
|
236
236
|
static getBaseProps = (props) => getBaseProps(props, fallbackProps);
|
|
@@ -239,7 +239,7 @@ class VictoryPie extends React.Component {
|
|
|
239
239
|
"dataComponent",
|
|
240
240
|
"labelComponent",
|
|
241
241
|
"groupComponent",
|
|
242
|
-
"containerComponent"
|
|
242
|
+
"containerComponent",
|
|
243
243
|
];
|
|
244
244
|
|
|
245
245
|
// Overridden in victory-native
|