This file documents the custom attributes added for visualization.
All attributes are in the namespace http://phrogz.net/visual-scxml
,
usually denoted with the namespace prefix viz
.
The names and values are intentionally somewhat terse to limit the amount of text added to what should be a human-readable and human-editable XML file.
-
viz:xywh="x y w h"
— Four numbers separated by whitespace indicating the left and top location of the top left corner, and the width and height of the state. All values are in global space, even for states that are children of another state. (Moving the parent state in the visual editor updates the x,y coordinates for all descendants.)To be visualized correctly children of a parallel must:
- Be arranged left-to-right, in source code order, dividing up the width of the parent.
child.y = parallelParent.y + 30
child.h = parallelParent.h - 30
-
viz:rgb="rrggbb"
— hexadecimal integer values for red, green, and blue fill color
viz:pts="start (wayline+)? end?"
— route points for the transition line- The first and last values (
start
andend
) describe offsets along an edge of the initial and target state; for example,E20
is a point 20 units down from the top of the right edge, whileN0
is a point (nominally) along the of the state at the left edge. Transitions cannot attach in the rounded region of a state, and soN0
is actually the leftmost point on the top edge where the edge is straight, andN999999
would result in the rightmost point on the straight portion of the top edge. - Waylines are horizontal or vertical locations in global coordinates that the transition's path
must pass through. A wayline of
X10
causes the transition to pass through the closest point on the vertical line atx=10
; a wayline ofY-100
causes the transition to pass through the closest point on the horizontal line aty=-100
.
- The first and last values (
viz:r="10"
— fixed corner radius to use when changing directionviz:offset="along"
,viz:offset="along across"
— distance from the transition start point to place textalong
the transition's route, with an optional offsetacross
(perpendicular to) the transition's path at that point; positive values foracross
are to the right, negative to the leftviz:align="NW|N|NE|W|C|E|SW|S|SE"
— alignment of the text around the offset point:N
places the text to be above the point and horizontally centered,NW
makes it above and right-justified, and so on.