@neo4j-nvl/react 0.3.6-8c7576fc → 0.3.6-ab6fbe86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +123 -0
- package/README.md +2 -0
- package/lib/basic-wrapper/BasicNvlWrapper.d.ts +2 -0
- package/lib/basic-wrapper/BasicNvlWrapper.js +15 -7
- package/package.json +5 -5
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to NVL will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
4
|
+
|
|
5
|
+
## [0.3.6] - 2025-02-21
|
|
6
|
+
|
|
7
|
+
NVL 0.3.6 improves the API docs and adds a result transformer for the Neo4j JavaScript Driver, as well as small improvements and bug fixes.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- [result transformer for the Neo4j JavaScript Driver](https://neo4j.com/docs/api/nvl/current/functions/_neo4j_nvl_base.nvlResultTransformer.html)
|
|
12
|
+
- [option](https://neo4j.com/docs/api/nvl/current/types/_neo4j_nvl_base.ZoomOptions.html) to disable transition when fitting nodes
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- lasso handler issues during initialization
|
|
17
|
+
|
|
18
|
+
## [0.3.5] - 2025-02-20
|
|
19
|
+
|
|
20
|
+
NVL 0.3.5 contains several bug fixes and changes the default rendering method of NVL from "webgl" to "canvas".
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Change default value for renderer to canvas
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Self-referring relationship overlay icon rotation position issue
|
|
29
|
+
- Invalid lasso area calculation when segment from first to last point intersects
|
|
30
|
+
|
|
31
|
+
## [0.3.4] - 2025-02-19
|
|
32
|
+
|
|
33
|
+
With this release, we are updating our docs and READMEs and publishing NVL's API documentation and examples on neo4j.com/docs/api/nvl/current.
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- NVL's API documentation and examples on [neo4j.com/docs/api/nvl/current](http://neo4j.com/docs/api/nvl/current).
|
|
38
|
+
- A fallback implementation for web workers when they aren't avilable in the current environment.
|
|
39
|
+
- A new onDrawStarted callback for the [draw interaction handler](https://neo4j.com/docs/api/nvl/current/classes/_neo4j_nvl_interaction_handlers.DrawInteraction.html)
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- Issues with lasso shape when parts of it are close to each other
|
|
44
|
+
- NVL crash when sometimes position map and nodeToBundle are out of sync
|
|
45
|
+
|
|
46
|
+
## [0.3.3] - 2025-02-18
|
|
47
|
+
|
|
48
|
+
This is a patch release to address a dependency issue in 0.3.2
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
|
|
52
|
+
- Move Segment dependency from dev dependencies
|
|
53
|
+
- Ensure workspace version references point to exact version
|
|
54
|
+
|
|
55
|
+
## [0.3.2] - 2025-02-17
|
|
56
|
+
|
|
57
|
+
This is our first patch release since going GA in May.
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
|
|
61
|
+
- [Telemetry](https://neo4j.com/docs/api/nvl/current/interfaces/_neo4j_nvl_base.NvlOptions.html#disableTelemetry)
|
|
62
|
+
- [Examples](https://neo4j.com/docs/api/nvl/current/examples.html) in API documentation
|
|
63
|
+
- More information in package.json files
|
|
64
|
+
- Overlay icons for nodes and relationships
|
|
65
|
+
- Links to documentation websites in readme
|
|
66
|
+
|
|
67
|
+
### Fixed
|
|
68
|
+
|
|
69
|
+
- Fixed zoom to fit for self relationships
|
|
70
|
+
- Aalign selected border color
|
|
71
|
+
- Issues with WebGL error propagation
|
|
72
|
+
- Issue with key captures on mouse click in draw-interactions
|
|
73
|
+
- Zoom to fit finishing too early
|
|
74
|
+
- Improve imagecache error handling
|
|
75
|
+
- Minimap viewport box not rendering
|
|
76
|
+
|
|
77
|
+
## [0.3.1] - 2025-02-16
|
|
78
|
+
|
|
79
|
+
This is our first GA release of NVL.
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
|
|
83
|
+
- Expose callback types through interactive react wrapper
|
|
84
|
+
- Feature/adv interaction fw drag callbacks amendments
|
|
85
|
+
- Add [lasso select interaction module](https://neo4j.com/docs/api/nvl/current/classes/_neo4j_nvl_interaction_handlers.LassoInteraction.html)
|
|
86
|
+
- Configurable node ring styles
|
|
87
|
+
- Support React concurrent mode in React wrappers
|
|
88
|
+
- [`renderer`](https://neo4j.com/docs/api/nvl/current/interfaces/_neo4j_nvl_base.NvlOptions.html#renderer) and [`setRenderer`](https://neo4j.com/docs/api/nvl/current/classes/_neo4j_nvl_base.NVL.html#setRenderer) API option and method
|
|
89
|
+
|
|
90
|
+
### Deprecated
|
|
91
|
+
|
|
92
|
+
- `useWebGL` and `setUseWebGL` (use `renderer` and `setRenderer` instead).
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
|
|
96
|
+
- Core library is now named "base" library
|
|
97
|
+
- All packages are published publicly
|
|
98
|
+
- Refactor rel validation method to improve performance
|
|
99
|
+
- Convert layout web workers to shared workers
|
|
100
|
+
- Don't check for WebGL availability if WebGL is disabled by NVL [`disableWebGL`](https://neo4j.com/docs/api/nvl/current/interfaces/_neo4j_nvl_base.NvlOptions.html#disableWebGL) option
|
|
101
|
+
|
|
102
|
+
### Removed
|
|
103
|
+
|
|
104
|
+
- Remove deprecated elements
|
|
105
|
+
|
|
106
|
+
### Fixed
|
|
107
|
+
|
|
108
|
+
- Wrong directions in a relationship bundle
|
|
109
|
+
- Issues with node and relationship id handling when strings are not numeric
|
|
110
|
+
- Zoom/pan jitter removal
|
|
111
|
+
- Ensure all interaction handlers return mouse events
|
|
112
|
+
- Cytoscape behaviour fixes
|
|
113
|
+
- Drag triggers too early
|
|
114
|
+
- Fix issue where right clicking sometime also triggers mouseup event
|
|
115
|
+
- Issues in dynamic zoom boundaries
|
|
116
|
+
- Don't trigger panning when mouse down was outside of NVL
|
|
117
|
+
- Only register callbacks if provided
|
|
118
|
+
- Ensure fit operation does not keep going on when zoom limit is reached
|
|
119
|
+
- Only update hover effect of elements when graph is not empty
|
|
120
|
+
- Ensure zoom to fit continues if panning has not finished yet
|
|
121
|
+
- Improve html overlay scaling
|
|
122
|
+
- Ensure Webgl context is released when NVL instance is destroyed
|
|
123
|
+
- Emoji in captions not rendering correctly
|
package/README.md
CHANGED
|
@@ -90,3 +90,5 @@ For example:
|
|
|
90
90
|
rels={[{ from: '0', to: '1', id: '10' }]}
|
|
91
91
|
/>
|
|
92
92
|
```
|
|
93
|
+
|
|
94
|
+
You can find more instructions and examples on how to use NVL interaction handlers in the [docs](https://neo4j.com/docs/nvl/current/react-wrappers/) and [API docs](https://neo4j.com/docs/api/nvl/current/modules/_neo4j_nvl_react.html), as well as in these [NVL code examples](https://neo4j.com/docs/api/nvl/current/examples.html?tab=react-vanilla).
|
|
@@ -23,6 +23,8 @@ export interface BasicReactWrapperProps {
|
|
|
23
23
|
nvlCallbacks?: ExternalCallbacks;
|
|
24
24
|
/** An object containing options for the Nvl instance */
|
|
25
25
|
nvlOptions?: NvlOptions;
|
|
26
|
+
/** Sets the positions of the nodes in the graph using the {@link NVL.setNodePositions} method. */
|
|
27
|
+
positions?: Node[];
|
|
26
28
|
/** A callback to handle any errors that happen during NVL initialization */
|
|
27
29
|
onInitializationError?: (error: unknown) => void;
|
|
28
30
|
}
|
|
@@ -12,7 +12,7 @@ import { useDeepCompareEffect } from '../utils/hooks';
|
|
|
12
12
|
*
|
|
13
13
|
* For examples, head to the {@link https://neo4j.com/docs/nvl/current/react-wrappers/#_basic_react_wrapper Basic React wrapper documentation page}.
|
|
14
14
|
*/
|
|
15
|
-
export const BasicNvlWrapper = memo(forwardRef(({ nodes, rels, layout, layoutOptions, nvlCallbacks = {}, nvlOptions = {}, onInitializationError, ...nvlEvents }, ref) => {
|
|
15
|
+
export const BasicNvlWrapper = memo(forwardRef(({ nodes, rels, layout, layoutOptions, nvlCallbacks = {}, nvlOptions = {}, positions = [], onInitializationError, ...nvlEvents }, ref) => {
|
|
16
16
|
const nvlRef = useRef(null);
|
|
17
17
|
useImperativeHandle(ref, () => {
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
@@ -78,17 +78,19 @@ export const BasicNvlWrapper = memo(forwardRef(({ nodes, rels, layout, layoutOpt
|
|
|
78
78
|
nvlRef.current.removeNodesWithIds(nodeChanges.removed.map((n) => n.id));
|
|
79
79
|
}, [currentNodes, currentRels, nodes, rels]);
|
|
80
80
|
useEffect(() => {
|
|
81
|
-
|
|
81
|
+
const updatedLayout = layout ?? nvlOptions.layout;
|
|
82
|
+
if (nvlRef.current === null || updatedLayout === undefined) {
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
|
-
nvlRef.current.setLayout(
|
|
85
|
-
}, [layout]);
|
|
85
|
+
nvlRef.current.setLayout(updatedLayout);
|
|
86
|
+
}, [layout, nvlOptions.layout]);
|
|
86
87
|
useDeepCompareEffect(() => {
|
|
87
|
-
|
|
88
|
+
const updatedLayoutOptions = layoutOptions ?? nvlOptions?.layoutOptions;
|
|
89
|
+
if (nvlRef.current === null || updatedLayoutOptions === undefined) {
|
|
88
90
|
return;
|
|
89
91
|
}
|
|
90
|
-
nvlRef.current.setLayoutOptions(
|
|
91
|
-
}, [layoutOptions]);
|
|
92
|
+
nvlRef.current.setLayoutOptions(updatedLayoutOptions);
|
|
93
|
+
}, [layoutOptions, nvlOptions.layoutOptions]);
|
|
92
94
|
useEffect(() => {
|
|
93
95
|
if (nvlRef.current === null || nvlOptions.useWebGL === undefined) {
|
|
94
96
|
return;
|
|
@@ -107,5 +109,11 @@ export const BasicNvlWrapper = memo(forwardRef(({ nodes, rels, layout, layoutOpt
|
|
|
107
109
|
}
|
|
108
110
|
nvlRef.current.setDisableWebGL(nvlOptions.disableWebGL);
|
|
109
111
|
}, [nvlOptions.disableWebGL]);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (nvlRef.current === null || positions.length === 0) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
nvlRef.current.setNodePositions(positions);
|
|
117
|
+
}, [positions]);
|
|
110
118
|
return _jsx("div", { id: BASIC_WRAPPER_ID, ref: containerRef, style: { height: '100%', outline: '0' }, ...nvlEvents });
|
|
111
119
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/react",
|
|
3
|
-
"version": "0.3.6-
|
|
3
|
+
"version": "0.3.6-ab6fbe86",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"homepage": "https://neo4j.com/docs/nvl/current/",
|
|
6
6
|
"license": "SEE LICENSE IN 'LICENSE.txt'",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"build": "yarn global:tsc",
|
|
19
19
|
"watch": "yarn global:tsc -w",
|
|
20
20
|
"test": " yarn global:jest",
|
|
21
|
-
"prepack": "cp ../../LICENSE.txt ./",
|
|
22
|
-
"postpack": "rm LICENSE.txt",
|
|
21
|
+
"prepack": "cp ../../LICENSE.txt ./ && cp ../../CHANGELOG.md ./",
|
|
22
|
+
"postpack": "rm LICENSE.txt && rm CHANGELOG.md",
|
|
23
23
|
"eslint": "yarn global:eslint ./src/"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"babel-eslint": "^10.1.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@neo4j-nvl/base": "0.3.6-
|
|
38
|
-
"@neo4j-nvl/interaction-handlers": "0.3.6-
|
|
37
|
+
"@neo4j-nvl/base": "0.3.6-ab6fbe86",
|
|
38
|
+
"@neo4j-nvl/interaction-handlers": "0.3.6-ab6fbe86",
|
|
39
39
|
"lodash": "4.17.21",
|
|
40
40
|
"react": "^18.2.0",
|
|
41
41
|
"react-dom": "^18.2.0"
|