violin

Configuration Structure

violin: {
bandwidthScale: number,
normalize: 'individual' | 'group',
points: { ... },
show: boolean,
shape: 'circle' | 'square',
size: number,
jitter: number,
constrainToViolin: boolean,
maxPoints: number,
opacity: number,
fillColor: string,
strokeColor: string,
strokeWidth: number,
colorScale: { ... },
colors: string[],
min: number,
max: number,
steps: number,
}

plotOptions

bandwidthScale

Default: 1

Multiplies the density-derived half-width of each violin. At 1, a curve's own peak density maps to half the category slot. Values above 1 widen the curves, below 1 narrow them.

normalize

Default: 'individual'

How violin widths are scaled across the series.

Available Options:

  • 'individual' (default) — each violin is scaled to its own peak, so every curve fills the slot regardless of sample size.
  • 'group' — all violins share one scale (the densest in the series), keeping widths proportional to density across categories.

points

Individual observations ("jitter") overlaid on the violin shape. The raw values come from the points array on each data point's y.

show

violin.points.show
Default: true

Render the jitter dots over each violin.

Available Options:

  • true (default)
  • false

shape

violin.points.shape
Default: 'circle'

Marker shape for each observation.

Available Options:

  • 'circle' (default)
  • 'square'

size

violin.points.size
Default: 2.5

Marker radius in pixels.

jitter

violin.points.jitter
Default: 0.5

Horizontal scatter of the dots as a 0..1 fraction of the violin's half-width. 0 stacks every dot on the centre line.

constrainToViolin

violin.points.constrainToViolin
Default: true

Clamp the jitter to the density width at each value so dots stay inside the curve outline.

Available Options:

  • true (default)
  • false

maxPoints

violin.points.maxPoints
Default: 3000

Cap on the number of dots drawn per violin. Observations beyond this are stride-thinned (evenly sampled) so dense groups stay performant.

opacity

violin.points.opacity
Default: 0.9

Opacity of the dots, from 0 to 1.

fillColor

violin.points.fillColor
Default: 'series-dark'

Fill colour of the dots. Accepts 'series-dark' (a darker shade of the violin's own colour), 'series' (the violin's colour as-is), or any literal colour string such as '#fff'.

strokeColor

violin.points.strokeColor
Default: '#fff'

Colour of the ring around each dot.

strokeWidth

violin.points.strokeWidth
Default: 1

Width of the dot outline in pixels. 0 disables the outline.

colorScale

violin.points.colorScale

Colour each dot by its value along a ramp, overriding fillColor. Dots are bucketed into steps shades to keep rendering fast.

colors

violin.points.colorScale.colors
Default: undefined

Hex colour stops, ordered low → high.

min

violin.points.colorScale.min
Default: undefined

Value mapped to the first colour stop. Defaults to the data minimum.

max

violin.points.colorScale.max
Default: undefined

Value mapped to the last colour stop. Defaults to the data maximum.

steps

violin.points.colorScale.steps
Default: 24

Number of shade buckets between min and max.