Architecture
IIFE Build and Registration
Built as IIFE via Vite (see
vite.config.lib.ts). Entrysrc/index.ts, outputdist/index.iife.js.Registers itself with the Octopus host when the global becomes available.
Type declarations emitted under
dist/.
Runtime Data Flow
Either subscribes to new values (
tangoAttributessubscription) or polls HDB++ histories.Applies optional server-side downsampling and client-side throttling (
appendInterval).Bar view (
barView = true) reprojects traces into a matrix (attr × time).
Importing in octopus-frontend
Include
dist/index.iife.js; it auto-registers under keytimeline(label “Timeline”).
SDK Utilities
Chart plumbing shared with the graph widget is delegated to @ska-octopus-widget-sdk/widget-sdk:
canonicalAttr,parseMargins,buildAxisTitle— normalisation and formatting helpers; imported insrc/utils/utils.tsandsrc/hooks/useTimelineLayout.ts.formatLegendName,extractStationAndNumber— legend label resolution; re-exported fromsrc/utils/utils.ts.getPlotlyLegendConfig— returns Plotly legend anchor/orientation config for a named position;getLegendAndMargininsrc/legendUtils.tsadds timeline-specific margin values on top.
Full SDK API reference: WIDGET_SDK.md