(Generated from this markdown source.)
The notation for specifying elements is similar to the regular Markdown syntax for links and images, generally following this format:
[text content]{variable_name: configuration}
The text representation of the element, like the link text or image alt text,
goes between the brackets, []
. The brackets are followed by braces, {}
,
which contain the variable name, and any configuration. The variable name MUST
be followed by a colon, :
, if there is any configuration present. The
configuration is what determines the kind of element, and specifies its
behavior. For example, a RangeElement can be constrained to a minimum and
maximum, and a SwitchElement can be given different labels for true
and
false
.
A read-only output of the current value of the specified variable <var_name>
.
The text is the default value, and used whenever the value of the variable is
undefined
.
[<text>]{<var_name>}
many eggs - [many eggs]{egg_count}
property | value |
---|---|
name |
|
value |
many eggs |
A number adjustable by dragging. The number MAY have a display precision specified. The slider MAY be constrained to a minimum and/or maximum, and MAY have a step value. The text is parsed, and the first number in the text becomes the output value. The remaining text is added to the template, allowing for units and other descriptive text to be included in the control.
A range MUST be specified, but MAY be infinite in both directions. The range’s
interval is specified using the CoffeeScript-style range
dots, where ..
is inclusive and ...
excludes the end. ie, 1..4
covers the interval 1 <= n <= 4
, while 1...4
covers 1 <= n < 4
. The range MUST be ascending (to preserve consistency in
the UI — drag left for negative, drag right for positive). The range’s step is
specified using the by
keyword and a number. The step MAY be omitted
(defaulting to 1
), but if specified MUST be positive.
The text content MAY include a number to use as the default value. Any surrounding text will be used as a template, allowing units or qualifiers to be included in the element’s presentation.
Specifying a display precision MAY be done using the default number value in
the text. 200.
formats to 0
decimal places. 200.000
formats to 3
decimals. If not specified, the value is unformatted.
Numbers MAY use the constants in Math
and combine them with a coefficient, eg 2pi
or 0.5pi
, which is treated as
n * Math.PI
. This can be done in the range min or max, or in the step. The
constants MUST be one of e
, pi
, ln2
, ln10
, log2e
, log10e
, sqrt1_2
,
sqrt2
, (uppercase or lowercase).
[<before> <number>.<decimal> <after>]{<var_name>: <bound>..<exclusive><bound> by <step>}
20. calories - [20. calories]{calories: 10..100 by 10}
property | value |
---|---|
name |
|
value |
|
interval |
|
step |
|
default |
|
display precision |
|
display format |
|
20.0 calories - [20.0 calories]{calories_2: 10..100 by 0.1}
property | value |
---|---|
name |
|
value |
|
interval |
|
step |
|
default |
|
display precision |
|
display format |
|
period 0.00 - [period 0.00]{period: 0..2pi by 0.25pi}
property | value |
---|---|
name |
|
value |
|
interval |
|
step |
|
default |
|
display precision |
|
display format |
|
20 calories - [20 calories]{calories_3: ..}
property | value |
---|---|
name |
|
value |
|
interval |
|
step |
|
default |
|
display precision |
|
display format |
|
over 200 calories - [over 200 calories]{calories_4: 1.. by 2}
property | value |
---|---|
name |
|
value |
|
interval |
|
step |
|
default |
|
display precision |
|
display format |
|
A boolean flag that has a value of true
, false
, or undefined
. The true
and false values can be labeled. If the label is present in the text, that value
becomes the default value. Otherwise, the value is undefined
.
[<before> <true_label or false_label or *> <after>]{<var_name>: <true_label> or <false_label>}
pick one - [pick one]{some_flag_1: true or false}
property | value |
---|---|
name |
|
value |
|
default |
|
true label |
|
false label |
|
display format |
|
true - [true]{some_flag_3: true or false}
property | value |
---|---|
name |
|
value |
|
default |
|
true label |
|
false label |
|
display format |
|
on deck - [on deck]{some_flag_3: on or off}
property | value |
---|---|
name |
|
value |
|
default |
|
true label |
|
false label |
|
display format |
|
An embedded chart, of type scatter, line, or bar. The chart is driven by the
specified function over the specified range. The ChartElement notation is
similar to the RangeElement, but with the addition of the type
, and the
leading !
. Also, the chart interval MUST be finite. Charts MUST have a
function defined in an ActiveCodeBlock.
![<x_label> <delimiter> <y_label>]{<type>=<fn_name>: <bound>..<exclusive><bound> by <step>}
![y vs x]{scatter=scatterFn: -10..10}
Offset: 0.
@scatterFn = (x) =>
return x + Math.random() * @scatter_offset
y vs x
property | value |
---|---|
name |
|
type |
|
x label |
|
y label |
|
interval |
|
step |
|
![sin(x)]{line=lineFn: 0..2pi by 0.001}
Period 1.00
b = 2 * Math.PI / @period
@lineFn = (x) =>
return Math.sin(b * x)
sin(x)
property | value |
---|---|
name |
|
type |
|
x label |
|
y label |
|
interval |
|
step |
|
![money by year]{bar=barFn: 1983..2013}
Threshold: 5.
@barFn = (x) =>
return x % @threshold
money by year
property | value |
---|---|
name |
|
type |
|
x label |
|
y label |
|
interval |
|
step |
|