Elicit.js

Mark & element contracts

What every factory is for: its kind, whether create and remove apply, and what you grab. Axes, grids and legends are on elements.*.

Kinds of factory

KindMeaning
dataViews dataset rows; channels name columns
parametricChannels are curve parameters (trend); rows are not created freely
map chromeBasemap / tiles; pointer-transparent
elementViews a scale; its edits write the domain, not rows

Data, parametric and map-chrome factories are all marks: they view rows. An element views a scale. Guides, the third kind on Core concepts, view state and are covered on Guides.

Marks are inert until an edit names the column it writes. Edits write fields, so an edit goes on a { field } channel. A constant { value } channel carries none.

Data marks

Factorycreate/removeWhat you grab
pointnaturalthe mark
shapenaturalthe shape
bar / barX / barYremove ok; create awkwardthe bar
rect / rectX / rectYnaturalthe rect (brushRect zones)
tick / tickX / tickYnaturalthe tick
ellipsenaturalthe mark; rx and ry are separate magnitudes
imagenaturalthe picture; a row with no src draws nothing
tracknaturalanywhere on the route; move on length reads the place along it
curve / curveX / curveYless naturala fat transparent hit path over the stroke
text / textX / textYcreate awkward; use editTextthe label
line / path / polygon / area (+ X/Y)natural (edit.line.*)per-datum / edge circles; the inside of a closed path for edit.line.moveSeries
rule / ruleX / ruleYless naturalthe segment when edited
dotStacknatural (canonical)tokens
waffleN/A → edit.waffle.fillcells
needleN/Athe path and its hub; handles sets the hub’s paint
arc / donutedit.stack.cut / edit.stack.mergerim boundary dots
compositedepends on partseach part is its own feature; in box mode, placed in a per-datum local frame
node / stickerdepends on partspresets over composite; the dot or the note
linkedit.network.connect / removea transparent hit path; endpoint handles where an edit writes that end

On every mark that draws a grip, handles takes true (drawn and grabbable), false (hidden and inert), or 'hit' (invisible but grabbable).

Parametric glyphs

FactoryNotesAffordance
trendx/y are axes; intercept/slope are paramsa circle at anchor, and slope circles at the line’s ends (or one at probe under grip: "probe")
trendBandthe spread around a trend; a view of the same rowsspread grips where an edit reaches the row
facea preset that returns a box-mode composite of ordinary marks. The emotion preset binds valence/arousal if unboundshape is the control — each feature is its own mark, so the universal edits apply and there is no edit.face.*

Set a stage on the edit, as in edit.trend.slope({ stage: 1 }). The mark takes no stage option.

Geographic

FactoryKindcreate/remove
geoPoint / geoLine / geoPolygon / geoRect / geoTextdatanatural (edit.geo.*)
geoBasemap / geoTilemap chromeN/A

Chart elements

Chart elements are exported as elements.*. Pass them in elements: [...] on the spec, or inside marks; both lists draw together, elements first.

FactoryEditsHandles
axis / axisX / axisYedit.axis.scale, edit.scale.categoriesdomain end grips / category labels
grid / gridX / gridYnone—
legend / …edit.legend.category / edit.legend.valueramp grip / swatches
axisRadialnone; edit, edits, field and table warninert; optional x/y placement for per-row rings

See Axis, Grid & Rule and Legend.

Guides and effects

An edit's guide: option draws its rules: bounds, catchment and track. An effect shows interaction state: hovered, selected or grabbed. Edits that select a target (pick: "nearest", pick: "sweep", brushSpan, brushRect, edit.geo.brush) turn catchment on when you omit guide. Set guide: false to turn it off. See Guides and Effects.