Plot
Defined in: map/plot.ts:92
Extends
Section titled “Extends”BaseEngine
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Plot(
host,opts?):Plot
Defined in: map/plot.ts:105
Parameters
Section titled “Parameters”HTMLElement
PlotOptions = {}
Returns
Section titled “Returns”Plot
Overrides
Section titled “Overrides”BaseEngine.constructor
Methods
Section titled “Methods”clearStyle()
Section titled “clearStyle()”clearStyle(
name,ids?):this
Defined in: map/base-engine.ts:976
Remove overrides (all of the layer’s when ids is omitted) and restore base styles.
Parameters
Section titled “Parameters”string
string | number | readonly (string | number)[]
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.clearStyle
destroy()
Section titled “destroy()”destroy():
void
Defined in: map/base-engine.ts:1678
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”BaseEngine.destroy
disableInteraction()
Section titled “disableInteraction()”disableInteraction():
this
Defined in: map/base-engine.ts:1226
Detach the current pan/zoom or rotation interaction (no-op if none).
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.disableInteraction
enableZoom()
Section titled “enableZoom()”enableZoom(
extent?,onTransform?):this
Defined in: map/base-engine.ts:1546
Enable scroll-to-zoom / drag-to-pan via d3-zoom, clamped to extent. The optional
onTransform callback fires after each setTransform during zoom — use it to keep an
HTML overlay (e.g. a LabelLayer) aligned with the GPU geometry as the view changes.
Parameters
Section titled “Parameters”extent?
Section titled “extent?”[number, number] = ...
onTransform?
Section titled “onTransform?”(t) => void
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.enableZoom
highlight()
Section titled “highlight()”Call Signature
Section titled “Call Signature”highlight(
name,idOrIds,style?):this
Defined in: map/base-engine.ts:1069
Highlight one drawable / a set of drawables of name by drawing them into a tiny
internal overlay layer on top (inheriting the source’s clipTo/sizeMode) — the base
layer’s buffers are untouched, so the per-change cost is tessellating the
highlighted items only. styleOrDraw falls back to the layer’s hover option,
then to the default white outline. null clears.
The draw-fn overload is generic over the layer’s datum type D (caller-asserted,
like select’s predicate) so a custom highlight draw sees a typed datum.
Parameters
Section titled “Parameters”string
idOrIds
Section titled “idOrIds”string | number | readonly (string | number)[] | null
style?
Section titled “style?”Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.highlight
Call Signature
Section titled “Call Signature”highlight<
D>(name,idOrIds,draw):this
Defined in: map/base-engine.ts:1070
Highlight one drawable / a set of drawables of name by drawing them into a tiny
internal overlay layer on top (inheriting the source’s clipTo/sizeMode) — the base
layer’s buffers are untouched, so the per-change cost is tessellating the
highlighted items only. styleOrDraw falls back to the layer’s hover option,
then to the default white outline. null clears.
The draw-fn overload is generic over the layer’s datum type D (caller-asserted,
like select’s predicate) so a custom highlight draw sees a typed datum.
Type Parameters
Section titled “Type Parameters”D = unknown
Parameters
Section titled “Parameters”string
idOrIds
Section titled “idOrIds”string | number | readonly (string | number)[] | null
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.highlight
labels()
Section titled “labels()”Call Signature
Section titled “Call Signature”labels(
data):this
Defined in: map/plot.ts:124
Show engine-owned text labels (#223): supply the data and d3-style accessors, and the engine
measures each label’s text once, then places + culls collisions and re-places them on every
pan/zoom (no manual overlay, transform callback, or text-metric estimates). Rendered by the
active backend — an HTML overlay on WebGL, native <text>/fillText on SVG/Canvas so labels
survive toSVG()/toPNG() export. Pass false to remove; re-call to rebuild after the bound
data or positions change.
Parameters
Section titled “Parameters”false
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”labels<
D>(data,opts):this
Defined in: map/plot.ts:125
Show engine-owned text labels (#223): supply the data and d3-style accessors, and the engine
measures each label’s text once, then places + culls collisions and re-places them on every
pan/zoom (no manual overlay, transform callback, or text-metric estimates). Rendered by the
active backend — an HTML overlay on WebGL, native <text>/fillText on SVG/Canvas so labels
survive toSVG()/toPNG() export. Pass false to remove; re-call to rebuild after the bound
data or positions change.
Type Parameters
Section titled “Type Parameters”D
Parameters
Section titled “Parameters”readonly D[]
Returns
Section titled “Returns”this
layer()
Section titled “layer()”layer<
D>(name,data,opts):LayerHandle<D>
Defined in: map/plot.ts:268
Declare (or re-declare) a named layer of arbitrary data, each datum drawn by the
opts.draw callback emitting path commands — so d3-shape/d3-geo generators that render
to a context (d3.line(), d3.arc(), geoPath(projection, ctx), …) work directly. Geometry
is tessellated once and retained, so all three backends render it identically and it stays
crisp under zoom. Re-declaring an existing name resets its base styles. Returns a
LayerHandle for appending data and per-layer styling. For large point sets prefer
Plot.points, which batches them through the shared instanced lane.
Type Parameters
Section titled “Type Parameters”D
the datum type passed to draw and the accessors.
Parameters
Section titled “Parameters”string
readonly D[]
Returns
Section titled “Returns”LayerHandle<D>
Call Signature
Section titled “Call Signature”on(
event,cb):this
Defined in: map/base-engine.ts:1598
Parameters
Section titled “Parameters”"click" | "hover"
(hit, ev) => void
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.on
Call Signature
Section titled “Call Signature”on(
event,cb):this
Defined in: map/base-engine.ts:1599
Parameters
Section titled “Parameters”"select"
(selected, ev?) => void
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.on
pick()
Section titled “pick()”pick(
x,y,exact?):HoverHit|null
Defined in: map/base-engine.ts:1618
Parameters
Section titled “Parameters”number
number
exact?
Section titled “exact?”boolean = true
Returns
Section titled “Returns”HoverHit | null
Inherited from
Section titled “Inherited from”BaseEngine.pick
points()
Section titled “points()”points<
D>(name,data,opts):LayerHandle<D>
Defined in: map/plot.ts:286
Declare (or re-declare) a named layer of points positioned by opts.x/opts.y, rendered
through the shared instanced point lane (one draw call for the whole layer). Prefer this over
Plot.layer for large point sets: it scales to millions and supports screen-space
declutter. data may be an array or a callback; with passThrough: true points stream
uncapped but aren’t pickable. Re-declaring an existing name resets its interaction/style
state. Returns a LayerHandle for appending data and per-layer styling.
Type Parameters
Section titled “Type Parameters”D
the datum type passed to the accessors.
Parameters
Section titled “Parameters”string
readonly D[] | (() => readonly D[])
Returns
Section titled “Returns”LayerHandle<D>
recolor()
Section titled “recolor()”recolor(
name):this
Defined in: map/base-engine.ts:949
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.recolor
render()
Section titled “render()”render():
this
Defined in: map/base-engine.ts:1673
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.render
select()
Section titled “select()”Call Signature
Section titled “Call Signature”select(
name,set):this
Defined in: map/base-engine.ts:1006
Select a set of drawables: style members with the layer’s selection.selected
(default: keep base style) and the complement with selection.others (default
{ opacity: 0.3 }). One O(n) compose + one styles-only push — click-time cost
only, nothing per frame. null clears. NOTE: selection rewrites the layer’s
whole override map, so it replaces earlier setStyle overrides (one table, last
write wins) — and select(null) restores plain base styles.
Also updates the managed selection set and fires on("select") with ev = undefined
(programmatic — no PointerEvent), so callers can observe programmatic selection the
same way they observe gesture selection.
The predicate overload is generic over the layer’s datum type D — annotate the
parameter ((d: MyDatum) => …) or pass select<MyDatum>(…) to get a typed datum,
mirroring d3-selection’s caller-asserted datum generics. Prefer the layer handle’s
LayerHandle.select, which already knows D from registration.
Parameters
Section titled “Parameters”string
readonly (string | number)[] | null
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.select
Call Signature
Section titled “Call Signature”select<
D>(name,predicate):this
Defined in: map/base-engine.ts:1007
Select a set of drawables: style members with the layer’s selection.selected
(default: keep base style) and the complement with selection.others (default
{ opacity: 0.3 }). One O(n) compose + one styles-only push — click-time cost
only, nothing per frame. null clears. NOTE: selection rewrites the layer’s
whole override map, so it replaces earlier setStyle overrides (one table, last
write wins) — and select(null) restores plain base styles.
Also updates the managed selection set and fires on("select") with ev = undefined
(programmatic — no PointerEvent), so callers can observe programmatic selection the
same way they observe gesture selection.
The predicate overload is generic over the layer’s datum type D — annotate the
parameter ((d: MyDatum) => …) or pass select<MyDatum>(…) to get a typed datum,
mirroring d3-selection’s caller-asserted datum generics. Prefer the layer handle’s
LayerHandle.select, which already knows D from registration.
Type Parameters
Section titled “Type Parameters”D = unknown
Parameters
Section titled “Parameters”string
predicate
Section titled “predicate”(d, i) => boolean
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.select
selection()
Section titled “selection()”selection():
HoverHit[]
Defined in: map/base-engine.ts:2069
Flatten the retained selection into HoverHit[], resolving datums + members() via the layer’s
Scene spec or its interactive lane (so a selected aggregate’s leaf ids are reachable, #105 N7c-2).
Returns
Section titled “Returns”HoverHit[]
Inherited from
Section titled “Inherited from”BaseEngine.selection
setBackend()
Section titled “setBackend()”setBackend(
type):this
Defined in: map/base-engine.ts:1219
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.setBackend
setClip()
Section titled “setClip()”setClip(
name,clipTo?):this
Defined in: map/base-engine.ts:1204
Parameters
Section titled “Parameters”string
clipTo?
Section titled “clipTo?”string
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.setClip
setSize()
Section titled “setSize()”setSize(
width,height):this
Defined in: map/base-engine.ts:487
Resize the engine in place to a new CSS size (px) — no teardown. Resizes the live backend, runs the subclass onResize hook (e.g. GeoMap refits its projection), then re-renders and repaints pass-through layers. Layers, view transform, and interaction state are preserved. A no-op when the size is unchanged or either axis is zero (a collapsed/hidden layout). In responsive modes the ResizeObserver calls this automatically; callers in fixed mode use it to apply a new explicit size without recreating the engine.
Parameters
Section titled “Parameters”number
height
Section titled “height”number
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.setSize
setStyle()
Section titled “setStyle()”setStyle(
name,ids,override):this
Defined in: map/base-engine.ts:963
Override the style of one drawable or a set (replaces any previous override for those ids — last write wins). O(ids) compose + one styles-only push.
Parameters
Section titled “Parameters”string
string | number | readonly (string | number)[]
override
Section titled “override”Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.setStyle
setTransform()
Section titled “setTransform()”setTransform(
t):this
Defined in: map/base-engine.ts:1267
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”BaseEngine.setTransform
toPNG()
Section titled “toPNG()”toPNG():
string
Defined in: map/base-engine.ts:1677
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”BaseEngine.toPNG
toSVG()
Section titled “toSVG()”toSVG():
string
Defined in: map/base-engine.ts:1676
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”BaseEngine.toSVG
whenReady()
Section titled “whenReady()”whenReady():
Promise<void>
Defined in: map/base-engine.ts:507
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”BaseEngine.whenReady