ashish-sdk
Version:
ThoughtSpot Embed SDK
102 lines (101 loc) • 3.24 kB
TypeScript
/**
* Copyright (c) 2022
*
* Embed a ThoughtSpot Liveboard or visualization
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
*
* @summary Liveboard & visualization embed
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
*/
import { DOMSelector } from '../types';
import { V1Embed, ViewConfig } from './ts-embed';
/**
* The configuration for the embedded Liveboard or visualization page view.
* @Category Liveboards and Charts
*/
export interface LiveboardViewConfig extends ViewConfig {
/**
* If set to true, the embedded object container dynamically resizes
* according to the height of the Liveboard.
*/
fullHeight?: boolean;
/**
* This is the minimum height(in pixels) for a full height Liveboard.
* Setting this height helps resolves issues with empty Liveboards and
* other screens navigable from a Liveboard.
* @version 1.5.0 or later
* @default 500
*/
defaultHeight?: number;
/**
* If set to true, the context menu in visualizations will be enabled.
*/
enableVizTransformations?: boolean;
/**
* The Liveboard to display in the embedded view.
* Use either of liveboardId or pinboardId to reference the Liveboard to embed.
*/
liveboardId?: string;
/**
* To support backward compatibilty
* @hidden
*/
pinboardId?: string;
/**
* The visualization within the Liveboard to display.
*/
vizId?: string;
/**
* If set to true, all filter chips from a
* Liveboard page will be read-only (no X buttons)
*/
preventLiveboardFilterRemoval?: boolean;
/**
* To support backward compatibilty
* @hidden
*/
preventPinboardFilterRemoval?: boolean;
}
/**
* Embed a ThoughtSpot Liveboard or visualization
* @Category Liveboards and Charts
*/
export declare class LiveboardEmbed extends V1Embed {
protected viewConfig: LiveboardViewConfig;
private defaultHeight;
constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig);
/**
* Construct a map of params to be passed on to the
* embedded Liveboard or visualization.
*/
private getEmbedParams;
/**
* Construct the URL of the embedded ThoughtSpot Liveboard or visualization
* to be loaded within the iframe.
* @param liveboardId The GUID of the Liveboard.
* @param vizId The optional GUID of a visualization within the Liveboard.
* @param runtimeFilters A list of runtime filters to be applied to
* the Liveboard or visualization on load.
*/
private getIFrameSrc;
/**
* Set the iframe height as per the computed height received
* from the ThoughtSpot app.
* @param data The event payload
*/
private updateIFrameHeight;
private embedIframeCenter;
private setIframeHeightForNonEmbedLiveboard;
/**
* Render an embedded ThoughtSpot Liveboard or visualization
* @param renderOptions An object specifying the Liveboard ID,
* visualization ID and the runtime filters.
*/
render(): LiveboardEmbed;
}
/**
* @hidden
*/
export declare class PinboardEmbed extends LiveboardEmbed {
}