There are seven kinds of input:
slider buttons number |
checkbox text |
iterator action |
The array of inputs in the MathCell()
command should contain a dictionary for each input desired, with 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 other than action
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
|
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.
A checkbox
input has a single additional option default
, which can be set to either 'checked'
or true
to have the box initially checked.
A text
input has two additional options: an initial string and a CSS string with the default values
default | empty |
width | automatic |
An iterator
input allows one to step forward or backward numerically, and has two additional options width default values
default | 0 |
reversible | false |
An action
input is a button that triggers a behavior. Its label
is any valid HTML but is not italicized by default. The type of action is set by a subtype
option and a corresponding script
string. Currently there is one such subtype
:
updateParent |
process script to update an attribute stored on the current cell
|
More actions are coming.