EmbedOptions

The EmbedOptions object contains details for what content items should be embedded and any filter information required.

Constructors

embedOptions{contentId:string, filters?: Filter, targets?:Target[], theme?:string, onLoad?: function (content:EmbeddedResult), deviceType?: string, slideNumber?: number, locale?:string, exporting?:exportTypes[], fullDiscovery?:boolean}: EmbedOptions
  • Use this to set the details for embedding.
  • The content ID is the GUID string of the item that is to be embedded. Required.
  • Filters is the Filter object of items to drive filtering on the content. Optional.
  • Targets is the Target object of items to drive targeted filtering on the content. Optional.
  • Theme is a string to drive the theme colors of the built-in dialogs. Optional. Colors are:
    • "dark"
    • "light" (default)
  • The onLoad event function is a callback function that will be triggered once the content has been loaded and there is a result. Optional.
  • The optional device type specifies the layout type of the presentation to use. If not supplied, the device type is determined automatically. Types are:
    • "desktop"
    • "tablet"
    • "phone"
  • The optional slide number value is used to launch a dashboard / present content item straight to a specific slide number.
  • The locale string can be used to change the localization of the embed client's UI to one of the supported application languages. Note this is only relevant with anonymous embedding.
  • Export types can be used to control which export / print options are available to the user.
  • The optional fullDiscovery boolean value indicates whether slicers should be visible when embedding Discover content.

Example

The following instantiates a new filter object and attaches a filter for the year 2020 from the dates dimension. This is then attached to the an EmbedOptions object called options, which is then added to the embed method call.

var fil = Filter.create(); fil.add("dates","years","2020"); var options = {contentId:"c20d42b4-be24-47cf-b711-d5782f048590", filters: fil, theme: 'dark', onLoad: ContentLoaded, exporting: { exportTypes: ['pdf', 'png', 'csv'] } } client.embed($("myContainer"), options)

When the content has loaded up, the ContentLoaded function will be called and passed the EmbeddResult object. Any dialogs also appear with the dark theme.