A dashboard is a collection of one or more pages (known as Sub Tabs). Sub Tabs are a collection of Entities. An entity in the context of a dashboard, is anything that is placed onto a Sub Tab. This could be a report or a filter list as well as any object that can be placed onto a canvas (Shapes, Text, Buttons, Images, etc).
Thus, the basic structure of a dashboard looks like this:
Sub Tabs, Reports and Filters all have a number of their own properties that can be seen in the reference guides for those areas.
As mentioned, an entity in the context of a dashboard is anything that is placed onto a Sub Tab. This could be a report or a filter list as well as any object that can be placed onto the canvas (Shapes, Text etc).
During Dashboard creation, when an entity is added to the Dashboard it is assigned a unique identifier. This is the identifier that is used for that Dashboard Entity internally within the DashboardAPI.
For reports, this unique ID is very important as it allows us to include the same report more than once on a dashboard and apply different filters to it. Otherwise if we had 2 versions of the same report we would not know which one to refer to when applying filters or drilling into that report.
The FiltersAPI on a dashboard contains every single user prompt filter that has been enabled on that dashboard. Even if they are filters that aren’t currently visible.
A Filter Panel is what the end-user sees. This uses the FilterObjects within the FilterAPI to generate what is displayed to the user.
It is not possible to manipulate Filter Panels without using DOM manipulation. However developers can manipulate the filters within those panels through the FiltersAPI.
You can see all of the reports and their entity IDs by using the getAllReports() function. This will return an Array of Objects which contains:
All of these reports will be automatically loaded by the dashboard when the sub tab becomes visible.
Yellowfin Present is built off of the Yellowfin Dashboard. As such all of the functions within the DashboardAPI will work when you apply them to a Presentation. If you wish to navigate to the next slide when using a Presentation you can simply call the “nextSubTab()” function, or if you wish to move to the fifth slide, moveToTabAtPosition(4).
String
Returns the UUID of the dashboard.
Returns the FiltersAPI for the Dashboard.
String
Returns the dashboard name. This will be translated into the users language if translations are enabled and a translation has been provided for that language.
String
Returns the dashboard description. This will be translated into the users language if translations are enabled and a translation has been provided for that language.
Number
Returns the sub tab ID of the sub tab the user is currently viewing.
String
Returns a direct link to this dashboard. For example,
http://localhost:8080/RunDashboard.i4?dashUUID=1e68d9cc-fa5a-44e2-816d-782aa40ceeae&primaryOrg=1&clientOrg=1 |
This is a simple link to access this dashboard directly, it doesn’t contain any filters.
Returns a direct embed link for this dashboard. For example,
<script type="text/javascript" src="http://localhost:8080/JsAPI/v3?dashUUID=1e68d9cc-fa5a-44e2-816d-782aa40ceeae"></script> |
Promise
Loads a report within the context of the dashboard. Resolves the promise and passes a Report object as the parameter, but does not automatically display it.
If the reportUUID/entityUUID combination has already been loaded for this dashboard, the promise will resolve immediately with the relevant Report object.
If the report has been set up as part of this dashboard and had filter linking and interaction linking applied, it will automatically have those links applied to it.
If the report is unrelated to this dashboard it will be loaded but will not be able to automatically use filters.
Options - Object
Must contain the following:
Returns the SubTab object for the currently selected tab. If the dashboard has no currently selected tab (this can happen in some cases when it first loads) the first sub tab will be returned.
let subTab = dashboard.getCurrentSubTab(); |
Returns the SubTab object for the passed position. This position starts at 0.
If a position value is outside of the number of tabs, null will be returned.
position: Number
Get the 4th sub tab and verify it exists and then output its name.
let subTab = getSubTabByPosition(4); |
Returns the SubTab object for the passed subTabId. If a SubTab name is passed in, it will attempt to be converted to its corresponding tab ID.
If no matches can be found, null will be returned.
subTabId: String
//Get sub tab by Id |
Object - {String, FilterObject}
Returns an Object that contains all of the user prompt filters for the SubTab that is passed to the function. This object is keyed by Filter UUID.
This function is useful for observing which filters are available for a given SubTab. If you are looking for a specific filter it is recommended using filters.getFilter(filterId) rather than getAllFilters()[uuid] as getFilters can accept a UUID or a name. If you wish to iterate over all filters, we recommend using filters.forEach(fn) instead.
Nothing
Changes the Dashboard’s current tab to the next one by order. From a user perspective this would move the tab to the right of the current tab.
If the dashboard is currently on the last tab, this will move the dashboard to the first tab.
Move the user to a new tab after they click the “next” button:
document.querySelector('div#nextTabButton').addEventListener('click', function(e) { |
Move the user to a new tab every 10 seconds:
setInterval(function() { |
Nothing
Changes the Dashboard’s current tab to the previous one by order. From a user perspective this would move the tab to the left of the current tab.
If the dashboard is currently on the first tab, this will move the dashboard to the last tab.
Move the user to a new tab after they click the “next” button:
document.querySelector('div#previousTabButton').addEventListener('click', function(e) { |
Move the user to a new tab every 10 seconds:
setInterval(function() { |
Number
Returns the position of the sub tab. If there is no matching sub tab, null will be returned. Sort indexing starts at 0.
subTabId: Number, String
ID or name of the sub tab you wish to find the position of.
Get the sub tab position by name:
let subTabPosition = dashboard.findSubTabOrder('Campaign Summary') |
Get the sub tab position by ID:
let subTabPosition = dashboard.findSubTabOrder(123456); |
Nothing
Changes the dashboard's current sub tab to the sub tab that matches the passed ID. If a name is passed, it will attempt to convert that to a matching ID. If there is no matching tab, then nothing will happen.
If the tab changes, a tabChanged event will be fired by the DashboardAPI.
subTabId: String
UUID or Name of the sub tab you wish to navigate to.
Move to the tab ‘Campaign Summary’:
dashboard.moveToTab('Campaign Summary'); |
Move to the tab with uuid “28c595a5-c097-445c-ac9d-cbd4c415a667”:
dashboard.moveToTab(‘28c595a5-c097-445c-ac9d-cbd4c415a667’); |
Nothing
Change the dashboard's current sub tab to the sub tab at the matching position. If there is no matching tab, then nothing will happen. If the subTabPosition isn’t within the possible range (i.e. the number of sub tabs on the dashboard), nothing will happen.
If the tab changes, a tabChanged event will be fired by the DashboardAPI.
position: Number
The sort order of the tab you wish to navigate to. Sort index starts at 0.
Move to the first sub tab:
dashboard.moveToTabAtPosition(0); |
Move to the last sub tab:
dashboard.moveToTabAtPosition(dashboard.getSubtabs().length - 1); |
Boolean
Returns true if the dashboard has any user prompt filters enabled. Otherwise returns false.
let hasFilters = dashboard.hasFilters(); |
Nothing
Re-runs all of the reports on the dashboard. This will force all of the reports to fetch new datasets from the server.
This can be useful in circumstances where you are working on live data and an action from the page will update the datasets behind some of the reports. This can then be used to re-run the reports with the same filter sets.
dashboard.refresh(); |
Nothing
Resets all of the reports on the dashboards to their default state, as well as resetting all of the filters to their default value.
This will reset all of the brushing and drill states on the reports as well as any linking of those filters.
Only reports that are on the current tab will be re-run.
Nothing
Navigates the browser to the report output page associated with the passed reportUUID. If the report can’t be found then the user will be shown a “Report Can’t be Found page” message.
reportUUID: String
PublishUUID of the report you wish to navigate to.
This will only function when being used within Dashboard Code Mode.
String
Gets the embed URL for the dashboard exactly as it stands now. The URL will include any applied filters or bookmarks.
This differs from the property externalApiUrl as that only includes the link to the dashboard in its base state (i.e. without any filter or bookmark references).
Array[SubTab]
Returns all of the sub tabs associated with the Dashboard in an ordered array.
Print all of the sub tab names and UUIDs in order:
let subTabs = dashboard.getSubTabs(); |
Array[Object]
Returns an array of objects containing a Report's UUID, the EntityUUID it has been assigned on the dashboard, as well as the sub tab it has been placed on.
If there are no reports on the dashboard, an empty array will be returned.
This function can be used to search for all instances of a particular report that might be on the dashboard:
let reportToFind = 'af67e527-81d3-47fc-81ce-dfc506a61dd2'; |
Nothing
Iterates over all of the sub tabs that are included on the dashboard in order. The function will be passed a SubTab object on each iteration.
Print the name and UUID of all of the sub tabs on the dashboard:
dashboard.forEach(subTab => { |
Triggered whenever the current sub tab or slide is changed.
Event
Contains:
dashboard.addEventListener('tabChanged', function(event) { |
dashboard.addEventListener('tabChanged', function(event) { |