victory-pie 30.6.1 → 31.2.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/README.md +24 -30
- package/dist/victory-pie.js +2247 -1956
- package/dist/victory-pie.min.js +1 -1
- package/es/helper-methods.js +26 -19
- package/es/slice.js +34 -4
- package/es/victory-pie.js +12 -6
- package/lib/helper-methods.js +27 -19
- package/lib/slice.js +44 -4
- package/lib/victory-pie.js +12 -6
- package/package.json +2 -2
- package/src/helper-methods.js +62 -34
- package/src/slice.js +50 -7
- package/src/victory-pie.js +79 -49
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ categories={{ x: ["dogs", "cats", "mice"] }}
|
|
|
48
48
|
|
|
49
49
|
The `colorScale` prop defines a color scale to be applied to each slice of `VictoryPie`. This prop should be given as an array of CSS colors, or as a string corresponding to one of the built in color scales: "grayscale", "qualitative", "heatmap", "warm", "cool", "red", "green", "blue". `VictoryPie` will assign a color to each slice by index, unless they are explicitly specified in the data object. Colors will repeat when there are more slices than colors in the provided `colorScale`.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
_default (provided by default theme):_ `colorScale="grayscale"`
|
|
52
52
|
|
|
53
53
|
```playground
|
|
54
54
|
<VictoryPie
|
|
@@ -65,7 +65,7 @@ The `colorScale` prop defines a color scale to be applied to each slice of `Vict
|
|
|
65
65
|
|
|
66
66
|
**Note:** `VictoryPie` only works with the `VictoryContainer` component
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
_default:_ `containerComponent={<VictoryContainer/>}`
|
|
69
69
|
|
|
70
70
|
```jsx
|
|
71
71
|
containerComponent={<VictoryContainer responsive={false}/>}
|
|
@@ -92,7 +92,6 @@ The `cornerRadius` prop specifies the corner radius of the slices rendered in th
|
|
|
92
92
|
|
|
93
93
|
See the [Data Accessors Guide][] for more detail on formatting and processing data.
|
|
94
94
|
|
|
95
|
-
|
|
96
95
|
```playground
|
|
97
96
|
<VictoryPie
|
|
98
97
|
data={[
|
|
@@ -113,7 +112,7 @@ See the [Data Accessors Guide][] for more detail on formatting and processing da
|
|
|
113
112
|
|
|
114
113
|
See the [Custom Components Guide][] for more detail on creating your own `dataComponents`
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
_default:_ `<Slice/>`
|
|
117
116
|
|
|
118
117
|
```jsx
|
|
119
118
|
dataComponent={<Slice events={{ onClick: handleClick }}/>}
|
|
@@ -125,8 +124,7 @@ dataComponent={<Slice events={{ onClick: handleClick }}/>}
|
|
|
125
124
|
|
|
126
125
|
The `endAngle` props defines the overall end angle of the pie in degrees. This prop is used in conjunction with `startAngle` to create a pie that spans only a segment of a circle, or to change overall rotation of the pie. This prop should be given as a number of degrees. Degrees are defined as starting at the 12 o'clock position, and proceeding clockwise.
|
|
127
126
|
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
_default:_ `endAngle={360}`
|
|
130
128
|
|
|
131
129
|
```playground
|
|
132
130
|
<div>
|
|
@@ -150,7 +148,7 @@ The `endAngle` props defines the overall end angle of the pie in degrees. This p
|
|
|
150
148
|
`VictoryPie` uses the standard `eventKey` prop to specify how event targets are addressed. **This prop is not commonly used.** [Read about the `eventKey` prop in more detail here](https://formidable.com/open-source/victory/docs/common-props#eventkey)
|
|
151
149
|
|
|
152
150
|
```jsx
|
|
153
|
-
eventKey="x"
|
|
151
|
+
eventKey = "x";
|
|
154
152
|
```
|
|
155
153
|
|
|
156
154
|
### events
|
|
@@ -203,7 +201,7 @@ See the [Events Guide][] for more information on defining events.
|
|
|
203
201
|
|
|
204
202
|
`VictoryPie` uses the standard `groupComponent` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#groupcomponent)
|
|
205
203
|
|
|
206
|
-
|
|
204
|
+
_default:_ `<g/>`
|
|
207
205
|
|
|
208
206
|
```jsx
|
|
209
207
|
groupComponent={<g transform="rotate(90)" />}
|
|
@@ -215,7 +213,7 @@ groupComponent={<g transform="rotate(90)" />}
|
|
|
215
213
|
|
|
216
214
|
`VictoryPie` uses the standard `height` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#height)
|
|
217
215
|
|
|
218
|
-
|
|
216
|
+
_default (provided by default theme):_ `height={400}`
|
|
219
217
|
|
|
220
218
|
```jsx
|
|
221
219
|
height={400}
|
|
@@ -240,7 +238,7 @@ The `innerRadius` prop determines the number of pixels between the center of the
|
|
|
240
238
|
|
|
241
239
|
`VictoryPie` uses the standard `labelComponent` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#labelcomponent)
|
|
242
240
|
|
|
243
|
-
|
|
241
|
+
_default:_ `<VictoryLabel/>`
|
|
244
242
|
|
|
245
243
|
```playground
|
|
246
244
|
<VictoryPie
|
|
@@ -256,7 +254,7 @@ The `innerRadius` prop determines the number of pixels between the center of the
|
|
|
256
254
|
|
|
257
255
|
The `labelPosition` prop defines the position inside the arc that will be used for positioning each slice label. If this props is not set, the label position will default to the centroid of the arc itself.
|
|
258
256
|
|
|
259
|
-
|
|
257
|
+
_default:_ `"centroid"`
|
|
260
258
|
|
|
261
259
|
```playground
|
|
262
260
|
<VictoryPie
|
|
@@ -300,7 +298,7 @@ The `labelRadius` prop defines the radius of the arc that will be used for posit
|
|
|
300
298
|
The `name` prop is used to reference a component instance when defining shared events.
|
|
301
299
|
|
|
302
300
|
```jsx
|
|
303
|
-
name="series-1"
|
|
301
|
+
name = "series-1";
|
|
304
302
|
```
|
|
305
303
|
|
|
306
304
|
### origin
|
|
@@ -337,7 +335,7 @@ The `padAngle` prop defines the amount of separation between adjacent data slice
|
|
|
337
335
|
|
|
338
336
|
`VictoryPie` uses the standard `padding` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#padding)
|
|
339
337
|
|
|
340
|
-
|
|
338
|
+
_default (provided by default theme):_ `padding={50}`
|
|
341
339
|
|
|
342
340
|
```jsx
|
|
343
341
|
padding={{ top: 20, bottom: 60 }}
|
|
@@ -349,7 +347,6 @@ padding={{ top: 20, bottom: 60 }}
|
|
|
349
347
|
|
|
350
348
|
The `radius` prop specifies the radius of the pie. When this prop is not given, it will be calculated base on the `width`, `height`, and `padding` props.
|
|
351
349
|
|
|
352
|
-
|
|
353
350
|
```playground
|
|
354
351
|
<VictoryPie
|
|
355
352
|
radius={100}
|
|
@@ -357,7 +354,6 @@ The `radius` prop specifies the radius of the pie. When this prop is not given,
|
|
|
357
354
|
/>
|
|
358
355
|
```
|
|
359
356
|
|
|
360
|
-
|
|
361
357
|
### sharedEvents
|
|
362
358
|
|
|
363
359
|
**The `sharedEvents` prop is used internally to coordinate events between components. It should not be set manually.**
|
|
@@ -371,7 +367,7 @@ The `radius` prop specifies the radius of the pie. When this prop is not given,
|
|
|
371
367
|
See the [Data Accessors Guide][] for more detail on formatting and processing data.
|
|
372
368
|
|
|
373
369
|
```jsx
|
|
374
|
-
sortKey="x"
|
|
370
|
+
sortKey = "x";
|
|
375
371
|
```
|
|
376
372
|
|
|
377
373
|
### sortOrder
|
|
@@ -380,7 +376,7 @@ sortKey="x"
|
|
|
380
376
|
|
|
381
377
|
The `sortOrder` prop specifies whether sorted data should be returned in ascending or descending order.
|
|
382
378
|
|
|
383
|
-
|
|
379
|
+
_default:_ `sortOrder="ascending"`
|
|
384
380
|
|
|
385
381
|
### standalone
|
|
386
382
|
|
|
@@ -388,7 +384,7 @@ The `sortOrder` prop specifies whether sorted data should be returned in ascendi
|
|
|
388
384
|
|
|
389
385
|
`VictoryPie` uses the standard `standalone` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#standalone)
|
|
390
386
|
|
|
391
|
-
|
|
387
|
+
_default:_ `standalone={true}`
|
|
392
388
|
|
|
393
389
|
```playground
|
|
394
390
|
<svg width={300} height={300}>
|
|
@@ -408,8 +404,7 @@ The `sortOrder` prop specifies whether sorted data should be returned in ascendi
|
|
|
408
404
|
|
|
409
405
|
The `startAngle` props defines the overall start angle of the pie in degrees. This prop is used in conjunction with `endAngle` to create a pie that spans only a segment of a circle, or to change overall rotation of the pie. This prop should be given as a number of degrees. Degrees are defined as starting at the 12 o'clock position, and proceeding clockwise.
|
|
410
406
|
|
|
411
|
-
|
|
412
|
-
|
|
407
|
+
_default:_ `endAngle={0}`
|
|
413
408
|
|
|
414
409
|
```playground
|
|
415
410
|
<div>
|
|
@@ -432,7 +427,7 @@ The `startAngle` props defines the overall start angle of the pie in degrees. Th
|
|
|
432
427
|
|
|
433
428
|
`VictoryPie` uses the standard `style` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#style)
|
|
434
429
|
|
|
435
|
-
|
|
430
|
+
_default (provided by default theme):_ See [grayscale theme][] for more detail
|
|
436
431
|
|
|
437
432
|
```playground
|
|
438
433
|
<VictoryPie
|
|
@@ -456,7 +451,7 @@ The `startAngle` props defines the overall start angle of the pie in degrees. Th
|
|
|
456
451
|
|
|
457
452
|
See the [Themes Guide][] for information about creating custom themes.
|
|
458
453
|
|
|
459
|
-
|
|
454
|
+
_default:_ `theme={VictoryTheme.grayscale}`
|
|
460
455
|
|
|
461
456
|
```jsx
|
|
462
457
|
theme={VictoryTheme.material}
|
|
@@ -468,7 +463,7 @@ theme={VictoryTheme.material}
|
|
|
468
463
|
|
|
469
464
|
`VictoryPie` uses the standard `width` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#width)
|
|
470
465
|
|
|
471
|
-
|
|
466
|
+
_default (provided by default theme):_ `width={400}`
|
|
472
467
|
|
|
473
468
|
```jsx
|
|
474
469
|
width={400}
|
|
@@ -483,7 +478,7 @@ width={400}
|
|
|
483
478
|
See the [Data Accessors Guide][] for more detail on formatting and processing data.
|
|
484
479
|
|
|
485
480
|
```jsx
|
|
486
|
-
x="employee.name"
|
|
481
|
+
x = "employee.name";
|
|
487
482
|
```
|
|
488
483
|
|
|
489
484
|
### y
|
|
@@ -498,10 +493,9 @@ See the [Data Accessors Guide][] for more detail on formatting and processing da
|
|
|
498
493
|
y={(d) => d.value + d.error}
|
|
499
494
|
```
|
|
500
495
|
|
|
501
|
-
|
|
502
|
-
[
|
|
503
|
-
[
|
|
504
|
-
[
|
|
505
|
-
[
|
|
506
|
-
[Themes Guide]: https://formidable.com/open-source/victory/guides/themes
|
|
496
|
+
[animations guide]: https://formidable.com/open-source/victory/guides/animations
|
|
497
|
+
[data accessors guide]: https://formidable.com/open-source/victory/guides/data-accessors
|
|
498
|
+
[custom components guide]: https://formidable.com/open-source/victory/guides/custom-components
|
|
499
|
+
[events guide]: https://formidable.com/open-source/victory/guides/events
|
|
500
|
+
[themes guide]: https://formidable.com/open-source/victory/guides/themes
|
|
507
501
|
[grayscale theme]: https://github.com/FormidableLabs/victory-core/blob/master/src/victory-theme/grayscale.js
|