du.widgets.scatterplot

Module implementing a scatter plot.

Requires: d3@v4 du.Widget

ScatterPlot

du.widgets.scatterplot.ScatterPlot(name[, parent])

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

opacity

du.widgets.scatterplot.ScatterPlot.opacity(value)

Sets the opacity of the area plots. Default is 0.3.
argtypedescription
valuenumberThe opacity value to set.
returndescription
du.widgets.scatterplot.ScatterPlotReference to the current ScatterPlot.

size

du.widgets.scatterplot.ScatterPlot.size(value)

Sets the size of the dots. in pixels. Default is 3.
argtypedescription
valuenumberThe size to set.
returndescription
du.widgets.scatterplot.ScatterPlotReference to the current ScatterPlot.

data

du.widgets.scatterplot.ScatterPlot.data(data)

Binds data to the scatter plot. Expected data format: array of objects with two properties: name which is the name of the plot and values which is an array containing (x, y) objects for the points.
argtypedescription
dataArrayData to plot.
returndescription
du.widgets.scatterplot.ScatterPlotReference to the current ScatterPlot.

highlight

du.widgets.scatterplot.ScatterPlot.highlight(key, duration)

Highlights the specified plot.
argtypedescription
keystring string[]Single key or an array of keys of the dot group(s) to highlight.
durationnumberDuration of the highlight animation.
returndescription
du.widgets.scatterplot.ScatterPlotReference to the current ScatterPlot.

highlightRange

du.widgets.scatterplot.ScatterPlot.highlightRange(range, duration)

Highlights the sepcified range.
argtypedescription
rangenumber[]Array containing the lower and upper boundary of the range to highlight.
durationnumberDuration of the highlight animation. nullable
returndescription
du.widgets.scatterplot.ScatterPlotReference to the current ScatterPlot.