FacetDocs

Chart

The behavior of a set compiles to a feature: a statechart, the binding of its states to the set's variants, and design axes. This page lists both forms side by side.

Compact (on a set)Full chart
"start": "Loading""initial": "Loading"
"Loading": {"LOADED": "route"}"Loading": {"view": "Loading", "on": {"LOADED": {"target": "route"}}}
"route": ["a == 'x' -> Failed", "Ready"]"route": {"always": [{"target": "Failed", "guard": "a == 'x'"}, {"target": "Ready"}]}
"plays": {"Retry": ["FAIL", "RETRY"]}"plays": [{"name": "Retry", "events": ["FAIL", "RETRY"]}]
"targets": {"RETRY": "Retry"}"binding": {"targets": {"RETRY": "Retry"}}
"looks": {"Look": {"Dark": "Kit/Dark"}}"designAxes": [{"name": "Look", "values": {"Dark": [{"mode": {"collection": "Kit", "mode": "Dark"}}]}}]

Guards

Guards are expressions over the scenario's axis values and the chart's context: numbers, quoted strings, true, false, null; !, -, +, *, /, %; <, <=, >, >=, ==, !=, ===, !==; &&, ||, ??; c ? a : b; parentheses; .length; and in('state.path'), true while that state is active. An unknown name is an error, not a value.

Axes

"axes": {"traffic": ["steady", "idle", "stopped"],
         "rhythm": {"values": ["daily", "weekly"], "when": {"traffic": ["idle", "stopped"]}}}

Every combination of axis values is a scenario; an axis with when varies only where the earlier axes it names take those values.

Commands

CommandShows
facet chart FEATUREwhere each view is reachable, coverage, play skeletons (--full per scenario)
facet states COMPONENTeach view's variant and where it is reachable
facet plays list / runplays and their runs per scenario
facet lattice FEATURE matrixevery state of a component in every scenario, as live instances
facet chart import @chart.jsonstores a full-format chart (or {"chart", "binding", "designAxes"})