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
| Kind | Meaning |
|---|---|
| data | Views dataset rows; channels name columns |
| parametric | Channels are curve parameters (trend); rows are not created freely |
| map chrome | Basemap / tiles; pointer-transparent |
| element | Views 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
| Factory | create/remove | What you grab |
|---|---|---|
point | natural | the mark |
shape | natural | the shape |
bar / barX / barY | remove ok; create awkward | the bar |
rect / rectX / rectY | natural | the rect (brushRect zones) |
tick / tickX / tickY | natural | the tick |
ellipse | natural | the mark; rx and ry are separate magnitudes |
image | natural | the picture; a row with no src draws nothing |
track | natural | anywhere on the route; move on length reads the place along it |
curve / curveX / curveY | less natural | a fat transparent hit path over the stroke |
text / textX / textY | create awkward; use editText | the 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 / ruleY | less natural | the segment when edited |
dotStack | natural (canonical) | tokens |
waffle | N/A → edit.waffle.fill | cells |
needle | N/A | the path and its hub; handles sets the hub’s paint |
arc / donut | edit.stack.cut / edit.stack.merge | rim boundary dots |
composite | depends on parts | each part is its own feature; in box mode, placed in a per-datum local frame |
node / sticker | depends on parts | presets over composite; the dot or the note |
link | edit.network.connect / remove | a 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
| Factory | Notes | Affordance |
|---|---|---|
trend | x/y are axes; intercept/slope are params | a circle at anchor, and slope circles at the line’s ends (or one at probe under grip: "probe") |
trendBand | the spread around a trend; a view of the same rows | spread grips where an edit reaches the row |
face | a preset that returns a box-mode composite of ordinary marks. The emotion preset binds valence/arousal if unbound | shape 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
| Factory | Kind | create/remove |
|---|---|---|
geoPoint / geoLine / geoPolygon / geoRect / geoText | data | natural (edit.geo.*) |
geoBasemap / geoTile | map chrome | N/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.
| Factory | Edits | Handles |
|---|---|---|
axis / axisX / axisY | edit.axis.scale, edit.scale.categories | domain end grips / category labels |
grid / gridX / gridY | none | — |
legend / … | edit.legend.category / edit.legend.value | ramp grip / swatches |
axisRadial | none; edit, edits, field and table warn | inert; 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.