PlotOptions
Defined in: map/plot.ts:15
Plot adds no engine-level options of its own — all of BaseEngineOptions
(sizing, backend, tooltipClass) apply.
Extends
Section titled “Extends”Properties
Section titled “Properties”aspectRatio?
Section titled “aspectRatio?”
optionalaspectRatio?:number
Defined in: map/base-engine.ts:284
width ÷ height. When set, the engine is width-driven and keeps this ratio on resize.
Inherited from
Section titled “Inherited from”backend?
Section titled “backend?”
optionalbackend?:BackendType
Defined in: map/base-engine.ts:296
Which renderer to draw with — see BackendType. Defaults to "webgl".
Use "auto" for an instant Canvas first paint that upgrades to WebGL in the background.
Inherited from
Section titled “Inherited from”curveTolerance?
Section titled “curveTolerance?”
optionalcurveTolerance?:number
Defined in: map/base-engine.ts:320
Max deviation, in world units, between a curve (arc / bezierCurveTo /
quadraticCurveTo in a layer’s draw) and the polyline it is baked to. Default
DEFAULT_CURVE_TOLERANCE (0.25).
The bake happens once, when a layer is registered, and the view transform only
scales it — so a facet measuring t world units measures t·k screen px at zoom k
(#45). A chart that zooms to kMax and wants sub-pixel curves therefore wants
curveTolerance: 0.25 / kMax.
It is a quality/size dial, not a free win, and it is deliberately opt-in: an arc’s
segment count grows as 1/sqrt(tolerance), so 0.25 / 40 bakes ~6.3× the vertices
of the world-scaled curved drawables only (straight paths, rects, and points()
circles — which every backend draws analytically — are untouched). Costs nothing per frame.
Anchored sizeMode: "screen" glyphs are exempt (#283): they are drawn as constant-pixel
offsets from their anchor, so their bake is already in screen px and cannot facet under zoom.
They bake at max(curveTolerance, 0.25) — the default’s sub-pixel 0.25px, or coarser if you
set a coarser tolerance — see anchoredCurveTolerance. The split is per drawable: a
screen-sizeMode layer drawn without anchors is world-scaled geometry, so it refines.
Inherited from
Section titled “Inherited from”BaseEngineOptions.curveTolerance
height?
Section titled “height?”
optionalheight?:number
Defined in: map/base-engine.ts:282
Inherited from
Section titled “Inherited from”onContextUnrestored?
Section titled “onContextUnrestored?”
optionalonContextUnrestored?: () =>void
Defined in: map/base-engine.ts:330
Called once when the browser takes the WebGL context away (a GPU-process reset, too many contexts on
the page) and has not given it back 10 s later, or giving it back failed:
the place to show a message, or to call setBackend("canvas") (setBackend("webgl") rebuilds at once).
Until then the engine draws nothing, keeps its data, styles, view and selection (toSVG() exports
them), and throws nothing, except toPNG(), which has no drawn image to copy. When the context comes
back — even after this call — it redraws them on a fresh WebGL backend by itself (#599). A context that
comes back in time calls nothing.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”BaseEngineOptions.onContextUnrestored
tooltipClass?
Section titled “tooltipClass?”
optionaltooltipClass?:string
Defined in: map/base-engine.ts:298
Class(es) for the hover tooltip box, replacing its default inline look.
Inherited from
Section titled “Inherited from”BaseEngineOptions.tooltipClass
width?
Section titled “width?”
optionalwidth?:number
Defined in: map/base-engine.ts:281