Embedding and Entry Points¶
Embedding¶
See the getting started page.
Entry points¶
When embedding GenomeSpy into a web application, you can choose between two
entry points for importing the embed function:
@genome-spy/core is the default entry point. It includes the standard
GenomeSpy runtime and the built-in data source and format registrations.
@genome-spy/core/minimal provides the same embed API without the built-in
loaders. Import the data source and format modules you need explicitly:
import { embed } from "@genome-spy/core/minimal";
import "@genome-spy/core/data/formats/parquet.js";
import "@genome-spy/core/data/sources/lazy/bigBedSource.js";
const spec = {
// view specification that uses the lazy bigBed source
};
const api = await embed(document.body, spec);
API object¶
The embed function returns a promise that resolves into an object that
provides the current public API. The API is documented in the interface
definition.
For practical examples of using the API, check the embed-examples package.
Debugging embeds¶
Use the Inspector to inspect the live view hierarchy,
resolutions, params, and dataflow of embedded visualizations. Core embeds can
attach the inspector through the @genome-spy/inspector package.