EmbedManager
Methods
This applies to: Visual Data Discovery
The following EmbedManager
methods can be used to manage embedded Symphony components. Sample code showing the use of these methods in an application are provided. See Embedded JavaScript Examples for a complete example of how these methods might be coded in JavaScript.
Method | Description |
---|---|
createComponent()
|
Creates a Symphony component in your application. This method is asynchronous and returns a promise that resolves the created component. The parameters input to this method include:
Use a standard The following example embeds a dashboard: const dashboard = await embedManager.createComponent('dashboard', { dashboardId: <id>, theme: 'composer', interactivityProfileName: '<interactivity-profile-name>', interactivity { settings:{ CHANGE_LAYOUT: "true", }, visualSettings:{ FILTER: "false", overrideVisualInteractivity: "true", }, } editor: { placement: 'dockRight' // use eve sidepanel }, header: { visible: true, showTitle: true, showActions: false, // will hide actions bar title: "Static custom title" } }); |
getComponentById()
|
Returns an instance of a Symphony component, based on its component instance ID. The parameter input to this method is a string representing the component instance ID. async function getComponent(<componentInstanceId>) { const embedManager = await createOrGetEmbedManager(); return embedManager.getComponentById(<componentInstanceId>); } |
refresh()
|
Refreshes all embedded components. This is useful when the token is expired. No parameters are passed to this method. async function refreshComponent(<newToken>) { const embedManager = await createOrGetEmbedManager(); embedManager.updateToken(<newToken>).then(() => { embedManager.refresh(); }); } |
refreshComponent()
|
Refreshes a particular component. The parameter used with this method is a string representing the component instance ID. The following example refreshes a specific dashboard: async function refreshDashboard(<newToken>, <componentInstanceId>) { const embedManager = await createOrGetEmbedManager(); embedManager.updateToken(<newToken>).then(() => { embedManager.refreshComponent(<componentInstanceId>); }); } |
refreshWithToken()
|
Combines an update token and refresh request for all components. The parameter input to this method is a string representing the new token. async function refreshComponent(<newToken>) { const embedManager = await createOrGetEmbedManager(); embedManager.refreshWithToken(<newToken>); } |
removeComponent()
|
Removes an embedded Symphony component from your application. This method returns the value The parameter input to this method is a string representing the component instance ID. async function clearComponent(id) { const embedManager = await createOrGetEmbedManager(); embedManager.removeComponent(<componentInstanceId>); } |
updateToken()
|
Refreshes the authorization token for an embedded Symphony component. This method is asynchronous and should be called prior to a refresh. The parameter input to this method is either a string representing the new token or a function requesting a new token. async function refreshDashboard(<newToken>) { const embedManager = await createOrGetEmbedManager(); embedManager.updateToken(<newToken>).then(() => { embedManager.refresh(); }); } |