[Linux] Add-on to hide any widget type
Summary: Vladyslav Hontar explains how to customize the hideWidgets plugin on Sisense to hide various types of widgets, including the BloX widget and other third-party widgets like the Sankey chart. The process involves creating a Sisense add-on and modifying the plugin's JavaScript logic to include the types of widgets you want to hide. Detailed steps for installation, logic adjustment, and troubleshooting are provided, with a note about the importance of managing plugin versions and caches. Additionally, caution is advised regarding supportability and the need for thorough testing in non-production environments before deployment.
The hideWidgets plugin is a small customization that hides every BloX widget on a dashboard. A common follow-up question is: can the same plugin hide a different widget type too — for example, a Sankey chart? The answer is yes. The plugin hides widgets by matching their widget.type value, so it can target any type once you know the correct string.
Building the plugin from scratch
If you don't already have a copy of the plugin, you can create one in a few minutes. A Sisense add-on is just a folder containing a manifest file (plugin.json) and one or more JavaScript files.
1. Create the folder and files
Create a folder named hideWidgets with two files inside it:
2. Add the manifest (plugin.json)
The manifest tells Sisense how to load your add-on. This example uses add-on infrastructure version 2, which is supported on modern Sisense versions:
{
"name": "hideWidgets",
"pluginInfraVersion": 2,
"isEnabled": true,
"source": ["main.6.js"],
"style": [],
"version": "1.0.0"
}name— a unique add-on name.pluginInfraVersion— the add-on infrastructure version (2 supports modern JavaScript).source— the list of JavaScript files to load.version— bump this every time you change the code (see the caching note later — this is what forces Sisense to load the new copy).
3. Add the logic (index.js)
This is the complete, working plugin. It hides every widget whose type appears in the typesToHide list. Start with just 'blox', and add more types once you have confirmed them (covered in the next sections):
// hideWidgets - hides widgets by their widget.type value
prism.on('dashboardloaded', function(ev, args) {
var dashboard = args.dashboard;
// Add every widget type you want to hide to this list
var typesToHide = ['blox'];
dashboard.widgets.$$widgets.forEach(function(widget) {
if (typesToHide.indexOf(widget.type) !== -1) {
if (widget.container) {
widget.container.style.display = 'none';
}
}
});
});Keep the hide list in one place (the
typesToHidearray). Adding a new widget type later is then a one-line change, with no other edits needed.
Installing the plugin
Sisense loads add-ons from a dedicated plugins folder. Once your hideWidgets folder is in place, Sisense picks it up and it appears in the Admin UI.
Sisense for Linux (including Cloud)
In Sisense, go to Admin → System Management → File Management.
Open the
pluginsfolder (the server path is/opt/sisense/storage/plugins/).Upload your
hideWidgetsfolder (or a.zipof it, then extract) so the files sit at/opt/sisense/storage/plugins/hideWidgets/.Go to Admin → Add-ons and confirm the add-on is listed and enabled.
Cloud customers - On Sisense Cloud you have File Management access to the
pluginsfolder, so you can upload the add-on yourself. If you cannot access it, open a support case and attach the plugin folder so it can be placed for you.Don't modify certified add-ons - Build your own folder rather than editing a certified Sisense add-on in place. Certified add-ons can be overwritten during an upgrade, which would discard your changes.
How the hideWidgets plugin works
On dashboard load, the plugin iterates over the dashboard's widgets and hides any widget whose type property equals "blox". The core logic looks like this:
prism.on('dashboardloaded', function(ev, args) {
var dashboard = args.dashboard;
dashboard.widgets.$$widgets.forEach(function(widget) {
if (widget.type === 'blox') {
widget.container.style.display = 'none'; // hide the widget
}
});
});The exact code in your copy may differ slightly, but the principle is the same: it checks widget.type and hides matches. To hide another widget type, you extend the condition to also match that type's string.
Why third-party widgets need an extra step
Native Sisense widgets have well-known type strings. Third-party Marketplace widgets — such as the Sankey chart — are registered by the plugin that provides them, and their internal type string is defined by that plugin, not by Sisense. It is therefore not listed in Sisense's official documentation.
Third-party widgets commonly register a type that resembles the plugin name (for example sankey, sankeyWidget, or a vendor-prefixed variant). Because the exact value can vary, you should confirm it directly rather than assume it.
Step 1 — Find the widget's type string
Open a dashboard that contains the widget you want to hide (for example, a Sankey chart).
Open your browser's Developer Tools (press
F12) and go to the Console tab.Run the snippet below to print the title and type of every widget on the active dashboard:
Find your target widget in the output and note its exact
Typevalue (for examplesankeyor a vendor-prefixed string).
Type strings are case-sensitive. Copy the value exactly as printed — a mismatch means the widget simply won't be hidden, with no error.
Step 2 — Extend the plugin
Open the plugin's main.6.js file inside the hideWidgets add-on folder and broaden the type check. The cleanest approach is to match against a list of types, so the plugin stays easy to extend later:
prism.on('dashboardloaded', function(ev, args) {
var dashboard = args.dashboard;
// Add every widget type you want to hide to this list
var typesToHide = ['blox', 'sankey']; // use the exact type from Step 1
dashboard.widgets.$$widgets.forEach(function(widget) {
if (typesToHide.indexOf(widget.type) !== -1) {
if (widget.container) {
widget.container.style.display = 'none';
}
}
});
});Guard for
widget.containerbefore setting its style. A widget that has not fully rendered may not expose a container yet, and referencing it blindly can throw a console error.
Step 3 — Reload the plugin and clear the cache
After editing the file, the change won't take effect — and you may see repeated console errors — if the browser or the plugin service is still running a stale copy of the JavaScript. This is the most common reason an edited plugin appears "broken" when the code is actually correct.
Save the modified plugin file in the add-on folder.
Disable and re-enable the add-on from Admin → Add-ons so the plugin service picks up the new code, then wait for the pods/service to restart.
In the browser, do a hard refresh (
Ctrl+Shift+R/Cmd+Shift+R) to discard the cached script.Reopen the dashboard and confirm the target widget is hidden and the console is clean.
Repeated console errors after editing a plugin are frequently caused by a stale cached copy of the plugin JavaScript combined with a missing function reference — not by your new logic. Force a fresh load of the plugin (re-enable the add-on) and a hard browser refresh before troubleshooting further.
A note on supportability
Custom and community add-ons are not covered by Sisense product support in the same way certified add-ons are, and a customization may need re-testing after a Sisense upgrade. Keep a backup of the working plugin, and test any change in a non-production environment before deploying it. If a widget you need to hide has no native way to be disabled, extending a small plugin like this is the recommended approach.