Interface#
The methods in the window.minerva.interface object control the side panels of MINERVA. At most one panel can be open at a time. Panel names:
'search'- search panel'project-info'- project information panel'export'- export panel'submaps'- submaps list panel'overlays'- overlays panel'overlay-group'- overlay group panel'available-plugins'- available plugins panel'layers'- layers panel'reaction'- reaction details panel'bio-entity'- bio-entity details panel'comment'- comment panel
The legend is not a panel, see Legend. Opening and closing panels triggers the onPanelOpen and onPanelClose events, see Events.
getOpenedPanel#
Returns the name of the currently open panel, or undefined if no panel is open.
Example of getOpenedPanel method usage:#
window.minerva.interface.getOpenedPanel(); // 'search', 'layers', undefined, ...hidePanel#
Closes the specified panel if it is currently open, or closes whichever panel is open when undefined is passed.
Example of hidePanel method usage:#
//close specific panel if the panel is opened
window.minerva.interface.hidePanel('available-plugins');
//close the panel (regardless which one is opened)
window.minerva.interface.hidePanel(undefined);openPanel#
Opens the specified panel. The 'reaction', 'bio-entity' and 'comment' panels show a single object, so they require a second argument with the id of the object to show:
'reaction'-{ reactionId: number }'bio-entity'-{ elementId: number }'comment'-{ commentId: number }
Called without the second argument, as in version 21, these panels are opened empty.
Example of openPanel method usage:#
window.minerva.interface.openPanel('available-plugins');
window.minerva.interface.openPanel('reaction', { reactionId: 15328 });
window.minerva.interface.openPanel('bio-entity', { elementId: 5053708 });
window.minerva.interface.openPanel('comment', { commentId: 42 });Deprecated panel names#
The following names accepted in version 21 are still accepted by openPanel and hidePanel, but getOpenedPanel never returns them:
'none'- closes whichever panel is open; usehidePanel(undefined)instead'plugins'- alias of'available-plugins';getOpenedPanel()reports the panel as'available-plugins''legend'-openPanel('legend')andhidePanel('legend')show and hide the legend; usewindow.minerva.legend.open()andclose()instead