Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Dashboard capabilities

Everything a Custom Metric widget can read from and do on the dashboard with @ubidots/react-html-canvas hooks, actions and widget events

A Custom Metric widget talks to the dashboard only through @ubidots/react-html-canvas. There are two directions: what the widget can GET (read) and what it can EMIT (drive). Each page below gives the exact shape and a snippet.

GET: read from the dashboard

What
How
Page

The widget's configured variables and their values

useWidgetEvents() onInfo / onData

All devices on the dashboard

useUbidots().state.dashboardDevices

The selected device(s)

useUbidotsSelectedDevice() / useUbidotsSelectedDevices()

The dashboard date range

useUbidotsDashboardDateRange()

Real-time on or off

useUbidotsRealTimeStatus()

Dashboard filters

useUbidotsSelectedFilters()

The dashboard object

useUbidotsDashboardObject()

EMIT: drive the dashboard (useUbidotsActions())

What
How
Page

Change the selected device(s)

setDashboardDevice(id) / setDashboardMultipleDevices([ids])

Set the date range

setDashboardDateRange({ startTime, endTime })

Turn real-time on or off

setRealTime(boolean)

Refresh the dashboard

refreshDashboard()

Fullscreen

setFullScreen('toggle' | 'enable' | 'disable')

Open a side drawer

openDrawer({ url, width })

Change the layer

setDashboardLayer(layerId)

Widget-to-widget events (useWidgetEvents())

What
How
Page

Emit and subscribe

emitWidgetEvent(event, payload) / onWidgetEvent(event, cb) / onAnyWidgetEvent(cb)

Last updated

Was this helpful?