WorkspaceLayoutMixin
Auto-generated from the @jbrowse/mobx-state-tree model in the source. See the developer guide for concepts. Built into JBrowse core. View source.
The whole workspace as one MST tree:
branch (a split) > panel (a grid cell) > tab > views (stacked)
Every action is tree -> tree through the pure functions in tree.ts, so
undo is applySnapshot on this node.
Properties
| Member | Description |
|---|---|
layouttypes.optional(LayoutNode, emptyPanel) |
|
activePanelIdstring | undefined |
|
maximizedPanelIdstring | undefined |
Show only this cell, at the size of the whole workspace. Kept here rather than as a flag on PanelNode so no tree.ts operation has to say what it does to it. |
Getters
| Member | Description |
|---|---|
treeLayoutTree |
Referentially stable, since getSnapshot is cached. Uncast on purpose: this assignment is what checks the models above agree with the interfaces in tree.ts. |
panelsPanelNode[] |
|
tabsTabNode[] |
|
visibleTreeLayoutTree |
The maximized cell alone, or the whole tree. The cell is resized to 1 because CSS hands out free space by grow factor only up to a total of 1, so a third-of-a-row cell would draw a third of the window. |
Methods
| Member | Description |
|---|---|
hasPanel(panelId: string) => boolean |
|
findTab(tabId: string) => TabHome | undefined |
|
tabContainingView(viewId: string) => TabHome | undefined |
|
panelContainingView(viewId: string) => PanelNode | undefined |
Actions
| Member | Description |
|---|---|
setActivePanelId(panelId: string | undefined) => void |
|
toggleMaximizedPanel(panelId: string) => void |
Show one cell at the size of the workspace, or go back; naming a different cell moves the mode. Unmounts every other cell's views rather than hiding them, to stay under the WebGL2 context ceiling (agent-docs/reference/GPU_PORTABILITY.md). |
restorePanels() => void |
|
setActiveTab(panelId: string, tabId: string) => void |
|
renameTab(tabId: string, title: string | undefined) => void |
|
| splitPanel |
Split a grid cell; the new cell gets one empty tab. |
closePanel(panelId: string) => void |
Close a grid cell, and every view in its tabs leaves the session. |
addTab(panelId: string, viewIds?: string[]) => TabNode | undefined |
"New empty tab": a tab in an existing cell, showing the launcher. |
closeTab(tabId: string) => void |
Close a tab, and its views leave the session. Its cell goes too if that was the last tab and not the workspace's last cell: a tabless cell renders nothing at all. |
addViewToTab(tabId: string, viewId: string) => void |
|
closeView(viewId: string) => void |
A view's own close button: the view leaves the session, and the tab or cell it empties goes with it. session.removeView keeps them, for callers that put another view in the same place. |
dropTabInPanel(tabId: string, targetPanelId: string, index?: number) => void |
Drop a dragged tab into an existing panel, as a tab. |
| dropTabInNewSplit |
Drop a dragged tab on a panel edge: split, and put the tab in the new half. |
setSizes(branchId: string, sizes: number[]) => void |
|
applyLayoutSpec(spec: LayoutSpecNode<LayoutViewRef>) => string[] |
Arrange the workspace as a spec states, in the shape a session spec's layout takes: a leaf's views names views by index into session.views or by id. A malformed leaf, an index past the end or an unknown id throws. |
moveViewToNewTab(viewId: string) => string | undefined |
ViewMenu's "move to new tab": the view leaves its tab for a new one. |
| moveViewToSplit |
ViewMenu's "move to split": the view moves to a new cell to the right (row) or below (column) of its current cell. |
moveViewToTab(viewId: string, tabId: string) => void |
ViewMenu's "move to tab": the view joins an existing tab, which becomes the one shown. |
homeUnassignedViews(viewIds: string[]) => void |
|
setPendingMove(move: PendingMove | undefined, _allViewIds?: string[]) => void |
Move one view to a new tab or a split beside its cell, keeping the rest of the arrangement. PUBLIC API: protein3d and msaview call it with the move alone. The second argument is an old plugin signature; the session's own views are read instead. |
tileViews(mode: TileMode) => void |
Re-arrange the whole workspace, one view per cell, in one of four shapes, in session.views order. |
layoutViews(spec: LayoutSpecNode<LayoutViewRef>) => string[] |
Arrange the session's views into panels: applyLayoutSpec, then session.views ordered to the spec's top-to-bottom order, which tabs read their order from. Leaves take view ids or indexes into session.views; a layout that seats no view throws rather than leaving a blank tab. A session spec's layout and an agent's live re-layout both call it. |