dash
dash, keyword
The dash keyword marks assignments evaluated during the interactive phase.
Dash variables exist only in the browser, and are recomputed when the user changes inputs.
Example
read upload "values" as Submitted with
Id : text
Value : number
table T[id] = with
[| as id, as Min, as Max |]
[| "A", 1, 5 |]
[| "B", 0, 10 |]
mutable T.Value = single(Submitted.Value) by Submitted.Id at T.id default 0
dash T.IsValid = T.Min <= T.Value and T.Value <= T.Max
dash T.Color = if T.IsValid then "default" else "red"
show table "Values" editable: "values" with
T.id { columnReadOnly: true }
T.Value mutable { cellBackground: #[T.Color] }
T.Min { columnReadOnly: true }
T.Max { columnReadOnly: true }
Remarks
Dash expressions can use number, boolean, text, date, week, month, markdown,
any enum, and tuples of those types. They support comparisons, arithmetic, boolean logic,
if then else, match, interpolation, broadcasting, and pure functions marked as dash.
A dash assignment cannot depend on itself, directly or indirectly. This also
applies when the expression is evaluated over slices.
Dash variables are rejected in non-dash contexts such as write, where, and non-dash
assignments, except for system-defined tiny tables.
Dash expressions can be displayed by browser-evaluated tiles such as gauge.
Tiles that still use server-side matrix evaluation reject dash expressions in
their with columns. The current rejecting tile types are assert,
histogram, menu, plot, scatter, slicepicker, slicetree, treemap,
and upload.
When a tile rejects such an expression, compilation fails with a message of the form:
'dash' expressions are not supported as columns in 'show upload'.