Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d02b2a9
first working react comp
OskarDamkjaer Jun 25, 2025
9d84f42
nvl demo works
OskarDamkjaer Jun 25, 2025
a13ba69
basics in place!
OskarDamkjaer Jun 25, 2025
d4914bb
basics in place2
OskarDamkjaer Jun 25, 2025
a712a2c
merge main
OskarDamkjaer Feb 11, 2026
e8b273b
re-fix dependencies
OskarDamkjaer Feb 11, 2026
fa15510
rebulds
OskarDamkjaer Feb 11, 2026
3a6fa1e
move to anywidget
OskarDamkjaer Feb 11, 2026
f1458e3
split builds
OskarDamkjaer Feb 11, 2026
36f4e02
fix ts errors
OskarDamkjaer Feb 11, 2026
13f5e9f
Move to single file HTML template
OskarDamkjaer Feb 11, 2026
be29e7b
cleanup
OskarDamkjaer Feb 11, 2026
06e8f2f
update options support
OskarDamkjaer Feb 11, 2026
7f32146
cleaning up project for publishing
OskarDamkjaer Feb 11, 2026
e013f39
cleanup changelog
OskarDamkjaer Feb 11, 2026
b5f746b
remove duplciate types
OskarDamkjaer Feb 11, 2026
9e14d8a
restore misleading deprecated notices
OskarDamkjaer Feb 11, 2026
5c7ccaf
move old to_html mention
OskarDamkjaer Feb 11, 2026
4998650
simplify applet
OskarDamkjaer Feb 12, 2026
cdbb482
cleanup widget
OskarDamkjaer Feb 12, 2026
0fd2f65
cleanup
OskarDamkjaer Feb 12, 2026
6d70499
with error boundary
OskarDamkjaer Feb 12, 2026
ab765f0
notes
OskarDamkjaer Feb 12, 2026
6905c40
Fix hot loading scripts
OskarDamkjaer Feb 12, 2026
7e6a8f1
self review
OskarDamkjaer Feb 12, 2026
66d9dea
self review
OskarDamkjaer Feb 12, 2026
bdce1bf
cleaup package.json
OskarDamkjaer Feb 12, 2026
6c52520
restore doc changes
OskarDamkjaer Feb 12, 2026
a210821
simplify paths
OskarDamkjaer Feb 12, 2026
03d81fd
ensure we run type checking as part of building
OskarDamkjaer Feb 12, 2026
31d11aa
self review
OskarDamkjaer Feb 12, 2026
7c6e6bb
limit changes
OskarDamkjaer Feb 12, 2026
4bb8934
restore changes
OskarDamkjaer Feb 12, 2026
76ee7b2
cleaup annotations
OskarDamkjaer Feb 12, 2026
269e3f9
cleanupdiff
OskarDamkjaer Feb 12, 2026
b37d057
restore tests
OskarDamkjaer Feb 12, 2026
a3183fa
cleanup
OskarDamkjaer Feb 12, 2026
7d7956c
cleanup entrypoints
OskarDamkjaer Feb 12, 2026
f701a66
update example with live binding
OskarDamkjaer Feb 12, 2026
90a230f
more tests
OskarDamkjaer Feb 12, 2026
2e832b3
restorepkgsjson
OskarDamkjaer Feb 12, 2026
2eb2edd
fix lint error
OskarDamkjaer Feb 12, 2026
3c7a0ef
formatting
OskarDamkjaer Feb 12, 2026
585b105
Update CONTRIBUTING.md
OskarDamkjaer Feb 16, 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
2 changes: 1 addition & 1 deletion .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
python-version: "3.11"
enable-cache: true
- run: uv venv
- run: uv sync --group dev --extra pandas --extra gds --extra snowflake
- run: uv sync --group dev --extra pandas --extra neo4j --extra gds --extra snowflake

- name: Check code style
run: source .venv/bin/activate && cd ${GITHUB_WORKSPACE} && ./scripts/checkstyle.sh
14 changes: 4 additions & 10 deletions .github/workflows/nvl-entrypoint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,18 @@ name: Build JS Applet and check for changes
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
paths:
- "js-applet/src/nvl_entrypoint/**" # JS sources
- "js-applet/webpack.config.js"
- "js-applet/babel.config.js"
- "js-applet/package.json"
- "js-applet/tsconfig.json"
branches: [ "main" ]
- "js-applet/**"
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

tests:

# The type of runner that the job will run on
runs-on: "ubuntu-latest"

Expand All @@ -34,7 +28,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '23.x'
node-version: "23.x"
- name: Setup
run: yarn
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snowflake-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
SNOWFLAKE_ROLE: ACCOUNTADMIN
SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }}
run: pytest tests/ --include-snowflake
run: uv run pytest tests/ --include-snowflake
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ out/*
.idea

.dmypy.json
python-wrapper/uv.lock
.virtual_documents
58 changes: 30 additions & 28 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ If you're not already a member, sign up!

We love our community and wouldn't be where we are without you.


## Need to raise an issue?

Where you raise an issue depends largely on the nature of the problem.
Expand All @@ -34,7 +33,6 @@ Include as much information as you can in any request you make:
- What errors are you seeing?
- What solutions have you tried already?


## Want to contribute?

If you want to contribute a pull request, we have a little bit of process you'll need to follow:
Expand All @@ -50,39 +48,47 @@ We can't guarantee that we'll accept pull requests and may ask you to make some
Occasionally, we might also have logistical, commercial, or legal reasons why we can't accept your work but we'll try to find an alternative way for you to contribute in that case.
Remember that many community members have become regular contributors and some are now even Neo employees!

## Quick start

Using [uv](https://docs.astral.sh/uv/):

```sh
cd js-applet
yarn && yarn dev
```

This starts Vite watch builds and Jupyter Lab with hot module reloading. Changes to `js-applet/src/` will auto-reload in active widget cells.

## Building the project locally

To build the Python packages, run inside the `python-wrapper` folder:

```sh
pip install . # run with --editable for development mode
cd python-wrapper
uv sync --group dev # Recommended: installs dev tools (ruff, mypy, pytest, etc.)
# or: pip install -e .
```

To rebuild the JavaScript applet, run inside the `js-applet` folder:
To rebuild the JavaScript applet:

```sh
cd js-applet
yarn # Install JavaScript dependencies
yarn build # Build JavaScript resources to be used by Python code
```

This will build the app and copy the relevant files to the python wrapper


## Specifically for this project

In this section, we will provide some more specific information about how to work with this particular project.


### Python development environment

* Install Python 3.9+
* [Install pip](https://pip.pypa.io/en/stable/installation/)
* Install the project's Python dependencies:
```bash
pip install -e .
pip install ".[dev]"
```
- Install Python 3.10+
- [Install pip](https://pip.pypa.io/en/stable/installation/)
- Install the project's Python dependencies:
```bash
uv sync --group dev --group notebook --group docs --extra pandas --extra neo4j --extra gds --extra snowflake
```

### Testing

Expand All @@ -95,14 +101,15 @@ pytest python-wrapper/tests
Additionally, there are integration tests that require an external data source.
These require additional setup and configuration, such as environment variables specifying connection details.


For a local Neo4j instance with GDS installed, execute:

```sh
cd test-envs/neo4j-gds
docker compose up -d
```

To run tests requiring a Neo4j DB instance with GDS installed, execute:

```sh
export NEO4J_URI=localhost:7687 # or credentials for Aura API
cd python-wrapper/
Expand All @@ -116,23 +123,20 @@ cd python-wrapper/
pytest tests/ --include-snowflake
```


### Project structure

The project contains of three parts:

- a JavaScript applet whith a basic NVL implementation under the `js-applect` folder
- a JavaScript applet under the `js-applet` folder
- a Python package which loads the applet and offers convenience functions to pass data to the applet
- Jupyter notebooks to test the NVL Python wrapper
- Jupyter notebooks to test the Python wrapper

### JavaScript configs

### JavaScipts configs

* `babel.config.js` - Config for the JavaScript compiler
* `tsconfig.json` - Configuration for TypeScript code
* `package.json` - For yarn, define dependencies and `build` target
* `webpack.config.js` - Config for bundling JS parts

- `vite.config.ts` - Vite config for the lib build (widget.js + style.css for anywidget)
- `vite.config.html.ts` - Vite config for the HTML singlefile build (self-contained index.html)
- `tsconfig.json` - Configuration for TypeScript code
- `package.json` - For yarn, define dependencies and `build` target

### Python

Expand All @@ -147,15 +151,13 @@ For convenience there are a couple of scripts:

```


## Got an idea for a new project?

If you have an idea for a new tool or library, start by talking to other people in the community.
Chances are that someone has a similar idea or may have already started working on it.
The best software comes from getting like minds together to solve a problem.
And we'll do our best to help you promote and co-ordinate your Neo4j ecosystem projects.


## Further reading

If you want to find out more about how you can contribute, head over to our website for [more information](http://neo4j.com/developer/contributing-code/).
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

`neo4j-viz` is a Python package for creating interactive graph visualizations.

The output is of type `IPython.display.HTML` and can be viewed directly in a Jupyter Notebook or Streamlit application.
The `render` method returns an `IPython.display.HTML` object that can be viewed directly in a Jupyter Notebook or Streamlit application.
For an interactive widget experience, use `render_widget()` which returns an anywidget-based `GraphWidget` with two-way data sync.
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/).
Expand Down Expand Up @@ -102,7 +103,8 @@ VG = VisualizationGraph(nodes=nodes, relationships=relationships)
VG.render()
```

This will return a `IPython.display.HTML` object that can be rendered in a Jupyter Notebook or streamlit application.
This will return an `IPython.display.HTML` object that can be rendered in a Jupyter Notebook or Streamlit application.
For an interactive Jupyter widget, use `VG.render_widget()` instead.

Please refer to the [documentation](https://neo4j.com/docs/nvl-python/preview/) for more details on the API and usage.

Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@

## Breaking changes

- Removed the `show_hover_tooltip` parameter from `render()`. The visualization now shows a detail side panel for selected nodes and relationships, replacing the previous hover tooltip.

## New features

- Nodes are now automatically colored by their caption (label) in the JavaScript visualization. This works out of the box without needing to call `color_nodes()`, and applies regardless of how the graph was created. Explicit colors set via `color_nodes()` or directly on nodes take precedence. There is no longer a limit on the number of unique labels for auto-coloring.
- New `render_widget()` method on `VisualizationGraph` returns a `GraphWidget` (anywidget) for interactive two-way data sync in Jupyter environments (JupyterLab, Notebook 7, VS Code, Colab).

## Bug fixes

## Improvements

- Migrated JavaScript visualization from `@neo4j-nvl/base` to `@neo4j-ndl/react-graph` React component.
- Migrated build system from Webpack to Vite.
- Added anywidget integration as the primary rendering path for Jupyter environments.

## Other changes
Loading