# Explore the graph

[Wiki](../README.md) / [Explorer](README.md)

The graph view draws the nodes and relationships in a result and lets you walk out from
them, a page of neighbours at a time, without writing another query. Nothing you do here
changes the database except **Edit**.

From version 2.2.2, Explorer counts what is still hidden behind every node, pages through
neighbours, works on a selection, and keeps an undo history.

## The canvas

Drag the background to pan, scroll to zoom and use **Fit** to see everything. Drag a node
to pin it where you drop it. **2D** and **3D** switch layouts; in 3D, Shift+drag (or a
right-button drag) orbits the camera and **Depth** exaggerates distance.

The graph shows up to 1,000 nodes. **Limit** on the canvas toolbar sets 300, 500, 1,000,
2,000 or 3,000. When a result has more nodes than the limit, the status line says how many
are shown; **Table** and **JSON** keep the whole result. Raising the limit lays out an
unexplored result again with more of its nodes.

Nodes returned by a query are joined by any relationships between them, so
`MATCH (u:User) RETURN u` also draws who follows whom. New nodes from an expand, a path
or an insight join the same way. Turn this off under **Style**.

**Relationships** shows or hides every relationship line and its type. The layout still
follows them, so connected nodes stay together. Above 400 relationships the type labels
are left off to keep the picture readable; click a relationship to see its type and
properties.

## What is still hidden

Turn on **Style → Show hidden relationship counts** and each node carries a badge such as
`+1.8k`: the relationships it has in the database that are not on the canvas. A node with no
badge has every relationship drawn; hover a badge for the exact count. The counts are off by
default from version 2.2.3.

## Expand

Double-click a node to load its next 50 neighbours. Double-click again for the next 50,
and so on until every relationship is drawn; each page carries on where the last stopped, in a
fixed order, so nothing is skipped or loaded twice. Once everything is shown, a
double-click collapses the node.

Alt+double-click, or **Collapse** in the inspector, removes the neighbours that came in
through that node, except any that are also linked to something else on the canvas.

When the graph reaches its limit, the expand stops at the first neighbour that does not
fit and says how many were left out. Raise the limit or hide some nodes, then expand again
to carry on from there.

## The neighbour breakdown

Click a node to open the inspector. Its **Neighbours** table counts the node's
relationships by direction, relationship type and the neighbour's label, with how many
of each are shown:

| | Type | Label | Shown |
|---|---|---|---|
| → | HAS_SESSION | Session | 50 / 1,800 |
| → | HAS_TAG | Tag | 0 / 12 |
| ← | FOLLOWS | User | 3 / 3 |

**+50** on a row loads the next page of just that group, so you can follow the tags
without pulling in every session. The inspector also has **Load 50 more**, **Collapse**,
**Hide**, **Edit** and, for a pinned node, **Unpin**.

## Right-click a node

From version 2.2.3, right-click a node for:

| Item | Does |
|---|---|
| Focus | Leaves only that node on the canvas |
| Focus with neighbours | Leaves the node, the nodes drawn next to it and the relationships between them |
| Load 50 more neighbours | The next page of its neighbours |
| Collapse | Removes what its expands brought in |
| Select neighbours | Selects the nodes drawn next to it |
| Shortest path to … | With one other node selected, draws the shortest path between them |
| Pin, Unpin, Hide, Inspect | As in the selection bar and the inspector |

After **Find in view** picks out a node of interest, **Focus** clears everything else away;
Ctrl+Z brings it back.

## Select

Click a node to select it. Shift+click (Ctrl+click in 3D) adds or removes nodes, Ctrl+A
selects everything, and clicking a label in the legend selects every node with that
label. Clicking empty canvas or pressing Esc clears the selection.

The selection bar along the bottom of the canvas acts on the selected nodes:

| Button | Does |
|---|---|
| Expand | Loads the next 50 neighbours of each selected node |
| Collapse | Removes what each selected node's expands brought in |
| Hide | Takes the selected nodes off the canvas (also the Delete key) |
| Keep only | Takes everything else off the canvas |
| Keep + neighbours | Keeps the selected nodes and the nodes drawn next to them |
| Pin, Unpin | Fixes the selected nodes in place, or lets them move again |
| Shortest path | With two nodes selected, draws the shortest path between them, up to 8 hops, in either direction |
| To editor | Puts `MATCH (n) WHERE id(n) IN [...] RETURN n` for the selection in the editor |

## Find in view

Type in **Find in view** and every node whose labels or property values contain the text
stays bright while the rest fade. `#42` finds the node with id 42. Press Enter to select
the matches; a single match is also opened in the inspector.

## Undo

**↶** (or Ctrl+Z) steps back through expands, collapses, hides, paths and the other
changes to the canvas, up to 25 steps for each tab.

## Edit properties

**Edit** in the inspector opens the property editor. Each property keeps its type: string,
integer, float, boolean, list or map (as JSON), bytes, and temporal or spatial values, which
are kept as they are. Types are checked before anything is sent, and **Save** replaces the
element's property map in one statement.

## Related articles

[Style, insights and saved views](insights.md) · [Write and run queries](queries.md) · [Paths](../cypher/paths.md)
