Skip to content

Property maths

The following syntax allow writing mathematical formulas in widgets' properties:


Where FORMULA is a valid MathJS expression:

  • syntax documentation
  • available functions
  • available constants
  • formulas can be multiline
  • property inheritance calls (@{...}) are always resolved before formulas
  • arrays / matrices indexes are zero-based (ie ["a","b"][0] returns "a")
  • strings can be multiline when enclosed in backticks instead of double quotes (` `)
  • inner closing brackets (}) must be escaped with a backslash (\})

Additionnal functions:

  • unpack(x): remove an array's brackets (unpack([1,2]) returns "1, 2")
  • pad(x, padding): add leading zeros if the length the integer part of x is smaller than padding (pad(1,2) returns "01")
  • length(x): returns the length of an array or string

A single widget property can contain multiple formulas. Variables and functions declared in a formula are available to subsequent formulas in the same property definition.