du.widgets.trackpad

Module implementing a track pad, which is simply a 2D slider.

Requires: d3@v4 du.Widget

TrackPad

du.widgets.trackpad.TrackPad(name[, parent])

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

xRange

du.widgets.trackpad.TrackPad.xRange(range)

Sets the range for the horizontal dimension. Default is [0, 1].
argtypedescription
rangeArrayArray containing the lower and upper boundaries of the horizontal range.
returndescription
du.widgets.trackpad.TrackPadReference to the current TrackPad.

yRange

du.widgets.trackpad.TrackPad.yRange(range)

Sets the range for the vertical dimension. Default is [0, 1].
argtypedescription
rangeArrayArray containing the lower and upper boundaries of the vertical range.
returndescription
du.widgets.trackpad.TrackPadReference to the current TrackPad.

callback

du.widgets.trackpad.TrackPad.callback(func)

Sets callback attached to the track pad. Must accept two parameter describing the position of the track pad. By default no callback is set.
argtypedescription
funcfunctionThe callback to call on value change.
returndescription
du.widgets.trackpad.TrackPadReference to the current TrackPad.

guide

du.widgets.trackpad.TrackPad.guide(on)

Enables the horizontal and vertical lines that help see the value of the trackpad. Default is false.
argtypedescription
onbooleanWhether guiding lines are enabled.
returndescription
du.widgets.trackpad.TrackPadReference to the current TrackPad.