@sigmacomputing/embed-sdk

0.5.0 • Public • Published

Getting Started

To use the embed-sdk in your project, you can install it using your node package manager.

Using npm:

npm install @sigmacomputing/embed-sdk

yarn:

yarn add @sigmacomputing/embed-sdk

pnpm:

pnpm add @sigmacomputing/embed-sdk

Documentation

Listeners

These are functions that can be used to listen for events from the embed, and react to them.

workbookLoadedListener

Listen for a workbook loaded event, and execute the given callback when it occurs.

workbookLoadedListener(event: MessageEvent, iframe: HTMLIFrameElement, onLoaded: (event: WorkbookLoadedEvent) => void)

workbookErrorListener

Listen for a workbook error event, and execute the given callback when it occurs.

workbookErrorListener(event: MessageEvent, iframe: HTMLIFrameElement, onError: (event: WorkbookErrorEvent) => void)

workbookVariableChangeListener

Listen for a workbook variable change event, and execute the given callback when it occurs.

workbookVariableChangeListener(event: MessageEvent, iframe: HTMLIFrameElement, onVariable: (event: WorkbookVariableOnChangeEvent) => void)

workbookVariableCurrentListener

Listen for a workbook variable current event, and execute the given callback when it occurs.

workbookVariableCurrentListener(event: MessageEvent, iframe: HTMLIFrameElement, onVariable: (event: WorkbookVariableCurrentEvent) => void)

workbookLinkSharingUpdateListener

Listen for a workbook sharing link update event, and execute the given callback when it occurs.

workbookLinkSharingUpdateListener(event: MessageEvent, iframe: HTMLIFrameElement, onVariable: (event: WorkbookSharingLinkUpdateEvent) => void)

workbookTableCellSelectListener

Listen for a table cell select event, and execute the given callback when it occurs.

workbookTableCellSelectListener(event: MessageEvent, iframe: HTMLIFrameElement, onTableCellSelect: (event: WorkbookTableCellSelectEvent) => void)

workbookPublishedListener

Listen for a workbook published event, and execute the given callback when it occurs.

workbookPublishedListener(event: MessageEvent, iframe: HTMLIFrameElement, onPublished: (event: WorkbookPublishedEvent) => void)

workbookFullScreenListener

Listen for a workbook full screen event, and execute the given callback when it occurs.

workbookFullScreenListener(event: MessageEvent, iframe: HTMLIFrameElement, onFullScreen: (event: WorkbookFullScreenEvent) => void)

workbookPageHeightListener

Listen for a workbook page height event, and execute the given callback when it occurs. Needs to be used with the responsive_height URL Parameter.

workbookPageHeightListener(event: MessageEvent, iframe: HTMLIFrameElement, onPageHeight: (event: WorkbookPageHeightEvent) => void)

workbookSelectedNodeListener

Listen for a workbook selected node event, and execute the given callback when it occurs.

workbookSelectedNodeListener(event: MessageEvent, iframe: HTMLIFrameElement, onPageSelectedNode: (event: WorkbookSelectedNodeEvent) => void)

workbookPivotTableCellSelectListener

Listen for a pivot table cell select event, and execute the given callback when it occurs.

workbookPivotTableCellSelectListener(event: MessageEvent, iframe: HTMLIFrameElement, onPivotTableCellSelect: (event: WorkbookPivotTableCellSelectEvent) => void)

workbookChartValueSelectListener

Listen for a chart value select event, and execute the given callback when it occurs.

workbookChartValueSelectListener(event: MessageEvent, iframe: HTMLIFrameElement, onChartValueSelect: (event: WorkbookChartValueSelectEvent) => void)

workbookCurrentVariablesListener

Listen for a workbook current variables event, and execute the given callback when it occurs. This is to be used when workbookVariablesList is called.

workbookCurrentVariablesListener(event: MessageEvent, iframe: HTMLIFrameElement, onCurrentVariables: (event: WorkbookCurrentVariablesEvent) => void)

workbookBookmarkCreateListener

Listen for a workbook bookmark create event, and execute the given callback when it occurs.

workbookBookmarkCreateListener(event: MessageEvent, iframe: HTMLIFrameElement, onBookmarkCreate: (event: WorkbookBookmarkOnCreateEvent) => void)

workbookDataLoadedListener

Listen for a workbook data loaded event, and execute the given callback when it occurs.

workbookDataLoadedListener(event: MessageEvent, iframe: HTMLIFrameElement, onWorkbookDataLoaded: (event: WorkbookDataLoadedEvent) => void)

workbookChartErrorListener

Listen for a workbook chart error event, and execute the given callback when it occurs.

workbookChartErrorListener(event: MessageEvent, iframe: HTMLIFrameElement, onChartError: (event: WorkbookChartErrorEvent) => void)

workbookExploreKeyOnChangeListener

Listen for a workbook explore key change event, and execute the given callback when it occurs.

workbookExploreKeyOnChangeListener(event: MessageEvent, iframe: HTMLIFrameElement, onExploreKeyOnChange: (event: WorkbookExploreKeyOnChangeEvent) => void)

workbookBookmarkOnChangeListener

Listen for a workbook bookmark change event, and execute the given callback when it occurs.

workbookBookmarkOnChangeListener(event: MessageEvent, iframe: HTMLIFrameElement, onBookmarkChange: (event: WorkbookBookmarkOnChangeEvent) => void)

urlOnChangeListener

Listen for a url change event, and execute the given callback when it occurs.

urlOnChangeListener(event: MessageEvent, iframe: HTMLIFrameElement, onUrlChange: (event: UrlOnChangeEvent) => void)

workbookIdOnChangeListener

Listen for a workbook id change event, and execute the given callback when it occurs.

workbookIdOnChangeListener(event: MessageEvent, iframe: HTMLIFrameElement, onWorkbookIdChange: (event: WorkbookIdOnChangeEvent) => void)

Mutations

These are functions that can be used to send messages to the embed. They may cause an event to be emitted from the embed.

workbookVariablesList

Send a message to the embed to list the current variables. This will cause a workbook:variables:current event to be emitted from the embed, and can be used with the workbookCurrentVariablesListener function.

workbookVariablesList(iframe: HTMLIFrameElement)

workbookVariablesUpdate

Send a message to the embed to update the variables.

workbookVariablesUpdate(iframe: HTMLIFrameElement, variables: Record<string, string>)

workbookSharingLinkUpdate

Send a message to the embed to update the sharing link.

workbookSharingLinkUpdate(iframe: HTMLIFrameElement, sharingLink: string | null, sharingExplorationLink?: string | null)

workbookBookmarkCreate

Send a message to the embed to create a bookmark.

workbookBookmarkCreate(iframe: HTMLIFrameElement, bookmark: WorkbookBookmarkCreateEvent)

workbookBookmarkUpdate

Send a message to the embed to update the current bookmark.

workbookBookmarkUpdate(iframe: HTMLIFrameElement)

workbookFullscreenUpdate

Send a message to the embed to toggle the fullscreen state of the given element.

workbookFullscreenUpdate(iframe: HTMLIFrameElement, nodeId: string | null)

workbookSelectedNodeIdUpdate

Send a message to the embed to update the selected element. Can be a pageId or elementId.

workbookSelectedNodeIdUpdate(iframe: HTMLIFrameElement, nodeId: string, nodeType: "element" | "page")

Readme

Keywords

Package Sidebar

Install

npm i @sigmacomputing/embed-sdk

Weekly Downloads

72

Version

0.5.0

License

MIT

Unpacked Size

58.1 kB

Total Files

7

Last publish

Collaborators

  • ayman-sigma
  • robarnold
  • rgdutta
  • madisonchamberlain
  • rwoollen
  • jlgale
  • jfranty
  • sigmaci
  • ktruong
  • donhcd
  • maxseiden
  • chukamattah
  • sigma-nathan-healey
  • pat-haimbaugh
  • owen-sigmacomputing
  • dmadelyn
  • yuchristina
  • kevinpham
  • pearce-sigma
  • jmhain
  • pballai
  • dinkarkhattar
  • mdevsigma
  • greg-at-sigma
  • turese
  • gsharoya
  • azule-lux
  • wtgjxj
  • nathansigma
  • alexisjohnson
  • hiranmaya
  • adityasigmacomputing
  • benjixd
  • dbronnik
  • ericbannatyne-sigma
  • anandnarayanan
  • mtoader
  • eranatsigma
  • dyoung_ncc
  • czhang_sigmacomputing
  • rudysigma
  • ezimanyi-sigma
  • sivadheeraj2
  • messerc
  • jhu_sigma
  • rjsigma
  • aakashpathak
  • yifeng-sigma
  • alexbiba
  • ankita.shankar
  • phillipwhite99
  • mansa_pabbaraju
  • terence.wils
  • yi-sigma
  • daisywang
  • cynthiashen
  • brett_b_at_sigma
  • wenxuan5
  • mwong-sigma
  • jaredspickard
  • moonero
  • muralisigma
  • hannahsigma
  • nicholaschandler
  • borissigma
  • diego-sigma
  • munteanuic
  • aarshinova
  • sharviln
  • sinanunan
  • yusufsigma
  • jonathanzhang53
  • aaron-sigma
  • rounaksalim95
  • vjeyaram
  • robinpille
  • guyatsigma
  • ncurrault
  • reitmr
  • tedbrakob
  • travisdickeysigma
  • maximus-sigma
  • ray.chen.sigma
  • jcheung-sigma
  • asadakram
  • haoxu-sigma
  • bohan_sigma
  • estellakarunia
  • samhv0
  • wessigma
  • vandit-sigma
  • peternandersson
  • purvilmehta
  • ryankwong
  • samirapatel
  • tifn
  • cgreybosh
  • liz425
  • aileensigma
  • matei_the_sigmanaut
  • rohan322
  • minhnle
  • yashsvisharma
  • gary-sigma
  • matt-bierman-sigma
  • jadefleishhacker
  • fanfan-sigma
  • jscherererer
  • olcawthorne
  • smoir
  • linusmt
  • ashnarya
  • slequar
  • ashishcha9211
  • angelafan
  • sigma-integrations
  • angshuman-sigma
  • ardaakmann
  • sahilsalim99
  • jackatsigma
  • montefern
  • ding-harrison
  • asingh888
  • tinocaersigma
  • curtiscastro
  • obashaw
  • christophermouri
  • abeljohnsigma
  • pa7-sigma
  • sigma-sherwin
  • voidd7
  • justineyuan
  • morriswan
  • siyaosigma
  • wil-sigma
  • vaibagra
  • mfpekala
  • acholmes
  • miguelsigma
  • mjones-sigma
  • foxhatleo
  • gsanford
  • john.yorke
  • hamishfrizzell
  • christinahuang
  • angel-sigma