SDK Surface Map

This page answers: “What can I use from the SDK?”

For full signatures and one-line descriptions of every export, see WIDGET_SDK.md.

Main Export Groups

Group

Use It For

Key Exports

Widget definition

Registering widgets and deriving config fields

makeWidgetDef, deriveConfigFields

Data hooks

GraphQL stream, polling, and mutation workflows

useStream, usePolling, useMutation, useStreamHistory

Host state hooks

Reading shared dashboard state

useBrush, useVariables, useWorkspace, useUserTimeRange, useEffectiveTimeRange, useWidgetRefreshRate, useWidgetLayout, useThemeMode, useHostVariables, useReplayMode, useRoleLevelAccess, useWidgetConfigPersistence

Config helpers

Schema shortcuts and input formatting

INPUT_*, WORKSPACES/VARIABLES, formatInputFormattedTemplate

Table toolkit

Shared table rendering and table state

InteractiveTable, useInteractiveTableState, fitColumnWidths, normalizeColumnOrder, normalizeColumnWidths

UI components

Standardized status and empty/error UI

DataLoadFailed, NoResults, RefreshingBadge, CommandResultAlert, StateChip, HoverCard, BaseSunburst, HoverPortal

Plotly utilities

Responsive Plotly charts with consistent theming

canonicalAttr, buildAxisTitle, parseMargins, formatLegendName, dedupeLegendLabels, getPlotlyLegendConfig, applyVerticalColorRanking, readTheme, ThemeVars, usePlotlyResize, useThemeObserver

Utilities

Expression parsing, brush parsing, normalization

parseBrush, makeMatcher, tokenize, parse, buildMatcher, parseExpression, evaluateExpression, tango input helpers

Dev + testing

Local host simulation and test mocks

createMockHost, DevProviders, @ska-octopus-widget-sdk/widget-sdk/testing

Common Import Patterns

Definition + schema shortcuts

import {
  makeWidgetDef,
  INPUT_TANGO_ATTRIBUTES,
  INPUT_FORMATED_SCHEMA_TYPE,
  WORKSPACES,
  VARIABLES,
} from "@ska-octopus-widget-sdk/widget-sdk";

Data + global state

import {
  useStream,
  useWidgetRefreshRate,
  useBrush,
  useVariables,
  useWorkspace,
} from "@ska-octopus-widget-sdk/widget-sdk";

Table-heavy widgets

import {
  InteractiveTable,
  StateChip,
  useInteractiveTableState,
  fitColumnWidths,
} from "@ska-octopus-widget-sdk/widget-sdk";

Plotly chart widgets

import {
  usePlotlyResize,
  useThemeObserver,
  canonicalAttr,
  buildAxisTitle,
  parseMargins,
  formatLegendName,
  dedupeLegendLabels,
  getPlotlyLegendConfig,
  applyVerticalColorRanking,
} from "@ska-octopus-widget-sdk/widget-sdk";

Local dev + tests

import { createMockHost, DevProviders } from "@ska-octopus-widget-sdk/widget-sdk";
import { installSdkWidgetTestMocks } from "@ska-octopus-widget-sdk/widget-sdk/testing";

Next Pages