Directives
Directives control the visual representation of elements, including icons, colors, attributes, and visibility.
Attribute Directives
These replace graph edges representing a relation with attribute fields within the source node of the edge.
1 2 |
|
Parameters
field
: Name of the field in the source specification upon which the constraint acts.
Size Directives
Assign a size to all atoms that meet a certain selector.
1 2 3 4 5 |
|
Parameters
selector
: A Forge expression that determines which elements upon which the constraint acts. This expression must return a set of singletons.height
: Height with which the node should be displayed.width
: Width with which the node should be displayed.
Pictorial Directives
Assign an icon to all atoms of a certain sig.
1 2 3 4 |
|
Parameters
selector
: A Forge expression that determines which elements upon which the constraint acts. This expression must return a set of singletons.path
: Path to the icon image (png
andjpg
supported). This path must be a publicly accessible URI.showLabels
: [Optional, defaultfalse
] Should atom labels (e.g., atom name, attributes) be shown in addition to icons. Iftrue
, the icon is made smaller to prevent overlap with label text.
Built In Icons
Cope and Drag also includes a selection of built in icons for ease of use.
Color Directives
Allow specific hex-colors (or simple color names) to be associated with selected atoms.
1 2 3 4 |
|
Parameters
selector
: A Forge expression that determines which elements upon which the constraint acts. This expression must return a set of singletons.value
: Hex (or simple english) description of the color to be applied.
Projection
These allow projections over atoms of a certain type.
1 2 |
|
Parameters
sig
: Sig name in the source specification.
Visibility Flags
Controls which elements are hidden.
1 2 |
|
Current flags are:
- hideDisconnected
: If true, hide all atoms in the graph that are not referenced by a relation.
- hideDisconnectedBuiltIns
: If true, hide all atoms of built-in type (ex. Int
) that are not referenced by a relation.
Inferred Edge
The inferredEdge
directive introduces visually distinct edges that represent inferred relationships — connections the diagrammer wants the viewer to see to better understand the model. These edges are not part of the model itself but help the viewer mentally hold and interpret higher-level connections.
1 2 3 4 |
|
Parameters
selector
: A Forge expression that determines which elements upon which the constraint acts. This expression must return a set of elements of arity >= 2, and the first and last of each tuple will be used.name
: The label to be given to this edge. Any ''middle'' tuple elements in the selector (i.e. elements that are not first or last in the tuple) are appended to this name to better identify edges.