A group gathers several widgets into one: a pump symbol made of a circle, a label and a region, or a whole area of a plant that should show and hide together. It is selected, moved, copied and hidden as one, while each member keeps its own formulas. A group draws nothing of its own. This page describes how groups are made and undone, what a group offers, and how its members are drawn.
ComponentGroup
A group is a ComponentGroup. It has no palette tile: it is made from a selection with Group and undone with
Ungroup, the toolbar buttons or their keys.
| Keys (Cmd instead of Ctrl on a Mac) | Action |
|---|---|
| Ctrl+G | Group the selected widgets |
| Ctrl+U | Ungroup the selected groups |
| Key | Editor label (English) | Formula or value | Result type | Default | Meaning |
|---|---|---|---|---|---|
components |
— (no editor: the members are edited in the component list) | Value | List of widgets | The widgets that were grouped | The members, in their drawing order: the first is on top |
Of the properties every widget shares, a group offers two:
name, the group's row in the component list. A new group is namedComponentGroupand a number.visible, a formula evaluated in the viewer:falsehides every member, the inputs and buttons among them included. A member is shown only while both the group and the member itself are visible. Like everyvisible, it needs a Boolean: see Result types.
What a group does not offer:
- Styles. The setup panel offers no Styles field, and a group's styles are never applied. Style each member.
- Offsets. The setup panel offers no X offset or Y offset field: a group cannot be moved by a formula. Give each member the same offsets instead.
- A size. A group has no width or height of its own, and no
dWidthordHeight. Its box, for selecting and aligning, is the box around all of its members.
Example. An area of the plant, and its inputs, shown only while the area is in service:
ComponentGroup Name AREA_2
Visible evl(AREA_2_IN_SERVICE == true, false)
Styling
- Element: an SVG group,
<g>, which holds the members' shapes. The members' inputs and buttons are HTML controls laid over the drawing, outside it. - Default styles: none that apply. A group made with Group still stores
{fill:"#6CF",stroke:"#000",stroke_width:3}in its record, which has no effect. - Keys that work: none. A group's styles are not applied.
- Keys to avoid: every key. Style the members, each with its own Styles.
- Example: to colour a whole pump symbol by its state, give each member the same condition:
Circle Styles {fill: evl(if(P101_RUN, "#16A34A", "#9CA3AF"), "#9CA3AF"), stroke: "#374151", stroke_width: 2}
Label Styles {fill: evl(if(P101_RUN, "#14532D", "#374151"), "#374151"), font_size: "12px"}
Grouping and ungrouping
- Group needs two widgets or more, all at the top level: a widget already inside a group cannot join a new one. A group can be grouped with other widgets, so groups can nest.
- The new group takes the place of the highest of its members in the component list. A widget that was between two members in the list ends up under the whole group.
- Ungroup puts the members back where the group was, in the group's order, and selects them. A group inside a group releases its members into the outer group.
- Deleting a group's last member deletes the group.
- Members keep their own coordinates and every property of their own. Moving a group, by dragging its centre handle or with the arrow keys, moves every member.
- Selecting. A click on a member selects the whole group; a second click goes one level in, to the member under the pointer, and Ctrl+click (Cmd+click on a Mac) goes straight to it. In the component list, a group's row holds its members. See Selecting, copying and grouping.
- Copying a group copies its members. A widget pasted while a member is selected goes into that member's group.
Drawing order inside a group
- Among the members, the first is on top, as in the component list. Move up and Move down move a member among the group's members.
- The members are kept in the order they were selected. A band drawn on the canvas keeps the order of the list. Widgets picked one by one with Shift+click or Ctrl+click on the canvas keep the order they were picked in, so the first one picked ends up on top: check the order after grouping, and correct it with Move up and Move down.
- The group as a whole is drawn at its own place in the component list, like any widget.
- Inputs and buttons stay above the drawing. A member that is an input or a button is drawn over every shape of the dashboard, grouped or not: see Paint order and layers. Among the inputs and buttons of one group, the first member is on top, as among its shapes.
Inputs and buttons in a group
Inputs, Buttons and Action buttons work in a group exactly as outside one:
- they are drawn, move with the group, and are hidden with it when the group's
visiblegivesfalse; - inputs and Buttons write their variables, and an Action button runs its script, as described on Inputs and Buttons;
- a group keeps its members redrawing: the view follows the variables of every member, at every depth.
In a panel, the members of a group are bound like every other widget: their variables and formulas name the codes the panel was opened with. See How binding works.
Next steps
This page describes Data Orchester Dashboards 1.9.4.