type
set equal to one of these string values, followed by a comma-separated list of optional attributes. Entries in the array can also be arrays of inputs, following the logic of matrices, to allow for arbitrary arrangements.
All inputs have two additional string options: a name
that is used to identify the input in subsequent code, and a label
that appears next to the input. The label can be any valid HTML. Single letter labels are italicized by default.
All variables are assigned in code via the helper function
var x = getVariable( id, 'x' );
where 'x'
is the name
of the variable.
A slider
input has four numeric options with default values
min | 0 |
max | 1 |
step | .01 |
default | min
|
A buttons
input has four additional options: an array of numbers or strings, an optional array of string labels, a value in the first array and a CSS string with default values
values | [1,2,3] |
labels | values
|
default | values[0]
|
width | empty |
A number
input has three numeric options with default values
min | 0 |
max | 1 |
default | min
|
A checkbox
input has a single additional option default
, which can be set to either 'checked'
or true
to have the box initially checked.
The minimum and maximum values of slider and number inputs can be set via the helper function
setLimit( id, name, end, value );
where end
is either 'min'
or 'max'
. This can be used to avoid invalid numerical input.