import { EmbedEvent } from '@thoughtspot/visual-embed-sdk';
// Or
// const { EmbedEvent } = window.tsembed;
// create the liveboard embed.
liveboardEmbed.on(EmbedEvent.Drilldown, (drilldown) => {
console.log('Drilldown event', drilldown);
}));
EmbedEvent
- Index
- Enumeration members
- ALL
- AddRemoveColumns
- AddToFavorites
- Alert
- AnswerChartSwitcher
- AnswerDelete
- AskSageInit
- AuthExpire
- AuthInit
- Cancel
- CopyAEdit
- CopyLink
- CopyToClipboard
- CreateConnection
- CreateLiveboard
- CreateModel
- CreateWorksheet
- CrossFilterChanged
- CustomAction
- Data
- DataSourceSelected
- Delete
- DeletePersonalisedView
- DialogClose
- DialogOpen
- Download
- DownloadAsCsv
- DownloadAsPdf
- DownloadAsPng
- DownloadAsXlsx
- DrillExclude
- DrillInclude
- Drilldown
- Edit
- EditTML
- Error
- Explore
- ExportTML
- FilterChanged
- GetDataClick
- Init
- LastPromptDeleted
- LastPromptEdited
- LiveboardInfo
- LiveboardRendered
- Load
- MakeACopy
- NoCookieAccess
- OnBeforeGetVizDataIntercept
- OrgSwitched
- ParameterChanged
- Pin
- Present
- PreviewSpotterData
- QueryChanged
- Rename
- ResetLiveboard
- ResetSpotterConversation
- RouteChange
- SageEmbedQuery
- SageWorksheetUpdated
- Save
- SaveAsView
- SavePersonalisedView
- Schedule
- SchedulesList
- Share
- ShowUnderlyingData
- SpotIQAnalyze
- SpotterData
- SpotterInit
- SpotterQueryTriggered
- TableVizRendered
- UpdateConnection
- UpdatePersonalisedView
- UpdateTML
- VizPointClick
- VizPointDoubleClick
- VizPointRightClick
Event types emitted by the embedded ThoughtSpot application.
To add an event listener use the corresponding LiveboardEmbed.on or AppEmbed.on or SearchEmbed.on method.
If you are using React components for embedding, you can register to any
events from the EmbedEvent
list by using the on<EventName>
convention.
For example,onAlert
, onCopyToClipboard
and so on.
// ...
const MyComponent = ({ dataSources }) => {
const onLoad = () => {
console.log(EmbedEvent.Load, {});
};
return (
<SearchEmbed
dataSources={dataSources}
onLoad = {logEvent("Load")}
/>
);
};
Index🔗
Enumeration members🔗
ALL🔗
ALL:= "*"
Emits all events.
Defined in : types.ts
Version : SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
appEmbed.on(EmbedEvent.ALL, payload => {
console.log('Embed Events', payload)
})
AddRemoveColumns🔗
AddRemoveColumns:= "addRemoveColumns"
One or more data columns have been selected.
Defined in : types.ts
Version : SDK: 1.10.0 | ThoughtSpot: 8.2.0.cl, 8.4.1.sw
returns
: columnIds - the list of columns
appEmbed.on(EmbedEvent.AddRemoveColumns, payload => {
console.log('AddRemoveColumns', payload);
})
AddToFavorites🔗
AddToFavorites:= "addToFavorites"
Emitted when a user clicks on the Favorite icon on a Liveboard
Defined in : types.ts
Version : SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
liveboardEmbed.on(EmbedEvent.AddToFavorites, payload => {
console.log('favorites', payload);
})
Alert🔗
Alert:= "alert"
The embedded object has sent an alert.
Defined in : types.ts
Version : SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
returns
: alert - An alert object
searchEmbed.on(EmbedEvent.Alert)
AnswerChartSwitcher🔗
AnswerChartSwitcher:= "answerChartSwitcher"
Emitted when an Answer is switched to a chart or table view.
Defined in : types.ts
Version : SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
searchEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
console.log('switch view', payload);
})
AnswerDelete🔗
AnswerDelete:= "answerDelete"
Emitted when an Answer is deleted in the app
Defined in : types.ts
Version : SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
//emit when action starts
appEmbed.on(EmbedEvent.AnswerDelete, payload => {
console.log('delete answer', payload)}, {start: true })
//trigger when action is completed
appEmbed.on(EmbedEvent.AnswerDelete, payload => {
console.log('delete answer', payload)})
AskSageInit🔗
AskSageInit:= "AskSageInit"
Emitted when the Ask Sage is initialized.
Defined in : types.ts
Version : SDK : 1.29.0 | ThoughtSpot Cloud: 9.12.0.cl
returns
: viewName: string
returns
: viewId: string
returns
: liveboardId: string
returns
: isPublic: boolean
AuthExpire🔗
AuthExpire:= "ThoughtspotAuthExpired"
The ThoughtSpot authentication session has expired.
Defined in : types.ts
Version : SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 8.4.1.sw
appEmbed.on(EmbedEvent.AuthExpire, showAuthExpired)
//show auth expired banner
function showAuthExpired() {
document.getElementById("authExpiredBanner");
}
AuthInit🔗
AuthInit:= "authInit"
Authentication has either succeeded or failed.
Defined in : types.ts
Version : SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
appEmbed.on(EmbedEvent.AuthInit, payload => {
console.log('AuthInit', payload);
})
returns
: isLoggedIn - A Boolean specifying whether authentication was successful.
Cancel🔗
Cancel:= "cancel"
Emitted when a user clicks Cancel in edit mode on a Liveboard
Defined in : types.ts
Version : SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
liveboardEmbed.on(EmbedEvent.Cancel)
CopyAEdit🔗
CopyAEdit:= "copyAEdit"
Emitted when the user creates a copy of an Answer.
Defined in : types.ts
Version : SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
//emit when action starts
appEmbed.on(EmbedEvent.CopyAEdit, payload => {
console.log('Copy and edit', payload)}, {start: true })
//emit when action ends
appEmbed.on(EmbedEvent.CopyAEdit, payload => {
console.log('Copy and edit', payload)})
CopyLink🔗
CopyLink:= "embedDocument"
Emitted when a user clicks Copy link action on a visualization.
Defined in : types.ts
Version : SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
liveboardEmbed.on(EmbedEvent.CopyLink, {
vizId: '730496d6-6903-4601-937e-2c691821af3c'})
CopyToClipboard🔗
CopyToClipboard:= "context-menu-item-copy-to-clipboard"
Emitted when a column value is copied in the embedded app.
Defined in : types.ts
Version : SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
seachEmbed.on(EmbedEvent.CopyToClipboard, payload => {
console.log('copy to clipboard', payload);
})
CreateConnection🔗
CreateConnection:= "createConnection"
Emitted when a user updates a connection on the Data page
Defined in : types.ts
Version : SDK : 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
CreateLiveboard🔗
CreateLiveboard:= "createLiveboard"
Emitted when the liveboard is created from pin modal or Liveboard list page. You can use this event as a hook to trigger other events on liveboard creation.
liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
console.log('payload', payload);
})
Defined in : types.ts
Version : SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl
CreateModel🔗
CreateModel:= "createModel"
Emitted when a user creates a Model.
Defined in : types.ts
Version : SDK : 1.37.0 | ThoughtSpot: 10.8.0.cl
CreateWorksheet🔗
CreateWorksheet:= "createWorksheet"
Emitted when a user creates a Worksheet.
Defined in : types.ts
Version : SDK : 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
CrossFilterChanged🔗
CrossFilterChanged:= "cross-filter-changed"
Emitted when a user interacts with cross filters on a visualization or Liveboard.
Defined in : types.ts
Version : SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.5.0.sw
liveboardEmbed.on(EmbedEvent.CrossFilterChanged, {
vizId: '730496d6-6903-4601-937e-2c691821af3c'})
CustomAction🔗
CustomAction:= "customAction"
A custom action has been triggered.
Defined in : types.ts
Version : SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
returns
: actionId - ID of the custom action
returns
: payload CustomActionPayload - Response payload with the
Answer or Liveboard data
appEmbed.on(EmbedEvent.customAction, payload => {
const data = payload.data;
if (data.id === 'insert Custom Action ID here') {
console.log('Custom Action event:', data.embedAnswerData);
}
})
Data🔗
Data:= "data"
Data pertaining to an Answer or Liveboard is received. The event payload includes the raw data of the object.
Defined in : types.ts
Version : SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
returns
: data - Answer of Liveboard data
liveboardEmbed.on(EmbedEvent.Data, payload => {
console.log('data', payload);
})