@@ -55,68 +55,104 @@ The main area of the viewport may initially be empty in the following cases:
55
55
- Reopening the Graph Visualizer after a previous session
56
56
-->
57
57
58
- You can [ Add nodes to the canvas] ( #add-nodes-to-the-canvas ) as well as
59
- [ Display a subgraph using a query] ( #display-a-subgraph-using-a-query ) .
58
+ You can [ Add nodes to the canvas manually] ( #add-nodes-to-the-canvas-manually )
59
+ as well as [ Add nodes and edges using a query] ( #add-nodes-and-edges-using-a-query ) .
60
+ Afterwards, you can also [ Add nodes and edges using a query based on a selection] ( #add-nodes-and-edges-using-a-query-based-on-a-selection ) .
60
61
61
62
### The viewport
62
63
63
64
The Graph Visualizer interface is comprised of the following components:
64
65
65
66
- ** Canvas** : The main area of the viewport.
66
- - ** Explore ** :
67
- A widget in the top left corner that opens a dialog for selecting nodes and
68
- edges to display.
67
+ - ** Search & add nodes to canvas ** and ** Queries ** :
68
+ A widget in the top left corner that opens dialogs for selecting nodes and
69
+ edges to display (manually or using queries) .
69
70
- [ ** Customization** ] ( #visual-customization ) :
70
71
A sidebar on the right-hand side to adjust the styling.
71
72
- [ ** Layout and Navigation** ] ( #layouts-and-navigation-tools ) :
72
73
A minimap and multiple tools for the canvas in the bottom right corner.
73
74
74
- ### Add nodes to the canvas
75
+ ### Add nodes to the canvas manually
75
76
76
77
You can add individual nodes to the canvas in addition to what is already
77
78
displayed.
78
79
79
- 1 . Click ** Explore** .
80
- 2 . On the ** Search** tab, select a ** Vertex type** . This is the name of the
81
- collection that stores the node you want to select.
82
- 3 . Enter a value into the ** Search** field. <!-- TODO: Which attributes?! -->
80
+ 1 . Click ** Search & add nodes to canvas** .
81
+ 2 . Select a ** Node type** . This is the name of the collection that stores the
82
+ node you want to select.
83
+ 3 . Enter a value into the ** Search** field. This searches common attributes
84
+ as indicated by the placeholder text and finds up to 10 nodes that contain
85
+ this text in one of these attributes (case-insensitive).
83
86
4 . Select one or more nodes from the list on the left-hand side.
84
87
5 . Optional: You can check the attributes of the selected nodes on the
85
88
right-hand side. Use the buttons at the bottom to switch between nodes.
86
89
6 . Click ** Add _ n_ vertices** .
87
90
7 . To see the neighbor nodes and the edges that connect them, right-click a node,
88
- click ** Expand (_ n_ )** and then ** All (_ n_ )** . <!-- TODO: What other options exist? -->
91
+ click ** Expand (_ n_ )** and then ** All (_ n_ )** .
89
92
90
- ### Display a subgraph using a query
93
+ ### Add nodes and edges using a query
91
94
92
- You can run an AQL query to view a subset of the graph.
93
- It replaces the current content of the canvas.
95
+ You can run an AQL query to add a nodes, edges, or paths of the graph to the canvas.
94
96
95
- 1 . Click ** Explore** .
96
- 2 . On the ** New query** tab, enter an AQL query that returns edges or paths
97
+ 1 . Click ** Queries** of the top-left widget.
98
+ 2 . Click ** New query** .
99
+ 3 . Enter an AQL query that returns nodes, edges, or paths
97
100
(e.g. a graph traversal query), for example:
98
101
``` aql
99
- FOR edge IN edgeColl FILTER edge.value > 10 RETURN edge
102
+ FOR node IN coll LIMIT 10 RETURN node // [ { "_id": "..." }, ... ]
100
103
```
101
104
``` aql
102
- FOR v, e, p IN 1..3 ANY "coll/753" GRAPH "myGraph" RETURN p
105
+ FOR edge IN edgeColl FILTER edge.value > 10 RETURN edge // [ { "_from": "...", "_to": "...", "_id": "..." }, ... ]
103
106
```
104
- 3 . The edges and their nodes appear on the canvas.
107
+ ``` aql
108
+ FOR v, e, p IN 1..3 ANY "coll/753" GRAPH "myGraph" RETURN p // [ { "vertices": [...], "edges": [...] }, ... ]
109
+ ```
110
+ 4 . Click ** Run query** . Depending on what the query returns, either only nodes
111
+ or edges with their nodes appear on the canvas, in addition to what is
112
+ already displayed.
105
113
106
114
{{< tip >}}
107
115
You can save queries for future use:
108
116
109
- 1 . Click ** Explore** .
110
- 2 . On the ** New query** tab, click ** Save as** , enter a name and optionally a
111
- description, then click ** Save** .
112
- 3 . To run a saved query, click ** Explore** .
113
- 4 . On the ** Saved Queries** tab, you can see a list of saved queries, and the
114
- following actions are available for each:
117
+ 1 . Click ** Queries** of the top-left widget.
118
+ 2 . Click ** New query** .
119
+ 3 . Enter or edit the AQL query you want to save. You can optionally use
120
+ bind variables to parameterize saved queries.
121
+ 4 . Enter a name and optionally a description, then click ** Save** .
122
+ 5 . To run a saved query, click ** Queries** of the top-left widget.
123
+ 6 . Select a query from the list. The following actions are available for each query:
124
+ - ** Bind Variables** to set for the query.
115
125
- ** Run** the query.
116
126
- ** Copy** the query string to the clipboard.
117
127
- ** Delete** a no longer needed query.
118
128
{{< /tip >}}
119
129
130
+ ### Add nodes and edges using a query based on a selection
131
+
132
+ You can select nodes and edges on the canvas and then use a ** Canvas Action** .
133
+ This runs an AQL query to add nodes, edges, or paths of the graph to the canvas.
134
+ The query has access to the current selection via special bind variables.
135
+
136
+ 1 . Create a selection. You have different options:
137
+ - Click a node or edge to select only this element.
138
+ - Hold the ** Shift** or ** Ctrl** key and click multiple nodes and edges.
139
+ - Hold the ** Shift** or ** Ctrl** key and drag the mouse to perform a box selection.
140
+ 2 . Right-click the canvas, click ** Canvas Action** , and select a saved action.
141
+ 3 . Depending on the query, additional nodes or edges with their nodes are added
142
+ to the canvas.
143
+ 4 . To create a custom Canvas Action query, click ** Queries** of the top-left widget.
144
+ 5 . Click ** Canvas Actions** , then ** New action** .
145
+ 6 . Enter an AQL query that makes use of the special bind variable ` @nodes ` ,
146
+ ` @edges ` , or both and returns nodes, edges, or paths. Examples:
147
+ ``` aql
148
+ FOR selectedNode IN @nodes
149
+ FOR v, e, p IN 1..3 ANY selectedNode GRAPH "myGraph"
150
+ FILTER p.edges[*].value ALL < 7
151
+ LIMIT 20
152
+ RETURN p
153
+ ```
154
+ 7 . Enter a name and optionally a description for the action and click ** Save** .
155
+
120
156
### View node and edge properties
121
157
122
158
You can inspect the document attributes of node or edge as follows:
0 commit comments