SageEmbed
Embed ThoughtSpot LLM and GPT-based Natural Language Search component.
version:
: SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.1-sw
Index🔗
Constructors🔗
new SageEmbed(domSelector: DOMSelector , viewConfig: SageViewConfig ) : SageEmbed
Function Parameters
- domSelector
-
-
domSelector: DOMSelector
-
- viewConfig
-
-
viewConfig: SageViewConfig
-
Returns
Defined in : embed/sage.ts
Overrides V1Embed.constructor
Methods🔗
destroy🔗
destroy() : void
Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
Returns
void
Version : SDK: 1.19.1 | ThoughtSpot: *
Defined in : embed/ts-embed.ts
Inherited from V1Embed.destroy
getAnswerService🔗
getAnswerService(vizId?: string ) : Promise< AnswerService >
Returns the answerService which can be used to make arbitrary graphql calls on top session.
Function Parameters
- vizId
-
Optional
-
vizId: string
-
to get for a specific viz in case of a liveboard.
Returns
Promise< AnswerService >
Version : SDK: 1.25.0 / ThoughtSpot 9.10.0
Defined in : embed/ts-embed.ts
Inherited from V1Embed.getAnswerService
getIFrameSrc🔗
getIFrameSrc() : string
Construct the URL of the embedded ThoughtSpot sage to be loaded in the iframe
Returns
string
Defined in : embed/sage.ts
getIframeSrc🔗
getIframeSrc() : string
Returns
string
Defined in : embed/ts-embed.ts
Inherited from V1Embed.getIframeSrc
getPreRenderIds🔗
getPreRenderIds() : {child?: string = …​, wrapper?: string = …​}
Retrieves unique HTML element IDs for PreRender-related elements. These IDs are constructed based on the provided 'preRenderId' from 'viewConfig'.
Returns
{child?: string = …​, wrapper?: string = …​}
property
: {string} wrapper - The HTML element ID for the PreRender wrapper.
property
: {string} child - The HTML element ID for the PreRender child.
Defined in : embed/ts-embed.ts
Inherited from V1Embed.getPreRenderIds
getThoughtSpotPostUrlParams🔗
getThoughtSpotPostUrlParams(additionalParams?: {[key: string ] : string | number} = {}) : string
Get the Post Url Params for THOUGHTSPOT from the current host app URL. THOUGHTSPOT URL params starts with a prefix "ts-"
Function Parameters
- additionalParams
-
-
additionalParams: {[key: string ] : string | number} = {}
-
Index Signature Parameters
Returns
string
Version : SDK: 1.14.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
Defined in : embed/ts-embed.ts
Inherited from V1Embed.getThoughtSpotPostUrlParams
getUnderlyingFrameElement🔗
getUnderlyingFrameElement() : HTMLIFrameElement
Returns
HTMLIFrameElement
Defined in : embed/ts-embed.ts
Inherited from V1Embed.getUnderlyingFrameElement
hidePreRender🔗
hidePreRender() : void
Hides the PreRender component if it is available. If the component is not preRendered, it issues a warning.
Returns
void
Defined in : embed/ts-embed.ts
Inherited from V1Embed.hidePreRender
off🔗
off(messageType: EmbedEvent , callback: MessageCallback ) : TsEmbed
Removes an event listener for a particular event type.
Function Parameters
- messageType
-
-
messageType: EmbedEvent
-
The message type
- callback
-
-
callback: MessageCallback
-
The callback to remove
Returns
TsEmbed
const errorHandler = (data) => { console.error(data); };
tsEmbed.on(EmbedEvent.Error, errorHandler);
tsEmbed.off(EmbedEvent.Error, errorHandler);
Defined in : embed/ts-embed.ts
Inherited from V1Embed.off
on🔗
on(messageType: EmbedEvent , callback: MessageCallback , options?: MessageOptions = …​) : TsEmbed
Function Parameters
- messageType
-
-
messageType: EmbedEvent
-
- callback
-
-
callback: MessageCallback
-
- options
-
-
options: MessageOptions = …​
-
Returns
TsEmbed
tsEmbed.on(EmbedEvent.Error, (data) => {
console.error(data);
});
tsEmbed.on(EmbedEvent.Save, (data) => {
console.log("Answer save clicked", data);
}, {
start: true // This will trigger the callback on start of save
});
Defined in : embed/ts-embed.ts
Inherited from V1Embed.on
preRender🔗
preRender(showPreRenderByDefault?: boolean = false) : TsEmbed
Creates the preRender shell
Function Parameters
- showPreRenderByDefault
-
-
showPreRenderByDefault: boolean = false
-
Show the preRender after render, hidden by default
Returns
TsEmbed
Defined in : embed/ts-embed.ts
Inherited from V1Embed.preRender
prerenderGeneric🔗
prerenderGeneric() : Promise< any >
Prerenders a generic instance of the TS component. This means without the path but with the flags already applied. This is useful for prerendering the component in the background.
Returns
Promise< any >
Version : SDK: 1.22.0
Defined in : embed/ts-embed.ts
Inherited from V1Embed.prerenderGeneric
render🔗
render() : Promise< SageEmbed >
Render the embedded ThoughtSpot Sage
Returns
Promise< SageEmbed >
Defined in : embed/sage.ts
Overrides V1Embed.render
showPreRender🔗
showPreRender() : void
Displays the PreRender component. If the component is not preRendered, it attempts to create and render it. Also, synchronizes the style of the PreRender component with the embedding element.
Returns
void
Defined in : embed/ts-embed.ts
Inherited from V1Embed.showPreRender
syncPreRenderStyle🔗
syncPreRenderStyle() : void
Synchronizes the style properties of the PreRender component with the embedding element. This function adjusts the position, width, and height of the PreRender component to match the dimensions and position of the embedding element.
Returns
void
throws
: {Error} Throws an error if the embedding element (passed as domSelector)
is not defined or not found.
Defined in : embed/ts-embed.ts
Inherited from V1Embed.syncPreRenderStyle
trigger🔗
trigger(messageType: HostEvent , data?: any = {}) : Promise< any >
Triggers an event to the embedded app
Function Parameters
- messageType
-
-
messageType: HostEvent
-
The event type
- data
-
-
data: any = {}
-
The payload to send with the message
Returns
Promise< any >
Defined in : embed/ts-embed.ts
Inherited from V1Embed.trigger