GenomeSpy Core API / EmbedOptions
Interface: EmbedOptions¶
Properties¶
wheelBehavior?¶
optionalwheelBehavior?:"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?¶
optionalrenderer?:"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?¶
optionalfontCatalog?: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?¶
optionalnamedDataProvider?: (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?¶
optionaltooltipHandlers?:Record<string,TooltipHandler>
Custom tooltip handlers. Use "default" to override the default handler
inputBindingContainer?¶
optionalinputBindingContainer?: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?¶
optionalpowerPreference?:"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?¶
optionaltheme?:GenomeSpyConfig
Optional theme configuration object that is merged after the internal
defaults and built-in theme, but before spec.config.
onError?¶
optionalonError?: (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?¶
optionalgetSpecOrigin?: (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