Dynamic Color Palettes
Download: Dynamic Color Palette
Introduction
This article explains how to automatically set a color palette, based on the logged in user's group.
User 1 View:
User 2 View:
Purpose/Benefits
In order to provide a better user experience, you may want to automatically define how your dashboards are colored based on the end user. This plugin allows you to map color palettes to user groups, and swap the color palette when a user loads a dashboard.
Step 1 - Add The Plugin
Download the attachment and unzip the contents into your C:\Program Files\Sisense\PrismWeb\plugins\ folder. If you are using version 7.2 and higher unzip the contents into your C:\Program Files\Sisense\app\plugins\ folder. If the plugins folder doesn't exist, just create it. After those files have been unzipped there, you may also have to restart the web server.
Step 2 - Configure The Plugin
Open the config.js file to manage the groups/color palette mapping. There is a groups property, which is a key-value pair for defining the name of the color palette for each group id. Your config file should look something like this:
// Define config settings
var config = {
groups: {
"583ead06825d252849000025": "sisense",
"57d341a1105e6e9c3600006f": "vivid"
}
}
In order to figure out your group IDs, use the API Reference page
Step 3 - Enable For Viewers
By default, viewer users are not allowed to change the color palette of a dashboard. This can be adjusted by overriding the role through the API. Look for the PUT /roles/{idOrName} endpoint in the v0.9 APIs, and specify consumer for the idOrName input. Copy any paste the code below into the body, to allow viewers to change the color palette, then click the purple RUN button. You should get a 200 response code back, if the API call was successful.
{
"manifest": {
"dashboards": {
"select_palette": true
}
}
}
Notes/Reference
- Since users can belong to multiple groups, this plugin looks only at groups that have a matching entry in the config file, and then uses the first group from this filtered list
-
This is fairly simple but it doesn't appear to work for me. I've looked up and verified the groups and the dashboard id are correct and the files are extracted into the plugins directory, but no results.
Could it be because I'm using a trial desktop version?
Can anyone help?
Thanks in advance
Please sign in to leave a comment.
Comments
5 comments