import { HostEvent } from '@thoughtspot/visual-embed-sdk';
// Or
// const { HostEvent } = window.tsembed;
// create the liveboard embed.
liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
{ columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
]);
HostEvent
- Index
- Enumeration members
- AddColumns
- AskSage
- CopyLink
- CreateMonitor
- Delete
- Download
- DownloadAsCsv
- DownloadAsPdf
- DownloadAsPng
- DownloadAsXlsx
- DrillDown
- Edit
- EditTML
- Explore
- ExportTML
- GetAnswerSession
- GetFilters
- GetIframeUrl
- GetParameters
- GetTML
- GetTabs
- LiveboardInfo
- MakeACopy
- ManageMonitor
- ManagePipelines
- Navigate
- OpenFilter
- Pin
- Present
- Remove
- RemoveColumn
- ResetLiveboardPersonalisedView
- ResetSearch
- Save
- SaveAnswer
- Schedule
- SchedulesList
- Search
- SetActiveTab
- SetHiddenTabs
- SetVisibleTabs
- SetVisibleVizs
- Share
- ShowUnderlyingData
- SpotIQAnalyze
- SyncToOtherApps
- SyncToSheets
- UpdateCrossFilter
- UpdateFilters
- UpdateParameters
- UpdatePersonalisedView
- UpdateRuntimeFilters
- UpdateSageQuery
- UpdateTML
- getExportRequestForCurrentPinboard
Event types that can be triggered by the host application to the embedded ThoughtSpot app.
To trigger an event use the corresponding LiveboardEmbed.trigger or AppEmbed.trigger or SearchEmbed.trigger method.
If using React components to embed, use the format shown in this example:
const selectVizs = () => {
embedRef.current.trigger(HostEvent.SetVisibleVizs, [
"715e4613-c891-4884-be44-aa8d13701c06",
"3f84d633-e325-44b2-be25-c6650e5a49cf"
]);
};
You can also attach an Embed event to a Host event to trigger a specific action as shown in this example:
const EmbeddedComponent = () => {
const embedRef = useRef(null); // import { useRef } from react
const onLiveboardRendered = () => {
embedRef.current.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
};
return (
<LiveboardEmbed
ref={embedRef}
liveboardId="<liveboard-guid>"
onLiveboardRendered={onLiveboardRendered}
/>
);
}
Index🔗
Enumeration members🔗
AddColumns🔗
AddColumns:= "addColumns"
Add columns to the current search query.
Defined in : types.ts
Version : SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['<column-GUID>','<column-GUID>'] })
AskSage🔗
AskSage:= "AskSage"
Trigger Ask Sage for viz
Defined in : types.ts
Version : SDK: 1.29.0 | Thoughtspot: 9.12.0.cl
liveboardEmbed.trigger(HostEvent.AskSage,
{vizId:'730496d6-6903-4601-937e-2c691821af3c'})
CopyLink🔗
CopyLink:= "embedDocument"
Trigger the Copy link action on a Liveboard or visualization
Defined in : types.ts
Version : SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
- Parameter
-
object - to trigger the action for a specific visualization in Liveboard embed, pass in
vizId
as a key
liveboardEmbed.trigger(HostEvent.CopyLink)
liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
vizEmbed.trigger((HostEvent.CopyLink)
CreateMonitor🔗
CreateMonitor:= "createMonitor"
Trigger the Create alert action on a KPI chart in a Liveboard or saved Answer.
Defined in : types.ts
Version : SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
- Parameter
-
an object with
vizId
as a key
liveboardEmbed.trigger(HostEvent.CreateMonitor {
vizId: '730496d6-6903-4601-937e-2c691821af3c'
})
searchEmbed.trigger(HostEvent.CreateMonitor)
Delete🔗
Delete:= "onDeleteAnswer"
Trigger the Delete action for a visualization in an embedded Liveboard, or a chart or table generated from Search.
Defined in : types.ts
Version : SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
- Parameter
-
Liveboard embed takes an object with
vizId
as a key. Can be left empty if embedding Search or visualization.
liveboardEmbed.trigger(HostEvent.Delete, {vizId:
'730496d6-6903-4601-937e-2c691821af3c'})
searchEmbed.trigger(HostEvent.Delete)
Download🔗
Download:= "downloadAsPng"
Trigger the Download action on charts in the embedded view.
Defined in : types.ts
Version : SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
Deprecated : from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.swUse {@link DownloadAsPng}
liveboardEmbed.trigger(HostEvent.Download, {vizId:
'730496d6-6903-4601-937e-2c691821af3c'})
embed.trigger(HostEvent.Download)
DownloadAsCsv🔗
DownloadAsCsv:= "downloadAsCSV"
Trigger the Download > CSV action on tables in the embedded view.
Defined in : types.ts
Version : SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
'730496d6-6903-4601-937e-2c691821af3c'})
vizEmbed.trigger(HostEvent.DownloadAsCsv)
searchEmbed.trigger(HostEvent.DownloadAsCsv)
DownloadAsPdf🔗
DownloadAsPdf:= "downloadAsPdf"
Trigger the Download PDF action on an embedded Liveboard, visualization or Answer.
NOTE: The Download > PDF action is available on visualizations and Answers if the data is in tabular format.
Defined in : types.ts
Version : SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
DownloadAsPng🔗
DownloadAsPng:= "downloadAsPng"
Trigger the Download > PNG action on charts in the embedded view.
Defined in : types.ts
Version : SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
liveboardEmbed.trigger(HostEvent.DownloadAsPng,
{vizId:'730496d6-6903-4601-937e-2c691821af3c'})
vizEmbed.trigger(HostEvent.DownloadAsPng)
searchEmbed.trigger(HostEvent.DownloadAsPng)
DownloadAsXlsx🔗
DownloadAsXlsx:= "downloadAsXLSX"
Trigger the Download > XLSX action on tables in the embedded view.
Defined in : types.ts
Version : SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
'730496d6-6903-4601-937e-2c691821af3c'})
vizEmbed.trigger(HostEvent.DownloadAsXlsx)
searchEmbed.trigger(HostEvent.DownloadAsXlsx)
DrillDown🔗
DrillDown:= "triggerDrillDown"
Triggers a drill on certain points of the specified column Includes the following properties:
Defined in : types.ts
Version : SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
- Parameter
-
points - an object containing selectedPoints/clickedPoints to drill to. For example, { selectedPoints: []}
- Parameter
-
columnGuid - Optional. GUID of the column to drill by. If not provided it will auto drill by the configured column.
- Parameter
-
autoDrillDown - Optional. If true, the drill down will be done automatically on the most popular column.
- Parameter
-
vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill in case of a Liveboard.
searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
console.log(payload);
const clickedPoint = payload.data.clickedPoint;
const selectedPoint = payload.data.selectedPoints;
console.log('>>> called', clickedPoint);
searchEmbed.trigger(HostEvent.DrillDown, {
points: {
clickedPoint,
selectedPoints: selectedPoint
},
autoDrillDown: true,
});
})
// Works with TS 9.8.0 and above
liveboardEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
console.log(payload);
const clickedPoint = payload.data.clickedPoint;
const selectedPoint = payload.data.selectedPoints;
console.log('>>> called', clickedPoint);
liveboardEmbed.trigger(HostEvent.DrillDown, {
points: {
clickedPoint,
selectedPoints: selectedPoint
},
columnGuid: "<guid of the column to drill>",
vizId: payload.data.vizId
});
})
Edit🔗
Edit:= "edit"
Trigger the Edit action on a Liveboard or a visualization on a Liveboard.
This event is not supported in visualization embed and search embed.
Defined in : types.ts
Version : SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
- Parameter
-
object - To trigger the action for a specific visualization in Liveboard embed, pass in
vizId
as a key.
liveboardEmbed.trigger(HostEvent.Edit)
liveboardEmbed.trigger(HostEvent.Edit, {vizId:
'730496d6-6903-4601-937e-2c691821af3c'})