@neo4j-nvl/layout-workers 0.3.2 → 0.3.3-5047577d

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.
@@ -0,0 +1,10 @@
1
+ export namespace coseBilkentLayoutFallbackWorker {
2
+ let port: CoseBilkentLayoutFallbackWorker;
3
+ }
4
+ declare class CoseBilkentLayoutFallbackWorker {
5
+ start(): void;
6
+ postMessage(data: any): void;
7
+ onmessage(): void;
8
+ close(): void;
9
+ }
10
+ export {};
@@ -0,0 +1,16 @@
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
+ };
@@ -0,0 +1,10 @@
1
+ export namespace hierarchicalLayoutFallbackWorker {
2
+ let port: HierarchicalLayoutFallbackWorker;
3
+ }
4
+ declare class HierarchicalLayoutFallbackWorker {
5
+ start(): void;
6
+ postMessage(data: any): void;
7
+ onmessage(): void;
8
+ close(): void;
9
+ }
10
+ export {};
@@ -0,0 +1,23 @@
1
+ /* eslint-disable @typescript-eslint/no-empty-function */
2
+ /* eslint-disable no-empty-function */
3
+ import { layout } from './dagre-layout-impl.js';
4
+ class HierarchicalLayoutFallbackWorker {
5
+ start() { }
6
+ postMessage(data) {
7
+ const { nodes, nodeIds, idToPosition, rels, direction, packing, pixelRatio, forcedDelay = 0 } = data;
8
+ const layoutData = layout(nodes, nodeIds, idToPosition, rels, direction, packing, pixelRatio);
9
+ if (forcedDelay) {
10
+ setTimeout(() => {
11
+ this.onmessage({ data: layoutData });
12
+ }, forcedDelay);
13
+ }
14
+ else {
15
+ this.onmessage({ data: layoutData });
16
+ }
17
+ }
18
+ onmessage() { }
19
+ close() { }
20
+ }
21
+ export const hierarchicalLayoutFallbackWorker = {
22
+ port: new HierarchicalLayoutFallbackWorker()
23
+ };
package/lib/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  import { createCoseBilkentLayoutWorker } from './cosebilkent-layout/workerFactory.mjs';
2
2
  import { createHierarchicalLayoutWorker } from './hierarchical-layout/workerFactory.mjs';
3
- export { createCoseBilkentLayoutWorker, createHierarchicalLayoutWorker };
3
+ import { hierarchicalLayoutFallbackWorker } from './hierarchical-layout/HierarchicalLayout.fallback.js';
4
+ import { coseBilkentLayoutFallbackWorker } from './cosebilkent-layout/CoseBilkentLayout.fallback.js';
5
+ export { createCoseBilkentLayoutWorker, createHierarchicalLayoutWorker, hierarchicalLayoutFallbackWorker, coseBilkentLayoutFallbackWorker };
package/lib/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { coseBilkentLayoutFallbackWorker } from './cosebilkent-layout/CoseBilkentLayout.fallback.js';
1
2
  import { createCoseBilkentLayoutWorker } from './cosebilkent-layout/workerFactory.mjs';
3
+ import { hierarchicalLayoutFallbackWorker } from './hierarchical-layout/HierarchicalLayout.fallback.js';
2
4
  import { createHierarchicalLayoutWorker } from './hierarchical-layout/workerFactory.mjs';
3
- export { createCoseBilkentLayoutWorker, createHierarchicalLayoutWorker };
5
+ export { createCoseBilkentLayoutWorker, createHierarchicalLayoutWorker, hierarchicalLayoutFallbackWorker, coseBilkentLayoutFallbackWorker };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-nvl/layout-workers",
3
- "version": "0.3.2",
3
+ "version": "0.3.3-5047577d",
4
4
  "license": "SEE LICENSE IN 'LICENSE.txt'",
5
5
  "description": "Layout workers for the Neo4j Visualization Library",
6
6
  "keywords": [
@@ -19,6 +19,7 @@
19
19
  ],
20
20
  "scripts": {
21
21
  "build": "tsc",
22
+ "watch": "tsc -w",
22
23
  "prepack": "cp ../../LICENSE.txt ./",
23
24
  "postpack": "rm LICENSE.txt",
24
25
  "eslint": "eslint ./src/ --ext .js,.mjs --plugin only-warn"
@@ -44,5 +45,6 @@
44
45
  "peerDependencies": {
45
46
  "eslint": "*",
46
47
  "typescript": "*"
47
- }
48
+ },
49
+ "stableVersion": "0.3.3"
48
50
  }