Skip to content

Variable: symbols ​

ts
const symbols: object;

Custom marker symbols (plan E8.11), exposed by the full bundle as Holochart.symbols.

register('pin', { path: 'M12 2C8 2 5 5 5 9c0 5 7 13 7 13s7-8 7-13c0-4-3-7-7-7z' }) makes 'pin', 'pin-open', 'pin-dot' and 'pin-open-dot' valid marker.symbol values everywhere markers are drawn (scatter, splom, box points, legends). Register before plotting: a figure validated before the name existed has already fallen back to circle. Registering a name again replaces its shape in every chart. The path is turned into a signed distance field asynchronously (by lazily loaded code); charts wait for it before ready resolves.

Type Declaration ​

NameTypeDefault valueDescription
has()(value) => booleanisCustomSymbolWhether symbol is a registered custom symbol (with an optional variant suffix) or a text: glyph. Whether value names a custom symbol: a registered name (with an optional variant suffix) or a text: glyph. The schema's marker.symbol accepts these besides Plotly's symbols.
names()() => string[]customSymbolNamesNames of the registered custom symbols (lower case, in registration order). Names of the registered symbols, in registration order.
ready()() => Promise<void>customMarkersReadyResolves once every registered symbol and requested marker image is ready to draw. Resolves once every symbol registered and image requested so far is in the atlases (or failed). The same promise until new work arrives.
register()(name, definition) => void-Register (or replace) a custom symbol. Names are case-insensitive; built-in names, numbers, names ending in a variant suffix (-open, -dot) and text: names are rejected (TypeError).

Released under the MIT License.