Skip to content

GenomeSpy Core API / EmbedOptions

Interface: EmbedOptions

Properties

wheelBehavior?

optional wheelBehavior?: "default" | "cooperative"

In cooperative mode, ordinary wheel input scrolls an overflowing vertical viewport or the page. Ctrl+wheel retains chart navigation and authored wheel selections. The embedding application provides any Ctrl-zoom hint.

Default value: "default"


renderer?

optional renderer?: "auto" | "webgl" | "canvas" | "webgpu"

Rendering backend. "auto" uses WebGL2 when available and falls back to the Canvas2D compatibility renderer. "webgpu" enables an experimental proof-of-concept renderer for a narrow subset of marks. "canvas" does not request WebGL or WebGPU and uses software-based datum picking.

Default value: "auto"


fontCatalog?

optional fontCatalog?: FontCatalogEntry[]

Additional TrueType faces for WebGPU text rendering. Entries are matched exactly by family, weight, and style and take precedence over GenomeSpy's temporary example-font catalog. Registering entries does not load them; each URL is fetched only if the initialized visualization requests it. This option has no effect with the WebGL or Canvas2D renderers.


namedDataProvider?

optional namedDataProvider?: (name) => any[]

A function that allows retrieval of named data. There are two ways to provide named data: 1. A data provider (this) 2. Explicit updates using the updateNamedData method (the other).

Parameters

Parameter Type
name string

Returns

any[]

Deprecated

Declare the dataset in the owning view and provide initial rows through the specification or update it through EmbedResult.datasets.set() for a top-level declaration or ViewHandle.datasets.set() for a nested declaration.


tooltipHandlers?

optional tooltipHandlers?: Record<string, TooltipHandler>

Custom tooltip handlers. Use "default" to override the default handler


inputBindingContainer?

optional inputBindingContainer?: HTMLElement | "default" | "none"

Where to put the input binding elements. The default is "default", which means that the input binding elements are placed in the same container as the GenomeSpy instance.


powerPreference?

optional powerPreference?: "default" | "high-performance" | "low-power"

A suggestion for the browser on the appropriate GPU setup for the WebGL environment. This setting has no effect in Canvas2D mode.

Default value: "default" in @genome-spy/core and "high-performance" in @genome-spy/app


theme?

optional theme?: GenomeSpyConfig

Optional theme configuration object that is merged after the internal defaults and built-in theme, but before spec.config.


onError?

optional onError?: (error, container) => boolean | void

Optional hook for handling launch and runtime errors. Return true to suppress default UI.

Parameters

Parameter Type
error unknown
container HTMLElement

Returns

boolean | void


getSpecOrigin?

optional getSpecOrigin?: (fragment) => string

Links reported errors to locations in your specification.

Called with a data definition, encoding branch, parameter, transform, expression reference, or interaction configuration from your specification. Return a string identifying that object, such as the JSON Pointer "/encoding/x" for { field: "position", type: "quantitative" }. Located errors include this string and a relative property path in SpecLocation. getSpecErrorLocation(error) reads it from errors delivered to onError or rejected by embed. Data-loading reports expose errorLocation for located processing errors and origin for the data definition itself.

Return undefined if the definition's location is unknown. Equivalent data definitions may share one source; its reports contain one definition's origin.

Parameters

Parameter Type
fragment object

Returns

string