Methods

This page describes the available methods within the HTML Canvas class

HTML Canvas methods

Method
Description

getHeaders

Returns the available Authentication Headers accordingly if the dashboard is public or not.

openDrawer

Embed a url's content in a drawer and displays it.

setDashboardDevices

Changes the currently selected device(s) in either multiple or single-device dynamic dashboards.

setDashboardDateRange

Changes the selected time range in a dashboard.

setRealTime

Turn on or off the dashboard's real time update.

refreshDashboard

Refreshes the dashboard data in all widget.

setDashboardLayer

Navigates to another layer.

getHeaders

Arguments: None

Signature: ubidots.getHeaders()

Return:

{
  Authorization: "Bearer receivedJWTToken",
  Content-type: "application/json"
}

openDrawer

Arguments: options: Object [mandatory] => An object containing the content's url and the drawer's width in px:

Signature:

Return: None

setDashboardDevices

Arguments: deviceIds: string [Mandatory] ⇒ Comma separated string with the Id's of the devices that you want to set.

Signature: ubidots.setDashboardDevices(<deviceIds>)

Return: None

setDashboardDateRange

Arguments: timeframe: Object [Mandatory] => An object containing the start and end timestamps:

Signature: ubidots.setDashboardDateRange(<timeframe>)

Return: None

setRealTime

Arguments: rt: Bool [Mandatory] => A boolean indicating the real time update setting

Signature: ubidots.setRealTime(<rt>)

Return: None

refreshDashboard

Arguments: None

Signature: ubidots.refreshDashboard()

Return: None

setFullScreen

Arguments: screenSetting: string(toggle | enable | disabled) [Mandatory] => A string representing the full screen setting.

Signature: ubidots.setFullScreen(<screenSetting>)

Return: None

setDashboardLayer

Arguments:

  • layer: string [Mandatory] ⇒ layer ID or label.

    • Use ID as a plain string: "6926000dcb198b4d10067b58"

    • Use label prefixed with ~: "~Layer-2"

  • queryParams: Object [Optional] ⇒ An object where each key/value pair will be added as a query param.

    • Allowed value types: string | number | boolean

    • Arrays are NOT allowed. If you need multiple values, pass a comma-separated string, e.g. "id1,id2,id3"

Last updated

Was this helpful?