Built-in library
Overview
The HTML Canvas built-in library is the backbone that allows interacting with dashboard data and the Ubidots API via:
Accessing the class' properties to modify/retrieve dashboards settings.
Accessing the class methods to perform actions on the dashboard or retrieving information from it.
Using the
on
event handler registration method for executing logic upon events that occur in the dashboard, a.k.a Listening events.
Properties
Property | Type | Description |
---|---|---|
|
| Dashboard's time frame. |
|
| Dashboard's information. |
|
| Device object of the currently selected device in a dynamic dashboard. |
|
| ID of the currently selected device in a dynamic dashboard. |
|
| String array of Id's of the selected devices in a dynamic dashboard |
|
| Device objects array of the selected devices in a dynamic dashboard |
|
| Array containing as many arrays as filters configured in the dashboard. Each nested array contains the filters objects for that particular filter. |
|
| Account's default token |
|
| Status of the real time in the dashboard |
dashboardDateRange
dashboardDateRange
dashboardObject
dashboardObject
selectedDevices
selectedDevices
selectedDeviceObjects
selectedDeviceObjects
selectedFilters
selectedFilters
Methods
Method | Description |
---|---|
| Returns the available Authentication Headers accordingly if the dashboard is public or not. |
| Embed a url's content in a drawer and displays it. |
| Changes the currently selected device in a dynamic dashboard. |
| Changes the selected time range in a dashboard. |
| Turn on or off the dashboard's real time update. |
| Refreshes the dashboard data in all widget. |
getHeaders
getHeaders
Arguments: None
Signature: ubidots.getHeaders()
Return:
For public dashboards:
For private dashboards:
openDrawer
openDrawer
Arguments: options
: Object
[mandatory] => An object containing the content's url and the drawer's width in px:
Signature:
Return: None
setDashboardDevice
setDashboardDevice
Arguments: deviceId
: string
[Mandatory] =>The ID of the device that you want to set.
Signature: ubidots.setDashboardDevice(<deviceId>)
Return: None
setDashboardDateRange
setDashboardDateRange
Arguments: timeframe
: Object
[Mandatory] => An object containing the start and end timestamps:
Signature: ubidots.setDashboardDateRange(<timeframe>)
Return: None
setRealTime
setRealTime
Arguments: rt
: Bool
[Mandatory] => A boolean indicating the real time update setting
Signature: ubidots.setRealTime(<rt>)
Return: None
refreshDashboard
refreshDashboard
Arguments: None
Signature: ubidots.refreshDashboard()
Return: None
setFullScreen
setFullScreen
Arguments: screenSetting
: string(toggle | enable | disabled)
[Mandatory] => A string representing the full screen setting.
Signature: ubidots.setFullScreen(<screenSetting>)
Return: None
Last updated