selector

The same parameter, picked from a list rather than dragged. For a quantity whose values are the ones the data holds and nothing in between: which country a chart shows, which of four models is fitted, which month. It is always discrete — there is nothing between its stops to stand in — so it declares no discrete: for anyone to say otherwise with. It is the one control whose values need not be numbers. options: of names, or over: a column of them, gives a parameter that holds a name; a mark's slice: over that same column then shows the rows carrying it, with no interpolation, because there is nothing between Brazil and China. A name never reaches an expression, which is why a selector is also the control whose parameter: is most often a word. To have the scene walk the choices instead, write cue.selector.

selectorNode
Population in millions against year for one country at a time, with a country menu beneath the plot.Population in millions against year for one country at a time, with a country menu beneath the plot.

#Attributes

parameterRequiredImplicit
The parameter this control declares and drives — slider:a, and the whole scene's a from then on. One letter is the ordinary case, and the only one an expression can read: curve: a*x^2 reaches it by that letter. A word (selector:country) is for a parameter that never appears in a formula, and cannot be read in maths — to the expression parser country is a product of seven letters.
parameter-name
Also written: varCan be written as shorthand: selector:value
name
What the parameter is called in front of a reader. Rich text, so Frequency bb sets its own maths.
Also written: label
over
A dataset column the parameter runs over: over: #pop.year. Its cells are the stops, their span is the range, and what they are decides the format — so range: is not consulted where this is given. A column of NAMES gives a parameter whose values are those names. This is the shape long-format data arrives in, and the shape a mark's slice: reads: the mark names the column, not the parameter, and the two meet at the column.
Also written: column
format
What the values are, for the readout: numbers, dates, months, weekdays, hours, weeks or names. Every one but the last places a value on its own number line — position 1…12 for a month, a fractional year for a date — so the range stays a pair of numbers and only the reading changes. names has no number line: the values are the data's own words. auto takes the kind from the column over: names, and is numeric where no column was named.
autonumbersdatesmonthsweekdayshoursweeksnames
Also written: values
Defaultauto
range
Range interval [start, end]. Ignored where over: or options: gives the stops: those decide.
Default[-10, 10]
step
Distance between stops. Absent, 1 — or, under over:, the closest the data's own values come to each other, which is the spacing that can reach every row.
default
Where it starts. Absent, 0 — or, under over:, the first value in the column. Where the stops are names this is an INDEX among them, since a name has no number line to sit on; writing the wanted one first in options: is the usual way to say which opens.
Also written: start
hiddenAnimatable
Keeps the control out of the footer: the expressions still read the parameter, the reader cannot move it.
Defaultfalse
lock
Keeps the reader from editing it on an editable: graph.
Also written: locked
Defaultfalse
options
The stops, written out — options: [linear, log, logit], or options: [1, 2, 5, 10]. Numbers give a numeric parameter with stops no step: ladder can express; anything else gives names, and one unreadable entry makes the whole list names — [1, 2, many] is three labels, not a number line with a word on the end. It outranks over:, which outranks range:/step:; writing it beside over: is refused, as two claims about the same list.
Also written: choices

#Derived attributes

Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.

valueDerived
Where the parameter currently stands. A selector whose values are names publishes nothing: a live value is a number.

#Allowed in

#Examples

selector:mode(options: [linear, log, logit])
selector:n(options: [1, 2, 5, 10, 20]; name: sample size)
selector:country(over: #pop.country)
bar(x: #pop.year; y: #pop.millions; slice: #pop.country)

Last updated