You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+32-50Lines changed: 32 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,6 @@ If you're not already a member, sign up!
9
9
10
10
We love our community and wouldn't be where we are without you.
11
11
12
-
13
12
## Need to raise an issue?
14
13
15
14
Where you raise an issue depends largely on the nature of the problem.
@@ -34,7 +33,6 @@ Include as much information as you can in any request you make:
34
33
- What errors are you seeing?
35
34
- What solutions have you tried already?
36
35
37
-
38
36
## Want to contribute?
39
37
40
38
If you want to contribute a pull request, we have a little bit of process you'll need to follow:
@@ -50,102 +48,87 @@ We can't guarantee that we'll accept pull requests and may ask you to make some
50
48
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.
51
49
Remember that many community members have become regular contributors and some are now even Neo employees!
52
50
53
-
54
-
## Building the project locally
55
-
56
-
To build the Python packages, run inside the `python-wrapper` folder:
51
+
## Quick start
57
52
58
53
```sh
59
-
pip install .# run with --editable for development mode
54
+
just js-dev
60
55
```
61
56
62
-
To rebuild the JavaScript applet, run inside the `js-applet` folder:
57
+
This starts Vite watch builds and Jupyter Lab with hot module reloading. Changes to `js-applet/src/` will auto-reload in active widget cells.
58
+
59
+
If you want to modify the python code, run:
63
60
64
61
```sh
65
-
yarn # Install JavaScript dependencies
66
-
yarn build # Build JavaScript resources to be used by Python code
62
+
just py-sync
67
63
```
68
64
69
-
This will build the app and copy the relevant files to the python wrapper
65
+
This will install all required dev dependencies and install the package in editable mode.
70
66
71
67
72
68
## Specifically for this project
73
69
74
70
In this section, we will provide some more specific information about how to work with this particular project.
- We recommend installing [just](https://github.com/casey/just) for running commands
76
+
77
+
Install the project's Python dependencies:
78
+
```bash
79
+
just py-sync
80
+
```
81
+
82
+
Apply and check python styling:
83
+
```sh
84
+
just py-style
85
+
```
86
+
86
87
87
88
### Testing
88
89
89
90
To run unit tests, execute:
90
91
91
92
```sh
92
-
pytest python-wrapper/tests
93
+
just py-test
93
94
```
94
95
95
96
Additionally, there are integration tests that require an external data source.
96
97
These require additional setup and configuration, such as environment variables specifying connection details.
97
98
98
-
99
-
For a local Neo4j instance with GDS installed, execute:
99
+
To test the Neo4j and GDS related tests, execute:
100
100
```sh
101
-
cd test-envs/neo4j-gds
102
-
docker compose up -d
103
-
```
104
-
105
-
To run tests requiring a Neo4j DB instance with GDS installed, execute:
106
-
```sh
107
-
export NEO4J_URI=localhost:7687 # or credentials for Aura API
108
-
cd python-wrapper/
109
-
pytest tests --include-neo4j-and-gds
101
+
just py-test-gds
110
102
```
103
+
This will spinup a Neo4j container with the GDS plugin installed.
111
104
112
105
To run tests requiring a Snowflake connection, execute:
113
-
114
106
```sh
115
107
cd python-wrapper/
116
108
pytest tests/ --include-snowflake
117
109
```
118
110
119
-
120
111
### Project structure
121
112
122
113
The project contains of three parts:
123
114
124
-
- a JavaScript applet whith a basic NVL implementation under the `js-applect` folder
115
+
- a JavaScript applet under the `js-applet` folder
125
116
- a Python package which loads the applet and offers convenience functions to pass data to the applet
126
-
- Jupyter notebooks to test the NVL Python wrapper
127
-
117
+
- Jupyter notebooks to test the Python wrapper
128
118
129
-
### JavaScipts configs
130
-
131
-
*`babel.config.js` - Config for the JavaScript compiler
132
-
*`tsconfig.json` - Configuration for TypeScript code
133
-
*`package.json` - For yarn, define dependencies and `build` target
134
-
*`webpack.config.js` - Config for bundling JS parts
119
+
### JavaScript configs
135
120
121
+
-`vite.config.ts` - Vite config for the lib build (widget.js + style.css for anywidget)
122
+
-`vite.config.html.ts` - Vite config for the HTML singlefile build (self-contained index.html)
123
+
-`tsconfig.json` - Configuration for TypeScript code
124
+
-`package.json` - For yarn, define dependencies and `build` target
136
125
137
126
### Python
138
127
139
128
Everything is configured inside `pyproject.toml`
140
129
141
130
To keep a consistent code-style, we use `ruff` and `mypy`.
142
-
For convenience there are a couple of scripts:
143
-
144
-
```sh
145
-
./scripts/makestyle.sh # try to fix linting violations and format code
146
-
./scripts/checkstyle.sh # check for linting, format or typing issues
147
-
148
-
```
131
+
For convenience there are a couple of just targets under `justfile`:
149
132
150
133
151
134
## Got an idea for a new project?
@@ -155,7 +138,6 @@ Chances are that someone has a similar idea or may have already started working
155
138
The best software comes from getting like minds together to solve a problem.
156
139
And we'll do our best to help you promote and co-ordinate your Neo4j ecosystem projects.
157
140
158
-
159
141
## Further reading
160
142
161
143
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/).
Copy file name to clipboardExpand all lines: changelog.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,22 @@
2
2
3
3
## Breaking changes
4
4
5
+
- 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.
6
+
- Nodes are colored by default by their caption. Use `VG.color_nodes(field="caption", colors=[neo4j_viz.colors.NEO4J_COLORS_DISCRETE[0]])` to apply the previous coloring.
7
+
5
8
6
9
## New features
7
10
11
+
- 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.
12
+
- New `Zoom to fit` button in the visualization.
13
+
- 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).
14
+
8
15
## Bug fixes
9
16
10
17
## Improvements
11
18
19
+
- Migrated JavaScript visualization from `@neo4j-nvl/base` to `@neo4j-ndl/react-graph` React component.
20
+
- Migrated build system from Webpack to Vite.
21
+
- Added anywidget integration as the primary rendering path for Jupyter environments.
Copy file name to clipboardExpand all lines: docs/antora/modules/ROOT/pages/customizing.adoc
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,8 @@ Nodes and relationships can be colored directly by providing them with a color f
55
55
This can be done by passing a color as a string to the `color` parameter of the
56
56
link:{api-docs-uri}/node[Node] or link:{api-docs-uri}/relationship[Relationship] object.
57
57
58
+
By default, the nodes will be colored based on their caption. The colors are the same as in other Neo4j tools, such as Neo4j Console and Neo4j Browser.
59
+
58
60
Alternatively, you can color nodes or relationships based on a field or property after a `VisualizationGraph` object has been
59
61
created.
60
62
@@ -258,4 +260,4 @@ for relationship in VG.relationships:
258
260
relationship.caption_size = 15
259
261
----
260
262
261
-
Any changes made to the nodes and relationships will be reflected in the next rendering of the graph.
263
+
Any changes made to the nodes and relationships will be reflected in the next rendering of the graph.
0 commit comments