This document is not up-to-date, please refer to the Japanese document.
InfoType API
plugin.js created by infomotion-tool
has a set of apis.
addData, clearData, resize and getEl.
addData
addData is called when date range is selected or timeline is toggled.
- Parameter: data
The data passed is based on the daterange or toggled dates/time.
clearData
When date range is selected, timeline is toggled or live mode is activted clearData is called.
- Parameter: N/A
resize
When the browser window changes size resize is called.
- Parameter: option.width, option.height
getEl
Returns the dom
- Parameter: N/A
InfoType settings modal
To make infotypes flexable to different data sets a settings schema is needed. There are 4 types
text
list
select
bool
.
An InfoType has a Schema and a default settings.
text
A basic key/value input setting.
* Schema
{
"type": "text",
"name": "tag"
}
* Default
{
"tag" : "tag-name"
}
list
A list of key/value input settings.
* Schema
{
"type": "list",
"name": "list-of-tags",
"help": "Set name of each tag",
"children": [{
"type": "text",
"name": "tag"
}]
}
* Default
{
"list-of-tags":[
{"tag":"tag1"},
{"tag":"tag2"},
{"tag":"tag3"}
]
}
select
A select option setting.
* Schema
{
"type": "select",
"name": "mode",
"help": "please select a mode",
"options": ["mode1", "mode2"]
}
* Default
{
"mode":"mode2"
}
bool
An on/off switch.
* Schema
{
"type" : "bool",
"name" : "switch",
"help" : "turning on will display something"
}
* Default
{
"switch": true
}