Style rules: colour shapes and markers by data
Write a facility's style rules once — conditions, fill colour, opacity, label, priority — and let data links and rack cells repaint by status. First match wins.
What a style rule is
A style rule says "when a record looks like this, paint it like that": a name, one or more conditions, the colours to use, and a priority. Rules belong to one facility. You write them once in the editor's side panel; each data link then ticks the rules it wants, and rack-cell rules also colour the facility's rack cells from their own data.
An example set for a facility with rooms and a rack: four rules colour rooms for a Room status data link from a rooms table's `status` field, and two colour rack cells from each bin's `custom.status`:
| Rule | Priority | Condition | Paint |
|---|---|---|---|
| Room available | p10 | `status` = Available | Green #22c55e, 50 % |
| Room in use | p10 | `status` = In use | Amber #f59e0b, 55 % |
| Room cleaning | p10 | `status` = Cleaning | Purple #a855f7, 55 % |
| Room out of service | p10 | `status` = Out of service | Slate #64748b, 60 % |
| Bin empty | p10 | `custom.status` = empty | Red #dc2626, 85 %, label "EMPTY" |
| Bin on hold | p20 | `custom.status` = blocked or `custom.status` = reserved | Slate #64748b, 70 % |
Priority: lowest number first, first match wins
For each record, a layer tries its ticked rules from the lowest priority number up (p5, then p10, then p20 …; ties go to the older rule). The first rule whose conditions match paints the record, and the rest are skipped. A record that matches nothing keeps the layer's default style. Switched-off rules are skipped.
A rule only overrides what it sets. If it sets a fill colour but no label, the label still comes from the layer's label field.
Find the Style rules panel
- 1Open the facility in the editor
On the Facilities page, open the facility's menu → Edit layout.
- 2Clear the selection
Press Esc or click empty map, so the side panel shows Workspace with the Layers list.
- 3Scroll to Style rules
The Style rules section sits near the bottom of the panel, below the lists of shapes. It lists this facility's rules in priority order, each as "scope · prio N · N cond".
| Control | What it does |
|---|---|
| Add rule | Creates "New rule" (scope Rack cell, `status` equals empty, grey fill, priority 10 above the current highest) and opens it. |
| Power icon | Enable rule / Disable rule — a disabled rule is skipped everywhere. |
| Pencil | Edit rule — opens the editor under the row. |
| Bin | Delete rule — removes it at once, from every layer that ticked it. |
If the facility has none yet: "No rules yet. Add one to paint cells / shapes from your imported data."
Write a rule
Changes save as you type; Done just closes the editor.
| Field | What to set |
|---|---|
| Name | What people see in the data link checklist. Prefixing the facility name keeps lists readable when several facilities use similar rules. |
| Priority | A number; lower runs first. Leave gaps (10, 20, 30) so you can slot rules in later. |
| Scope | Which kind of thing the rule is for: Any, Rack cell, Polygon, Circle, Line, Marker, Image, 3D model, Text label or Stair. |
| Combine | All match (AND) or Any matches (OR). Bin on hold above uses OR: blocked or reserved. |
| Suggest fields from data-link layer (optional) | Pick one of the facility's data links to list its real fields and values in the attribute menu — "N payload fields available in the attribute picker below." It isn't saved with the rule. |
| Target and Data source | Which shapes the rule paints and where its conditions read from, for rules that colour the facility's own shapes and rack cells. Data links ignore them. |
| Conditions | Attribute adds attribute · operator · value. Operators: =, ≠, <, ≤, >, ≥, in, not in, contains, starts with, ends with, is empty, is set, older than, newer than. No conditions means the rule always matches. |
| Paint when matched | Fill, Border, Opacity %, Border w., Elevation, Height and a Label template (optional) such as `{sku}` or `{capacity} units`. |
Apply rules to a data link
A rule does nothing to a data link until the link ticks it. Open the link (Data flyout → Manage data links → pencil), go to Style rules and tick the rules — see Style a data link layer. Change a rule later and every layer that ticked it repaints; viewers and share links follow automatically.
More in Data links
- Data links · OverviewData links: put live data on the mapA data link turns rows from a table, REST API or file into markers, tinted shapes, badges or heatmaps on a facility map. Learn the modes and the editor.
- Data links · ManagerManage a facility's data linksOpen the Data links list for a facility to search, switch on or off, edit and delete every data link — and find the shortcuts from the toolbar and shapes.
- Data links · Source and modePick a data source and display modeThe first three sections of a data link: name it, pick the table, REST API or file it reads, and choose one of nine display modes for the map.
- Data links · Shapes and floorsAttach data link records to shapes and floorsMatch each data-link record to a shape by name, role or external code, or pin a link to one shape, then choose which floors of the facility the layer shows on.