Skip to content

plugin-api/PlotActionRegistry#

usePlotActionButtons()#

function usePlotActionButtons(): PlotActionButtonDef[];

React hook that returns all registered plot action buttons, re-rendering on changes.

Returns#

PlotActionButtonDef[]


plotActionRegistry#

const plotActionRegistry: PlotActionRegistry;

PlotActionButtonDef#

Static definition for a plot action button (registered at module load time).

Properties#

group?#

optional group?: string;

Optional visual group key for clustering buttons in the sidebar.

icon#

icon: ComponentType<{
  fontSize?: "small" | "medium" | "inherit" | "large";
}>;

id#

id: string;

isDisabled?#

optional isDisabled?: (ctx) => boolean;

Dynamic disabled state.

Parameters#
Parameter Type
ctx PlotContext
Returns#

boolean

isLoading?#

optional isLoading?: (ctx) => boolean;

Dynamic loading state.

Parameters#
Parameter Type
ctx PlotContext
Returns#

boolean

isToggle?#

optional isToggle?: boolean;

Whether this button acts as a toggle (active/inactive). Default: true.

order#

order: number;

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?#

optional panelConfig?: {
  height: number;
  title: string;
  width: number;
  windowId: string;
};

PopoutWindow config (only used if panelComponent is set).

height#
height: number;
title#
title: string;
width#
width: number;
windowId#
windowId: string;

plotClickHandler?#

optional plotClickHandler?: (dataX, dataY) => void;

For plugin buttons: called when user clicks the plot while this button is active.

Parameters#
Parameter Type
dataX number
dataY number
Returns#

void

tooltip#

tooltip: string | ((ctx) => string);

visibilityCondition#

visibilityCondition: (ctx) => boolean;
Parameters#
Parameter Type
ctx PlotContext
Returns#

boolean


PlotContext#

Context describing the current plot state, passed to visibility conditions.

Properties#

hasData#

hasData: boolean;

is2D#

is2D: boolean;

isContourPlot#

isContourPlot: boolean;

isRidgePlot#

isRidgePlot: boolean;

isSpectrumPlot#

isSpectrumPlot: boolean;

isSurface#

isSurface: boolean;

legendVisible#

legendVisible: boolean;

Whether the plot legend is currently shown (plotSettings.legend.show).

overrideHandlerId#

overrideHandlerId: string;

plotId#

plotId: string | undefined;

referenceFrequencyHz#

referenceFrequencyHz: number | undefined;

solventDisplayName#

solventDisplayName: string | null;