du.widgets.violinplot

Module implementing a violin plot.

Requires: d3@v4 du.Widget

ViolinPlot

du.widgets.violinplot.ViolinPlot(name[, parent])

The violin plot widget class.
argtypedescription
namestringIdentifier of the widget.
parentobjectParent element to append widget to. If not specified, widget is appended to body. optional

data

du.widgets.violinplot.ViolinPlot.data(data)

Binds data to the violin plot. Expected data format: array containing the violin objects. Each violin needs to have a name property denoting its name and a data property that contains the array of corresponding values. The violins are calculated automatically.
argtypedescription
dataobjectData to plot.
returndescription
du.widgets.violinplot.ViolinPlotReference to the current ViolinPlot.

highlight

du.widgets.violinplot.ViolinPlot.highlight(key, duration)

Highlights the specified violin.
argtypedescription
keystring string[]Single key or an array of keys of the violin(s) to highlight.
durationnumberDuration of the highlight animation.
returndescription
du.widgets.violinplot.ViolinPlotReference to the current ViolinPlot.