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.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | ISliderInitialValues | No | (default: {}) |
generateValues
Build nbSteps evenly spaced values between min and max and use them as the slider values.
| Argument | Type | Required | Description |
|---|---|---|---|
min | Number | Yes | |
max | Number | Yes | |
nbSteps | Number | Yes |
newInstance
Method used to create a new instance of vtkSlider.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ISliderInitialValues | No | for 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.
| Argument | Type | Required | Description |
|---|---|---|---|
el | Yes |
setValue
Move the cursor to the given value. The value is ignored when it falls outside of the current values range.
| Argument | Type | Required | Description |
|---|---|---|---|
v | Number | Yes |
setValues
Replace the set of values the cursor can snap to.
| Argument | Type | Required | Description |
|---|---|---|---|
values | Array[Number] | Yes |
updateCursorStyle
Merge the given CSS properties into the cursor style and apply them.
| Argument | Type | Required | Description |
|---|---|---|---|
cursorStyle | Partial<CSSStyleDeclaration> | No |