import { JumpNS } from './JumpNS'; export * from './JumpNS'; /** * The basic option to create a WynBI instance. */ export type WynBIOption = { /** * The web address of your wyn server. */ baseUrl: string; /** * The access token. the token is generated from the Admin portal. */ token: string; /** * Set the key name used in query parameters, this name is configured in the Wyn config file.\ * If `tokenKey` is not specified, the default value `'token'` is used. * @example * tokenKey: 'tkn', */ tokenKey?: string; /** * Set if the token should be sent in the request header instead of the query parameter. * default value: false * @example * useTokenInHeader: true, */ useTokenInHeader?: boolean; }; /** * The default properties of DashboardDesignerInitOption. */ export type DashboardDesignerDefaults = { /** * The dashboard click actions. */ clickAction?: string; /** * The dashboard container filter scope. */ containerFilterScope?: string; /** * The dashboard context menu actions */ contextMenuActions?: string; /** * The dashboard id. */ dashboardId?: string; /** * The dashboard dataset id. */ datasetId?: string; /** * The dashboard document theme id. */ documentThemeId?: string; /** * The dashboard parameters. */ dp?: object | string; /** * Enable developer mode for custom visual dev tools. */ enableDeveloperMode?: boolean; /** * The language of the user interface. */ lng?: string; /** * The setting of dashboard notification time. */ notificationTime?: number; /** * The id create dashboard with dashboard document. */ templateId?: string; /** * The id create dashboard with dashboard template. */ dbdTemplateId?: string; /** * The dashboard theme. */ theme?: string; }; /** * The features properties of DashboardDesignerInitOption. */ export type DashboardDesignerFeatures = { /** * Define the action bar action white list. */ actionbarItems?: string[]; /** * Control which component categories are available in the designer. */ componentCategories?: string[]; /** * Control the animation enabled. */ disableAnimation?: boolean; /** * Control whether the user can change the binding dataset of the scenario. */ disableChangeDataset?: boolean; /** * Control the visibility of the close button. */ showCloseButton?: boolean; /** * Control the visibility of the designer's data binding panel. */ showDataBindingPanel?: boolean; /** * Control the visibility of the help button. */ showHelpButton?: boolean; /** * Control the visibility of the designer inspector. */ showInspector?: boolean; /** * Control the visibility of the inspector when open. */ showInspectorWhenOpen?: boolean; /** * Control the visibility of the mobile designer. */ showMobileDesigner?: boolean; /** * Control the visibility of the panel when open. */ showPanelWhenOpen?: boolean; /** * Control the visibility of the wizard. */ showWizard?: boolean; /** * Control the visibility of the toolbar. */ toolbar?: 'show' | 'hide'; /** **Save As** dialog settings */ saveAsDialog: { /** * Specifies whether it is possible to set categories.\ * By default this feature is **enabled**. * @example * designerOptions.saveAsDialog.canSetCategories = false; */ canSetCategories: boolean; /** * Specifies whether it is possible to set comment.\ * By default this feature is **enabled**. * @example * designerOptions.saveAsDialog.canSetComment = false; */ canSetComment: boolean; }; }; /** * The options of initializing a dashboard designer. */ export type DashboardDesignerInitOption = { /** * A DOM element used to mount the dashboard designer. */ container?: Element; /** * Default options of initializing a dashboard designer. */ defaults?: DashboardDesignerDefaults; /** * Features options of initializing a dashboard designer. */ features?: DashboardDesignerFeatures; /** * This is a callback function, it will be invoked after the designer mounted. */ onMount?: () => void; /** * This is a callback function, it will be invoked when the designer is closed. */ onClose?: () => void; /** * This is a callback function, it will be invoked when users save a document . */ onSave?: (docName: string, id: string) => void; /** * This is a callback function, it will be invoked after the designer loaded. */ onLoaded?: (docName: string) => void; /** * This is a callback function, it will be invoked when the document has any error message. */ onError?: (errorInfo: object) => void; /** * Invoked when custom jump is triggered. */ onCustomJump?: (options: JumpNS.ICustomJumpOptions) => void; }; /** * The options of saving the current document. */ export type DocumentSaveOption = { /** * Specify a name for the current document. */ name?: string; /** * Add a comment for the current document. */ comment?: string; /** * Specify categories for the current document. */ categories?: Array; /** * Publish the current document when the server enables the draft function. */ shouldPublish?: boolean; }; /** * The options of whether synchronizing the state changes or not. */ export type DocumentSyncOption = { /** * If there are some state changes in the preview, the designer will show the sync dialog. Use this parameter to synchronize changes to the current document and to control the visibility of the sync dialog. */ syncChanges?: boolean; }; export declare const enum DesignerEventType { /** * Dashboard designer close event */ Close = "close", /** * Dashboard designer loading complete event */ Loaded = "loaded", /** * Dashboard designer rendering complete event */ Rendered = "rendered", /** * Dashboard designer error event */ Error = "error", /** * Dashboard document save complete event */ Saved = "saved", /** * Enter the preview state event */ PreviewEntered = "previewEntered", /** * Exit preview state event */ PreviewExited = "previewExited", /** * Enter the mobile view event */ MobileViewEntered = "mobileViewEntered", /** * Exit mobile view event */ MobileViewExited = "mobileViewExited", /** * Property panel display event */ InspectorShown = "inspectorShown", /** * Property panel hidden event */ InspetorHidden = "inspetorHidden", /** * Data binding panel display event */ DatabindingPanelShown = "databindingPanelShown", /** * Data binding panel hidden event */ DatabindingPanelHidden = "databindingPanelHidden" } /** * The default properties of DashboardViewerInitOptions. */ export type DashboardViewerDefaults = { /** * The dashboard id. */ dashboardId: string; /** * The dashboard click actions. */ clickAction?: string; /** * The dashboard container filter scope. */ containerFilterScope?: string; /** * The dashboard context menu actions */ contextMenuActions?: string; /** * The dashboard document theme id. */ documentThemeId?: string; /** * The dashboard parameters. */ dp?: object | string; /** * Hide all dashboard error notifications. */ hideErrors?: boolean; /** * The language of the user interface. */ lng?: string; /** * The setting of dashboard notification time. */ notificationTime?: number; /** * The viewer page number starts from 1. */ pageNumber?: string; /** * The single scenario name. */ scenario?: string; /** * The mode for opening the full dashboard when integration single scenario. */ openfulldashboardmode?: 'newWindow' | 'redirect' | 'none'; /** * Set the display mode of the dashboard in the viewer */ size?: 'fitheight' | 'fittoheight' | 'fitwidth' | 'fittowidth' | 'fitscreen' | 'fittoscreen' | 'auto'; /** * Show scenario title only when do single scenario integration. */ showScenarioTitle?: boolean; /** * The dashboard theme. */ theme?: string; }; /** * The features properties of DashboardViewerInitOptions. */ export type DashboardViewerFeatures = { /** * Define the action bar action white list. */ actionbarItems?: string[]; /** * Control the animation enabled. */ disableAnimation?: boolean; /** * Control the autoscroll enabled. */ disableAutoScroll?: boolean; /** * Control the auto switch page enabled. */ disableAutoSwitchPage?: boolean; /** * Control the hidden toolbar action items. */ hideToolbarActions?: string[]; /** * Enable to set default variant or not. */ enableSetDefaultVariant?: boolean; }; /** * The options of initializing a dashboard standard viewer. */ export type DashboardViewerInitOption = { /** * A DOM element used to mount the dashboard standard viewer. */ container?: Element; /** * Default options of initializing a dashboard standard viewer. */ defaults?: DashboardViewerDefaults; /** * Features options of initializing a dashboard standard viewer. */ features?: DashboardViewerFeatures; /** * Invoked after the designer mounted. */ onMount?: () => void; /** * Invoked when the designer is closed. */ onClose?: () => void; /** * Invoked after the designer loaded. */ onLoaded?: (docName: string, id: string) => void; /** * Invoked after the designer rendered. */ onRendered?: (docName: string) => void; /** * Invoked when the document has any error message. */ onError?: (errorInfo: object) => void; /** * Invoked when custom jump is triggered. */ onCustomJump?: (options: JumpNS.ICustomJumpOptions) => void; }; /** * The supported data source types for the viewer draw-by-API workflow. */ export type DataSourceType = 'serverData' | 'embeddedData'; /** * A scalar value used by embedded data. */ export type EmbeddedDataValue = string | number | boolean; /** * Embedded data in column-oriented form keyed by field display name. * All arrays should represent rows in the same order and have the same length. */ export type IEmbeddedColumnData = { [fieldName: string]: Array; }; /** * Embedded data in row-oriented form. */ export type IEmbeddedRowData = Array<{ [fieldName: string]: EmbeddedDataValue; }>; /** * Embedded data accepted by `setDataBinding`. */ export type IEmbeddedData = IEmbeddedColumnData | IEmbeddedRowData; /** * A field binding definition for a dashboard data role. * Use a string when only the field display name is required. * Use the object form when an aggregation method or explicit display name is needed. */ export interface IDataBindingField { /** * The field name or display name used to resolve the source field. */ name: string; /** * The display name shown in the dashboard field well. */ displayName?: string; /** * The aggregation method used for the field, for example `sum`. */ method?: string; } /** * The role-to-field mapping used by `setDataBinding`. * Role names should match the data roles exposed by the target visual, for example * `Category`, `Series`, or `Values`. */ export type IDataBinding = { [dataRole: string]: Array; }; /** * The options of binding server data or embedded data to a visual added in viewer mode. */ export interface IDataBindingOption { /** * The data source type used by the visual. * Use `serverData` for an existing dataset or data model on the Wyn server. * Use `embeddedData` for client-provided in-memory data. */ dataSourceType: DataSourceType; /** * The dataset or semantic model id when `serverData` is used. */ dataId?: string; /** * The role binding information of the visual. */ dataBinding: IDataBinding; /** * The embedded data payload. * It can be provided in column-oriented form keyed by field display name, * or in row-oriented form as an array of records. * This property is used when the data source type is `embeddedData`. */ data?: IEmbeddedData; } /** * The built-in visual types that can be added by the viewer draw-by-API workflow. * Use a custom visual name string when the visual was created by a plugin author. */ export declare enum VisualType { Column = "column", StackedColumn = "stackedColumn", PercentStackedColumn = "percentStackedColumn", RangeColumn = "rangeColumn", Bar = "bar", StackedBar = "stackedBar", PercentStackedBar = "percentStackedBar", RangeBar = "rangeBar", Line = "line", Area = "area", StackedArea = "stackedArea", PercentStackedArea = "percentStackedArea", RangeArea = "rangeArea", Pie = "pie", Donut = "donut", Rose = "rose", RadialStackedBar = "radialStackedBar", StackedBarInPolar = "stackedBarInPolar", Sunburst = "sunburst", BarInPolar = "barInPolar", Radar = "radar", FilledRadar = "filledRadar", Scatter = "scatter", Bubble = "bubble", TreeMap = "treeMap", Combined = "combined", Funnel = "funnel", Gauge = "gauge", Indicator = "indicator", KPI = "KPI", PivotTable = "pivotTable", DataTable = "dataTable", KpiMatrix = "kpiMatrix", Map = "map", FloorPlan = "floorPlan", Candlestick = "candlestick", KpiKanban = "KpiKanban", LiquidFillGauge = "LiquidFillGauge", EchartsColumn = "echarts-column", EchartsLine = "echarts-line", EchartsPie = "echarts-pie", EchartsBubble = "echarts-bubble", EchartsRadar = "echarts-radar", EchartsCombined = "echarts-combined", EchartsFunnel = "echarts-funnel", EchartsTreemap = "echarts-treemap", EchartsGauge = "echarts-gauge", EchartsWordCloud = "echarts-wordcloud", EchartsCandlestick = "echarts-candlestick", EchartsColumn3D = "echarts-column3D", EchartsPolar = "echarts-polar", L7AreaMap = "AreaMap", L73DBarMap = "3DBarMap", L7BubbleMap = "BubbleMap", L7HeatmapMap = "HeatmapMap", L7FlowLineMap = "FlowLineMap", DecompositionTree = "DecompositionTree", DataFilter = "DataFilter", L7SymbolMap = "SymbolMap", L7CombinedMap = "CombinedMap", BasicGraphicRect = "BasicGraphic-Rect", BasicGraphicCircle = "BasicGraphic-Circle", BasicGraphicHeart = "BasicGraphic-Heart", BasicGraphicCylinder = "BasicGraphic-Cylinder", BasicGraphicStar = "BasicGraphic-Star", BasicGraphicTriangle = "BasicGraphic-Triangle", BasicGraphicEllipse = "BasicGraphic-Ellipse", BasicGraphicPolygon = "BasicGraphic-Polygon", BasicGraphicRightArrow = "BasicGraphic-RightArrow", BasicGraphicDownArrow = "BasicGraphic-DownArrow", BasicGraphicLeftArrow = "BasicGraphic-LeftArrow", BasicGraphicUpArrow = "BasicGraphic-UpArrow" } /** * The event name dashboard supported. */ export declare enum CommandName { SwitchTab = "SwitchTab", SwitchPage = "SwitchPage", Drill = "Drill", DrillDown = "DrillDown", DrillUp = "DrillUp", DrillReset = "ResetDrill", HideScenario = "HideScenario", ShowScenario = "ShowScenario", ToggleScenario = "ToggleScenario" } /** * The options of executing the command. */ export type CommandOption = { /** * The event name of the command. */ name: CommandName; /** * The payload of each command. */ payload: SwitchTabCommandPayload | SwitchPageCommandPayload | DrillDownCommandPayload | DrillUpCommandPayload | DrillResetCommandPayload | ToggleScenarioCommandPayload | ShowScenarioCommandPayload | HideScenarioCommandPayload; }; /** * The payload of executing 'SwitchTab' command. */ export type SwitchTabCommandPayload = { /** * The name of the container that you want to control. */ target: string; /** * The index of a tab of the container. */ index?: number; /** * The name of a tab of the container. */ name?: string; /** * The id of the container. */ containerId?: string; }; /** * The payload of executing 'SwitchPage' command. */ export type SwitchPageCommandPayload = { /** * The index of the page. */ index?: number; /** * The name of the page. */ name?: string; /** * The id of the page. */ pageId?: string; }; /** * The payload of executing 'DrillDown' command. */ export type DrillDownCommandPayload = { /** * The name of a scenario that you want to control. */ target: string; /** * The name of a target dimension. Available only when the drill type is All or List, that is, if the drill type is Path, the drillDimension is ignored and drill to the dimension specified at data binding. */ drillDimension?: string; }; /** * The payload of executing 'DrillUp' command. */ export type DrillUpCommandPayload = { /** * The name of a scenario that you want to control. */ target: string; }; /** * The payload of executing 'ResetDrill' command. */ export type DrillResetCommandPayload = { /** * The name of a scenario that you want to control. */ target: string; }; /** * The payload of executing 'ToggleScenario' command. */ export type ToggleScenarioCommandPayload = { /** * The name of a scenario that you want to control. */ target: string; /** * The id of a scenario. */ scenarioId?: string; /** * The delay time(s) of executing the command. */ delay?: number; /** * The duration time(s) of showing or hiding a scenario. */ duration?: number; /** * The animation type of showing a scenario. */ enterAnimation?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'fadeIn'; /** * The animation type of hiding a scenario. */ leaveAnimation?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'fadeIn'; }; /** * The payload of executing 'ShowScenario' command. */ export type ShowScenarioCommandPayload = { /** * The name of a scenario that you want to control. */ target: string; /** * The id of a scenario. */ scenarioId?: string; /** * The delay time(s) of executing the command. */ delay?: number; /** * The duration time(s) of showing or hiding a scenario. */ duration?: number; /** * The animation type of showing a scenario. */ enterAnimation?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'fadeIn'; }; /** * The payload of executing 'HideScenario' command. */ export type HideScenarioCommandPayload = { /** * The name of a scenario that you want to control. */ target: string; /** * The id of a scenario. */ scenarioId?: string; /** * The delay time(s) of executing the command. */ delay?: number; /** * The duration time(s) of showing or hiding a scenario. */ duration?: number; /** * The animation type of hiding a scenario. */ leaveAnimation?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'fadeIn'; }; /** * The options of initializing a dashboard lite viewer. */ export type DashboardLiteViewerInitOption = { /** * A DOM element used to mount the dashboard lite viewer. */ container?: Element; /** * Default options of initializing a dashboard lite viewer. */ defaults?: DashboardLiteViewerDefaults; /** * Features options of initializing a dashboard lite viewer. */ features?: DashboardLiteViewerFeatures; /** * disabled auto connect the UIDashboard */ manual?: boolean; /** * Invoked when custom jump is triggered. */ onCustomJump?: (options: JumpNS.ICustomJumpOptions) => void; }; /** * The default properties of DashboardLiteViewerInitOptions. */ export type DashboardLiteViewerDefaults = { /** * The dashboard id. */ dashboardId: string; /** * The dashboard click actions. */ clickAction?: string; /** * The dashboard container filter scope. */ containerFilterScope?: string; /** * The dashboard context menu actions */ contextMenuActions?: string; /** * The dashboard document theme id. */ documentThemeId?: string; /** * The dashboard parameters. */ dp?: object | string; /** * Hide all dashboard error notifications. */ hideErrors?: boolean; /** * The language of the user interface. */ lng?: string; /** * The setting of dashboard notification time. */ notificationTime?: number; /** * The viewer page number starts from 1. */ pageNumber?: string; /** * The single scenario name. */ scenario?: string; /** * The mode for opening the full dashboard when integration single scenario. */ openfulldashboardmode?: 'newWindow' | 'redirect' | 'none'; /** * Allow show scenario title only when do single scenario integration. */ showScenarioTitle?: boolean; /** * The dashboard theme. */ theme?: string; }; /** * The features properties of DashboardLiteViewerInitOptions. */ export type DashboardLiteViewerFeatures = { /** * Define the action bar action white list. */ actionbarItems?: string[]; /** * Control the animation enabled. */ disableAnimation?: boolean; /** * Control the autoscroll enabled. */ disableAutoScroll?: boolean; /** * Control the auto switch page enabled. */ disableAutoSwitchPage?: boolean; }; export declare enum Toolbar { Default = "default", Show = "show", Auto = "auto", Hide = "hide" } export declare enum InteractionMouseEventAction { ShowTooltip = "showTooltip", None = "none", Keep = "keep", Exclude = "exclude", DrillTo = "drillTo", JumpTo = "jumpTo" } /** * The options of initializing a dashboard designer. */ export type SceneConfig = { /** * The language of the user interface. */ lng?: string; /** * The scene theme. */ theme?: string; /** * The scene id. */ docId?: string; /** * The scene theme id. */ documentThemeId?: string; }; export type SceneDesignerInitOption = { /** * A DOM element used to mount the scene designer. */ container?: Element; /** * Invoked after the designer mounted. */ onMount?: () => void; /** * Invoked when the designer is closed. */ onClose?: () => void; /** * Invoked after the designer loaded. */ onLoaded?: (docName: string, id: string) => void; /** * Invoked when the document has any error message. */ onError?: (errorInfo: object) => void; /** * This is a callback function, it will be invoked when users save a document . */ onSave?: (id: string) => void; }; export type SceneViewerInitOption = { /** * A DOM element used to mount the scene viewer. */ container?: Element; /** * Invoked after the viewer mounted. */ onMount?: () => void; /** * Invoked when the viewer is closed. */ onClose?: () => void; /** * Invoked after the viewer loaded. */ onLoaded?: (docName: string, id: string) => void; /** * Invoked after the viewer rendered. */ onRendered?: (docName: string) => void; /** * Invoked when the document has any error message. */ onError?: (errorInfo: object) => void; }; export type AIChatAnalysisDatasetSelection = 'manual' | 'auto'; export type AIChatAnalysisAnalysisMode = 'standard' | 'advanced'; /** * The setup guide shown when AI chat analysis is not configured. */ export type AIChatAnalysisSetupGuideOptions = { /** * The main title. */ title?: string; /** * The subtitle shown under the title. */ subtitle?: string; /** * The descriptive text shown in the unavailable state. */ description?: string; /** * The action button text. */ actionText?: string; /** * The URL opened by the action button. */ actionUrl?: string; }; type AIChatAnalysisSharedOptions = { /** * A DOM element used to mount AI chat analysis. */ container?: Element; /** * The default dataset id. */ dataset?: string; /** * The available dataset ids for AI chat analysis. */ availableDatasets?: string[]; /** * Controls whether users manually choose a dataset or allow AI to select one. */ datasetSelection?: AIChatAnalysisDatasetSelection; /** * Controls whether insight-related UI and requests are enabled for this integration. */ insights?: boolean; /** * Controls whether advanced analysis is available. */ advancedAnalysis?: boolean; /** * Controls whether suggested questions are shown after a completed answer. */ suggestedQuestions?: boolean; /** * Controls the default analysis mode for a new session. */ analysisMode?: AIChatAnalysisAnalysisMode; /** * Controls whether the data panel is shown. */ showDataPanel?: boolean; /** * The setup guide shown when AI chat analysis setup is required. */ setupGuide?: AIChatAnalysisSetupGuideOptions; }; /** * The options of creating an AI chat analysis instance. */ export type AIChatAnalysisConfig = commonConfig & AIChatAnalysisSharedOptions & { /** * The web address of your wyn server. */ baseUrl: string; /** * The access token. the token is generated from the Admin portal. */ token: string; /** * Set the key name used in query parameters, this name is configured in the Wyn config file. * If `tokenKey` is not specified, the default value `'token'` is used. */ tokenKey?: string; /** * Fallback mount target. `selector` is still preferred in `createAIChatAnalysis`. */ container?: Element; /** * The language of the user interface. */ lng?: string; /** * The theme of the user interface. */ theme?: string; /** * Invoked when creating or initializing AI chat analysis fails. */ onError?: (error: unknown) => void; }; export type WynDashboardAppType = 'DashboardDesigner' | 'DashboardViewer' | 'ViewerLite' | 'SceneDesigner' | 'SceneViewer'; export type WynDashboardApp = T extends 'DashboardDesigner' ? DashboardDesigner : T extends 'DashboardViewer' ? DashboardViewer : T extends 'ViewerLite' ? DashboardLiteViewer : any; export declare class DashboardDesigner { /** * Initializes a designer instance and returns a promise. * * @param initOption * @returns * * Sample Code * ``` * designer.initialize({ * container: document.querySelector("#dashboard"), * defaults: { * datasetId * }, * features: { * actionbarItems : ["focus","annotation","shareScenario"] * }, * onLoaded: (docName) => { * document.title = docName; * } * }); * ``` */ initialize(initOption: DashboardDesignerInitOption): Promise; /** * Releases the resources of the dashboard designer instance. */ destroy(): void; /** * Shows the inspector panel of the dashboard designer. */ showInspector(): void; /** * Hides the inspector panel of the dashboard designer. */ hideInspector(): void; /** * Shows the data binding panel of the dashboard designer. */ showDataBindingPanel(): void; /** * Hides the data binding panel of the dashboard designer. */ hideDataBindingPanel(): void; /** * Switches designer's view mode. If the designer is now in the 'Design' state, then it will go to the 'Preview' state and vice versa. * * @param option */ togglePreview(option?: DocumentSyncOption): void; /** * Saves the current document. * * @param option * @returns * * Sample Code * ``` * designer.save({ * name: 'xxxxx', * categories: ['xx'], * comment: 'xxxx', * shouldPublish: true * }); * ``` */ save(option?: DocumentSaveOption): Promise; /** * Adds a new scenario to the current document. * * @param visualName The visual name of the new scenario.
* Here are some built-in visual names, "richEditor", "picture","container", "tabContainer", "spreadChart", "mergedChart", "embeddedDashboard", "embeddedReport", "treeSlicer", "dateRangeSlicer", "comboBoxSlicer", "labelSlicer", "relativeDateSlicer", "dataRangeSlicer", "column", "stackedColumn", "percentStackedColumn", "rangeColumn", "bar", "stackedBar", "percentStackedBar", "rangeBar", "line""area", "stackedArea", "percentStackedArea", "rangeArea", "pie", "donut", "rose", "radialStackedBar", "stackedBarInPolar", "sunburst", "barInPolar", "radar", "filledRadar", "scatter", "bubble", "treeMap", "combined", "funnel", "gauge", "indicator", "KPI", "pivotTable", "dataTable", "kpiMatrix", "map", "webContent", "floorPlan", "card", "candlestick", "KpiKanban", etc.
* If the added scenario is a custom visual chart, the visual name is defined by its author. * @param width The width of the new scenario. * @param height The height of the new scenario. * @param left The left position of the new scenario. * @param top The top position of the new scenario. * @returns * * Sample Code * ``` * designer.addVisual( * visualName: 'column', * width: 400, * height: 300, * left: 0, * top: 0 * ); * ``` */ addVisual(visualName: string, width?: number, height?: number, left?: number, top?: number): Promise; /** * Adds a new scenario by template to the current document. * * @param templateId The scenario template id of the new scenario. * @param left The left position of the new scenario. * @param top The top position of the new scenario. * @returns * * Sample Code * ``` * designer.addVisualByTemplateId( * templateId: '658f8e5c-81a2-4a0c-a016-84ba52368b29', * left: 0, * top: 0 * ); * ``` */ addVisualByTemplateId(templateId: string, left?: number, top?: number): Promise; /** * Specifies a dataset for the current scenario. * * @param datasetId The dataset id. */ setDatasetId(datasetId: string): void; /** * Returns a bool value whether the state of the current document is dirty. * * @returns */ isDocumentDirty(): boolean; /** * Subscribes to a dashboard event. * * @returns */ on(eventType: DesignerEventType, eventHandler: (...args: any[]) => void): void; /** * Unsubscribes to a dashboard event. * * @returns */ off(eventType: DesignerEventType, eventHandler: (...args: any[]) => void): void; } /** * The standard dashboard viewer. * In addition to loading existing documents, the viewer also supports drawing visuals by API. * Calls to `addVisual`, `setDataBinding`, and `removeDataBinding` are queued lazily and only * applied after `update` is invoked. */ export declare class DashboardViewer { /** * Initializes a standard viewer instance and returns a promise. * After initialization, the returned instance can execute commands, set parameters, and * draw charts by API with `addVisual`, `setDataBinding`, `removeDataBinding`, and `update`. * * @param initOption * @returns * * Sample Code * ``` * viewer.initialize({ * container: document.querySelector("#viewer"), * defaults: { * dashboardId: 'xxxxxx', * }, * features: { * actionbarItems : ["focus","annotation","shareScenario"] * }, * onLoaded: (docName) => { * document.title = docName; * } * }); * ``` */ initialize(initOption: DashboardViewerInitOption): Promise; /** * Releases the resources of the viewer instance. */ destroy(): void; /** * Provides some events for users to control the current document. * * @param option * @returns * * Sample Code * ``` * viewer.executeCommand({ * name: 'DrillDown', // or 'Drill' * payload: { * target: 'column', * drillDimension: 'Region', * } * }).then(() => { * // drill down successfully * }).catch((err) => { * console.log(err); * }); * ``` * */ executeCommand(option: CommandOption): Promise; /** * Makes the current document enter the full screen mode. */ requestFullScreen(): void; /** * Returns all the used datasets. * * @returns */ getDatasets(): Promise>; /** * Sets parameters value for the current document. * * @param parameters * @returns * * Sample code * ``` * viewer.setParameterValue({ * p1: ['product1'], * p2: [['dd1', '2018'], ['dd2', '2017']] * }) * ``` */ setParameterValue(parameters: { [key in objKey]: Array; }): void; /** * Queues a visual to be added to the current dashboard page. * `visualName` is the unique name used later by `setDataBinding` and `removeDataBinding`. * `visualType` selects the built-in visual type, while custom visuals should pass the * plugin-defined visual name string directly. * Width, height, left, and top are based on the dashboard designer coordinate system. * The viewer will scale the final layout to the actual container size during rendering. * * @param visualName The unique name of the visual to add. * @param visualType The built-in visual type or a custom visual name. * @param width The width of the visual in designer coordinates. * @param height The height of the visual in designer coordinates. * @param left The left position of the visual in designer coordinates. * @param top The top position of the visual in designer coordinates. * @param scenarioJson Optional scenario JSON used to initialize the visual directly. * @returns The current viewer instance for fluent chaining. * * Sample code * ``` * viewer * .addVisual('salesByRegion', 'column', 400, 300, 0, 0) * .update(); * ``` */ addVisual(visualName: string, visualType: VisualType | string, width: number, height: number, left: number, top: number, scenarioJson?: any): this; /** * Queues data binding for the specified visual. * Use `serverData` to bind an existing dataset or semantic model from the Wyn server. * Use `embeddedData` to bind client-side tabular data supplied through `data`. * The visual will resolve fields from the role mapping by display name. * * @param visualName The target visual name previously passed to `addVisual`. * @param dataBindingInfo The binding definition of the visual. * @returns The current viewer instance for fluent chaining. * * Sample code * ``` * viewer * .addVisual('salesByRegion', 'column', 400, 300, 0, 0) * .setDataBinding('salesByRegion', { * dataSourceType: 'serverData', * dataId: '660488d8-8d86-4cb5-94f7-f49fa88f5946', * dataBinding: { * Category: ['Region'], * Series: ['Carrier'], * Values: [{ name: 'Sales', method: 'sum' }], * }, * }) * .update(); * ``` */ setDataBinding(visualName: string, dataBindingInfo: IDataBindingOption): this; /** * Queues removal of the data binding on the specified visual. * The change is applied only after `update` is called. * * @param visualName The target visual name previously passed to `addVisual`. * @returns The current viewer instance for fluent chaining. */ removeDataBinding(visualName: string): this; /** * Applies all pending draw-by-API operations, including `addVisual`, `setDataBinding`, * and `removeDataBinding`. * Call this method after batching updates to improve rendering performance. * * @returns A promise that resolves after all pending draw-by-API operations are applied. * * Sample code * ``` * viewer * .addVisual('salesByRegion', 'column', 400, 300, 0, 0) * .setDataBinding('salesByRegion', { * dataSourceType: 'embeddedData', * dataBinding: { * Category: ['Region'], * Series: ['Carrier'], * Values: ['Sales'], * }, * data: { * Region: ['East', 'West'], * Carrier: ['A', 'B'], * Sales: [120, 90], * }, * }) * .update(); * ``` */ update(): Promise; } export declare class AIChatAnalysis { /** * Releases the resources of the AI chat analysis instance. */ destroy(): void; } export declare enum ScenarioType { PivotChart = "pivotChart", RichEditor = "richEditor", Picture = "picture", Container = "container", TabContainer = "tabContainer", Group = "group", Visual = "visual", Slicer = "slicer", SpreadChart = "spreadChart", MergedChart = "mergedChart", EmbeddedDashboard = "embeddedDashboard", EmbeddedReport = "embeddedReport", EmbeddedScene = "3DScene" } export declare enum EventType { Mounted = "mounted", Render = "render", Rendered = "rendered", Failed = "failed", Update = "update", SelectionChange = "selectionChange" } export interface UIWidget { connect(container: HTMLElement): void; isConnected(): boolean; disconnect(): void; getName(): string; on(type: EventType, cb: (...args: any[]) => void): void; once(type: EventType, cb: (...args: any[]) => void): void; off(type: EventType, cb: (...args: any[]) => void): void; refresh(): void; resize(): void; suspend(): void; resume(): void; } export interface UIScenario extends UIWidget { scenarioType: ScenarioType; getTitle(): string; } export interface UIContainer extends UIWidget { scenarios: UIScenario[]; scenarioType: ScenarioType; getScenarioByName(scenarioName: string): UIScenario; getScenarioByID(scenarioID: string): UIScenario; getTitle(): string; } export interface UIPage extends UIWidget { scenarios: UIScenario[]; containers: UIScenario[]; widgets: UIScenario[]; getScenarioByName(scenarioName: string): UIScenario; getScenarioByID(scenarioID: string): UIScenario; } export interface UIDashboard extends UIWidget { pages: UIPage[]; getCurrentPage(): UIPage; showPrevPage(): UIPage; showNextPage(): UIPage; getPageByName(pageName: string): UIPage; getPageByID(id: string): UIPage; getScenarioByName(scenarioName: string): UIScenario; getScenarioByID(scenarioID: string): UIScenario; } type objKey = string | number; /** * The lightweight dashboard viewer. * It exposes the same draw-by-API workflow as the standard viewer and can also return the * underlying `UIDashboard` instance for low-level UI control. */ export declare class DashboardLiteViewer { /** * Initializes a lite viewer instance and returns a promise. * After initialization, the returned lite viewer can draw visuals by API in the same * way as `DashboardViewer`. * * @param initOption * @returns * * Sample Code * ``` * liteViewer.initialize({ * container: document.querySelector("#dashboard"), * defaults: { * dashboardId: 'xxxxxx', * }, * features: { * actionbarItems : ["focus","annotation","shareScenario"] * }, * onLoaded: (docName) => { * document.title = docName; * } * }); * ``` */ initialize(initOption: DashboardLiteViewerInitOption): Promise; /** * Releases the resources of the lite viewer instance. */ destroy(): void; /** * Provides some events for users to control the current document. * * @param option * @returns * * Sample Code * ``` * liteViewer.executeCommand({ * name: 'DrillDown', // or 'Drill' * payload: { * target: 'column', * drillDimension: 'Region', * } * }).then(() => { * // drill down successfully * }).catch((err) => { * console.log(err); * }); * ``` * */ executeCommand(option: CommandOption): Promise; /** * Makes the current document enter the full screen mode. */ requestFullScreen(): void; /** * Returns all the used datasets. * * @returns */ getDatasets(): Promise>; /** * Sets parameters value for the current document. * * @param parameters * @returns * * Sample code * ``` * viewer.setParameterValue({ * p1: ['product1'], * p2: [['dd1', '2018'], ['dd2', '2017']] * }) * ``` */ setParameterValue(parameters: { [key in objKey]: Array; }): void; /** * Queues a visual to be added to the current dashboard page. * `visualName` is the unique name used later by `setDataBinding` and `removeDataBinding`. * `visualType` selects the built-in visual type, while custom visuals should pass the * plugin-defined visual name string directly. * Width, height, left, and top are based on the dashboard designer coordinate system. * The lite viewer will scale the final layout to the actual container size during rendering. * * @param visualName The unique name of the visual to add. * @param visualType The built-in visual type or a custom visual name. * @param width The width of the visual in designer coordinates. * @param height The height of the visual in designer coordinates. * @param left The left position of the visual in designer coordinates. * @param top The top position of the visual in designer coordinates. * @param scenarioJson Optional scenario JSON used to initialize the visual directly. * @returns The current lite viewer instance for fluent chaining. */ addVisual(visualName: string, visualType: VisualType | string, width: number, height: number, left: number, top: number, scenarioJson?: any): this; /** * Queues data binding for the specified visual. * Use `serverData` to bind an existing dataset or semantic model from the Wyn server. * Use `embeddedData` to bind client-side tabular data supplied through `data`. * The visual will resolve fields from the role mapping by display name. * * @param visualName The target visual name previously passed to `addVisual`. * @param dataBindingInfo The binding definition of the visual. * @returns The current lite viewer instance for fluent chaining. */ setDataBinding(visualName: string, dataBindingInfo: IDataBindingOption): this; /** * Queues removal of the data binding on the specified visual. * The change is applied only after `update` is called. * * @param visualName The target visual name previously passed to `addVisual`. * @returns The current lite viewer instance for fluent chaining. */ removeDataBinding(visualName: string): this; /** * Applies all pending draw-by-API operations, including `addVisual`, `setDataBinding`, * and `removeDataBinding`. * Call this method after batching updates to improve rendering performance. * * @returns A promise that resolves after all pending draw-by-API operations are applied. */ update(): Promise; /** * Returns UIDashboard instance. * * @returns */ getUIDashboard(): UIDashboard; } export type commonConfig = { version?: string; }; export type DashboardDesignerConfig = DashboardDesignerInitOption & Partial & WynBIOption & commonConfig; export type DashboardViewerConfig = DashboardViewerInitOption & Partial & WynBIOption & commonConfig; export type DashboardLiteViewerConfig = DashboardLiteViewerInitOption & Partial & WynBIOption & commonConfig; export type SceneDesignerConfig = SceneDesignerInitOption & SceneConfig & WynBIOption & commonConfig; export type SceneViewerConfig = SceneViewerInitOption & SceneConfig & WynBIOption & commonConfig;