From 21c59ff446849bb5db9e05bbc8a801a0ca329601 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 31 Aug 2018 11:16:40 +0200 Subject: [PATCH] docs/log: math timestamp --- CHANGELOG.md | 3 ++- resources/docs/extras/property-maths.md | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d516606..aaa5868f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,9 @@ - **new** `gyroscope` widget - **new** `frame` widget - **breaking change** in `panel`: dropped Visual Format Language support (`layout` and `spacing` properties) + - maths: added `timestamp()` function - editor - - widget property names can be clicked to show documentation + - widget property names can be clicked to show documentation - misc - the client app can be translated (https://github.com/jean-emmanuel/open-stage-control/issues/302) diff --git a/resources/docs/extras/property-maths.md b/resources/docs/extras/property-maths.md index b229e48a..70a96129 100644 --- a/resources/docs/extras/property-maths.md +++ b/resources/docs/extras/property-maths.md @@ -14,7 +14,7 @@ Where FORMULA is a valid [MathJS](http://mathjs.org/docs/expressions/syntax.html - formulas can be [multiline](http://mathjs.org/docs/expressions/syntax.html#multiline-expressions) - 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 (``` ` ` ```) +- strings can be multiline when enclosed in backticks (``` ` ` ```) - inner closing brackets (`}`) must be escaped with a backslash (`\}`) Additionnal functions: @@ -22,6 +22,9 @@ 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 +- `values(x)`: returns an array of a given object's own property values +- `keys(x)`: returns an array of a given object's own property names +- `timestamp()`: returns the number of milliseconds elapsed since January 1, 1970 !!! tip "" 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.