@neo4j-nvl/base 0.3.1-fd6624ed → 0.3.2
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.
|
@@ -16,7 +16,7 @@ export declare class ForceCytoLayout {
|
|
|
16
16
|
getShouldUpdate(): boolean;
|
|
17
17
|
getComputing(): boolean;
|
|
18
18
|
updateNodes(positionList: any): void;
|
|
19
|
-
getNodePositions(data: any):
|
|
19
|
+
getNodePositions(data: any): import("../..").Node[];
|
|
20
20
|
terminateUpdate(): void;
|
|
21
21
|
destroy(): void;
|
|
22
22
|
}
|
|
@@ -1,70 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import type { ForceDirectedOptions, NvlState } from '../../../modules/state';
|
|
2
|
+
import type { Node, Relationship } from '../../../types/graph-element';
|
|
3
|
+
import type { Point } from '../../../utils/geometry';
|
|
4
|
+
export declare class PhysLayout {
|
|
5
|
+
private physVbo;
|
|
6
|
+
private physSmallVbo;
|
|
7
|
+
private physProjection;
|
|
8
|
+
private physSmallProjection;
|
|
9
|
+
private gl;
|
|
10
|
+
private useReadpixelWorkaround;
|
|
11
|
+
private averageNodeSize;
|
|
12
|
+
private shouldUpdate;
|
|
13
|
+
private iterationCount;
|
|
14
|
+
private lastSpeedValues;
|
|
15
|
+
private rollingAvgGraphSpeed;
|
|
16
|
+
private nodeVariation;
|
|
17
|
+
private nodeCenterPoint;
|
|
18
|
+
private peakIterationMultiplier;
|
|
19
|
+
private stateDisposers;
|
|
20
|
+
private state;
|
|
21
|
+
private dpr;
|
|
22
|
+
private intelWorkaround;
|
|
23
|
+
private simulationStopVelocitySquared;
|
|
24
|
+
private gravity;
|
|
25
|
+
private force;
|
|
26
|
+
private nodeIdToIndex;
|
|
27
|
+
private nodeIndexToId;
|
|
28
|
+
private numNodes;
|
|
29
|
+
private solarMerger;
|
|
30
|
+
private subGraphs;
|
|
31
|
+
private nodeSortMap;
|
|
32
|
+
private firstUpdate;
|
|
33
|
+
private curPhysData;
|
|
34
|
+
private apprxRepForceShader;
|
|
35
|
+
private levelsClusterTexture;
|
|
36
|
+
private levelsFinestIndexTexture;
|
|
37
|
+
private initalLevelTexture;
|
|
38
|
+
private levelsData;
|
|
39
|
+
private collisionDetectionMultiplier;
|
|
40
|
+
private physShader;
|
|
41
|
+
private physData;
|
|
42
|
+
private workaroundData;
|
|
43
|
+
private pinData;
|
|
44
|
+
private updateData;
|
|
45
|
+
private updateShader;
|
|
46
|
+
private workaroundShader;
|
|
47
|
+
private physPositions;
|
|
48
|
+
private springTexture;
|
|
49
|
+
private sizeTexture;
|
|
50
|
+
private offsetTexture;
|
|
51
|
+
private pinTexture;
|
|
52
|
+
private addedNodes;
|
|
53
|
+
private updateTexture;
|
|
54
|
+
enableVerlet: boolean;
|
|
55
|
+
constructor(config: ForceDirectedOptions & {
|
|
56
|
+
webGLContext: WebGL2RenderingContext;
|
|
57
|
+
state: NvlState;
|
|
58
|
+
});
|
|
19
59
|
/**
|
|
20
60
|
* Sets the layout options
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {boolean} options.intelWorkaround whether to use the layout implementation for Intel GPUs
|
|
23
|
-
* @param {Number} options.simulationStopVelocity the graph speed at which to stop the layout
|
|
24
|
-
* @param {Number} options.gravity the force layout's gravity strength
|
|
61
|
+
* @param {ForceDirectedOptions} options the object with the options
|
|
25
62
|
* @param {boolean} [initial=false] whether this is the first setting of options
|
|
26
63
|
*/
|
|
27
|
-
setOptions(options:
|
|
28
|
-
intelWorkaround: boolean;
|
|
29
|
-
simulationStopVelocity: number;
|
|
30
|
-
gravity: number;
|
|
31
|
-
}, initial?: boolean): void;
|
|
32
|
-
intelWorkaround: boolean;
|
|
33
|
-
enableVerlet: any;
|
|
34
|
-
simulationStopVelocitySquared: number;
|
|
35
|
-
gravity: number;
|
|
36
|
-
force: any;
|
|
64
|
+
setOptions(options?: ForceDirectedOptions, initial?: boolean): void;
|
|
37
65
|
/**
|
|
38
66
|
* Sets graph data to be used
|
|
39
|
-
* @param {
|
|
40
|
-
* @
|
|
41
|
-
* @param {Array<Object>} data.rels the relationships in the graph
|
|
42
|
-
* @returns {Object} the top level graph of the subgraphs created by the solar merger
|
|
67
|
+
* @param {{ nodes: Node[]; rels: Relationship[] }} data the graph object
|
|
68
|
+
* @returns the top level graph of the subgraphs created by the solar merger
|
|
43
69
|
*/
|
|
44
70
|
setData(data: {
|
|
45
|
-
nodes:
|
|
46
|
-
rels:
|
|
71
|
+
nodes: Node[];
|
|
72
|
+
rels: Relationship[];
|
|
47
73
|
}): any;
|
|
48
|
-
_nodeIdToIndex: {};
|
|
49
|
-
_nodeIndexToId: {};
|
|
50
|
-
_numNodes: any;
|
|
51
|
-
solarMerger: SolarMerger;
|
|
52
|
-
subGraphs: any[];
|
|
53
|
-
nodeSortMap: {};
|
|
54
|
-
_firstUpdate: boolean;
|
|
55
|
-
_curPhysData: any;
|
|
56
74
|
/**
|
|
57
75
|
* Updates the node's positions for the next step in the physics layout iterations if the layout needs to update
|
|
58
|
-
* @param
|
|
59
|
-
* @returns
|
|
76
|
+
* @param refreshPositions whether the entire layout should be reheated
|
|
77
|
+
* @returns whether the layout should update in the following step
|
|
60
78
|
*/
|
|
61
|
-
update(refreshPositions
|
|
62
|
-
collisionDetectionMultiplier: number;
|
|
79
|
+
update(refreshPositions?: boolean): boolean;
|
|
63
80
|
/**
|
|
64
81
|
* Stops the layout
|
|
65
82
|
*/
|
|
66
83
|
terminateUpdate(): void;
|
|
67
|
-
addedNodes: {};
|
|
68
84
|
/**
|
|
69
85
|
* Returns whether the current layout needs to be updated in the next iteration step.
|
|
70
86
|
* @returns {boolean} Whether the layout should update in the following step.
|
|
@@ -78,20 +94,23 @@ export class PhysLayout {
|
|
|
78
94
|
getComputing(): boolean;
|
|
79
95
|
/**
|
|
80
96
|
* Adds the current x,y coordinates for each node to a given list of nodes.
|
|
81
|
-
* @param {
|
|
82
|
-
* @returns {
|
|
97
|
+
* @param {Node[]} nodeList The list of nodes to get positions for.
|
|
98
|
+
* @returns {(Node & Point)[]} The list of nodes containing the x,y coordinates on each node object.
|
|
83
99
|
*/
|
|
84
|
-
getNodePositions(nodeList:
|
|
100
|
+
getNodePositions(nodeList: Node[]): (Node & Point)[];
|
|
85
101
|
/**
|
|
86
102
|
* Reheats the layout
|
|
87
103
|
* @param {Object} fullData The entire graph object.
|
|
88
104
|
*/
|
|
89
|
-
reheat(fullData:
|
|
105
|
+
reheat(fullData: {
|
|
106
|
+
nodes: Node[];
|
|
107
|
+
rels?: Relationship[];
|
|
108
|
+
}): void;
|
|
90
109
|
/**
|
|
91
110
|
* Updates the existing nodes of a graph with a given list of updates
|
|
92
|
-
* @param {
|
|
111
|
+
* @param {Node[]} nodeList The list of updates.
|
|
93
112
|
*/
|
|
94
|
-
updateNodes(nodeList:
|
|
113
|
+
updateNodes(nodeList: Node[]): void;
|
|
95
114
|
/**
|
|
96
115
|
* Adds and removes nodes from the graph based on given updates
|
|
97
116
|
* @param {Object} fullData The entire graph object.
|
|
@@ -102,66 +121,37 @@ export class PhysLayout {
|
|
|
102
121
|
* @param {Array<Object>} nodeChanges.removes A list of nodes to be removed.
|
|
103
122
|
*/
|
|
104
123
|
addRemoveData(fullData: {
|
|
105
|
-
nodes:
|
|
106
|
-
rels:
|
|
124
|
+
nodes: Node[];
|
|
125
|
+
rels: Relationship[];
|
|
107
126
|
}, nodeChanges: {
|
|
108
|
-
adds:
|
|
109
|
-
removes:
|
|
127
|
+
adds: Record<string, Node>;
|
|
128
|
+
removes: Record<string, Node>;
|
|
110
129
|
}): any;
|
|
111
|
-
_pinData: Uint8Array;
|
|
112
130
|
/**
|
|
113
131
|
* Destroys the class and all buffers and textures.
|
|
114
132
|
*/
|
|
115
133
|
destroy(): void;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
_setupSprings(data: any): void;
|
|
140
|
-
connections: any;
|
|
141
|
-
_offsetTexture: any;
|
|
142
|
-
_springTexture: any;
|
|
143
|
-
_setupPhysics(): void;
|
|
144
|
-
_setupPhysicsForNodes(): void;
|
|
145
|
-
_physData: any[];
|
|
146
|
-
_physShader: Shader;
|
|
147
|
-
_setupPhysicsForCoarse(): void;
|
|
148
|
-
levelsData: any[];
|
|
149
|
-
levelsClusterTexture: any[];
|
|
150
|
-
levelsFinestIndexTexture: any[];
|
|
151
|
-
initalLevelTexture: any;
|
|
152
|
-
_apprxRepForceShader: Shader;
|
|
153
|
-
_setupPinData(): void;
|
|
154
|
-
_pinTexture: any;
|
|
155
|
-
_setupUpdates(): void;
|
|
156
|
-
_updateData: Float32Array;
|
|
157
|
-
_updateTexture: any;
|
|
158
|
-
_updateShader: Shader;
|
|
159
|
-
_setupReadpixelWorkaround(): void;
|
|
160
|
-
_workaroundShader: Shader;
|
|
161
|
-
_workaroundData: any[];
|
|
162
|
-
_doReadpixelWorkaround(): void;
|
|
163
|
-
_definePhysicsArrays(): void;
|
|
134
|
+
private dumpTexture;
|
|
135
|
+
private getScaleNumber;
|
|
136
|
+
private getBaseLength;
|
|
137
|
+
private checkForUpdates;
|
|
138
|
+
private getNodePosition;
|
|
139
|
+
private getMaxSpeedSquared;
|
|
140
|
+
private getMedianSpeedSquared;
|
|
141
|
+
private getPhysData;
|
|
142
|
+
private newTexture;
|
|
143
|
+
private newFramebuffer;
|
|
144
|
+
private checkCompatibility;
|
|
145
|
+
private printGlStats;
|
|
146
|
+
private adjustToGlSize;
|
|
147
|
+
private setupSize;
|
|
148
|
+
private setupSprings;
|
|
149
|
+
private setupPhysics;
|
|
150
|
+
private setupPhysicsForNodes;
|
|
151
|
+
private setupPhysicsForCoarse;
|
|
152
|
+
private setupPinData;
|
|
153
|
+
private setupUpdates;
|
|
154
|
+
private setupReadpixelWorkaround;
|
|
155
|
+
private doReadpixelWorkaround;
|
|
156
|
+
private definePhysicsArrays;
|
|
164
157
|
}
|
|
165
|
-
import { mat4 } from 'gl-matrix';
|
|
166
|
-
import SolarMerger from './solarmerger/SolarMerger';
|
|
167
|
-
import Shader from '../../../modules/Shader';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BorderStyle } from '../../../modules/state';
|
|
2
2
|
import type { Node, Relationship } from '../../../types/graph-element';
|
|
3
3
|
import type { Point } from '../../../utils/geometry';
|
|
4
|
-
import ImageCache from '../ImageCache';
|
|
4
|
+
import type ImageCache from '../ImageCache';
|
|
5
5
|
import type ArrowBundle from './ArrowBundle';
|
|
6
6
|
/**
|
|
7
7
|
* This function calculates the difference in radius between two nodes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/base",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
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",
|
|
@@ -34,9 +34,8 @@
|
|
|
34
34
|
"tsconfig": "./tsconfig.json"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@neo4j-nvl/layout-workers": "^0.3.
|
|
37
|
+
"@neo4j-nvl/layout-workers": "^0.3.2",
|
|
38
38
|
"color-string": "^1.9.1",
|
|
39
|
-
"contrast": "1.0.1",
|
|
40
39
|
"d3-force": "^3.0.0",
|
|
41
40
|
"gl-matrix": "^3.3.0",
|
|
42
41
|
"glsl-inject-defines": "^1.0.3",
|
|
@@ -45,6 +44,7 @@
|
|
|
45
44
|
"mobx": "^3.2.2",
|
|
46
45
|
"node-pid-controller": "^1.0.1",
|
|
47
46
|
"resizelistener": "^1.1.0",
|
|
47
|
+
"tinycolor2": "1.6.0",
|
|
48
48
|
"uuid": "^8.3.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@types/d3-force": "^3.0.3",
|
|
54
54
|
"@types/lodash": "4.14.202",
|
|
55
55
|
"@types/segment-analytics": "0.0.38",
|
|
56
|
+
"@types/tinycolor2": "^1.4.6",
|
|
56
57
|
"babel-loader": "^8.2.5",
|
|
57
58
|
"copy-webpack-plugin": "^11.0.0",
|
|
58
59
|
"eslint": "^8.38.0",
|
|
@@ -66,6 +67,5 @@
|
|
|
66
67
|
"eslint": "*",
|
|
67
68
|
"jest": "*",
|
|
68
69
|
"typescript": "*"
|
|
69
|
-
}
|
|
70
|
-
"stableVersion": "0.3.1"
|
|
70
|
+
}
|
|
71
71
|
}
|