Layers in a Neo4j graph model

Layers let you split a model into parts you can show, hide, and lock separately: the hardware and the software of a system, the current model and a proposed change, or each imported source on its own. They're one of the two things toro4n adds to plain graph drawing; the other is notes.

The Layers panel

Open it with the Layers tab in the side panel or the L key. Each layer has an eye to show or hide it, a lock, a name you can rename, and a position you can drag. The active layer is where new nodes go. Show all and Hide all at the top switch every layer in one step.

A node can be in several layers

Select a node and the Edit tab shows one switch per layer. A node is visible when at least one of its layers is visible, locked when any of them is locked, counted in each of them, and drawn once, in the topmost of its visible layers. The last layer can't be switched off. A duplicate goes into the same layers as the original; pasted and new nodes go into the active layer only. If the active layer is hidden when you add something, it's shown again so you can see what you made.

Relationships and layers

A relationship has no layer by default: it's visible when both of its nodes are, and locked when either of them is. You can put a relationship in a layer with the Layer dropdown in its section; it's then visible only when that layer and both nodes are, follows the layer's lock, and goes with the layer's contents when the layer is deleted. Default takes it back out.

Deleting a layer

Deleting a layer asks what to do with its contents: Move contents to another layer, or Delete contents. Nodes that also belong to another layer stay there either way.

Two fixed layers

Layers and import

Every import gets a layer of its own, named in the Import dialog ("Layer for this import"; blank means the imported model's name, and a dropped file's name is prefilled). When you add an imported model to the open one, the new layer holds every node and relationship the import brought, and a node that received an imported node is added to it too, so hiding that layer hides everything the import changed. The imported model's own layers don't come along. Opening a file with File → Open keeps its layers.

Layers in export

SVG and PNG draw everything, hidden layers included, unless you check Visible layers only. JSON and Cypher always include everything; a JSON file keeps the layers themselves and reopens with the same visibility and locks.

Related