@neo4j-nvl/layout-workers 0.3.1 → 0.3.2-ea823910
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/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Shared workers dependency for @neo4j-nvl/base
|
|
1
|
+
Shared workers dependency for @neo4j-nvl/base
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { layout } from './dagre-layout-impl.js';
|
|
2
|
+
describe('Dagre-layout-impl', () => {
|
|
3
|
+
test('is defined', () => {
|
|
4
|
+
expect(layout).toBeDefined();
|
|
5
|
+
});
|
|
6
|
+
test('the waypoints are defined by the first relationship', () => {
|
|
7
|
+
const nodes = [
|
|
8
|
+
{ id: '1', color: '#000000', caption: 'Thing1', pinned: false, activated: false, selected: false },
|
|
9
|
+
{ id: '2', color: '#000000', caption: 'Thing2', pinned: false, activated: false, selected: false },
|
|
10
|
+
{ id: '3', color: '#000000', caption: 'Thing3', pinned: false, activated: false, selected: false }
|
|
11
|
+
];
|
|
12
|
+
const nodeIds = {
|
|
13
|
+
1: { id: '1', color: '#000000', caption: 'Thing1', pinned: false, activated: false, selected: false },
|
|
14
|
+
2: { id: '2', color: '#000000', caption: 'Thing2', pinned: false, activated: false, selected: false },
|
|
15
|
+
3: { id: '3', color: '#000000', caption: 'Thing3', pinned: false, activated: false, selected: false }
|
|
16
|
+
};
|
|
17
|
+
const rels = [
|
|
18
|
+
{ id: '1000', from: '1', to: '2', type: 'CONNECTED_TO', properties: {} },
|
|
19
|
+
{ id: '1002', from: '2', to: '3', type: 'CONNECTED_TO', properties: {} },
|
|
20
|
+
{ id: '1004', from: '1', to: '3', type: 'CONNECTED_TO', properties: {} },
|
|
21
|
+
{ id: '1005', from: '3', to: '1', type: 'CONNECTED_TO', properties: {} }
|
|
22
|
+
];
|
|
23
|
+
const idToPosition = { 1: { id: '1' }, 2: { id: '2' }, 3: { id: '3' } };
|
|
24
|
+
const result = layout(nodes, nodeIds, idToPosition, rels, 'right', 2);
|
|
25
|
+
expect(result).toBeDefined();
|
|
26
|
+
expect(result.positions).toBeDefined();
|
|
27
|
+
expect(result.parents).toBeDefined();
|
|
28
|
+
expect(result.waypoints).toBeDefined();
|
|
29
|
+
expect(result.waypoints['1-3']).toBeDefined();
|
|
30
|
+
const wpObject = result.waypoints['1-3'];
|
|
31
|
+
const xs = [wpObject.from.x, ...wpObject.points.map((p) => p.x), wpObject.to.x];
|
|
32
|
+
for (let i = 1; i < xs.length; i++) {
|
|
33
|
+
expect(xs[i]).toBeGreaterThan(xs[i - 1]);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/layout-workers",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2-ea823910",
|
|
4
4
|
"license": "SEE LICENSE IN 'LICENSE.txt'",
|
|
5
|
+
"description": "Layout workers for the Neo4j Visualization Library",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"neo4j",
|
|
8
|
+
"visualization",
|
|
9
|
+
"graph"
|
|
10
|
+
],
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://community.neo4j.com/c/neo4j-graph-platform/neo4j-bloom"
|
|
13
|
+
},
|
|
5
14
|
"main": "lib/index.js",
|
|
6
15
|
"type": "module",
|
|
7
16
|
"files": [
|
|
@@ -11,7 +20,8 @@
|
|
|
11
20
|
"scripts": {
|
|
12
21
|
"build": "tsc",
|
|
13
22
|
"prepack": "cp ../../LICENSE.txt ./",
|
|
14
|
-
"postpack": "rm LICENSE.txt"
|
|
23
|
+
"postpack": "rm LICENSE.txt",
|
|
24
|
+
"eslint": "eslint ./src/ --ext .js,.mjs --plugin only-warn"
|
|
15
25
|
},
|
|
16
26
|
"typedoc": {
|
|
17
27
|
"entryPoint": "./src/index.js",
|
|
@@ -28,9 +38,12 @@
|
|
|
28
38
|
},
|
|
29
39
|
"devDependencies": {
|
|
30
40
|
"@types/node": "^18.11.11",
|
|
41
|
+
"eslint": "8.38.0",
|
|
31
42
|
"typescript": "^5.4.5"
|
|
32
43
|
},
|
|
33
44
|
"peerDependencies": {
|
|
45
|
+
"eslint": "*",
|
|
34
46
|
"typescript": "*"
|
|
35
|
-
}
|
|
47
|
+
},
|
|
48
|
+
"stableVersion": "0.3.2"
|
|
36
49
|
}
|