IWorkspaceStylingService
This service provides access to workspace styling settings such as color palette.
export interface IWorkspaceStylingService
Remarks
The contract here is that styling settings ARE applied in Analytical Designer and Dashboard applications and so any SDK code that embeds entities created by those applications MUST also use the same styling settings in order to maintain consistent user experience.
Methods
Method | Description |
|---|---|
Clear active color palette setting from workspace. | |
Clear active theme setting from workspace. | |
Create a new color palette on the workspace level. | |
Create a new theme on the workspace level. | |
Delete a color palette on the workspace level. | |
Delete a theme on the workspace level. | |
Request active color palette setting from workspace. | |
Request active theme setting from workspace. | |
Request all workspace-level color palettes the workspace can use. | |
Request all workspace-level themes the workspace can use. | |
Asynchronously returns items in the color palette. | |
Read one color palette by reference, wherever the workspace can see it. | |
Request all color palettes defined on the workspace level. | |
Asynchronously returns theme. | |
Request all themes defined on the workspace level. | |
Set active color palette setting in workspace. | |
Set active theme setting in workspace. | |
Update an existing color palette on the workspace level. | |
Update an existing theme on the workspace level. |
Method details
IWorkspaceStylingService.clearActiveColorPalette()method
Clear active color palette setting from workspace.
clearActiveColorPalette(): Promise<void>;
Returns
Promise<void>
promise
IWorkspaceStylingService.clearActiveTheme()method
Clear active theme setting from workspace.
clearActiveTheme(): Promise<void>;
Returns
Promise<void>
promise
IWorkspaceStylingService.createColorPalette()method
Create a new color palette on the workspace level.
createColorPalette(colorPalette: IColorPaletteDefinition): Promise<IColorPaletteMetadataObject>;
Parameters
Parameter | Type | Description |
|---|---|---|
colorPalette | color palette definition |
Returns
Promise<IColorPaletteMetadataObject>
promise of the created color palette metadata object
IWorkspaceStylingService.createTheme()method
Create a new theme on the workspace level.
createTheme(theme: IThemeDefinition): Promise<IThemeMetadataObject>;
Parameters
Parameter | Type | Description |
|---|---|---|
theme | theme definition |
Returns
Promise<IThemeMetadataObject>
promise of the created theme metadata object
IWorkspaceStylingService.deleteColorPalette()method
Delete a color palette on the workspace level.
deleteColorPalette(colorPaletteRef: ObjRef): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
colorPaletteRef | color palette reference |
Returns
Promise<void>
promise
IWorkspaceStylingService.deleteTheme()method
Delete a theme on the workspace level.
deleteTheme(themeRef: ObjRef): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
themeRef | theme reference |
Returns
Promise<void>
promise
IWorkspaceStylingService.getActiveColorPalette()method
Request active color palette setting from workspace.
getActiveColorPalette(): Promise<ObjRef | undefined>;
Returns
Promise<ObjRef | undefined>
promise of color palette object reference
IWorkspaceStylingService.getActiveTheme()method
Request active theme setting from workspace.
getActiveTheme(): Promise<ObjRef | undefined>;
Returns
Promise<ObjRef | undefined>
promise of theme object reference
IWorkspaceStylingService.getAvailableColorPalettes()method
Request all workspace-level color palettes the workspace can use.
getAvailableColorPalettes(): Promise<IColorPaletteMetadataObject[]>;
Returns
Promise<IColorPaletteMetadataObject[]>
promise of array of color palette metadata objects
Remarks
The workspace’s own palettes plus those inherited from its parent workspaces. Unlike IWorkspaceStylingService.getColorPalettes(), the result includes palettes the workspace cannot manage. Each reference is an idRef typed "workspaceColorPalette", so it can be passed to IWorkspaceStylingService.setActiveColorPalette() as is. Palettes with invalid content are left out. Organization color palettes are not included; read them from the organization styling service.
IWorkspaceStylingService.getAvailableThemes()method
Request all workspace-level themes the workspace can use.
getAvailableThemes(): Promise<IThemeMetadataObject[]>;
Returns
Promise<IThemeMetadataObject[]>
promise of array of theme metadata objects
Remarks
The workspace’s own themes plus those inherited from its parent workspaces. Unlike IWorkspaceStylingService.getThemes(), the result includes themes the workspace cannot manage. Each reference is an idRef typed "workspaceTheme", so it can be passed to IWorkspaceStylingService.setActiveTheme() as is. Organization themes are not included; read them from the organization styling service.
IWorkspaceStylingService.getColorPalette()method
Asynchronously returns items in the color palette.
getColorPalette(): Promise<IColorPalette>;
Returns
Promise<IColorPalette>
promise of color palette
IWorkspaceStylingService.getColorPaletteByRef()method
Read one color palette by reference, wherever the workspace can see it.
getColorPaletteByRef(colorPaletteRef: ObjRef): Promise<IColorPalette | undefined>;
Parameters
Parameter | Type | Description |
|---|---|---|
colorPaletteRef | color palette reference |
Returns
Promise<IColorPalette | undefined>
promise of the color palette, or undefined where the workspace cannot see one
Remarks
The scope is carried by the reference itself, as it is for IWorkspaceStylingService.setActiveColorPalette(): an idRef typed "workspaceColorPalette" names a workspace-scoped palette, one typed "colorPalette" an organization-scoped one. Both are read through this method. A workspace-scoped palette is reached whether the workspace owns it or inherits it from a parent, which is what separates this from IWorkspaceStylingService.getColorPalettes().
IWorkspaceStylingService.getColorPalettes()method
Request all color palettes defined on the workspace level.
getColorPalettes(): Promise<IColorPaletteMetadataObject[]>;
Returns
Promise<IColorPaletteMetadataObject[]>
promise of array of color palette metadata objects
Remarks
The workspace’s own palettes, which are the ones it can manage. A palette inherited from a parent workspace is not among them; use IWorkspaceStylingService.getAvailableColorPalettes() to list those, or IWorkspaceStylingService.getColorPaletteByRef() to read one that is merely referenced.
IWorkspaceStylingService.getTheme()method
Asynchronously returns theme.
getTheme(): Promise<ITheme>;
Returns
Promise<ITheme>
promise of theme
IWorkspaceStylingService.getThemes()method
Request all themes defined on the workspace level.
getThemes(): Promise<IThemeMetadataObject[]>;
Returns
Promise<IThemeMetadataObject[]>
promise of array of theme metadata objects
Remarks
The workspace’s own themes, which are the ones it can manage. A theme inherited from a parent workspace is not among them; use IWorkspaceStylingService.getAvailableThemes() for those.
IWorkspaceStylingService.setActiveColorPalette()method
Set active color palette setting in workspace.
setActiveColorPalette(colorPaletteRef: ObjRef): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
colorPaletteRef | active color palette reference |
Returns
Promise<void>
promise
Remarks
The scope is carried by the reference itself: an idRef typed "workspaceColorPalette" activates a workspace-scoped color palette, otherwise it is treated as organization-scoped. There is no cross-scope fallback when the active setting is later resolved.
IWorkspaceStylingService.setActiveTheme()method
Set active theme setting in workspace.
setActiveTheme(themeRef: ObjRef): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
themeRef | active theme reference |
Returns
Promise<void>
promise
Remarks
The scope is carried by the reference itself: an idRef typed "workspaceTheme" activates a workspace-scoped theme, otherwise the theme is treated as organization-scoped. There is no cross-scope fallback when the active setting is later resolved.
IWorkspaceStylingService.updateColorPalette()method
Update an existing color palette on the workspace level.
updateColorPalette(colorPalette: IColorPaletteDefinition): Promise<IColorPaletteMetadataObject>;
Parameters
Parameter | Type | Description |
|---|---|---|
colorPalette | color palette definition |
Returns
Promise<IColorPaletteMetadataObject>
promise of the updated color palette metadata object
IWorkspaceStylingService.updateTheme()method
Update an existing theme on the workspace level.
updateTheme(theme: IThemeDefinition): Promise<IThemeMetadataObject>;
Parameters
Parameter | Type | Description |
|---|---|---|
theme | theme definition |
Returns
Promise<IThemeMetadataObject>
promise of the updated theme metadata object