Options
All
  • Public
  • Public/Protected
  • All
Menu

Allows you to interact and embed dashboards into your application.

const sdk = new EmbedSDK({ ... });
const dashboard = sdk.createDashboard({ ... });

// renders a dashboard
dashboard.render(document.getElementById('embed-dashboard'));

Hierarchy

  • (Anonymous class)<(Anonymous class) & DashboardEventSender, this> & (Anonymous class)<DashboardEventSender, this> & DashboardEventSender<this>
    • Dashboard

Index

Methods

_send

  • _send(eventName: string, ...payload: unknown[]): Promise<[]>
  • Send message to embedded app.

    Parameters

    • eventName: string
    • Rest ...payload: unknown[]

    Returns Promise<[]>

getAllCharts

  • getAllCharts(): Promise<DashboardChart[]>
  • Returns Promise<DashboardChart[]>

    all charts on the dashboard

getChart

  • getChart(id: string): Promise<DashboardChart>
  • Parameters

    • id: string

    Returns Promise<DashboardChart>

    get the dashboard chart with specified id

getChartsBackground

  • getChartsBackground(): Promise<string>
  • Returns Promise<string>

    current chartsBackground or empty string if not set

getFilter

  • getFilter(): Promise<PlainObject>
  • Returns the current filter applied to the embedded chart The filter value is taken from the state of the chart entity in the Charts app component.

    Returns Promise<PlainObject>

    a promise that resolves once the filter is taken from the Charts state

getHeightMode

  • getHeightMode(): Promise<Scaling>
  • Returns Promise<Scaling>

    get height scaling mode of embedded dashboard

getImage

  • getImage(options: GetImageOptions): Promise<string | Blob>
  • Get the image data of embeded entity in base64 or binary encoding

    Parameters

    • options: GetImageOptions

      options for image generation

    Returns Promise<string | Blob>

    image encoded with base64 or binary

getMaxDataAge

  • getMaxDataAge(): Promise<number>
  • Returns Promise<number>

    the number of seconds before a chart or dashboard's data expires

getPreFilter

  • getPreFilter(): Promise<PlainObject>
  • Returns the current pre-filter applied to the embedded chart The filter value is taken from the state of the chart entity in the Charts app component.

    Returns Promise<PlainObject>

    a promise that resolves once the filter is taken from the Charts state

getTheme

  • getTheme(): Promise<string>
  • Returns Promise<string>

    the current theme applied to the chart or dashboard

getWidthMode

  • getWidthMode(): Promise<Scaling>
  • Returns Promise<Scaling>

    get width scaling mode of embedded dashboard

isAutoRefresh

  • isAutoRefresh(): Promise<boolean>
  • Returns Promise<boolean>

    whether auto refreshing is enabled

isShowAttribution

  • isShowAttribution(): Promise<boolean>
  • Returns Promise<boolean>

    whether attribution logo should be shown

refresh

  • refresh(): Promise<void>
  • Triggers a refresh of the chart or dashboard (if it has been embedded).

    Returns Promise<void>

    a promise that resolves once the chart or dashboard updated its data

render

  • render(container: HTMLElement): Promise<void>
  • Sends the ready event to Charts together with the chart options to render the embedded dashboard in the container

    Parameters

    • container: HTMLElement

      where the dashboard will render

    Returns Promise<void>

setAutoRefresh

  • setAutoRefresh(value: boolean): Promise<void>
  • Enable/Disable auto refreshing.

    Parameters

    • value: boolean

    Returns Promise<void>

setChartsBackground

  • setChartsBackground(value: string): Promise<void>
  • Set a custom background color for all charts. To clear existing value, set it to empty string.

    Parameters

    • value: string

    Returns Promise<void>

setFilter

  • setFilter(value: PlainObject): Promise<void>
  • Sets a filter to the state of the chart/dashboard entity in the Charts app component. The chart entity can be an embedded chart, embedded dashboard chart or embedded dashboard. The filter gets applied to the embedded chart/dashboard.

    This expects an object that contains a valid query operators. Any fields referenced in this filter are expected to be allowed for filtering in the "Embed Chart" dialog or "Embed Dashboard" dialog for each chart/dashboard you wish to filter on.

    Parameters

    • value: PlainObject

      The filter object to be applied to the chart/dashboard

    Returns Promise<void>

    a promise that resolves once the filter is saved and the component rerendered

setHeightMode

  • setHeightMode(value: Scaling): Promise<void>
  • Set height scaling mode for embedded dashboard

    Parameters

    • value: Scaling

    Returns Promise<void>

setMaxDataAge

  • setMaxDataAge(value: number): Promise<void>
  • Set the number of seconds a chart or dashboard's data expires.

    Parameters

    • value: number

    Returns Promise<void>

setPreFilter

  • setPreFilter(value: PlainObject): Promise<void>
  • Sets a filter which will be applied as the first stage on the Data Source. The chart entity can be an embedded chart, embedded dashboard chart or embedded dashboard. If a Charts View is defined in the UI, then this filter will be applied after the defined pipeline.

    This expects an object that contains a valid query operators. Any fields referenced in this filter are expected to be allowed for filtering in the "Embed Chart" dialog or "Embed Dashboard" dialog for each chart/dashboard you wish to filter on.

    If filtering is required on a dynamic field defined via a Lookup, Calculated or Query Bar, then setFilter is the appropriate method.

    Parameters

    • value: PlainObject

      The filter object to be applied after the defined Charts View in the UI

    Returns Promise<void>

    a promise that resolves once the filter is saved and the component rerendered

setShowAttribution

  • setShowAttribution(value: boolean): Promise<void>
  • Enable/Disable attribution logo.

    Parameters

    • value: boolean

    Returns Promise<void>

setTheme

  • setTheme(value: Theme): Promise<void>
  • Sets the color scheme to apply to the chart or dashboard.

    If the theme is set to 'dark' and you have specified a custom background color, you should ensure that your background color has appropriate contrast.

    Parameters

    • value: Theme

    Returns Promise<void>

setWidthMode

  • setWidthMode(value: Scaling): Promise<void>
  • Set width scaling mode for embedded dashboard

    Parameters

    • value: Scaling

    Returns Promise<void>

Static _send

  • _send(msgName: string, ...payload: unknown[]): Promise<[]>
  • Send message to embedded app.

    Parameters

    • msgName: string
    • Rest ...payload: unknown[]

    Returns Promise<[]>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc