IDashboardLoader
Dashboard loader is responsible for loading dashboard and all the assets that the dashboard needs. As a result, it returns a React component and an instance of props to use in order to mount the dashboard.
export interface IDashboardLoader
Methods
Method | Description |
|---|---|
Specify dashboard to load. | |
Alternatively specify workspace indirectly, using data product, segment and client identifier. | |
Specify identifier of workspace where the dashboard is stored. | |
Load the dashboard, dashboard engine and plugins that should be on the dashboard. | |
Specify an instance of Analytical Backend that hosts the dashboards. | |
Specify an instance of IDashboardBaseProps to use for the dashboard component. | |
Specify embedded plugins to use on top of any plugins that the dashboard is already configured to use. | |
Override filter context to use for the loaded dashboard. |
Method details
IDashboardLoader.forDashboard()method
Specify dashboard to load.
forDashboard(dashboardRef: ObjRef): IDashboardLoader;
Parameters
Parameter | Type | Description |
|---|---|---|
dashboardRef | reference to an existing dashboard. |
Returns
IDashboardLoader.fromClientWorkspace()method
Alternatively specify workspace indirectly, using data product, segment and client identifier.
fromClientWorkspace(clientWorkspace: IClientWorkspaceIdentifiers): IDashboardLoader;
Parameters
Parameter | Type | Description |
|---|---|---|
clientWorkspace | complex identifier of the client workspace |
Returns
Remarks
Note: this indirect method of identification was only supported by the Life Cycle Management features of the retired legacy platform; current backends do not support it.
IDashboardLoader.fromWorkspace()method
Specify identifier of workspace where the dashboard is stored.
fromWorkspace(workspace: string): IDashboardLoader;
Parameters
Parameter | Type | Description |
|---|---|---|
workspace | string | identifier of workspace |
Returns
IDashboardLoader.load()method
Load the dashboard, dashboard engine and plugins that should be on the dashboard.
load(options?: IDashboardLoadOptions): Promise<DashboardLoadResult>;
Parameters
Parameter | Type | Description |
|---|---|---|
options | (Optional) |
Returns
Promise<DashboardLoadResult>
Remarks
Then performs the initialization of the plugins and their registration.
Finally, returns result containing the DashboardComponent to render, it’s props and details about the plugins that will be in effect once the DashboardComponent gets mounted.
IDashboardLoader.onBackend()method
Specify an instance of Analytical Backend that hosts the dashboards.
onBackend(backend: IAnalyticalBackend): IDashboardLoader;
Parameters
Parameter | Type | Description |
|---|---|---|
backend | an instance of analytical backend |
Returns
IDashboardLoader.withBaseProps()method
Specify an instance of IDashboardBaseProps to use for the dashboard component.
withBaseProps(props: IDashboardBaseProps): IDashboardLoader;
Parameters
Parameter | Type | Description |
|---|---|---|
props | base props to use |
Returns
Remarks
Note: the base props may also contain backend and workspace parameters. The loader can work with them. If specified, they are equivalent to calling IDashboardLoader.onBackend() and/or IDashboardLoader.fromWorkspace()
IDashboardLoader.withEmbeddedPlugins()method
Specify embedded plugins to use on top of any plugins that the dashboard is already configured to use.
withEmbeddedPlugins(...plugins: IEmbeddedPlugin[]): IDashboardLoader;
Parameters
Parameter | Type | Description |
|---|---|---|
plugins | extra plugins to use |
Returns
Remarks
The embedded plugins are implemented, built and linked into the application that loads the dashboard. There is no specific runtime loading and linkage required for these plugins.
The lifecycle of the embedded plugins follows the lifecycle of normal plugins that may be linked with the dashboard; instead of loading the plugin assets, the loader will call embedded plugin’s factory function to obtain an instance of the actual dashboard plugin to use. From this point on, the lifecycle is the same as for normal plugins:
- The loader will call the onPluginLoaded, pass any parameters that may be specified for the embedded plugin 2. Plugin registration is done same as for normal plugins 3. The loader will call onPluginUnload when the dashboard containing the plugins gets unmounted
IDashboardLoader.withFilterContext()method
Override filter context to use for the loaded dashboard.
withFilterContext(filterContextRef: ObjRef): IDashboardLoader;
Parameters
Parameter | Type | Description |
|---|---|---|
filterContextRef | reference to filter context to use instead of the default filter context |
Returns
Remarks
Note: Each dashboard has its own, default filter context - that filter context will be used automatically unless you override it using this call. You typically don’t need to do this: filter context overrides are needed most commonly during export and scheduled exports - where application has to create point-in-time snapshot of the filters so that they can be reused during exports instead of the default filter context.