BaseRootModel
Auto-generated from the @jbrowse/mobx-state-tree model in the source — see the developer guide for concepts. Built into JBrowse core. View source.
Holds the loaded config, the session, the assembly manager and the RPC manager. Every JBrowse product's root model composes this one.
Properties
| Member | Description |
|---|---|
jbrowsejbrowse: jbrowseModelType | jbrowse is a mapping of the config.json into the in-memory state tree |
sessionsession: types.maybe(sessionModelType) | session encompasses the currently active state of the app, including views open, tracks open in those views, etc. |
sessionPathsessionPath: types.stripDefault(types.string, '') | |
| assemblyManager |
Volatiles
| Member | Description |
|---|---|
rpcManagerRpcManager | |
adminModeboolean | |
errorunknown | |
textSearchManagerTextSearchManager | |
pluginManagerPluginManager | |
detachDisposers(() => void)[] | What has to stop the moment the host lets go of this root: everything reaching outside the tree, like an autosave autorun. Not addDisposer, which fires only on destroy, and destroy follows a task later, once React has let go of the views it still holds (ADR-069). Work left running in that gap acts for the outgoing session. See detach. |
Actions
| Member | Description |
|---|---|
setError(error: unknown) => void | |
addDetachDisposer(disposer: () => void) => void | Register something that must stop when the host detaches this root. |
detach() => void | Called when the host releases this root. Stops the worker pool and whatever was registered with addDetachDisposer, and leaves the tree itself alone.The caller destroys the tree on a later task ( scheduleDetachedDestroy), which runs the beforeDestroy hooks in it; plugins rely on those hooks, so the destroy cannot be skipped. ADR-069. |
setSession(sessionSnapshot?: any) => void | Sets the active session. Remaps any legacy display type names (e.g. LinearPileupDisplay → LinearAlignmentsDisplay), drops nodes whose pluggable type this build has no plugin for (see pruneUnbuildableNodes), then walks the resulting MST tree to drop open tracks whose config can't hydrate so shared sessions still load when referencing tracks that no longer exist. Both kinds of drop are surfaced to the user via a snackbar. If filtering throws, the previous session is restored. |
setDefaultSession() => void | Starts a new session from the config's defaultSession. An id in it (a pasted session export has one) is dropped, since sessions are autosaved by id and each new one would otherwise overwrite the last. The name has no date, because the saved-session lists show when each was used, and a dated name saved back as the default would gain another date on every new session. |
setSessionPath(path: string) => void | |
renameCurrentSession(newName: string) => void |