Many many options can be changed via msg.ui_control
## UI Widget configuration via msg.ui_control
The following configuration properties of ui widget nodes can be set by using a `msg.ui_control` property on a msg.
Multiple properties of the node can be set at the same time. For example you can use a change
node to set msg.ui_control to JSON `{ "min":10, "max":50 }`
**Note**: It is still recommended that nodes are configured via the editor in order to preset the default values.
|widget |property |type | notes / example
|--- |--- |--- |---
|ui_button |color |string | not needed
| |bgcolor |string | not needed
| |icon |string | on refresh
| |format |string | not needed
| |tooltip |string | on refresh
| |className |string | (Note 4)
|ui_chart |look |string |"line","bar","horizontalBar","pie","polar-area","radar"
| |legend |boolean |
| |interpolate |string |"linear","step","bezier"
This file has been truncated. show original
const dataset = obj.node.dataset ? obj.node.dataset : {};
// check for defaults
const defaults = !isUndefined(config.defaults) ? config.defaults : false;
if (defaults !== false) {
config = extend({}, config, defaults);
delete config.defaults;
}
// configurable parameters
obj.config = {
// id : string
// this is container element id
id: config.id,
// classId : string
// this is the class id utilize when generating styles
classId: uuid(),
// value : float
// value gauge is showing
Flow:
[{"id":"8a9931c63ddf715b","type":"inject","z":"afcfe6f7a144f0b4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"2","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":230,"y":620,"wires":[["468db23d521c4844"]]},{"id":"468db23d521c4844","type":"random","z":"afcfe6f7a144f0b4","name":"","low":1,"high":10,"inte":"true","property":"payload","x":400,"y":620,"wires":[["de06e2704d7ddfe6"]]},{"id":"de06e2704d7ddfe6","type":"ui_gauge","z":"afcfe6f7a144f0b4","name":"","group":"d129285e4b08a665","order":2,"width":"3","height":"3","gtype":"donut","title":"gauge","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":570,"y":660,"wires":[]},{"id":"9ab1252e4c2a76e6","type":"inject","z":"afcfe6f7a144f0b4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":660,"wires":[["9d83cf7302235638"]]},{"id":"9d83cf7302235638","type":"change","z":"afcfe6f7a144f0b4","name":"gauge color","rules":[{"t":"set","p":"ui_control","pt":"msg","to":"{\"options\":{\"gaugeColor\":\"#ff00ff\"}}","tot":"json"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":660,"wires":[["de06e2704d7ddfe6"]]},{"id":"d129285e4b08a665","type":"ui_group","name":"Select Station","tab":"85850867b381145e","order":1,"disp":true,"width":"6","collapse":false},{"id":"85850867b381145e","type":"ui_tab","name":"Trains","icon":"dashboard","disabled":false,"hidden":false}]