config-fields.md

September 16, 2021 · View on GitHub

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.

widgetpropertytypenotes / example
ui_buttoncolorstringnot needed
bgcolorstringnot needed
iconstringon refresh
formatstringnot needed
tooltipstringon refresh
classNamestring(Note 4)
ui_chartlookstring"line","bar","horizontalBar","pie","polar-area","radar"
legendboolean 
interpolatestring"linear","step","bezier"
nodatastring 
yminnumber 
ymaxnumber 
dotboolean 
xformatstring"HH:mm:ss"
cutoutnumber 
colorsobjectn/a
useOneColorbooleann/a
spanGapsbooleann/a
animationstring(Note 1), {duration:1000, easing:"easeInOutSine"}
optionsobject(Note 2), {scales: {yAxes: [{ticks: {fontSize: 20}}]}}
classNamestring(Note 4)
ui_colour_pickerformatstringon refresh
showPickerbooleanon refresh
showSwatchbooleanon refresh
showValuebooleanon refresh
showAlphabooleanon refresh
showLightnessbooleanon refresh
classNamestring(Note 4)
ui_dropdownplacestring"placeholder text"
optionsarray[{"label":"foo","value":"0","type":"str"}]
classNamestring(Note 4)
ui_gaugegtypestring"gage", "donut", "compass", "wave"
minnumber 
seg1numbersegment 1 limit
seg2numbersegment 2 limit
maxnumber 
colorsarray["blue","#00ff00","#f00"]
optionsobject(see Note 3 below)
classNamestring(Note 4)
ui_numericminnumber 
maxnumber 
stepnumber 
formatstring"{{value}}"
classNamestring(Note 4)
ui_sliderminnumber 
maxnumber 
stepnumber 
classNamestring(Note 4)
ui_switchoniconstringall or nothing
officonstringall or nothing
oncolorstringall or nothing
offcolorstringall or nothing
classNamestring(Note 4)
ui_templateformatstringthe script
templateScopestring"local" or "global"
classNamestring(Note 4)
ui_textformatstring"{{value}}"
layoutstring"row-left", "row-right", etc
classNamestring(Note 4)
ui_text_inputmodestring"text", "email", "password", "color"
delaynumber 
classNamestring(Note 4)

Notes:

  1. See http://easings.net/ for examples of easings for chart animation.

  2. The chart can take many of the angular-chartjs options for changing axes label, scales etc

  3. The gauge options can accept any of the Justgage parameters for example:

     {"options":{"pointer":false,"gaugeWidthScale":1.5}}
     {"options":{"pointer":true,"gaugeWidthScale":0.4,"reverse":true}}
    
  4. when a className is specified, it is added to the parent element. E.g for a button, the class is added to the md-card This permits overriding of styles in all sub elements e.g. md-card.my-button button { color: red }

Likewise the Wave type gauge can accept liquidfillgauge config options for example:

    {options:{circleColor:"#FF7777", textColor:"#FF4444", waveTextColor:"#FFAAAA", waveColor:"#FFDDDD", circleThickness:0.3, textVertPosition:0.2, waveHeight:0.05, waveCount:8}}