du.widgets.contourplot

Module implementing a contour plot. A contour plot can show slow changes of a variable in two dimensions when displaying the raw data would result in over plotting.

Requires: d3@v4 du.Widget

ContourPlot

du.widgets.contourplot.ContourPlot(name[, parent])

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

layers

du.widgets.contourplot.ContourPlot.layers(count)

Sets the number of contour layers which are distributed uniformly over the scale of the data. Default is 20.
argtypedescription
countnumberNumber of layers to use.
returndescription
du.widgets.contourplot.ContourPlotReference to the current ContourPlot.

grid

du.widgets.contourplot.ContourPlot.grid(size)

Sets the grid size to compute contours on. Default is [40, 40].
argtypedescription
sizenumber[]Array of numbers containing the horizontal and vertical size of the grid..
returndescription
du.widgets.contourplot.ContourPlotReference to the current ContourPlot.

borders

du.widgets.contourplot.ContourPlot.borders(on)

Adds borders to the contours. Default is false.
argtypedescription
onbooleanWhether to add borders.
returndescription
du.widgets.contourplot.ContourPlotReference to the current ContourPlot.

colors

du.widgets.contourplot.ContourPlot.colors(colors)

Sets the min, mid and max colors of the contour plot. Must be an array with three colors. The color of intermediate contours is interpolated with HSL interpolation. Default color set is [transparent, grey, black].
Overrides: du.widgets.Widget.colors
argtypedescription
colorsstring[]Start and end colors of the gauge.
returndescription
du.widgets.contourplot.ContourPlotReference to the current ContourPlot.

data

du.widgets.contourplot.ContourPlot.data(data)

Binds data to the contour plot. Expected data format: array of objects containing the x, y coordinates of the data points and a value denoting the weight of the data point. If value is missing, it is assumed to be 1.
argtypedescription
dataArrayData to plot.
returndescription
du.widgets.contourplot.ContourPlotReference to the current ContourPlot.

highlight

du.widgets.contourplot.ContourPlot.highlight(key, duration)

Highlights the specified contour.
argtypedescription
keystring string[]Single key or an array of keys of the contour(s) to highlight.
durationnumberDuration of the highlight animation.
returndescription
du.widgets.contourplot.ContourPlotReference to the current ContourPlot.