Skip to content

Commit 7076ca3

Browse files
committed
Add neo4j_viz block for exampels
1 parent 84191e4 commit 7076ca3

6 files changed

+114
-6
lines changed

doc/modules/ROOT/pages/tutorials/graph-analytics-serverless-self-managed.adoc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ version `1.15` or later.
3535

3636
[source, python, role=no-test]
3737
----
38-
%pip install "graphdatascience>=1.15" python-dotenv
38+
%pip install "graphdatascience>=1.15" python-dotenv "neo4j_viz[gds]"
3939
----
4040

4141
[source, python, role=no-test]
@@ -252,6 +252,18 @@ G, result = gds.graph.project(
252252
str(G)
253253
----
254254

255+
[source, python, role=no-test]
256+
----
257+
# Let us visualize the projected graph
258+
from neo4j_viz.gds import from_gds
259+
260+
VG = from_gds(gds, G, db_node_properties=["name"])
261+
for node in VG.nodes:
262+
node.caption = node.properties.get("name")
263+
264+
VG.render(initial_zoom=1.2)
265+
----
266+
255267
== Running Algorithms
256268

257269
You can run algorithms on the constructed graph using the standard GDS

doc/modules/ROOT/pages/tutorials/graph-analytics-serverless-standalone.adoc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ version `1.15` or later.
3434

3535
[source, python, role=no-test]
3636
----
37-
%pip install "graphdatascience>=1.15" python-dotenv
37+
%pip install "graphdatascience>=1.15" python-dotenv "neo4j_viz[gds]"
3838
----
3939

4040
[source, python, role=no-test]
@@ -204,6 +204,18 @@ G = gds.graph.construct("people-fruits", nodes, relationships)
204204
str(G)
205205
----
206206

207+
[source, python, role=no-test]
208+
----
209+
# Let us visualize the projected graph
210+
from neo4j_viz.gds import from_gds
211+
212+
VG = from_gds(gds, G, db_node_properties=["name"])
213+
for node in VG.nodes:
214+
node.caption = node.properties.get("name")
215+
216+
VG.render(initial_zoom=1.2)
217+
----
218+
207219
== Running Algorithms
208220

209221
You can run algorithms on the constructed graph using the standard GDS

doc/modules/ROOT/pages/tutorials/graph-analytics-serverless.adoc

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ version `1.15` or later.
3535

3636
[source, python, role=no-test]
3737
----
38-
%pip install "graphdatascience>=1.15" python-dotenv
38+
%pip install "graphdatascience>=1.15" python-dotenv "neo4j_viz[gds]"
3939
----
4040

4141
[source, python, role=no-test]
@@ -244,6 +244,28 @@ G, result = gds.graph.project(
244244
str(G)
245245
----
246246

247+
[source, python, role=no-test]
248+
----
249+
# Let us visualize the projected graph
250+
from neo4j_viz.gds import from_gds
251+
252+
VG = from_gds(gds, G, db_node_properties=["name"])
253+
for node in VG.nodes:
254+
node.caption = node.properties.get("name")
255+
256+
VG.render(initial_zoom=1.2)
257+
----
258+
259+
[source, python, role=no-test]
260+
----
261+
262+
----
263+
264+
[source, python, role=no-test]
265+
----
266+
267+
----
268+
247269
== Running Algorithms
248270

249271
You can run algorithms on the constructed graph using the standard GDS

examples/graph-analytics-serverless-self-managed.ipynb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
},
5858
"outputs": [],
5959
"source": [
60-
"%pip install \"graphdatascience>=1.15\" python-dotenv"
60+
"%pip install \"graphdatascience>=1.15\" python-dotenv \"neo4j_viz[gds]\""
6161
]
6262
},
6363
{
@@ -314,6 +314,22 @@
314314
"str(G)"
315315
]
316316
},
317+
{
318+
"cell_type": "code",
319+
"execution_count": null,
320+
"metadata": {},
321+
"outputs": [],
322+
"source": [
323+
"# Let us visualize the projected graph\n",
324+
"from neo4j_viz.gds import from_gds\n",
325+
"\n",
326+
"VG = from_gds(gds, G, db_node_properties=[\"name\"])\n",
327+
"for node in VG.nodes:\n",
328+
" node.caption = node.properties.get(\"name\")\n",
329+
"\n",
330+
"VG.render(initial_zoom=1.2)"
331+
]
332+
},
317333
{
318334
"cell_type": "markdown",
319335
"metadata": {},

examples/graph-analytics-serverless-standalone.ipynb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
},
5959
"outputs": [],
6060
"source": [
61-
"%pip install \"graphdatascience>=1.15\" python-dotenv"
61+
"%pip install \"graphdatascience>=1.15\" python-dotenv \"neo4j_viz[gds]\""
6262
]
6363
},
6464
{
@@ -272,6 +272,22 @@
272272
"str(G)"
273273
]
274274
},
275+
{
276+
"cell_type": "code",
277+
"execution_count": null,
278+
"metadata": {},
279+
"outputs": [],
280+
"source": [
281+
"# Let us visualize the projected graph\n",
282+
"from neo4j_viz.gds import from_gds\n",
283+
"\n",
284+
"VG = from_gds(gds, G, db_node_properties=[\"name\"])\n",
285+
"for node in VG.nodes:\n",
286+
" node.caption = node.properties.get(\"name\")\n",
287+
"\n",
288+
"VG.render(initial_zoom=1.2)"
289+
]
290+
},
275291
{
276292
"cell_type": "markdown",
277293
"metadata": {},

examples/graph-analytics-serverless.ipynb

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
},
5858
"outputs": [],
5959
"source": [
60-
"%pip install \"graphdatascience>=1.15\" python-dotenv"
60+
"%pip install \"graphdatascience>=1.15\" python-dotenv \"neo4j_viz[gds]\""
6161
]
6262
},
6363
{
@@ -306,6 +306,36 @@
306306
"str(G)"
307307
]
308308
},
309+
{
310+
"cell_type": "code",
311+
"execution_count": null,
312+
"metadata": {},
313+
"outputs": [],
314+
"source": [
315+
"# Let us visualize the projected graph\n",
316+
"from neo4j_viz.gds import from_gds\n",
317+
"\n",
318+
"VG = from_gds(gds, G, db_node_properties=[\"name\"])\n",
319+
"for node in VG.nodes:\n",
320+
" node.caption = node.properties.get(\"name\")\n",
321+
"\n",
322+
"VG.render(initial_zoom=1.2)"
323+
]
324+
},
325+
{
326+
"cell_type": "code",
327+
"execution_count": null,
328+
"metadata": {},
329+
"outputs": [],
330+
"source": []
331+
},
332+
{
333+
"cell_type": "code",
334+
"execution_count": null,
335+
"metadata": {},
336+
"outputs": [],
337+
"source": []
338+
},
309339
{
310340
"cell_type": "markdown",
311341
"metadata": {},

0 commit comments

Comments
 (0)