|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "code", |
| 5 | + "execution_count": 1, |
| 6 | + "id": "7886114b-ad71-42af-a22c-58e931408b1b", |
| 7 | + "metadata": {}, |
| 8 | + "outputs": [ |
| 9 | + { |
| 10 | + "data": { |
| 11 | + "application/vnd.jupyter.widget-view+json": { |
| 12 | + "model_id": "619e600a0dda4b81817f4254f9d03309", |
| 13 | + "version_major": 2, |
| 14 | + "version_minor": 0 |
| 15 | + }, |
| 16 | + "text/plain": [ |
| 17 | + "GraphWidget(layout=Layout(height='500px', width='100%'))" |
| 18 | + ] |
| 19 | + }, |
| 20 | + "metadata": {}, |
| 21 | + "output_type": "display_data" |
| 22 | + } |
| 23 | + ], |
| 24 | + "source": [ |
| 25 | + "\"\"\"Execute in jupyter notebook or jupyter lab\"\"\"\n", |
| 26 | + "from yfiles_jupyter_graphs import GraphWidget\n", |
| 27 | + "# shows empty widget\n", |
| 28 | + "GraphWidget()" |
| 29 | + ] |
| 30 | + }, |
| 31 | + { |
| 32 | + "cell_type": "code", |
| 33 | + "execution_count": 2, |
| 34 | + "id": "17beb2f3-1bff-46fb-8af0-0c573a80fcbd", |
| 35 | + "metadata": {}, |
| 36 | + "outputs": [ |
| 37 | + { |
| 38 | + "data": { |
| 39 | + "application/vnd.jupyter.widget-view+json": { |
| 40 | + "model_id": "a4cee0e3bad34562a6d7aef1cad67eaa", |
| 41 | + "version_major": 2, |
| 42 | + "version_minor": 0 |
| 43 | + }, |
| 44 | + "text/plain": [ |
| 45 | + "GraphWidget(layout=Layout(height='610px', width='100%'))" |
| 46 | + ] |
| 47 | + }, |
| 48 | + "metadata": {}, |
| 49 | + "output_type": "display_data" |
| 50 | + } |
| 51 | + ], |
| 52 | + "source": [ |
| 53 | + "from yfiles_jupyter_graphs_for_neo4j import Neo4jGraphWidget\n", |
| 54 | + "from neo4j import GraphDatabase\n", |
| 55 | + "\n", |
| 56 | + "NEO4J_URI = \"neo4j+ssc://demo.neo4jlabs.com\" \n", |
| 57 | + "NEO4J_USERNAME = \"movies\"\n", |
| 58 | + "NEO4J_PASSWORD = \"movies\"\n", |
| 59 | + "driver = GraphDatabase.driver(uri = NEO4J_URI, auth = (NEO4J_USERNAME, NEO4J_PASSWORD), database = 'movies')\n", |
| 60 | + "\n", |
| 61 | + "g = Neo4jGraphWidget(driver)\n", |
| 62 | + "\n", |
| 63 | + "g.show_cypher(\"MATCH (s)-[r]->(t) RETURN s,r,t LIMIT 20\")" |
| 64 | + ] |
| 65 | + }, |
| 66 | + { |
| 67 | + "cell_type": "code", |
| 68 | + "execution_count": 3, |
| 69 | + "id": "386de43e-a301-47ef-a001-220188647506", |
| 70 | + "metadata": {}, |
| 71 | + "outputs": [ |
| 72 | + { |
| 73 | + "name": "stdout", |
| 74 | + "output_type": "stream", |
| 75 | + "text": [ |
| 76 | + "Collecting neo4j\n", |
| 77 | + " Downloading neo4j-5.23.0-py3-none-any.whl.metadata (5.7 kB)\n", |
| 78 | + "Requirement already satisfied: pytz in /srv/conda/envs/notebook/lib/python3.10/site-packages (from neo4j) (2024.1)\n", |
| 79 | + "Downloading neo4j-5.23.0-py3-none-any.whl (293 kB)\n", |
| 80 | + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m293.7/293.7 kB\u001b[0m \u001b[31m4.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", |
| 81 | + "\u001b[?25hInstalling collected packages: neo4j\n", |
| 82 | + "Successfully installed neo4j-5.23.0\n" |
| 83 | + ] |
| 84 | + } |
| 85 | + ], |
| 86 | + "source": [ |
| 87 | + "! pip install neo4j" |
| 88 | + ] |
| 89 | + } |
| 90 | + ], |
| 91 | + "metadata": { |
| 92 | + "kernelspec": { |
| 93 | + "display_name": "Python 3 (ipykernel)", |
| 94 | + "language": "python", |
| 95 | + "name": "python3" |
| 96 | + }, |
| 97 | + "language_info": { |
| 98 | + "codemirror_mode": { |
| 99 | + "name": "ipython", |
| 100 | + "version": 3 |
| 101 | + }, |
| 102 | + "file_extension": ".py", |
| 103 | + "mimetype": "text/x-python", |
| 104 | + "name": "python", |
| 105 | + "nbconvert_exporter": "python", |
| 106 | + "pygments_lexer": "ipython3", |
| 107 | + "version": "3.10.14" |
| 108 | + } |
| 109 | + }, |
| 110 | + "nbformat": 4, |
| 111 | + "nbformat_minor": 5 |
| 112 | +} |
0 commit comments