Skip to main content

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) {
...
}
}
FieldDescription
versionThe version of the visualizer API.
typeThe type of the monitor. Two options are available: scoreboard, and table.
doThe 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:

MethodDescriptionParametersReturns
getTokenRequest access tokenNoneToken or empty string
refreshTokenRefresh access tokenNoneToken or empty string
askForAuthorizationAsk the user for authorizationNoneNone
showMessageShow a message to the userStringNone
setScoreboardSet a Scoreboard dataCheck the Monitor Types sectionNone
setTableSet a Table dataCheck the Monitor Types sectionNone