plugin-api/PlotActionRegistry#
usePlotActionButtons()#
React hook that returns all registered plot action buttons, re-rendering on changes.
Returns#
PlotActionPriority#
const PlotActionPriority: {
Essential: 100;
Navigation: 10;
Passive: 5;
Primary: 70;
Secondary: 30;
Unspecified: 50;
};
Rail survival tiers. A short rail collapses the lowest priority first.
Essential— adjusted while reading any spectrum; collapses only once nothing else is left.Primary— analysis surfaces opened per sample rather than per glance.Unspecified— the default, including every plugin action: ranked below core analysis but above core one-shots, so a plugin lands mid-rail rather than at either extreme.Secondary— occasional or specialist tools and read-only records.Navigation— leaves the plot for another page, so the rail slot buys nothing that the overflow menu does not.Passive— a read-only record consulted when something looks wrong, neither a destination nor a tool that changes the spectrum; collapses first.
Type Declaration#
Essential#
Navigation#
Passive#
Primary#
Secondary#
Unspecified#
plotActionRegistry#
PlotActionBadgeProps#
Properties#
compact#
Icon-only rail: the badge overlays the button corner instead of trailing the label.
ctx#
PlotActionButtonDef#
Static definition for a plot action button (registered at module load time).
Properties#
badge?#
Status mark drawn on the button; renders null when there is nothing to show.
commandId?#
Base id of the plot command that does what this button does, nuclei.plot.<tool>. The
sidebar reads its key from the registry for the tooltip; nothing is typed here.
group?#
Optional visual group key for clustering buttons in the sidebar.
icon#
id#
isDisabled?#
Dynamic disabled state.
Parameters#
| Parameter | Type |
|---|---|
ctx |
PlotContext |
Returns#
boolean
isLoading?#
Dynamic loading state.
Parameters#
| Parameter | Type |
|---|---|
ctx |
PlotContext |
Returns#
boolean
isToggle?#
Whether this button acts as a toggle (active/inactive). Default: true.
kind?#
Interaction outcome; used to distinguish destinations, inspectors and view toggles.
onClick?#
A one-shot action: run on click in place of toggling a panel.
Parameters#
| Parameter | Type |
|---|---|
ctx |
PlotContext |
Returns#
void
operatorPage?#
Page an operator's policy must open for the action to show; other roles always see it.
order#
Sort order. Built-in buttons use 100–700.
panelComponent?#
optional panelComponent?: ComponentType<{
activePage: string;
onClose: () => void;
plotId: string | undefined;
}>;
For plugin buttons: panel component rendered in PopoutWindow when active.
panelConfig?#
PopoutWindow config (only used if panelComponent is set).
height#
title#
width#
windowId#
plotClickHandler?#
For plugin buttons: called when user clicks the plot while this button is active.
Parameters#
| Parameter | Type |
|---|---|
dataX |
number |
dataY |
number |
Returns#
void
priority?#
How long the button keeps its rail slot before collapsing into the overflow
menu; higher survives longer. See PlotActionPriority. Defaults to
PlotActionPriority.Unspecified.
tooltip#
visibilityCondition#
Parameters#
| Parameter | Type |
|---|---|
ctx |
PlotContext |
Returns#
boolean
PlotContext#
Context describing the current plot state, passed to visibility conditions.
Properties#
editLockReason?#
Why the loaded scan cannot be edited; empty or absent while it can.
experimentType#
The loaded scan's experiment, for an action that only makes sense on one kind of plane — a DOSY map needs a diffusion set, and cross-peaks mean nothing on a J-resolved plane whose F1 carries coupling rather than a second shift.
hasData#
is2D#
Whether the current VIEW draws a 2D plot (heatmap/contour trace present).
isContourPlot#
isData2D#
Whether the DATA is 2D, which the surface and ridge views render with 1D
trace types. An action whose backend rejects 2D data must gate on this, not
on is2D, or those views let a 2D scan reach a 1D endpoint.
isPhaseSensitive2D?#
2D only: the plane was recorded with a phase-sensitive F1 scheme, so it can be phased.
isRidgePlot#
isSpectrumPlot#
isSurface#
legendVisible#
Whether the plot legend is currently shown (plotSettings.legend.show).