Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
63da09a
Update lib version
FlorentinD May 8, 2026
ce0cb59
Add support for AGA
FlorentinD Jun 5, 2026
4ed1b89
Fix setup for AGA
FlorentinD Jun 5, 2026
c2e5ef7
Fix cell ids in gds notebook
FlorentinD Jun 5, 2026
cb34a6d
Switch CI to AuraDB project
FlorentinD Jun 5, 2026
127abc5
Try to fix example graph image
FlorentinD Jun 5, 2026
ea47a62
Format code
FlorentinD Jun 5, 2026
dcb99ae
Merge pull request #268 from neo4j/use-aura-graph-analytics
FlorentinD Jun 5, 2026
a3a7171
Bump the python-patch-and-minor group across 1 directory with 5 updates
dependabot[bot] Jun 5, 2026
29be046
Merge pull request #364 from neo4j/dependabot/pip/python-wrapper/pyth…
FlorentinD Jun 8, 2026
17bcd3f
Add utiltiy methods to GraphWidget
FlorentinD Jun 8, 2026
e776391
Use new methods in getting-started
FlorentinD Jun 8, 2026
ba49877
Add utiltiy methods for rendering
FlorentinD Jun 9, 2026
bfe4048
Fix doc strings
FlorentinD Jun 9, 2026
c85dfa1
Fix doc strings
FlorentinD Jun 9, 2026
58e04f5
Use pydantic model for graphwidget options
FlorentinD Jun 12, 2026
dc3f1f0
Merge pull request #368 from neo4j/gds-209-add-utility-methods-to-gra…
FlorentinD Jun 12, 2026
7e52bd3
Use correct env var name for aura project
FlorentinD Jun 12, 2026
d4fd7fa
Move extra tests in sub dirs
FlorentinD Jun 12, 2026
99f1fa7
Avoid any type in conftest
FlorentinD Jun 12, 2026
7b758a1
Merge pull request #369 from neo4j/fix-gds-integration-test
FlorentinD Jun 12, 2026
c0f65f6
Add support for python 3.14
FlorentinD Jun 12, 2026
7436cc3
Merge pull request #370 from neo4j/3-14-support
FlorentinD Jun 12, 2026
771a597
Bump mypy and ruff
FlorentinD Jun 12, 2026
0804dae
Update python deps
FlorentinD Jun 12, 2026
dd0890d
Remove unused extra from integration test
FlorentinD Jun 12, 2026
1a5b7da
Merge pull request #371 from neo4j/cleanup-ci-actions
FlorentinD Jun 12, 2026
4bd1517
Check for dangling relationships
FlorentinD Jun 12, 2026
cab5832
Document new parameter
FlorentinD Jun 12, 2026
4b5ad89
Merge pull request #374 from neo4j/GDS-96
FlorentinD Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/gds-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
with:
python-version: "3.11"
enable-cache: true
- run: uv sync --group dev --extra pandas --extra neo4j --extra gds --extra snowflake
- run: uv sync --group dev --extra pandas --extra neo4j --extra gds

- name: Run tests
env:
AURA_API_CLIENT_ID: 4V1HYCYEeoU4dSxThKnBeLvE2U4hSphx
AURA_API_CLIENT_SECRET: ${{ secrets.AURA_API_CLIENT_SECRET }}
AURA_API_TENANT_ID: eee7ec28-6b1a-5286-8e3a-3362cc1c4c78
AURA_API_PROJECT_ID: 3f8df5e7-4800-4d4f-ad1d-2d044dfd587c
run: uv run pytest tests/ --include-neo4j-and-gds
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

defaults:
run:
Expand Down
14 changes: 9 additions & 5 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Changes in 1.4.0
# Changes in 1.5.0

## Breaking changes

## New features

* Add `GraphWidget` methods to change render options in place without re-rendering: `set_layout`, `set_zoom`, `set_pan`, `set_renderer`, and `set_show_layout_button`
* Add `GraphWidget` methods to change styling in place without re-rendering such as `color_relationships`

## Bug fixes

- Fixed a bug in displaying the `Download`, `Selection` and `Layout` buttons, which was introduced in 1.2.0.
* Warn when relationships reference node ids that are not in the graph. It is configurable via the `on_dangling` parameter (`"warn"` (default), `"error"`, or `"none"`) on `render`, `render_widget`, and `GraphWidget.add_data`

## Improvements

- Support `neo4j.EagerResult` in the `from_neo4j` integration which is the default return type by `neo4j.Driver.execute_query()`.
- Detect light/dark theme changes and adapt rendering unless theme was explicitly set. Before the theme would only be checked on the first render.

* Support Python 3.14
* Support Aura Graph Analytics
* Support `gds.v2` endpoints
* Use typed options field in `GraphWidget`

## Other changes
8 changes: 7 additions & 1 deletion docs/antora/modules/ROOT/pages/rendering.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ It defaults to 10.000, because rendering a large number of nodes can be slow and
However, you can increase this value if you are confident that your environment can handle the scale.
In this case you might also want to pass `Renderer.WEB_GL` as the `renderer` to improve performance.

Relationships whose `source` or `target` is not part of the graph's nodes ("dangling" relationships) cannot be
drawn, and a graph containing them may appear empty.
By default `render` emits a warning that lists the offending relationships so the problem is not silent.
You can change this with the `on_dangling` parameter: pass `"error"` to raise a `ValueError` instead, or `"none"`
to skip the check entirely.

By default a tooltip showing IDs and properties will be shown when mouse hovering over a node or relationship.
But you can disable this by passing `show_hover_tooltip=False`.

Expand All @@ -60,4 +66,4 @@ html = VG.render(...)

with open("my_graph.html", "w") as f:
f.write(html.data)
----
----
2 changes: 2 additions & 0 deletions docs/source/api-reference/widget.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. autoclass:: neo4j_viz.GraphWidget
:members:
5,031 changes: 125 additions & 4,906 deletions examples/gds-example.ipynb

Large diffs are not rendered by default.

1,727 changes: 73 additions & 1,654 deletions examples/getting-started.ipynb

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions examples/neo4j-example.ipynb

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ py-style:
./scripts/makestyle.sh && ./scripts/checkstyle.sh

py-test:
cd python-wrapper && uv sync --all-extras --group dev
cd python-wrapper && uv run --group dev pytest

py-test-gds:
Expand All @@ -18,13 +19,25 @@ py-test-gds:
trap "cd $ENV_DIR && docker compose down" EXIT
cd $ENV_DIR && docker compose up -d
cd -
cd python-wrapper && \
NEO4J_URI=bolt://localhost:7687 \
NEO4J_USER=neo4j \
NEO4J_USERNAME=neo4j \
NEO4J_PASSWORD=password \
NEO4J_DB=neo4j \
cd python-wrapper && uv run --group dev --extra gds pytest tests --include-neo4j-and-gds
uv run --group dev --extra gds pytest tests --include-neo4j-and-gds
cd ..


# this expects the local compose setup to be running.
py-test-gds-sessions filter="":
#!/usr/bin/env bash
cd python-wrapper && \
GDS_SESSION_URI=bolt://localhost:7688 \
NEO4J_URI=bolt://localhost:7687 \
NEO4J_USERNAME=neo4j \
NEO4J_PASSWORD=password \
uv run --group dev --extra gds pytest tests --include-neo4j-and-gds {{ if filter != "" { "-k '" + filter + "'" } else { "" } }}

local-neo4j-setup:
#!/usr/bin/env bash
set -e
Expand Down
2 changes: 1 addition & 1 deletion python-wrapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Alternatively, you can export the output to a file and view it in a web browser.
The package wraps the [Neo4j Visualization JavaScript library (NVL)](https://neo4j.com/docs/nvl/current/).


![Example Graph](https://github.com/neo4j/python-graph-visualization/blob/main/examples/example_graph.png)
![Example Graph](https://raw.githubusercontent.com/neo4j/python-graph-visualization/main/examples/example_graph.png)


## Some notable features
Expand Down
40 changes: 22 additions & 18 deletions python-wrapper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "neo4j-viz"
version = "1.4.0"
version = "1.5.0"
description = "A simple graph visualization tool"
readme = "README.md"
authors = [{ name = "Neo4j", email = "team-gds@neo4j.org" }]
Expand All @@ -22,6 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Database :: Front-Ends",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Visualization",
Expand All @@ -42,31 +43,35 @@ requires-python = ">=3.10"

[project.optional-dependencies]
pandas = ["pandas>=2, <3", "pandas-stubs>=2, <3"]
gds = ["graphdatascience>=1, <2"]
gds = ["graphdatascience>=1.22, <2"]
neo4j = ["neo4j"]
snowflake = ["snowflake-snowpark-python>=1, <2"]


[dependency-groups]
dev = [
"ruff==0.15.12",
"mypy==1.20.2",
"ruff==0.15.17",
"mypy==2.1.0",
"pytest==9.0.3",
"selenium==4.43.0",
"ipykernel==7.2.0",
"selenium==4.44.0",
"ipykernel==7.3.0",
"palettable==3.3.3",
"pytest-mock==3.15.1",
"nbconvert==7.17.1",
"streamlit==1.57.0",
"streamlit==1.58.0",
"matplotlib>=3.9.4",
"jupyterlab>=4.5.7",
"anywidget[dev]"
"anywidget[dev]",
"python-dotenv"
]
docs = [
# Sphinx is capped at 8.1.x: 8.2+ requires Python >=3.11 and Sphinx 9 requires >=3.12
# (the docs group must satisfy requires-python = ">=3.10"), and Sphinx 9 also breaks
# `enum_tools.autoenum` (removed `logger` from `sphinx.ext.autodoc`).
"sphinx==8.1.3",
"enum-tools[sphinx]",
"nbsphinx==0.9.8",
"nbsphinx-link==1.3.1",
"nbsphinx-link==1.4.1",
]
notebook = [
"ipykernel>=6.29.5",
Expand All @@ -75,10 +80,10 @@ notebook = [
"ipywidgets>=8.0.0",
"palettable>=3.3.3",
"matplotlib>=3.9.4",
"snowflake-snowpark-python==1.50.0",
"python-dotenv",
"snowflake-snowpark-python==1.52.0",
"requests",
"marimo",
"python-dotenv"
]

[project.urls]
Expand Down Expand Up @@ -113,7 +118,12 @@ markers = [
]
filterwarnings = [
"error",
"ignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning"
"ignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning",
# snowflake vendors an older `requests` whose dependency check rejects the chardet
# version (pulled in transitively via `encutils`). Harmless; ignore it.
# Matched by message only: naming the category here would make pytest import
# `snowflake.connector` to resolve it, and that import is exactly what fails.
"ignore:.*doesn't match a supported version"
]

[tool.ruff]
Expand Down Expand Up @@ -174,9 +184,3 @@ exclude = [
]
plugins = ['pydantic.mypy']
untyped_calls_exclude=["nbconvert"]

[tool.marimo.runtime]
output_max_bytes = 20_000_000
#
#[tool.marimo.server]
#follow_symlink = true
6 changes: 6 additions & 0 deletions python-wrapper/src/neo4j_viz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
ForceDirectedLayoutOptions,
HierarchicalLayoutOptions,
Layout,
NvlOptions,
Packing,
PanPosition,
Renderer,
WidgetOptions,
)
from .relationship import Relationship
from .visualization_graph import VisualizationGraph
Expand All @@ -15,6 +18,9 @@
__all__ = [
"VisualizationGraph",
"GraphWidget",
"WidgetOptions",
"NvlOptions",
"PanPosition",
"Node",
"Relationship",
"CaptionAlignment",
Expand Down
Loading
Loading