@neo4j-nvl/layout-workers 1.2.0-158df7fc → 1.2.0-16f55e80
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/lib/__mocks__/index.d.ts +10 -9
- package/lib/__mocks__/index.js +2 -2
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -3
- package/package.json +1 -3
- package/lib/cosebilkent-layout/CoseBilkentLayout.fallback.d.ts +0 -10
- package/lib/cosebilkent-layout/CoseBilkentLayout.fallback.js +0 -16
- package/lib/cosebilkent-layout/CoseBilkentLayout.worker.d.ts +0 -1
- package/lib/cosebilkent-layout/CoseBilkentLayout.worker.js +0 -9
- package/lib/cosebilkent-layout/cose-bilkent-layout-impl.d.ts +0 -3
- package/lib/cosebilkent-layout/cose-bilkent-layout-impl.js +0 -29
- package/lib/cosebilkent-layout/workerFactory.d.mts +0 -1
- package/lib/cosebilkent-layout/workerFactory.mjs +0 -8
package/lib/__mocks__/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
port
|
|
3
|
-
start: jest.Mock<any, any, any>;
|
|
4
|
-
onmessage: jest.Mock<any, any, any>;
|
|
5
|
-
postMessage: jest.Mock<any, any, any>;
|
|
6
|
-
close: jest.Mock<any, any, any>;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export function createHierarchicalLayoutWorker(): {
|
|
1
|
+
declare namespace sharedWorkerMock {
|
|
2
|
+
namespace port {
|
|
3
|
+
let start: jest.Mock<any, any, any>;
|
|
4
|
+
let onmessage: jest.Mock<any, any, any>;
|
|
5
|
+
let postMessage: jest.Mock<any, any, any>;
|
|
6
|
+
let close: jest.Mock<any, any, any>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare function createHierarchicalLayoutWorker(): {
|
|
10
10
|
port: {
|
|
11
11
|
start: jest.Mock<any, any, any>;
|
|
12
12
|
onmessage: jest.Mock<any, any, any>;
|
|
@@ -14,3 +14,4 @@ export function createHierarchicalLayoutWorker(): {
|
|
|
14
14
|
close: jest.Mock<any, any, any>;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
+
export { sharedWorkerMock as hierarchicalLayoutFallbackWorker };
|
package/lib/__mocks__/index.js
CHANGED
|
@@ -7,6 +7,6 @@ const sharedWorkerMock = {
|
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
9
|
module.exports = {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
createHierarchicalLayoutWorker: () => sharedWorkerMock,
|
|
11
|
+
hierarchicalLayoutFallbackWorker: sharedWorkerMock
|
|
12
12
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createCoseBilkentLayoutWorker } from './cosebilkent-layout/workerFactory.mjs';
|
|
2
1
|
import { createHierarchicalLayoutWorker } from './hierarchical-layout/workerFactory.mjs';
|
|
3
2
|
import { hierarchicalLayoutFallbackWorker } from './hierarchical-layout/HierarchicalLayout.fallback.js';
|
|
4
|
-
|
|
5
|
-
export { createCoseBilkentLayoutWorker, createHierarchicalLayoutWorker, hierarchicalLayoutFallbackWorker, coseBilkentLayoutFallbackWorker };
|
|
3
|
+
export { createHierarchicalLayoutWorker, hierarchicalLayoutFallbackWorker };
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { coseBilkentLayoutFallbackWorker } from './cosebilkent-layout/CoseBilkentLayout.fallback.js';
|
|
2
|
-
import { createCoseBilkentLayoutWorker } from './cosebilkent-layout/workerFactory.mjs';
|
|
3
1
|
import { hierarchicalLayoutFallbackWorker } from './hierarchical-layout/HierarchicalLayout.fallback.js';
|
|
4
2
|
import { createHierarchicalLayoutWorker } from './hierarchical-layout/workerFactory.mjs';
|
|
5
|
-
export {
|
|
3
|
+
export { createHierarchicalLayoutWorker, hierarchicalLayoutFallbackWorker };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/layout-workers",
|
|
3
|
-
"version": "1.2.0-
|
|
3
|
+
"version": "1.2.0-16f55e80",
|
|
4
4
|
"license": "SEE LICENSE IN 'LICENSE.txt'",
|
|
5
5
|
"description": "Layout workers for the Neo4j Visualization Library",
|
|
6
6
|
"keywords": [
|
|
@@ -33,8 +33,6 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@neo4j-bloom/dagre": "0.8.14",
|
|
35
35
|
"bin-pack": "1.0.2",
|
|
36
|
-
"cytoscape": "3.33.1",
|
|
37
|
-
"cytoscape-cose-bilkent": "4.1.0",
|
|
38
36
|
"graphlib": "2.1.8"
|
|
39
37
|
},
|
|
40
38
|
"devDependencies": {
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
2
|
-
/* eslint-disable no-empty-function */
|
|
3
|
-
import { layout } from './cose-bilkent-layout-impl.js';
|
|
4
|
-
class CoseBilkentLayoutFallbackWorker {
|
|
5
|
-
start() { }
|
|
6
|
-
postMessage(data) {
|
|
7
|
-
const { elements, spacingFactor } = data;
|
|
8
|
-
const layoutData = layout(elements, spacingFactor);
|
|
9
|
-
this.onmessage({ data: layoutData });
|
|
10
|
-
}
|
|
11
|
-
onmessage() { }
|
|
12
|
-
close() { }
|
|
13
|
-
}
|
|
14
|
-
export const coseBilkentLayoutFallbackWorker = {
|
|
15
|
-
port: new CoseBilkentLayoutFallbackWorker()
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { layout } from './cose-bilkent-layout-impl.js';
|
|
2
|
-
onconnect = ({ ports }) => {
|
|
3
|
-
const port = ports[0];
|
|
4
|
-
port.onmessage = ({ data }) => {
|
|
5
|
-
const { elements, spacingFactor } = data;
|
|
6
|
-
const layoutData = layout(elements, spacingFactor);
|
|
7
|
-
port.postMessage(layoutData);
|
|
8
|
-
};
|
|
9
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import cytoscape from 'cytoscape';
|
|
2
|
-
import coseBilkent from 'cytoscape-cose-bilkent';
|
|
3
|
-
cytoscape.use(coseBilkent);
|
|
4
|
-
const type = 'cose-bilkent';
|
|
5
|
-
export const layout = (elements, spacingFactor) => {
|
|
6
|
-
const c = cytoscape({
|
|
7
|
-
headless: true,
|
|
8
|
-
styleEnabled: false
|
|
9
|
-
});
|
|
10
|
-
c.add(elements);
|
|
11
|
-
const positions = {};
|
|
12
|
-
const cytoLayout = c.layout({
|
|
13
|
-
name: type,
|
|
14
|
-
animate: false,
|
|
15
|
-
spacingFactor,
|
|
16
|
-
quality: 'default',
|
|
17
|
-
tile: false,
|
|
18
|
-
randomize: true,
|
|
19
|
-
stop: () => {
|
|
20
|
-
c.nodes().forEach((n) => {
|
|
21
|
-
positions[n.id()] = { ...n.position() };
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
cytoLayout.run();
|
|
26
|
-
return {
|
|
27
|
-
positions
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function createCoseBilkentLayoutWorker(): SharedWorker;
|