Visualizer
The Visualizer is the tool you use to build visualization for your monitor. You should provide a JS object, that has the same signature like the example below:
{
version: 1.0,
type: "<type>",
do: async function(ctx) {
...
}
}
Field | Description |
---|---|
version | The version of the visualizer API. |
type | The type of the monitor. Two options are available: scoreboard , and table . |
do | The function that will do the visualization. |
More about the do function​
This function is supplied with an input usually called ctx
which is provided with useful functions you may need.
The ctx Object​
This object has some useful methods like getToken
and askForAuthorization
, which makes working with OAuth easier.
All the methods included with the ctx
object are:
Method | Description | Parameters | Returns |
---|---|---|---|
getToken | Request access token | None | Token or empty string |
refreshToken | Refresh access token | None | Token or empty string |
askForAuthorization | Ask the user for authorization | None | None |
showMessage | Show a message to the user | String | None |
setScoreboard | Set a Scoreboard data | Check the Monitor Types section | None |
setTable | Set a Table data | Check the Monitor Types section | None |