@vx/stats

The package provides react components for visualizing distributions, such as Box Plots and Violin Plots

Installation

npm install --save @vx/stats

Examples

Components

APIs

#<BoxPlot />

# BoxPlot.valueScaleScaleThreshold<DefaultThresholdInput, number> | ScaleTime<number, number> | ScaleLinear<number, number> | ... 4 more ... | ScaleQuantize<...>required

Scale for converting input values to pixel offsets.

# BoxPlot.boxPropsSVGProps<SVGRectElement> | undefinedoptional

Props to pass to the box glyph rect.

Default {}

# BoxPlot.boxWidthnumber | undefinedoptional

Width of the BoxPlot.

Default 10

# BoxPlot.children((childRenderProps: ChildRenderProps) => ReactNode) | undefinedoptional

Override render function to fully control the rendering of the BoxPlot glyph.

# BoxPlot.classNamestring | undefinedoptional

Classname to apply to parent group element.

# BoxPlot.containerboolean | undefinedoptional

Whether to render a container rect element (e.g., to capture mouse events).

Default false

# BoxPlot.containerPropsSVGProps<SVGRectElement> | undefinedoptional

Props to pass to the container glyph rect if rendered.

Default {}

# BoxPlot.fillstring | undefinedoptional

Fill color to apply to outlier circles and BoxPlot rect.

# BoxPlot.fillOpacitystring | number | undefinedoptional

Fill color opacity to apply to outlier circles and BoxPlot rect.

# BoxPlot.firstQuartilenumber | undefinedoptional

First quartile BoxPlot value.

# BoxPlot.horizontalboolean | undefinedoptional

Whether the glyph should be rendered horizontally instead of vertically.

# BoxPlot.leftnumber | undefinedoptional

Left pixel offset of the glyph.

Default 0

# BoxPlot.maxnumber | undefinedoptional

Maximum BoxPlot value.

# BoxPlot.maxPropsSVGProps<SVGLineElement> | undefinedoptional

Props to pass to the maximum glyph line.

Default {}

# BoxPlot.mediannumber | undefinedoptional

Median BoxPlot value.

# BoxPlot.medianPropsSVGProps<SVGLineElement> | undefinedoptional

Props to pass to the median glyph line.

Default {}

# BoxPlot.minnumber | undefinedoptional

Minimum BoxPlot value.

# BoxPlot.minPropsSVGProps<SVGLineElement> | undefinedoptional

Props to pass to the minimum glyph line.

Default {}

# BoxPlot.outlierPropsSVGProps<SVGCircleElement> | undefinedoptional

Props to pass to the outlier glyph circles.

Default {}

# BoxPlot.outliersnumber[] | undefinedoptional

Array of outlier values to be rendered.

Default []

# BoxPlot.rxnumber | undefinedoptional

Rx to apply to BoxPlot rect.

Default 2

# BoxPlot.rynumber | undefinedoptional

Ry to apply to BoxPlot rect.

Default 2

# BoxPlot.strokestring | undefinedoptional

Stroke color to apply to outlier circles, BoxPlot rect, and min/median/max lines.

# BoxPlot.strokeWidthstring | number | undefinedoptional

Stroke width to apply to outlier circles, BoxPlot rect, and min/median/max lines.

# BoxPlot.thirdQuartilenumber | undefinedoptional

Third quartile BoxPlot value.

# BoxPlot.topnumber | undefinedoptional

Top pixel offset of the glyph.

Default 0

#<ViolinPlot />

# ViolinPlot.dataDatum[]required

Data used to draw the violin plot glyph. Violin plot values and counts should be able to be derived from data.

# ViolinPlot.valueScaleScaleThreshold<DefaultThresholdInput, number> | ScaleTime<number, number> | ScaleLinear<number, number> | ... 4 more ... | ScaleQuantize<...>required

Scale for converting values to pixel offsets.

# ViolinPlot.children((providedProps: { path: string; }) => ReactNode) | undefinedoptional

Override render function to fully control the rendering of the ViolinPlot glyph.

# ViolinPlot.classNamestring | undefinedoptional

Classname to apply to parent group element.

# ViolinPlot.count((d: Datum) => number) | undefinedoptional

Given an datum, returns the count for it.

# ViolinPlot.horizontalboolean | undefinedoptional

Whether the glyph should be rendered horizontally instead of vertically.

# ViolinPlot.leftnumber | undefinedoptional

Left pixel offset of the glyph.

Default 0

# ViolinPlot.topnumber | undefinedoptional

Top pixel offset of the glyph.

Default 0

# ViolinPlot.value((d: Datum) => number) | undefinedoptional

Given an datum, returns the value for it.

# ViolinPlot.widthnumber | undefinedoptional

Width of the violin plot glyph.

Default 10