victory-errorbar 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 +31 -35
- package/dist/victory-errorbar.js +1399 -1149
- package/dist/victory-errorbar.min.js +1 -1
- package/es/helper-methods.js +2 -1
- package/es/victory-errorbar.js +8 -2
- package/lib/helper-methods.js +5 -1
- package/lib/victory-errorbar.js +8 -2
- package/package.json +2 -2
- package/src/error-bar.js +38 -18
- package/src/helper-methods.js +59 -22
- package/src/victory-errorbar.js +32 -13
package/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
# VictoryErrorBar
|
|
3
2
|
|
|
4
3
|
`victory-errorbar@^30.0.0` exports `VictoryErrorBar` and `ErrorBar` components
|
|
@@ -101,7 +100,7 @@ Specify data via the `data` prop. By default, `VictoryErrorBar` expects data as
|
|
|
101
100
|
|
|
102
101
|
See the [Custom Components Guide][] for more detail on creating your own `dataComponents`
|
|
103
102
|
|
|
104
|
-
|
|
103
|
+
_default:_ `<ErrorBar/>`
|
|
105
104
|
|
|
106
105
|
```jsx
|
|
107
106
|
dataComponent={<ErrorBar events={{ onClick: handleClick }}/>}
|
|
@@ -126,6 +125,7 @@ domain={{x: [0, 100], y: [0, 1]}}
|
|
|
126
125
|
```jsx
|
|
127
126
|
domainPadding={{x: [10, -10], y: 5}}
|
|
128
127
|
```
|
|
128
|
+
|
|
129
129
|
### errorX
|
|
130
130
|
|
|
131
131
|
`type: string || integer || array[string] || function`
|
|
@@ -134,20 +134,19 @@ Use `errorX` data accessor prop to define the x error bar.
|
|
|
134
134
|
|
|
135
135
|
**string:** specify which property in an array of data objects should be used as the errorX value
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
_examples:_ `errorX="uncertainty"`
|
|
138
138
|
|
|
139
139
|
**function:** use a function to translate each element in a data array into a errorX value
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
_examples:_ `errorX={() => 10}`
|
|
142
142
|
|
|
143
143
|
**array index:** specify which index of an array should be used as a errorX value when data is given as an array of arrays
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
_examples:_ `errorX={1}`
|
|
146
146
|
|
|
147
147
|
**path string or path array:** specify which property in an array of nested data objects should be used as a errorX value
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
_examples:_ `errorX="measurement.uncertainty"`, `errorX={["measurement", "uncertainty"]}`
|
|
151
150
|
|
|
152
151
|
### errorY
|
|
153
152
|
|
|
@@ -157,19 +156,19 @@ Use `errorY` data accessor prop to define the y error bar.
|
|
|
157
156
|
|
|
158
157
|
**string:** specify which property in an array of data objects should be used as the errorY value
|
|
159
158
|
|
|
160
|
-
|
|
159
|
+
_examples:_ `errorY="uncertainty"`
|
|
161
160
|
|
|
162
161
|
**function:** use a function to translate each element in a data array into a errorY value
|
|
163
162
|
|
|
164
|
-
|
|
163
|
+
_examples:_ `errorY={() => 10}`
|
|
165
164
|
|
|
166
165
|
**array index:** specify which index of an array should be used as a errorY value when data is given as an array of arrays
|
|
167
166
|
|
|
168
|
-
|
|
167
|
+
_examples:_ `errorY={1}`
|
|
169
168
|
|
|
170
169
|
**path string or path array:** specify which property in an array of nested data objects should be used as a errorY value
|
|
171
170
|
|
|
172
|
-
|
|
171
|
+
_examples:_ `errorY="measurement.uncertainty"`, `errorY={["measurement", "uncertainty"]}`
|
|
173
172
|
|
|
174
173
|
### eventKey
|
|
175
174
|
|
|
@@ -178,7 +177,7 @@ Use `errorY` data accessor prop to define the y error bar.
|
|
|
178
177
|
`VictoryErrorBar` 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)
|
|
179
178
|
|
|
180
179
|
```jsx
|
|
181
|
-
eventKey="x"
|
|
180
|
+
eventKey = "x";
|
|
182
181
|
```
|
|
183
182
|
|
|
184
183
|
### events
|
|
@@ -229,7 +228,7 @@ See the [Events Guide][] for more information on defining events.
|
|
|
229
228
|
|
|
230
229
|
`VictoryErrorBar` uses the standard `groupComponent` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#groupcomponent)
|
|
231
230
|
|
|
232
|
-
|
|
231
|
+
_default:_ `<g/>`
|
|
233
232
|
|
|
234
233
|
```jsx
|
|
235
234
|
groupComponent={<g transform="translate(10, 10)" />}
|
|
@@ -241,7 +240,7 @@ groupComponent={<g transform="translate(10, 10)" />}
|
|
|
241
240
|
|
|
242
241
|
`VictoryErrorBar` uses the standard `height` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#height)
|
|
243
242
|
|
|
244
|
-
|
|
243
|
+
_default (provided by default theme):_ `height={300}`
|
|
245
244
|
|
|
246
245
|
```jsx
|
|
247
246
|
height={400}
|
|
@@ -253,7 +252,7 @@ height={400}
|
|
|
253
252
|
|
|
254
253
|
`VictoryErrorBar` uses the standard `labelComponent` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#labelcomponent)
|
|
255
254
|
|
|
256
|
-
|
|
255
|
+
_default:_ `<VictoryLabel/>`
|
|
257
256
|
|
|
258
257
|
```playground
|
|
259
258
|
<VictoryErrorBar
|
|
@@ -282,7 +281,6 @@ height={400}
|
|
|
282
281
|
|
|
283
282
|
`VictoryErrorBar` uses the standard `maxDomain` prop. [Read about it in detail](https://formidable.com/open-source/victory/docs/common-props#maxDomain)
|
|
284
283
|
|
|
285
|
-
|
|
286
284
|
```playground
|
|
287
285
|
<VictoryChart maxDomain={8}>
|
|
288
286
|
<VictoryErrorBar data={sampleErrorData}/>
|
|
@@ -295,7 +293,6 @@ height={400}
|
|
|
295
293
|
|
|
296
294
|
`VictoryErrorBar` uses the standard `minDomain` prop. [Read about it in detail](https://formidable.com/open-source/victory/docs/common-props#minDomain)
|
|
297
295
|
|
|
298
|
-
|
|
299
296
|
```playground
|
|
300
297
|
<VictoryChart minDomain={0}>
|
|
301
298
|
<VictoryErrorBar data={sampleErrorData}/>
|
|
@@ -309,7 +306,7 @@ height={400}
|
|
|
309
306
|
The `name` prop is used to reference a component instance when defining shared events.
|
|
310
307
|
|
|
311
308
|
```jsx
|
|
312
|
-
name="series-1"
|
|
309
|
+
name = "series-1";
|
|
313
310
|
```
|
|
314
311
|
|
|
315
312
|
### origin
|
|
@@ -320,14 +317,13 @@ name="series-1"
|
|
|
320
317
|
|
|
321
318
|
[Read about the `origin` prop in detailhttps://formidable.com/open-source/victory](/docs/common-props#origin)
|
|
322
319
|
|
|
323
|
-
|
|
324
320
|
### padding
|
|
325
321
|
|
|
326
322
|
`type: number || { top: number, bottom: number, left: number, right: number }`
|
|
327
323
|
|
|
328
324
|
`VictoryErrorBar` uses the standard `padding` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#padding)
|
|
329
325
|
|
|
330
|
-
|
|
326
|
+
_default (provided by default theme):_ `padding={50}`
|
|
331
327
|
|
|
332
328
|
```jsx
|
|
333
329
|
padding={{ top: 20, bottom: 60 }}
|
|
@@ -355,7 +351,7 @@ padding={{ top: 20, bottom: 60 }}
|
|
|
355
351
|
|
|
356
352
|
`VictoryErrorBar` uses the standard `samples` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#samples)
|
|
357
353
|
|
|
358
|
-
|
|
354
|
+
_default:_ `samples={50}`
|
|
359
355
|
|
|
360
356
|
```jsx
|
|
361
357
|
samples={100}
|
|
@@ -368,7 +364,7 @@ samples={100}
|
|
|
368
364
|
`VictoryErrorBar` uses the standard `scale` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#scale)
|
|
369
365
|
Options for scale include "linear", "time", "log", "sqrt" and the `d3-scale` functions that correspond to these options.
|
|
370
366
|
|
|
371
|
-
|
|
367
|
+
_default:_ `scale="linear"`
|
|
372
368
|
|
|
373
369
|
```jsx
|
|
374
370
|
scale={{x: "linear", y: "log"}}
|
|
@@ -393,7 +389,7 @@ scale={{x: "linear", y: "log"}}
|
|
|
393
389
|
See the [Data Accessors Guide][] for more detail on formatting and processing data.
|
|
394
390
|
|
|
395
391
|
```jsx
|
|
396
|
-
sortKey="x"
|
|
392
|
+
sortKey = "x";
|
|
397
393
|
```
|
|
398
394
|
|
|
399
395
|
### sortOrder
|
|
@@ -402,7 +398,7 @@ sortKey="x"
|
|
|
402
398
|
|
|
403
399
|
The `sortOrder` prop specifies whether sorted data should be returned in ascending or descending order.
|
|
404
400
|
|
|
405
|
-
|
|
401
|
+
_default:_ `sortOrder="ascending"`
|
|
406
402
|
|
|
407
403
|
### standalone
|
|
408
404
|
|
|
@@ -412,7 +408,7 @@ The `sortOrder` prop specifies whether sorted data should be returned in ascendi
|
|
|
412
408
|
|
|
413
409
|
**note:** When `VictoryErrorBar` is nested within a component like `VictoryChart`, this prop will be set to `false`
|
|
414
410
|
|
|
415
|
-
|
|
411
|
+
_default:_ `standalone={true}`
|
|
416
412
|
|
|
417
413
|
```playground
|
|
418
414
|
<svg width={300} height={300}>
|
|
@@ -431,7 +427,7 @@ The `sortOrder` prop specifies whether sorted data should be returned in ascendi
|
|
|
431
427
|
|
|
432
428
|
`VictoryErrorBar` uses the standard `style` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#style)
|
|
433
429
|
|
|
434
|
-
|
|
430
|
+
_default (provided by default theme):_ See [grayscale theme][] for more detail
|
|
435
431
|
|
|
436
432
|
```playground
|
|
437
433
|
<VictoryErrorBar
|
|
@@ -456,7 +452,7 @@ The `sortOrder` prop specifies whether sorted data should be returned in ascendi
|
|
|
456
452
|
|
|
457
453
|
See the [Themes Guide][] for information about creating custom themes.
|
|
458
454
|
|
|
459
|
-
|
|
455
|
+
_default:_ `theme={VictoryTheme.grayscale}`
|
|
460
456
|
|
|
461
457
|
```jsx
|
|
462
458
|
theme={VictoryTheme.material}
|
|
@@ -468,7 +464,7 @@ theme={VictoryTheme.material}
|
|
|
468
464
|
|
|
469
465
|
`VictoryErrorBar` uses the standard `width` prop. [Read about it here](https://formidable.com/open-source/victory/docs/common-props#width)
|
|
470
466
|
|
|
471
|
-
|
|
467
|
+
_default (provided by default theme):_ `width={450}`
|
|
472
468
|
|
|
473
469
|
```jsx
|
|
474
470
|
width={400}
|
|
@@ -498,13 +494,13 @@ See the [Data Accessors Guide][] for more detail on formatting and processing da
|
|
|
498
494
|
y={(d) => d.value + d.error}
|
|
499
495
|
```
|
|
500
496
|
|
|
501
|
-
[
|
|
502
|
-
[
|
|
503
|
-
[
|
|
504
|
-
[
|
|
505
|
-
[
|
|
497
|
+
[animations guide]: https://formidable.com/open-source/victory/guides/animations
|
|
498
|
+
[data accessors guide]: https://formidable.com/open-source/victory/guides/data-accessors
|
|
499
|
+
[custom components guide]: https://formidable.com/open-source/victory/guides/custom-components
|
|
500
|
+
[events guide]: https://formidable.com/open-source/victory/guides/events
|
|
501
|
+
[themes guide]: https://formidable.com/open-source/victory/guides/themes
|
|
506
502
|
[`x`]: https://formidable.com/open-source/victory/docs/victory-candlestick#x
|
|
507
503
|
[`y`]: https://formidable.com/open-source/victory/docs/victory-candlestick#y
|
|
508
|
-
[`
|
|
509
|
-
[`
|
|
504
|
+
[`errorx`]: https://formidable.com/open-source/victory/docs/victory-candlestick#errorX
|
|
505
|
+
[`errory`]: https://formidable.com/open-source/victory/docs/victory-candlestick#errorY
|
|
510
506
|
[grayscale theme]: https://github.com/FormidableLabs/victory-core/blob/master/src/victory-theme/grayscale.js
|