JBrowseWebRootModel
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. View source.
note: many properties of the root model are available through the session, and we generally prefer using the session model (via e.g. getSession) over the root model (via e.g. getRoot) in plugin code
Members a composed model contributes are listed here too, so these tables are the whole surface.
Properties
| Member | Description | Defined by |
|---|---|---|
configPathconfigPath: types.maybe(types.string) | JBrowseWebRootModel | |
jbrowsejbrowse: jbrowseModelType | jbrowse is a mapping of the config.json into the in-memory state tree | BaseRootModel |
sessionsession: types.maybe(sessionModelType) | session encompasses the currently active state of the app, including views open, tracks open in those views, etc. | BaseRootModel |
sessionPathsessionPath: types.stripDefault(types.string, '') | BaseRootModel | |
| assemblyManager | BaseRootModel | |
| internetAccounts | InternetAccountsMixin | |
| history | used for undo/redo | HistoryManagementMixin |
Volatiles
| Member | Description | Defined by |
|---|---|---|
adminModeadminMode | JBrowseWebRootModel | |
sessionDBsessionDB: undefined as SessionDBHandle | undefined | JBrowseWebRootModel | |
versionversion: packageJSON.version | JBrowseWebRootModel | |
gitCommitgitCommit | JBrowseWebRootModel | |
pluginsUpdatedpluginsUpdated: false | JBrowseWebRootModel | |
savedSessionMetadatasavedSessionMetadata: undefined as SessionMetadata[] | undefined | JBrowseWebRootModel | |
detachDisposersdetachDisposers: [] as (() => void)[] | What has to stop the moment the React host lets go of this root — the beforeunload listener and the autoruns that write to sessionStorage and IndexedDB, i.e. everything reaching outside the tree.Deliberately not addDisposer, which fires only on destroy, because destroy is what this root cannot do at detach time: React is still holding its views and widgets in the outgoing props of the same passive-effect flush. The destroy follows on a later task, so an addDisposer here would run late rather than never — but "the moment the host lets go" is the contract these want. See detach and SessionLoader's disposePluginManager. | JBrowseWebRootModel |
| reloadPluginManagerCallback | JBrowseWebRootModel | |
| rpcManager | BaseRootModel | |
errorerror: undefined as unknown | BaseRootModel | |
textSearchManagertextSearchManager: new TextSearchManager(pluginManager) | BaseRootModel | |
pluginManagerpluginManager | BaseRootModel | |
mutableMenuActions: [] as MenuAction[] | RootAppMenuMixin |
Methods
| Member | Description |
|---|---|
() => Menu[] |
Actions
| Member | Description | Defined by |
|---|---|---|
setSavedSessionMetadata(sessions: SessionMetadata[]) => void | JBrowseWebRootModel | |
fetchSessionMetadata() => Promise<void> | Re-reads the whole metadata store. For anything that changes rows this model didn't just write itself (first load, pruning, favorite, rename, delete) — the autosave path uses upsertSessionMetadata instead. | JBrowseWebRootModel |
upsertSessionMetadata(meta: SessionMetadata) => void | Merges a row this model has just written into the in-memory list. The autosave autorun writes exactly one row on every debounced session edit — every 400ms for as long as you keep panning — and already holds its contents, so re-reading every session's metadata to learn what it just stored is the expensive way to move one row to the top. | JBrowseWebRootModel |
setSessionDB(sessionDB: SessionDBHandle | undefined) => void | JBrowseWebRootModel | |
addDetachDisposer(disposer: () => void) => void | Register something that must stop when the React host detaches this root. See the detachDisposers volatile for why this is not addDisposer. | JBrowseWebRootModel |
detach() => void | The React host has let go of this root: stop everything of ours that reaches outside the tree — the worker pool, the beforeunload listener, the sessionStorage and IndexedDB autoruns — and leave the tree itself alone.Half the teardown. The caller destroys the tree on a later task ( scheduleDetachedDestroy), which is what runs the beforeDestroy hooks in it — a plugin-facing contract, so skipping it is not an option. What this action does is take everything that reaches outside the tree off that deferral, so nothing keeps running in the window between the two. ADR-069. | JBrowseWebRootModel |
setPluginsUpdated() => void | JBrowseWebRootModel | |
| setReloadPluginManagerCallback | JBrowseWebRootModel | |
activateSession(id: string) => Promise<void> | JBrowseWebRootModel | |
setSavedSessionFavorite(id: string, favorite: boolean) => Promise<void> | JBrowseWebRootModel | |
deleteSavedSession(id: string) => Promise<void> | JBrowseWebRootModel | |
deleteSavedSessions(ids: string[]) => Promise<void> | Deletes a batch of saved sessions in ONE transaction, and re-reads the metadata once at the end. Looping deleteSavedSession instead is both N transactions and N full getAll('metadata') scans, and — because those interleave — leaves savedSessionMetadata holding whichever scan happened to resolve last, so already-deleted rows stay on screen until something else refreshes the list.The open session is skipped rather than reported on, since a bulk delete is not aimed at any one row (see deleteSavedSession). | JBrowseWebRootModel |
renameSavedSession(id: string, name: string) => Promise<void> | JBrowseWebRootModel | |
setError(error: unknown) => void | BaseRootModel | |
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. | BaseRootModel |
setDefaultSession() => void | BaseRootModel | |
setSessionPath(path: string) => void | BaseRootModel | |
renameCurrentSession(newName: string) => void | BaseRootModel | |
| initializeInternetAccount | InternetAccountsMixin | |
| createEphemeralInternetAccount | InternetAccountsMixin | |
findAppropriateInternetAccount(location: UriLocation) => any | InternetAccountsMixin | |
(newMenus: MenuDefinition[]) => void | Replace the menu bar wholesale. Item contributions recorded before this one are dropped along with the menus they targeted, so a plugin adding to the existing bar wants appendToMenu instead. | RootAppMenuMixin |
(menuName: string) => void | Add a top-level menu, if the app bar does not already have one with this name. | RootAppMenuMixin |
(menuName: string, position: number) => void | Insert a top-level menu, if the app bar does not already have one with this name. | RootAppMenuMixin |
(menuName: string, menuItem: MenuItem) => void | Add a menu item to a top-level menu, creating the menu if it does not exist. | RootAppMenuMixin |
(menuName: string, menuItem: MenuItem, position: number) => void | Insert a menu item into a top-level menu, creating the menu if it does not exist. | RootAppMenuMixin |
(menuPath: string[], menuItem: MenuItem) => void | Add a menu item to a sub-menu, creating any part of the path that does not exist. | RootAppMenuMixin |
| Insert a menu item into a sub-menu, creating any part of the path that does not exist. | RootAppMenuMixin |