EmbedOptions
The EmbedOptions object contains details for what content items should be embedded and any filter information required.
Constructor
embedOptions{
contentId:string,
filters?: Filter,
targets?:Target[],
theme?:string,
appStyles?:AppStyle,
onLoad?: function (content:EmbeddedResult),
deviceType?: string,
slideNumber?: number,
locale?:string,
exporting?:exportTypes[],
fullDiscovery?:boolean,
contentTheme?:string,
contentThemeOverrides?:customTheme
}: EmbedOptions
Use this to set the details for content 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 basic colors of the embedded application. This general package of settings can be overwritten or customized with the detailed AppStyles settings (see below) . Optional. Choices are:
- "dark"
- "light" (default)
- AppStyles is the optional AppStyle object of settings to highly customize the embedded client application's appearance. It does NOT change the look a feel of analytic content. This is handled by the contentTheme property below. It is used to customize the basic application "Theme" chosen above.
- The optional onLoad callback function is triggered once the content has been loaded and there is a result. It returns the deprecated EmbeddedResult object. Instead of using this mechanism, developers should instead the result via the content object.
- 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.
- The optional exporting value contains the Export typesobject that 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.
- ContentTheme is a string of the ID for a design theme that should be used to stylize the content itself. It's optional, and the original content theme will be used if it is not supplied. The content theme specified is a theme designed inside the application. You can adjust the theme settings using the contentThemeOverrides property (see below).
- ContentThemeOverrides is an optional customTheme object of settings to customize the content theme (added in its own above property). The custom theme can cover an entire set of theme settings, or override a selection of settings.
Content Themes
The listing of content themes can be extracted using the Theme APIs. The themes are built by admins using the point-and-click theme editor inside the admin console. These can then be adjusted at runtime, from code, using the contentThemeOverrides property.
Example
The following instantiates a new filter object and attaches a filter for the year 2025 from the dates dimension. This is then attached to the an EmbedOptions object called options, which is then added to the content (or 'embed') method call. The result is a content object which has its own methods and properties.
var fil = Filter.create();
fil.add("dates","years","2025");
Var options = {contentId:"c20d42b4-be24-47cf-b711-d5782f048590",
filters: fil, theme: 'dark',
exporting: {
exportTypes: ['pdf', 'png', 'csv']
}
};
var contentObj = client.content($("myContainer"), options)
//client.embed also works