6.15. Layers management
The layers management widget allows the user to move graphical objects to multiple layers to create a contextualization between them or even to improve the model's visualization when the set of objects is too large to fit the entire canvas, for instance. The created layers can be quickly toggled, causing all objects associated with them to be shown or hidden. The user has the option to display layer names as well as colored rectangles around the objects that are within a certain layer. Layer rectangles around objects are currently available only for tables, views, and textboxes, and they are stacked around the objects if they belong to two or more layers. The sample image below shows a model that contains 2 layers (Default layer and rels).

Layers are not global entities, which means that the loaded database models can have a different set of layers according to the context of each one. The user is free to add or remove any number of layers needed in a model, but at least one layer must be present in the model, so pgModeler denies the removal of a layer if it is the only one in the model. Layer names can contain only the following characters: a-z, A-Z, -, _ and space; any other special character is replaced by _. To change the layers assigned to a set of objects, just right-click them in the canvas and hit the action Quick > Set layers.
Layers can also be generated from schemas: right-click a schema and choose Quick > Add layer from schema to create a layer named after the schema and put in it all the tables, foreign tables, and views of that schema (the rectangle of the schema is hidden afterward, since the layer already groups its objects). The item Quick > Add layers from schemas, available when right-clicking the database or a blank area of the canvas, creates one layer for each schema after asking for confirmation. Unlike tags, layers are cumulative, so objects that already belong to other layers just receive the new one.
123456789
| Layers | ||
|---|---|---|
| # | Field | Description |
| 1 | Add | Adds a new layer to the database model ( |
| 2 | Delete | Deletes the selected layer ( |
| 3 | Delete all | Deletes all the layers created by the user ( |
| 4 | Visibility | Visibility |
| 5 | Display layer rectangles | Toggles the visibility of the layer rectangles. |
| 6 | Relationships follow tables' visibility | Relationships are hidden or shown according to the visibility of their tables. When checked, this option ignores the layers' visibility of the affected relationships. |
| 7 | Display layer names | Toggles the visibility of the layer names. It is enabled only when |
| 8 | Select objects on selected layers | When checked, selecting one or more layers in the list selects, in the canvas, the objects assigned to them. |
| 9 | Layers | The layers of the model, including the default one. The check box beside each layer name toggles the visibility of the objects assigned to it; the columns |