Skip to main content
Skip table of contents

Plugin API

Overview

Frontend Add-ons run in a sandboxed iframe, and all external interactions with the Seeq application must be done via the Plugin API. This API serves as the gateway for communication between your Add-on and Seeq's core functionality. Below, we'll provide detailed explanations of key functions within the Plugin API, as they are essential for creating powerful and interactive Add-ons.

Function

Description

Inputs

Outputs

pluginInfo

Gets information about the plugin.

None

PluginInfo

queryParam

Gets the value of an optional query parameter from the URL of a HomeScreen plugin.

None

string or undefined

isPresentationWorkbookMode

Checks if the workbench is in presentation mode.

None

boolean

isHeadlessRenderMode

Checks if the workbench is in headless render mode.

None

boolean

workbook

Gets the active workbook.

None

{ id: string; name: string; description: string; }

worksheet

Gets the active worksheet.

None

{ id: string; name: string; }

subscribeToCurrentWorkstep

Subscribes to receive the current workstep ID when it changes.

cb: WorkstepCallback

RemoveListener

subscribeToUserLanguage

Subscribes to receive the current user language when it changes.

cb: StringCallback

RemoveListener

subscribeToTimezone

Subscribes to receive the worksheet timezone when it changes.

cb: TimezoneCallback

RemoveListener

subscribeToDisplayRange

Subscribes to receive display range updates.

cb: DateRangeCallback

RemoveListener

subscribeToInvestigationRange

Subscribes to receive investigation range updates.

cb: DateRangeCallback

RemoveListener

subscribeToSignals

Subscribes to signals.

cb: TrendSignalArrayCallback

RemoveListener

subscribeToScalars

Subscribes to scalars.

cb: TrendScalarArrayCallback

RemoveListener

subscribeToConditions

Subscribes to conditions.

cb: TrendConditionArrayCallback

RemoveListener

subscribeToMetrics

Subscribes to metrics.

cb: TrendMetricArrayCallback

RemoveListener

subscribeToTables

Subscribes to tables.

cb: TrendTableArrayCallback

RemoveListener

setDisplayRange

Updates the display range start and end times.

start: number, end: number

void

setInvestigateRange

Updates the investigate range start and end times.

start: number, end: number

void

selectItem

Selects an item in the details pane or a capsule in the capsules pane.

id: string, selected: boolean

void

log

Logs a message that will be saved to the client.log.

severity: LogSeverity, message: string

void

setPluginState

Sets the plugin state.

pluginState: PluginState

void

subscribeToPluginState

Subscribes to plugin state updates.

cb: PluginStateCallback

RemoveListener

runFormula

Runs a Seeq Formula.

{ start: string; end: string; formula: string; _function: string; parameters: Object; fragments: Object; offset: number; limit: number; cancellationGroup: string; }

Promise<PluginResponse<FormulaRunOutput>>

fetchMetric

Fetches a metric.

id: string

Promise<PluginResponse<ThresholdMetricOutputV1>>

openUrl

Opens a user-provided Seeq URL in a new window.

url: string, windowFeatures: string

void

downloadContent

Downloads a provided file object.

file: File

void

setItemInLocalStorage

Sets a value in the browser local storage for the given key.

key: string, value: string

void

getItemFromLocalStorage

Gets the value from the browser local storage for the given key.

key: string

`Promise<string

subscribeToSelectedCapsules

Subscribes to selected capsules in the capsules pane.

cb: TrendCapsuleArrayCallback

RemoveListener

subscribeToCapsules

Subscribes to capsules in the capsules pane.

cb: TrendCapsuleArrayCallback

RemoveListener

setTrendDataStatusLoading

Sets the data status of an item in the details pane to loading.

id: string

void

setTrendDataStatusSuccess

Sets the data status of an item in the details pane to success.

results: DataStatusResults

void

pluginRenderComplete

Must be called by the plugin when it has completed its initial render of plugin content.

None

void

setPointerValues

Sets the x value and y values corresponding to where the mouse pointer is on the chart.

xValue: number, yValues: YValue[]

void

clearPointerValues

Clears the pointer x and y values from the details pane.

None

void

setYAxis

Sets the Axis Min and Axis Max values of an item in the details pane.

id: string, axisMin: number, axisMax: number

void

setYAxisAutoScale

Sets the Auto property of an item in the details pane.

id: string, autoScale: boolean

void

catchItemDataFailure

Handles non-success responses when fetching data for an item.

id: string, cancellationGroup: string, error: SeeqError

void

editNewFormula

Opens the formula tool for editing with the supplied formula and parameters.

formula: string, parameters: FormulaParameter[]

void

closeActiveTool

Closes the active investigate tool.

None

void

showDetailsPaneColumns

Shows details pane customization columns.

keys: DetailsPaneColumnKey[]

void

getLicensedFeature

Returns the details for the licensed feature that matches the specified name.

name: string

Promise<LicensedFeatureStatusOutputV1>

callSdkApi

Calls a Seeq SDK API endpoint. (Experimental)

{ path: string; method?: string; query?: Record<string, unknown>; body?: Record<string, unknown>; headers?: Record<string, unknown>; }

Promise<T>

callDataLabApi

Calls a Seeq Data Lab API endpoint.

{ projectId: string; notebookName: string; path: string; method?: string; query?: Record<string, unknown>; body?: Record<string, unknown>; headers?: Record<string, unknown>; }

Promise<T>

getDataLabProject

Returns the ID of the single Data Lab Project that matches the supplied name.

projectName: string

Promise<{ projectId: string }>

shouldProvideOrganizerVisualizationData()

If true, then the plugin is being rendered as part of capturing content for the Organizer.

None

Promise<boolean>

provideOrganizerVisualizationData(data)

Provides data to Organizer to be able to render the plugin. The last call to this will be the data that is used.

data: any

void

shouldLoadDataFromOrganizer()

If true, then the plugin is being rendered in Organizer and should load it's data from Organizer by calling loadDataFromOrganizer.

None

Promise<boolean>

loadDataFromOrganizer()

Loads the plugin data from Organizer. This will be the exact data was provided by the plugin via provideOrganizerVisualizationData.

None

Promise<any>

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.