8. The canvas surface
Contents of ATD 0.1
The surface of a diagram (grammar/canvas.lark): its coordinates, notation, toolbox, forms, layout and viewpoints, each carrying the DISL construct named here (FR-003).
coordinates { … } (DISL §5.2) holds system <name> { … } (DISL's CoordinateSystem, §5.7), axis <name> { … } (DISL's Axis, §5.3 to §5.6), snapping <name> { … } (a snapping profile, DISL's Snapping, §5.9 and §5.10), default <system>, and settings of DISL's Coordinates.
A node's placement (DISL §5.8) is its setting placement: { … } (DISL's Placement), whose coordinates are values: a literal, @attribute for a two-way binding to an attribute, or ( CEL ). A node's snapping is its setting snapping.
notation { … } (DISL §6) holds:
theme { … }: DISL'sTheme(tokens,modes,defaultMode,followSystem,contrast), its tokens keyed by dotted names (color.surface: "#FFFFFF");style <name> [extends <names>] { … }: a named style, DISL'sStyle;shape <name> { … },marker <name> { … },icon <name> { … }: custom shapes, markers and icons (DISL'sShapeDef,MarkerDef,IconDef);canvas { … }anddefaults { … }: DISL'sCanvasand the notation's defaults;node,edgeandportnotations (sections 8.4, 8.5);- settings of DISL's
Notation(textMetric,fonts).
node <Types> { … } is the notation of element types (DISL §6.9):
shape <value> [{ … }]: the shape, a built-in or defined one, with its parameters (DISL'sShapeInstance);label <value> [as <id>] [{ … }]: a label, its text a value, its id afteras, and DISL'sLabelas settings (editable,position,wrap,placeholder, …);variant <name> [when <CEL>] { … }: a variant (DISL'sNodeVariant), with the members of a node notation;state <name> { … }: the style of a state (hover,selected,dropTarget, …, DISL'sStates);compartment <id> { … },badge <id> { … },port <Types> { … }: DISL'sCompartment,BadgeandPortNotation;- settings of DISL's
NodeNotation(style,size,anchors,container,icon,deletable,refusals,doubleClick,lod,tooltip, …), and of DISL'sStyle(fill,stroke,font,padding, …): a setting that is a property ofStyleand not ofNodeNotationis a property of the node's inline style, itsstylewhen it names no style, or the style it adds to the one it names.
edge <Types> { … } is the notation of relation types (DISL §6.10), and of reference attributes: a name <Type>.<attribute> draws the edge DISL §6.10 draws for the reference attribute attribute of Type, whose type MUST be an element type, and self in it is the element that holds the attribute. Its members are line { … } (DISL's LineSpec), marker source|target|mid <value> [{ … }] (DISL §6.11), label, variant, state, and settings of DISL's EdgeNotation (selectable, deletable, reconnectable, layer, anchoring, stub, …) and, as for a node, of its inline Style.
toolbox { … } (DISL §7.1 to §7.4) holds group <id> ["<label>"] { … } (nested groups and tools, DISL's ToolGroup), tool <id> ["<label>"] { … } (DISL's Tool), context [for <Types>] [when <CEL>] { … } (a context tool set, DISL's ContextToolSet, whose tool [<name>] ["<label>"] { … } entries are DISL's ContextTool), template <id> ["<label>"] { … } (DISL's Template), and settings of DISL's Toolbox (generic, position, searchable, starters). A context tool has no id in DISL, so its name is optional and its block is not.
form <id> ["<label>"] [for <Types>] { … } is a form (DISL §7.5): field <attribute> ["<label>"] { … }, section [<id>] ["<label>"] { … } holding fields, sections and items, and item [<id>] ["<label>"] { … } for every other kind of form item, each with DISL's FormItem as settings; and settings of DISL's Form. A field of a form that an operation names as its paramsForm edits that operation's parameter of the same name, not an attribute. Forms are admitted in diagrams and designers (section 14.4). An embedded form is a node's setting form (DISL §7.6).
layout { … } (DISL §10) holds default <name>, algorithm <name> [capability <name>] { … }, and settings of DISL's Layout (animate, incremental, respect, trigger, containers). An algorithm is either one of DISL's (its setting algorithm: tidyTree, layered, force, rowPacked, rows, with DISL's LayoutConfig), or a capability of the layout extension point, named after capability and given its arguments as settings (section 13.3). A query argument is evaluated with self the node, or the edge, it is asked of. A layout capability's result may carry values, numbers its contract names for each node or edge it places, which the notation's CEL reads as layout.value(e, name): the number the default algorithm gave e under name, or null where it gave none, so that a drawing can follow numbers its layout computes (layout.flowRelaxation's top, sourceAt and targetAt).
viewpoint <id> ["<label>"] { … } is a viewpoint (DISL §3.5, DISL's Viewpoint).