Skip to content

Slider ​

Introduction ​

vtkSlider is a DOM widget that draws a draggable cursor inside a container. The cursor snaps to the closest of a discrete set of values and its orientation follows the longest dimension of the container.

Methods ​

extend ​

Method used to decorate a given object (publicAPI+model) with vtkSlider characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesISliderInitialValuesNo(default: {})

generateValues ​

Build nbSteps evenly spaced values between min and max and use them as the slider values.

ArgumentTypeRequiredDescription
minNumberYes
maxNumberYes
nbStepsNumberYes

newInstance ​

Method used to create a new instance of vtkSlider.

ArgumentTypeRequiredDescription
initialValuesISliderInitialValuesNofor pre-setting some of its content

resize ​

Recompute the orientation and the cursor size from the container size.

setContainer ​

Attach the slider cursor to the given DOM element and bind the mouse listeners on it. Passing null detaches and unbinds.

ArgumentTypeRequiredDescription
elYes

setValue ​

Move the cursor to the given value. The value is ignored when it falls outside of the current values range.

ArgumentTypeRequiredDescription
vNumberYes

setValues ​

Replace the set of values the cursor can snap to.

ArgumentTypeRequiredDescription
valuesArray[Number]Yes

updateCursorStyle ​

Merge the given CSS properties into the cursor style and apply them.

ArgumentTypeRequiredDescription
cursorStylePartial<CSSStyleDeclaration>No