Class Slider
JXG.CoordsElement,JXG.GeometryElement
↳ JXG.Point
↳ Glider
↳ Slider
A slider can be used to choose values from a given range of numbers.
Defined in: slider.js.
Extends
Glider.
Constructor Attributes | Constructor Name and Description |
---|---|
Slider(start,end,data)
|
- Fields borrowed from class JXG.GeometryElement:
- _org_type, _pos, ancestors, baseElement, board, childElements, dash, descendants, draft, dump, elementClass, elType, fillColor, fillOpacity, fixed, frozen, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isReal, lastDragTime, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, parents, quadraticform, rendNode, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, transitionDuration, type, visible, visProp, visPropCalc
- Fields borrowed from class JXG.CoordsElement:
- coords, groups, needsUpdateFromParent, onPolygon, position, slideObject, slideObjects
Field Attributes | Field Name and Description |
---|---|
End value of the slider range.
|
|
Start value of the slider range.
|
|
Attributes for the base line of the slider.
|
|
Attributes for the highlighting line of the slider.
|
|
Attributes for the slider label.
|
|
Attributes for first (left) helper point defining the slider position.
|
|
Attributes for second (right) helper point defining the slider position.
|
|
If not null, this is appended to the value and to unitLabel in the slider label.
|
|
The precision of the slider value displayed in the optional text.
|
|
Sets the maximum value of the slider.
|
|
Sets the minimum value of the slider.
|
|
Sets the value of the slider.
|
|
Size of slider point.
|
|
The slider only returns integer multiples of this value, e.g.
|
|
If not null, this replaces the part "name = " in the slider label.
|
|
Attributes for the ticks of the base line of the slider.
|
|
If not null, this is appended to the value in the slider label.
|
|
Returns the current slider value.
|
|
Show slider label.
|
|
Show slider ticks.
|
- Fields borrowed from class JXG.GeometryElement:
- _org_type, _pos, ancestors, baseElement, board, childElements, dash, descendants, draft, dump, elementClass, elType, fillColor, fillOpacity, fixed, frozen, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isReal, lastDragTime, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, parents, quadraticform, rendNode, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, transitionDuration, type, visible, visProp, visPropCalc
- Fields borrowed from class JXG.CoordsElement:
- coords, groups, needsUpdateFromParent, onPolygon, position, slideObject, slideObjects
- Methods borrowed from class Glider:
- startAnimation, stopAnimation
- Methods borrowed from class JXG.Point:
- face, hasPoint, makeIntersection, normalizeFace, setStyle, update, updateRenderer, updateTransform
- Methods borrowed from class JXG.GeometryElement:
- _set, addChild, addDescendants, addParents, addRotation, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, fullUpdate, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getTextAnchor, getType, handleSnapToGrid, hideElement, labelColor, noHighlight, normalize, prepareUpdate, remove, removeChild, removeDescendants, resolveShortcuts, setArrow, setAttribute, setDash, setDisplayRendNode, setLabel, setLabelText, setName, setParents, setPosition, setPositionDirectly, setProperty, showElement, snapToPoints, updateVisibility
- Methods borrowed from class JXG.CoordsElement:
- _anim, addAnchor, addConstraint, Dist, free, handleAttractors, handleSnapToPoints, makeGlider, moveAlong, moveTo, popSlideObject, setGliderPosition, setPositionByTransform, updateConstraint, updateCoords, updateGlider, updateGliderFromParent, visit, X, XEval, Y, YEval, Z, ZEval
- Events borrowed from class JXG.GeometryElement:
- attribute, attribute:<attribute><attribute>, down, drag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, touchdown, touchdrag, touchup, up
Class Detail
Slider(start,end,data)
- Parameters:
- {Array_Array_Array} start,end,data
- The first two arrays give the start and the end where the slider is drawn on the board. The third array gives the start and the end of the range the slider operates as the first resp. the third component of the array. The second component of the third array gives its start value.
- Throws:
- {Exception}
- If the element cannot be constructed with the given parent objects an exception is thrown.
- Examples:
// Create a slider with values between 1 and 10, initial position is 5. var s = board.create('slider', [[1, 2], [3, 2], [1, 5, 10]]);
// Create a slider taking integer values between 1 and 50. Initial value is 50. var s = board.create('slider', [[1, 3], [3, 1], [0, 10, 50]], {snapWidth: 1, ticks: { drawLabels: true }});
Field Detail
{Number}
_smax
End value of the slider range.
{Number}
_smin
Start value of the slider range.
{Line}
baseline
Attributes for the base line of the slider.
Defined in: options.js.
Defined in: options.js.
{Line}
highline
Attributes for the highlighting line of the slider.
Defined in: options.js.
Defined in: options.js.
{Label}
label
Attributes for the slider label.
Defined in: options.js.
Defined in: options.js.
{Point}
point1
Attributes for first (left) helper point defining the slider position.
Defined in: options.js.
Defined in: options.js.
{Point}
point2
Attributes for second (right) helper point defining the slider position.
Defined in: options.js.
Defined in: options.js.
postLabel
If not null, this is appended to the value and to unitLabel in the slider label.
Possible types: string, number or function.
Defined in: options.js.
Defined in: options.js.
- See:
- JXG.Slider#suffixLabel
- JXG.Slider#unitLabel
- Default Value:
- null
{Number}
precision
The precision of the slider value displayed in the optional text.
Defined in: options.js.
Defined in: options.js.
- Default Value:
- 2
{Object}
setMax
Sets the maximum value of the slider.
{Object}
setMin
Sets the minimum value of the slider.
{Object}
setValue
Sets the value of the slider. This call must be followed
by a board update call.
{Number}
size
Size of slider point.
Defined in: options.js.
Defined in: options.js.
- See:
- Point#size
- Default Value:
- 6
{Number}
snapWidth
The slider only returns integer multiples of this value, e.g. for discrete values set this property to 1. For
continuous results set this to -1.
Defined in: options.js.
Defined in: options.js.
suffixLabel
If not null, this replaces the part "name = " in the slider label.
Possible types: string, number or function.
Defined in: options.js.
Defined in: options.js.
- See:
- JXG.Slider#unitLabel
- JXG.Slider#postLabel
- Default Value:
- null
{Ticks}
ticks
Attributes for the ticks of the base line of the slider.
Defined in: options.js.
Defined in: options.js.
unitLabel
If not null, this is appended to the value in the slider label.
Possible types: string, number or function.
Defined in: options.js.
Defined in: options.js.
- See:
- JXG.Slider#suffixLabel
- JXG.Slider#postLabel
- Default Value:
- null
{Number}
Value
Returns the current slider value.
{Boolean}
withLabel
Show slider label.
Defined in: options.js.
Defined in: options.js.
- Default Value:
- true
{Boolean}
withTicks
Show slider ticks.
Defined in: options.js.
Defined in: options.js.
- Default Value:
- true