This repository provides the library that is used to communicate Ubidots' HTML Canvas widgets with the dashboard.
For now it provides access to the following events:
- A device has been selected in the dashboard
- The date range of data shown in the dashboard has changed.
- A new token has been generated by Ubidots.
- The real time status has changed
It provide the following 'setters' methods
-
setDashboardDevice: Ability to set the selected device in a dynamic dashboard
-
setDashboardDateRange: Ability to set the date and time range in a dashboard, dynamic or static.
-
setRealTime: Ability to turn on or off the dashboard read time update
-
refreshDashboard: Ability to refresh the dashboard data in all widget
If you want to use this library in your Ubidots' HTML Canvas, you can read the following article in our help center.
HTML Canvas: Interacting with account data
- Node v10 or greater. We recommend using the latest LTS version (Node 12 at the time of writing this README).
- Yarn
After you clone this repository in your local machine you must execute the following steps in order to generate the production file:
- Install the dependencies of the project:
yarn install
. - Transpile the src files:
yarn build
.
You must now have folder called build/
in the projects' root folder which contains two files:
ubidots-html-canvas.js
ubidots-html-canvas.js.map
If you'd like to run the current tests of the project you must execute the following command: yarn unit
which will
run every file that is in the tests/
folder.