@neo4j-nvl/base 0.3.8-950b8eb7 → 0.3.8-cf97142e
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/dist/base.mjs +1 -1
- package/dist/types/layouts/forcedirectedlayout/physlayout/PhysLayout.d.ts +7 -8
- package/dist/types/layouts/forcedirectedlayout/physlayout/solarmerger/SolarMerger.d.ts +39 -17
- package/dist/types/layouts/forcedirectedlayout/physlayout/solarmerger/solar-placer.d.ts +1 -4
- package/package.json +2 -2
- package/dist/types/layouts/forcedirectedlayout/physlayout/solarmerger/types.d.ts +0 -48
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { ForceDirectedOptions, NvlState } from '../../../modules/state/types';
|
|
2
2
|
import type { Node, Relationship } from '../../../types/graph-element';
|
|
3
3
|
import type { Point } from '../../../utils/geometry';
|
|
4
|
-
import type { CoarsenedGraph } from './solarmerger/types';
|
|
5
4
|
export declare class PhysLayout {
|
|
6
5
|
private physVbo;
|
|
7
6
|
private physSmallVbo;
|
|
8
7
|
private physProjection;
|
|
9
8
|
private physSmallProjection;
|
|
10
9
|
private gl;
|
|
11
|
-
private
|
|
10
|
+
private useReadpixelWorkaround;
|
|
12
11
|
private averageNodeSize;
|
|
13
12
|
private shouldUpdate;
|
|
14
13
|
private iterationCount;
|
|
@@ -32,10 +31,10 @@ export declare class PhysLayout {
|
|
|
32
31
|
private nodeSortMap;
|
|
33
32
|
private firstUpdate;
|
|
34
33
|
private curPhysData;
|
|
35
|
-
private
|
|
34
|
+
private apprxRepForceShader;
|
|
36
35
|
private levelsClusterTexture;
|
|
37
36
|
private levelsFinestIndexTexture;
|
|
38
|
-
private
|
|
37
|
+
private initalLevelTexture;
|
|
39
38
|
private levelsData;
|
|
40
39
|
private collisionDetectionMultiplier;
|
|
41
40
|
private physShader;
|
|
@@ -71,7 +70,7 @@ export declare class PhysLayout {
|
|
|
71
70
|
setData(data: {
|
|
72
71
|
nodes: Node[];
|
|
73
72
|
rels: Relationship[];
|
|
74
|
-
}):
|
|
73
|
+
}): any;
|
|
75
74
|
/**
|
|
76
75
|
* Updates the node's positions for the next step in the physics layout iterations if the layout needs to update
|
|
77
76
|
* @param refreshPositions whether the entire layout should be reheated
|
|
@@ -127,7 +126,7 @@ export declare class PhysLayout {
|
|
|
127
126
|
}, nodeChanges: {
|
|
128
127
|
adds: Record<string, Node>;
|
|
129
128
|
removes: Record<string, Node>;
|
|
130
|
-
}):
|
|
129
|
+
}): any;
|
|
131
130
|
/**
|
|
132
131
|
* Destroys the class and all buffers and textures.
|
|
133
132
|
*/
|
|
@@ -152,7 +151,7 @@ export declare class PhysLayout {
|
|
|
152
151
|
private setupPhysicsForCoarse;
|
|
153
152
|
private setupPinData;
|
|
154
153
|
private setupUpdates;
|
|
155
|
-
private
|
|
156
|
-
private
|
|
154
|
+
private setupReadpixelWorkaround;
|
|
155
|
+
private doReadpixelWorkaround;
|
|
157
156
|
private definePhysicsArrays;
|
|
158
157
|
}
|
|
@@ -1,21 +1,43 @@
|
|
|
1
|
-
import type { Node, Relationship } from '../../../../types/graph-element';
|
|
2
|
-
import type { CoarsenedGraph, SolarNode, SolarRelationship } from './types';
|
|
3
1
|
export default class SolarMerger {
|
|
2
|
+
constructor(graph: any, nodeIdToIndex: any);
|
|
4
3
|
graph: {
|
|
5
|
-
nodes:
|
|
6
|
-
relationships:
|
|
7
|
-
idToRel:
|
|
4
|
+
nodes: any[];
|
|
5
|
+
relationships: any[];
|
|
6
|
+
idToRel: {};
|
|
7
|
+
};
|
|
8
|
+
subGraphs: any[];
|
|
9
|
+
sunMap: {};
|
|
10
|
+
constructGraphObjects(graph: any, nodeIdToIndex: any): {
|
|
11
|
+
nodes: any[];
|
|
12
|
+
relationships: any[];
|
|
13
|
+
idToRel: {};
|
|
14
|
+
};
|
|
15
|
+
relIdMap: any[];
|
|
16
|
+
coarsenTo(targetSize: any): {
|
|
17
|
+
nodes: any[];
|
|
18
|
+
relationships: any[];
|
|
19
|
+
idToRel: {};
|
|
20
|
+
};
|
|
21
|
+
nodeSortMap: {};
|
|
22
|
+
coarsenBy(levelToCoarsenBy: any): {
|
|
23
|
+
nodes: any[];
|
|
24
|
+
relationships: any[];
|
|
25
|
+
idToRel: {};
|
|
26
|
+
};
|
|
27
|
+
coarsen({ nodes, relationships }: {
|
|
28
|
+
nodes: any;
|
|
29
|
+
relationships: any;
|
|
30
|
+
}, firstIteration: any): {
|
|
31
|
+
output: {
|
|
32
|
+
nodes: {
|
|
33
|
+
id: any;
|
|
34
|
+
}[];
|
|
35
|
+
relationships: any[];
|
|
36
|
+
};
|
|
37
|
+
sortedInput: {
|
|
38
|
+
nodes: any[];
|
|
39
|
+
relationships: any[];
|
|
40
|
+
};
|
|
41
|
+
nodeSortMap: {};
|
|
8
42
|
};
|
|
9
|
-
subGraphs: CoarsenedGraph[];
|
|
10
|
-
sunMap: Record<string, string>;
|
|
11
|
-
relIdMap: string[][];
|
|
12
|
-
nodeSortMap?: Record<number, number>;
|
|
13
|
-
constructor(inputGraph: {
|
|
14
|
-
nodes: Node[];
|
|
15
|
-
rels: Relationship[];
|
|
16
|
-
}, nodeIdToIndex: Record<string, number>);
|
|
17
|
-
private constructGraphObjects;
|
|
18
|
-
coarsenTo(targetSize: number): CoarsenedGraph;
|
|
19
|
-
coarsenBy(levelToCoarsenBy: number): CoarsenedGraph;
|
|
20
|
-
private coarsen;
|
|
21
43
|
}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import type { Point } from '../../../../utils/geometry';
|
|
2
|
-
export declare const calculatePositions: (centre: Point, r: number, noOfChildren: number) =>
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
}[];
|
|
2
|
+
export declare const calculatePositions: (centre: Point, r: number, noOfChildren: number) => any[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/base",
|
|
3
|
-
"version": "0.3.8-
|
|
3
|
+
"version": "0.3.8-cf97142e",
|
|
4
4
|
"license": "SEE LICENSE IN 'LICENSE.txt'",
|
|
5
5
|
"homepage": "https://neo4j.com/docs/nvl/current/",
|
|
6
6
|
"description": "Base library for the Neo4j Visualization Library",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"postpack": "rm LICENSE.txt && rm CHANGELOG.md"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@neo4j-nvl/layout-workers": "0.3.8-
|
|
31
|
+
"@neo4j-nvl/layout-workers": "0.3.8-cf97142e",
|
|
32
32
|
"@segment/analytics-next": "^1.70.0",
|
|
33
33
|
"color-string": "^1.9.1",
|
|
34
34
|
"d3-force": "^3.0.0",
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Node } from '../../../../types/graph-element';
|
|
2
|
-
export interface SolarNode extends Node {
|
|
3
|
-
id: string;
|
|
4
|
-
solarId: number;
|
|
5
|
-
weight?: number;
|
|
6
|
-
finestIndex?: number;
|
|
7
|
-
originalId?: string;
|
|
8
|
-
position?: {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
};
|
|
12
|
-
placement?: {
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export interface SolarRelationship {
|
|
18
|
-
id: string;
|
|
19
|
-
from: string;
|
|
20
|
-
to: string;
|
|
21
|
-
}
|
|
22
|
-
export interface CoarsenedGraph {
|
|
23
|
-
nodes: Sun[];
|
|
24
|
-
relationships: number[][];
|
|
25
|
-
idToRel: Record<string, SolarRelationship>;
|
|
26
|
-
}
|
|
27
|
-
export interface Sun extends SolarNode {
|
|
28
|
-
planets?: Planet[];
|
|
29
|
-
solarSize?: () => number;
|
|
30
|
-
children?: () => Planet[];
|
|
31
|
-
previousIndex?: number;
|
|
32
|
-
}
|
|
33
|
-
export interface Planet extends SolarNode {
|
|
34
|
-
parent: Sun;
|
|
35
|
-
sunId: number;
|
|
36
|
-
moons: Moon[];
|
|
37
|
-
solarSize: () => number;
|
|
38
|
-
children: () => Moon[];
|
|
39
|
-
}
|
|
40
|
-
export interface Moon extends SolarNode {
|
|
41
|
-
parent: Planet;
|
|
42
|
-
sunId: number;
|
|
43
|
-
solarSize: () => number;
|
|
44
|
-
}
|
|
45
|
-
export type Celestial = Sun | Planet | Moon;
|
|
46
|
-
export declare const isSun: (node: SolarNode | Celestial) => node is Sun;
|
|
47
|
-
export declare const isPlanet: (node: SolarNode | Celestial) => node is Planet;
|
|
48
|
-
export declare const isMoon: (node: SolarNode | Celestial) => node is Moon;
|