@neo4j-nvl/interaction-handlers 0.3.6 → 0.3.7-6326e57d
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
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
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.7] - 2025-02-28
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
* Export zoom functionalities as a named function
|
|
10
|
+
* Add a `positions` prop to the react wrapper
|
|
11
|
+
* Color custimzation options
|
|
12
|
+
* Aria attributes for NVL canvas and option to disable them
|
|
13
|
+
* Option to disable web workers
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* Change default threshold when relationship captions are displayed
|
|
18
|
+
* update default selection color and default node color to be aligned with the Neo4j Design Library
|
|
19
|
+
|
|
20
|
+
### Deprecated
|
|
21
|
+
|
|
22
|
+
* `selectedBorderColor` - use `styling.selectedBorderColor` instead
|
|
23
|
+
* `nodeDefaultBorderColor` - use `styling.nodeDefaultBorderColor` instead
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
* Fix icon colors not being inverted for dark node colors
|
|
28
|
+
* fix bug where selected border color was not processed if a default border color was not provided in options
|
|
29
|
+
* Address several warnings during initialization
|
|
30
|
+
* Address multi-select callback inconsistencies
|
|
31
|
+
* Canvas renderer performance improvements
|
|
32
|
+
* ensure properties provided via `nvlOptions` are also updated on prop change in React wrappers
|
|
33
|
+
|
|
34
|
+
## [0.3.6] - 2025-02-21
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- [result transformer for the Neo4j JavaScript Driver](https://neo4j.com/docs/api/nvl/current/functions/_neo4j_nvl_base.nvlResultTransformer.html)
|
|
41
|
+
- [option](https://neo4j.com/docs/api/nvl/current/types/_neo4j_nvl_base.ZoomOptions.html) to disable transition when fitting nodes
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- lasso handler issues during initialization
|
|
46
|
+
|
|
47
|
+
## [0.3.5] - 2025-02-20
|
|
48
|
+
|
|
49
|
+
NVL 0.3.5 contains several bug fixes and changes the default rendering method of NVL from "webgl" to "canvas".
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- Change default value for renderer to canvas
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
- Self-referring relationship overlay icon rotation position issue
|
|
58
|
+
- Invalid lasso area calculation when segment from first to last point intersects
|
|
59
|
+
|
|
60
|
+
## [0.3.4] - 2025-02-19
|
|
61
|
+
|
|
62
|
+
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.
|
|
63
|
+
|
|
64
|
+
### Added
|
|
65
|
+
|
|
66
|
+
- NVL's API documentation and examples on [neo4j.com/docs/api/nvl/current](http://neo4j.com/docs/api/nvl/current).
|
|
67
|
+
- A fallback implementation for web workers when they aren't avilable in the current environment.
|
|
68
|
+
- A new onDrawStarted callback for the [draw interaction handler](https://neo4j.com/docs/api/nvl/current/classes/_neo4j_nvl_interaction_handlers.DrawInteraction.html)
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
|
|
72
|
+
- Issues with lasso shape when parts of it are close to each other
|
|
73
|
+
- NVL crash when sometimes position map and nodeToBundle are out of sync
|
|
74
|
+
|
|
75
|
+
## [0.3.3] - 2025-02-18
|
|
76
|
+
|
|
77
|
+
This is a patch release to address a dependency issue in 0.3.2
|
|
78
|
+
|
|
79
|
+
### Fixed
|
|
80
|
+
|
|
81
|
+
- Move Segment dependency from dev dependencies
|
|
82
|
+
- Ensure workspace version references point to exact version
|
|
83
|
+
|
|
84
|
+
## [0.3.2] - 2025-02-17
|
|
85
|
+
|
|
86
|
+
This is our first patch release since going GA in May.
|
|
87
|
+
|
|
88
|
+
### Added
|
|
89
|
+
|
|
90
|
+
- [Telemetry](https://neo4j.com/docs/api/nvl/current/interfaces/_neo4j_nvl_base.NvlOptions.html#disableTelemetry)
|
|
91
|
+
- [Examples](https://neo4j.com/docs/api/nvl/current/examples.html) in API documentation
|
|
92
|
+
- More information in package.json files
|
|
93
|
+
- Overlay icons for nodes and relationships
|
|
94
|
+
- Links to documentation websites in readme
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
|
|
98
|
+
- Fixed zoom to fit for self relationships
|
|
99
|
+
- Aalign selected border color
|
|
100
|
+
- Issues with WebGL error propagation
|
|
101
|
+
- Issue with key captures on mouse click in draw-interactions
|
|
102
|
+
- Zoom to fit finishing too early
|
|
103
|
+
- Improve imagecache error handling
|
|
104
|
+
- Minimap viewport box not rendering
|
|
105
|
+
|
|
106
|
+
## [0.3.1] - 2025-02-16
|
|
107
|
+
|
|
108
|
+
This is our first GA release of NVL.
|
|
109
|
+
|
|
110
|
+
### Added
|
|
111
|
+
|
|
112
|
+
- Expose callback types through interactive react wrapper
|
|
113
|
+
- Feature/adv interaction fw drag callbacks amendments
|
|
114
|
+
- Add [lasso select interaction module](https://neo4j.com/docs/api/nvl/current/classes/_neo4j_nvl_interaction_handlers.LassoInteraction.html)
|
|
115
|
+
- Configurable node ring styles
|
|
116
|
+
- Support React concurrent mode in React wrappers
|
|
117
|
+
- [`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
|
|
118
|
+
|
|
119
|
+
### Deprecated
|
|
120
|
+
|
|
121
|
+
- `useWebGL` and `setUseWebGL` (use `renderer` and `setRenderer` instead).
|
|
122
|
+
|
|
123
|
+
### Changed
|
|
124
|
+
|
|
125
|
+
- Core library is now named "base" library
|
|
126
|
+
- All packages are published publicly
|
|
127
|
+
- Refactor rel validation method to improve performance
|
|
128
|
+
- Convert layout web workers to shared workers
|
|
129
|
+
- 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
|
|
130
|
+
|
|
131
|
+
### Removed
|
|
132
|
+
|
|
133
|
+
- Remove deprecated elements
|
|
134
|
+
|
|
135
|
+
### Fixed
|
|
136
|
+
|
|
137
|
+
- Wrong directions in a relationship bundle
|
|
138
|
+
- Issues with node and relationship id handling when strings are not numeric
|
|
139
|
+
- Zoom/pan jitter removal
|
|
140
|
+
- Ensure all interaction handlers return mouse events
|
|
141
|
+
- Cytoscape behaviour fixes
|
|
142
|
+
- Drag triggers too early
|
|
143
|
+
- Fix issue where right clicking sometime also triggers mouseup event
|
|
144
|
+
- Issues in dynamic zoom boundaries
|
|
145
|
+
- Don't trigger panning when mouse down was outside of NVL
|
|
146
|
+
- Only register callbacks if provided
|
|
147
|
+
- Ensure fit operation does not keep going on when zoom limit is reached
|
|
148
|
+
- Only update hover effect of elements when graph is not empty
|
|
149
|
+
- Ensure zoom to fit continues if panning has not finished yet
|
|
150
|
+
- Improve html overlay scaling
|
|
151
|
+
- Ensure Webgl context is released when NVL instance is destroyed
|
|
152
|
+
- Emoji in captions not rendering correctly
|
package/README.md
CHANGED
|
@@ -33,4 +33,4 @@ clickInteraction.updateCallback('onNodeClick', (node) => {
|
|
|
33
33
|
|
|
34
34
|
If you are using React and want to add interactivity to your graph, you can also make use of the InteractiveReactWrapper.
|
|
35
35
|
|
|
36
|
-
You can find more instructions and examples on how to use NVL interaction handlers in the [docs](https://neo4j.com/docs/nvl/current/interaction-handlers/).
|
|
36
|
+
You can find more instructions and examples on how to use NVL interaction handlers in the [docs](https://neo4j.com/docs/nvl/current/interaction-handlers/) and [API docs](https://neo4j.com/docs/api/nvl/current/modules/_neo4j_nvl_interaction_handlers.html), as well as in these [NVL code examples](https://neo4j.com/docs/api/nvl/current/examples.html?tab=plain-interaction-module).
|
|
@@ -3,7 +3,7 @@ import '@testing-library/jest-dom';
|
|
|
3
3
|
import { LassoInteraction, checkIntersection, checkLinesCrossing, checkPointInside } from '../interaction-handlers/lasso-interaction';
|
|
4
4
|
jest.mock('@neo4j-nvl/layout-workers');
|
|
5
5
|
const testNodes = [
|
|
6
|
-
{ id: '0', x:
|
|
6
|
+
{ id: '0', x: 25, y: 25 },
|
|
7
7
|
{ id: '1', x: 200, y: 200 }
|
|
8
8
|
];
|
|
9
9
|
const testRels = [{ id: '10', from: '0', to: '1' }];
|
|
@@ -35,12 +35,12 @@ describe('LassoInteraction', () => {
|
|
|
35
35
|
expect(myNVL.getSelectedNodes()).toHaveLength(0);
|
|
36
36
|
const gesture1 = [
|
|
37
37
|
createMouseEvent('mousedown', 0, 0),
|
|
38
|
-
createMouseEvent('mousemove',
|
|
39
|
-
createMouseEvent('mousemove', 20,
|
|
38
|
+
createMouseEvent('mousemove', 50, 0),
|
|
39
|
+
createMouseEvent('mousemove', 20, 50),
|
|
40
40
|
createMouseEvent('mouseup', 0, 0)
|
|
41
41
|
];
|
|
42
42
|
const gesture2 = [
|
|
43
|
-
createMouseEvent('mousedown', 200,
|
|
43
|
+
createMouseEvent('mousedown', 200, 150),
|
|
44
44
|
createMouseEvent('mousemove', 210, 210),
|
|
45
45
|
createMouseEvent('mouseup', 190, 210)
|
|
46
46
|
];
|
|
@@ -76,6 +76,23 @@ describe('LassoInteraction', () => {
|
|
|
76
76
|
resolve();
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
|
+
test('will not start when node is below pointer when dragging', () => {
|
|
80
|
+
lassoInteraction.updateCallback('onLassoStarted', startCallback);
|
|
81
|
+
lassoInteraction.updateCallback('onLassoSelect', selectCallback);
|
|
82
|
+
expect(myNVL.getSelectedNodes()).toHaveLength(0);
|
|
83
|
+
const gesture1 = [
|
|
84
|
+
createMouseEvent('mousedown', 10, 10),
|
|
85
|
+
createMouseEvent('mousemove', 50, 0),
|
|
86
|
+
createMouseEvent('mousemove', 20, 50),
|
|
87
|
+
createMouseEvent('mouseup', 0, 0)
|
|
88
|
+
];
|
|
89
|
+
const container = myNVL.getContainer();
|
|
90
|
+
gesture1.forEach((e) => container.dispatchEvent(e));
|
|
91
|
+
return new Promise((resolve) => {
|
|
92
|
+
expect(startCallback).not.toHaveBeenCalled();
|
|
93
|
+
resolve();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
79
96
|
test('test for line crossing utility function', () => {
|
|
80
97
|
const res1 = checkLinesCrossing([0, 0], [10, 10], [10, 0], [0, 10]);
|
|
81
98
|
expect(res1).toBeTruthy();
|
|
@@ -106,10 +106,10 @@ export class BoxSelectInteraction extends BaseInteraction {
|
|
|
106
106
|
}
|
|
107
107
|
else {
|
|
108
108
|
this.isBoxSelecting = true;
|
|
109
|
+
this.callCallbackIfRegistered('onBoxStarted', event);
|
|
109
110
|
if (this.currentOptions.selectOnRelease === true) {
|
|
110
111
|
this.nvlInstance.deselectAll();
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
|
-
this.callCallbackIfRegistered('onBoxStarted', event);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import concaveman from 'concaveman';
|
|
2
|
+
import { NODE_EDGE_WIDTH } from '../constants';
|
|
2
3
|
import { OverlayRenderer } from '../overlay-renderer/overlay-renderer';
|
|
3
4
|
import { BaseInteraction } from './base';
|
|
4
5
|
import { getCanvasPosition, getWorldPosition } from './utils';
|
|
@@ -87,9 +88,18 @@ export class LassoInteraction extends BaseInteraction {
|
|
|
87
88
|
this.addEventListener('mouseleave', this.endLasso, true);
|
|
88
89
|
}
|
|
89
90
|
startLasso = (event) => {
|
|
90
|
-
this.
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
const hits = this.nvlInstance.getHits(event, ['node'], { hitNodeMarginWidth: NODE_EDGE_WIDTH });
|
|
92
|
+
if (hits.nvlTargets.nodes.length > 0) {
|
|
93
|
+
this.active = false;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
this.active = true;
|
|
97
|
+
this.points = [getCanvasPosition(this.containerInstance, event)];
|
|
98
|
+
this.callCallbackIfRegistered('onLassoStarted', event);
|
|
99
|
+
if (this.currentOptions.selectOnRelease === true) {
|
|
100
|
+
this.nvlInstance.deselectAll();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
93
103
|
};
|
|
94
104
|
handleMouseDown = (event) => {
|
|
95
105
|
if (event.button === 0 && !this.active) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/interaction-handlers",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7-6326e57d",
|
|
4
4
|
"license": "SEE LICENSE IN 'LICENSE.txt'",
|
|
5
5
|
"homepage": "https://neo4j.com/docs/nvl/current/",
|
|
6
6
|
"description": "Interaction handlers for the Neo4j Visualization Library",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"build": "yarn global:tsc",
|
|
23
23
|
"watch": "yarn global:tsc -w",
|
|
24
24
|
"test": "yarn global:jest",
|
|
25
|
-
"prepack": "cp ../../LICENSE.txt ./",
|
|
26
|
-
"postpack": "rm LICENSE.txt",
|
|
25
|
+
"prepack": "cp ../../LICENSE.txt ./ && cp ../../CHANGELOG.md ./",
|
|
26
|
+
"postpack": "rm LICENSE.txt && rm CHANGELOG.md",
|
|
27
27
|
"eslint": "yarn global:eslint ./src/"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@neo4j-nvl/base": "0.3.
|
|
30
|
+
"@neo4j-nvl/base": "0.3.7-6326e57d",
|
|
31
31
|
"concaveman": "^1.2.1",
|
|
32
32
|
"lodash": "4.17.21"
|
|
33
33
|
},
|
|
@@ -36,5 +36,6 @@
|
|
|
36
36
|
"@testing-library/react": "^13.4.0",
|
|
37
37
|
"@types/concaveman": "1.1.6",
|
|
38
38
|
"@types/lodash": "4.14.202"
|
|
39
|
-
}
|
|
39
|
+
},
|
|
40
|
+
"stableVersion": "0.3.7"
|
|
40
41
|
}
|