Skip to content

Commit 995f571

Browse files
committed
Fix style + update js dependencies
1 parent e5af9d7 commit 995f571

File tree

5 files changed

+8586
-8602
lines changed

5 files changed

+8586
-8602
lines changed

examples/getting-started.ipynb

Lines changed: 56 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -25,54 +25,16 @@
2525
},
2626
{
2727
"cell_type": "code",
28+
"execution_count": 1,
2829
"id": "801d0bed",
2930
"metadata": {
3031
"tags": [
3132
"preserve-output"
32-
],
33-
"ExecuteTime": {
34-
"end_time": "2026-03-05T09:12:41.931079Z",
35-
"start_time": "2026-03-05T09:12:41.465109Z"
36-
}
33+
]
3734
},
38-
"source": [
39-
"from neo4j_viz import Node, Relationship, VisualizationGraph\n",
40-
"\n",
41-
"nodes = [\n",
42-
" Node(id=0, size=10, caption=\"Person\"),\n",
43-
" Node(id=1, size=10, caption=\"Product\"),\n",
44-
" Node(id=2, size=20, caption=\"Product\"),\n",
45-
" Node(id=3, size=10, caption=\"Person\"),\n",
46-
" Node(id=4, size=10, caption=\"Product\"),\n",
47-
"]\n",
48-
"relationships = [\n",
49-
" Relationship(\n",
50-
" source=0,\n",
51-
" target=1,\n",
52-
" caption=\"BUYS\",\n",
53-
" ),\n",
54-
" Relationship(\n",
55-
" source=0,\n",
56-
" target=2,\n",
57-
" caption=\"BUYS\",\n",
58-
" ),\n",
59-
" Relationship(\n",
60-
" source=3,\n",
61-
" target=2,\n",
62-
" caption=\"BUYS\",\n",
63-
" ),\n",
64-
"]\n",
65-
"\n",
66-
"VG = VisualizationGraph(nodes=nodes, relationships=relationships)\n",
67-
"\n",
68-
"VG.render(initial_zoom=2)"
69-
],
7035
"outputs": [
7136
{
7237
"data": {
73-
"text/plain": [
74-
"<IPython.core.display.HTML object>"
75-
],
7638
"text/html": [
7739
"<!doctype html>\n",
7840
"<html lang=\"en\" class=\"light\">\n",
@@ -1640,14 +1602,48 @@
16401602
" <div id=\"neo4j-viz-ca4061323d2d\" style=\"width: 100%; height: 100vh\"></div>\n",
16411603
" </body>\n",
16421604
"</html>\n"
1605+
],
1606+
"text/plain": [
1607+
"<IPython.core.display.HTML object>"
16431608
]
16441609
},
16451610
"execution_count": 1,
16461611
"metadata": {},
16471612
"output_type": "execute_result"
16481613
}
16491614
],
1650-
"execution_count": 1
1615+
"source": [
1616+
"from neo4j_viz import Node, Relationship, VisualizationGraph\n",
1617+
"\n",
1618+
"nodes = [\n",
1619+
" Node(id=0, size=10, caption=\"Person\"),\n",
1620+
" Node(id=1, size=10, caption=\"Product\"),\n",
1621+
" Node(id=2, size=20, caption=\"Product\"),\n",
1622+
" Node(id=3, size=10, caption=\"Person\"),\n",
1623+
" Node(id=4, size=10, caption=\"Product\"),\n",
1624+
"]\n",
1625+
"relationships = [\n",
1626+
" Relationship(\n",
1627+
" source=0,\n",
1628+
" target=1,\n",
1629+
" caption=\"BUYS\",\n",
1630+
" ),\n",
1631+
" Relationship(\n",
1632+
" source=0,\n",
1633+
" target=2,\n",
1634+
" caption=\"BUYS\",\n",
1635+
" ),\n",
1636+
" Relationship(\n",
1637+
" source=3,\n",
1638+
" target=2,\n",
1639+
" caption=\"BUYS\",\n",
1640+
" ),\n",
1641+
"]\n",
1642+
"\n",
1643+
"VG = VisualizationGraph(nodes=nodes, relationships=relationships)\n",
1644+
"\n",
1645+
"VG.render(initial_zoom=2)"
1646+
]
16511647
},
16521648
{
16531649
"cell_type": "markdown",
@@ -1667,28 +1663,16 @@
16671663
},
16681664
{
16691665
"cell_type": "code",
1666+
"execution_count": 2,
16701667
"id": "d935b3d4",
16711668
"metadata": {
16721669
"tags": [
16731670
"preserve-output"
1674-
],
1675-
"ExecuteTime": {
1676-
"end_time": "2026-03-05T09:12:42.356868Z",
1677-
"start_time": "2026-03-05T09:12:42.057085Z"
1678-
}
1671+
]
16791672
},
1680-
"source": [
1681-
"VG.color_nodes(field=\"size\")\n",
1682-
"VG.set_node_captions(field=\"size\")\n",
1683-
"\n",
1684-
"VG.render(initial_zoom=2)"
1685-
],
16861673
"outputs": [
16871674
{
16881675
"data": {
1689-
"text/plain": [
1690-
"<IPython.core.display.HTML object>"
1691-
],
16921676
"text/html": [
16931677
"<!doctype html>\n",
16941678
"<html lang=\"en\" class=\"light\">\n",
@@ -3256,14 +3240,22 @@
32563240
" <div id=\"neo4j-viz-7c5bd7800270\" style=\"width: 100%; height: 100vh\"></div>\n",
32573241
" </body>\n",
32583242
"</html>\n"
3243+
],
3244+
"text/plain": [
3245+
"<IPython.core.display.HTML object>"
32593246
]
32603247
},
32613248
"execution_count": 2,
32623249
"metadata": {},
32633250
"output_type": "execute_result"
32643251
}
32653252
],
3266-
"execution_count": 2
3253+
"source": [
3254+
"VG.color_nodes(field=\"size\")\n",
3255+
"VG.set_node_captions(field=\"size\")\n",
3256+
"\n",
3257+
"VG.render(initial_zoom=2)"
3258+
]
32673259
},
32683260
{
32693261
"cell_type": "markdown",
@@ -3288,35 +3280,14 @@
32883280
},
32893281
{
32903282
"cell_type": "code",
3283+
"execution_count": null,
32913284
"id": "6j6duo4v7p9",
3292-
"metadata": {
3293-
"ExecuteTime": {
3294-
"end_time": "2026-03-05T09:12:42.646898Z",
3295-
"start_time": "2026-03-05T09:12:42.484526Z"
3296-
}
3297-
},
3285+
"metadata": {},
3286+
"outputs": [],
32983287
"source": [
32993288
"widget = VG.render_widget()\n",
33003289
"widget"
3301-
],
3302-
"outputs": [
3303-
{
3304-
"data": {
3305-
"text/plain": [
3306-
"<neo4j_viz.widget.GraphWidget object at 0x10cad94d0>"
3307-
],
3308-
"application/vnd.jupyter.widget-view+json": {
3309-
"version_major": 2,
3310-
"version_minor": 1,
3311-
"model_id": "9d5c4403528e43d39b8d773f0f23cb0e"
3312-
}
3313-
},
3314-
"execution_count": 3,
3315-
"metadata": {},
3316-
"output_type": "execute_result"
3317-
}
3318-
],
3319-
"execution_count": 3
3290+
]
33203291
},
33213292
{
33223293
"cell_type": "markdown",
@@ -3330,13 +3301,10 @@
33303301
},
33313302
{
33323303
"cell_type": "code",
3304+
"execution_count": null,
33333305
"id": "652ybsznrab",
3334-
"metadata": {
3335-
"ExecuteTime": {
3336-
"end_time": "2026-03-05T09:13:18.530453Z",
3337-
"start_time": "2026-03-05T09:13:18.516885Z"
3338-
}
3339-
},
3306+
"metadata": {},
3307+
"outputs": [],
33403308
"source": [
33413309
"# Run this cell multiple times - each run adds a new node to the widget above\n",
33423310
"import random\n",
@@ -3348,19 +3316,12 @@
33483316
"new_rel = Relationship(source=new_id, target=target_id, caption=\"KNOWS\")\n",
33493317
"\n",
33503318
"widget.add_data(nodes=new_node, relationships=new_rel)"
3351-
],
3352-
"outputs": [],
3353-
"execution_count": 6
3319+
]
33543320
}
33553321
],
33563322
"metadata": {
33573323
"language_info": {
33583324
"name": "python"
3359-
},
3360-
"kernelspec": {
3361-
"name": "python3",
3362-
"language": "python",
3363-
"display_name": "Python 3 (ipykernel)"
33643325
}
33653326
},
33663327
"nbformat": 4,

0 commit comments

Comments
 (0)