ashish-sdk
Version:
ThoughtSpot Embed SDK
92 lines (91 loc) • 3.04 kB
TypeScript
/**
* Copyright (c) 2021
*
* Embed a ThoughtSpot pinboard or visualization
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
*
* @summary Pinboard & visualization embed
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
*/
import { DOMSelector } from '../types';
import { V1Embed, ViewConfig } from './ts-embed';
/**
* The configuration for the embedded pinboard or visualization page view.
* @Category Pinboards and Charts
*/
export interface PinboardViewConfig extends ViewConfig {
/**
* If set to true, the embedded object container dynamically resizes
* according to the height of the pinboard.
*/
fullHeight?: boolean;
/**
* This is the minimum height(in pixels) for a full height pinboard.
* Setting this height helps resolves issues with empty pinboards and
* other screens navigable from a pinboard.
* @default 500
* * _since 1.5.0_
*/
defaultHeight?: number;
/**
* If set to true, the context menu in visualizations will be enabled.
*/
enableVizTransformations?: boolean;
/**
* The pinboard to display in the embedded view.
*/
pinboardId: string;
/**
* The visualization within the pinboard to display.
*/
vizId?: string;
/**
* If set to true, all filter chips from a
* pinboard page will be read-only (no X buttons)
*/
preventPinboardFilterRemoval?: boolean;
/**
* An array of vizids which should be visible when this pinboard loads.
* The ids not in this array are hidden from the pinboard.
* _since: 1.6.0_
*/
pinboardVisibleVizs?: string[];
}
/**
* Embed a ThoughtSpot pinboard or visualization
* @Category Pinboards and Charts
*/
export declare class PinboardEmbed extends V1Embed {
protected viewConfig: PinboardViewConfig;
private defaultHeight;
constructor(domSelector: DOMSelector, viewConfig: PinboardViewConfig);
/**
* Construct a map of params to be passed on to the
* embedded pinboard or visualization.
*/
private getEmbedParams;
/**
* Construct the URL of the embedded ThoughtSpot pinboard or visualization
* to be loaded within the iframe.
* @param pinboardId The GUID of the pinboard.
* @param vizId The optional GUID of a visualization within the pinboard.
* @param runtimeFilters A list of runtime filters to be applied to
* the pinboard 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 handleRouteChangeFullHeightPinboard;
/**
* Render an embedded ThoughtSpot pinboard or visualization
* @param renderOptions An object specifying the pinboard ID,
* visualization ID and the runtime filters.
*/
render(): PinboardEmbed;
}