@neo4j-nvl/base 1.2.0-158df7fc → 1.2.0-1a6a48cd
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 +1 -1
- package/dist/base.mjs +1 -1
- package/dist/types/index.d.ts +5 -4
- package/dist/types/layouts/animatedlayout/AnimatedLayout.d.ts +2 -2
- package/dist/types/layouts/d3forcelayout/d3ForceLayout.d.ts +2 -2
- package/dist/types/layouts/forcedirectedlayout/physlayout/PhysLayout.d.ts +51 -2
- package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/multilevel-fragment.d.ts +1 -1
- package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/multilevel-repulsive-fragment.d.ts +1 -1
- package/dist/types/layouts/forcedirectedlayout/physlayout/solarmerger/SolarMerger.d.ts +57 -0
- package/dist/types/layouts/freeLayout/FreeLayout.d.ts +2 -4
- package/dist/types/layouts/gridLayout/GridLayout.d.ts +2 -6
- package/dist/types/modules/NvlController.d.ts +28 -2
- package/dist/types/modules/dataset.d.ts +3 -1
- package/dist/types/modules/state/types.d.ts +6 -15
- package/dist/types/renderers/domrenderer/canvasrenderer/arrowDrawing.d.ts +2 -16
- package/dist/types/renderers/domrenderer/shared/ImageCache.d.ts +1 -0
- package/dist/types/renderers/domrenderer/shared/arrows/arrows.d.ts +4 -6
- package/dist/types/renderers/webglrenderer/Controller.d.ts +26 -6
- package/dist/types/renderers/webglrenderer/IconLayerRegistry.d.ts +14 -0
- package/dist/types/renderers/webglrenderer/IconLayerRegistry.test.d.ts +1 -0
- package/dist/types/renderers/webglrenderer/Renderer.d.ts +31 -2
- package/dist/types/renderers/webglrenderer/node-animation-fragment.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/node-animation-vertex.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/node-fragment-point.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/node-vertex-point.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/rel-vertex-line.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/viewport-box-fragment.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/viewport-box-vertex.d.ts +1 -1
- package/dist/types/types/graph-element.d.ts +9 -1
- package/dist/types/types/nvl-window-functions.d.ts +2 -2
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/webWorkerUtils.d.ts +1 -1
- package/dist/types/utils/zoomFunctions.d.ts +9 -2
- package/package.json +5 -5
- package/dist/types/layouts/forcedirectedlayout/ForceCytoLayout.d.ts +0 -22
- package/dist/types/layouts/forcedirectedlayout/cosebilkentlayout/CoseBilkentLayout.d.ts +0 -33
|
@@ -2,6 +2,9 @@ import { mat4 } from 'gl-matrix';
|
|
|
2
2
|
import type { DataSet } from '../../modules/dataset';
|
|
3
3
|
import type { NvlState } from '../../modules/state/types';
|
|
4
4
|
import type { Node, Relationship } from '../../types/graph-element';
|
|
5
|
+
export type RendererOptions = {
|
|
6
|
+
enableIcons?: boolean;
|
|
7
|
+
};
|
|
5
8
|
export default class Renderer {
|
|
6
9
|
private readonly nodeShader;
|
|
7
10
|
private readonly nodeAnimShader;
|
|
@@ -14,36 +17,62 @@ export default class Renderer {
|
|
|
14
17
|
private readonly disableNodeColor;
|
|
15
18
|
private readonly gl;
|
|
16
19
|
activeNodes: Record<string, boolean>;
|
|
20
|
+
numActiveNodes: number;
|
|
17
21
|
readonly canvas: HTMLCanvasElement;
|
|
18
22
|
projection: mat4;
|
|
19
23
|
private idToIndex;
|
|
24
|
+
/** Node-id → texel-index map for GPU-shared rendering; null falls back to insertion order. */
|
|
25
|
+
private texelIndexForId;
|
|
26
|
+
/** texelIndexForId value when vertex buffers were last built; used to detect mode flips. */
|
|
27
|
+
private texelMapAtBuild;
|
|
28
|
+
private lastNodes;
|
|
29
|
+
private lastBundledRels;
|
|
20
30
|
private posBuffer;
|
|
31
|
+
private positionsDirty;
|
|
21
32
|
private numRels;
|
|
22
33
|
private numNodes;
|
|
23
34
|
private nodeDataByte;
|
|
24
35
|
private relIdToIndex;
|
|
25
36
|
private relData;
|
|
26
37
|
private viewportBoxBuffer;
|
|
38
|
+
private readonly viewportBoxVertices;
|
|
27
39
|
private relBuffer;
|
|
28
40
|
private nodeBuffer;
|
|
29
41
|
private posTexture;
|
|
42
|
+
private iconTexture;
|
|
30
43
|
private nodeVao;
|
|
31
44
|
private relVao;
|
|
32
45
|
private nodeAnimVao;
|
|
33
|
-
|
|
46
|
+
private readonly iconLayers;
|
|
47
|
+
private uploadedIconLayers;
|
|
48
|
+
private nodeColors;
|
|
49
|
+
private nodeDisabled;
|
|
50
|
+
constructor(gl: WebGL2RenderingContext, nodes: DataSet<Node>, rels: DataSet<Relationship>, state: NvlState, options?: RendererOptions);
|
|
34
51
|
private setShaderUniforms;
|
|
35
52
|
setData(data: {
|
|
36
53
|
nodes: Node[];
|
|
37
54
|
rels: Relationship[];
|
|
38
55
|
}): void;
|
|
39
|
-
|
|
56
|
+
/** Sets the texel-index map for GPU-shared rendering, or null for insertion order. */
|
|
57
|
+
setPositionTexelIndices(map: Readonly<Record<string, number>> | null): void;
|
|
58
|
+
/** Texel index for a node id; falls back to insertion index, or 0 if the id is unknown. */
|
|
59
|
+
private getTexelIndex;
|
|
60
|
+
/** Rebuilds vertex buffers when the GPU↔CPU texel mode has changed since the last build. */
|
|
61
|
+
private rebuildBuffersIfModeFlipped;
|
|
62
|
+
render(positionArray: Node[], positionsChanged?: boolean): void;
|
|
63
|
+
/** Renders using a GPU position texture directly as `u_positions` */
|
|
64
|
+
renderFromGpuTexture(positionTexture: WebGLTexture): void;
|
|
40
65
|
renderViewbox(): void;
|
|
41
66
|
updateNodes(updates: Node[]): void;
|
|
42
67
|
updateRelationships(relItems: Relationship[]): void;
|
|
43
68
|
private createPositionTexture;
|
|
69
|
+
private createIconTexture;
|
|
70
|
+
private uploadPendingIconLayers;
|
|
71
|
+
hasPendingIcons(): boolean;
|
|
44
72
|
updateViewportBox(zoom: number, panX: number, panY: number, viewportWidth: number, viewportHeight: number): void;
|
|
45
73
|
updateViewport(zoom: number, panX: number, panY: number): void;
|
|
46
74
|
private setupViewportRendering;
|
|
75
|
+
private resolveNodeColor;
|
|
47
76
|
private setupNodeRendering;
|
|
48
77
|
private setupRelationshipRendering;
|
|
49
78
|
private renderAnimations;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\nprecision
|
|
1
|
+
declare const _default: "#version 300 es\nprecision mediump float;\n\nuniform mediump float u_zoom;\nuniform lowp float u_animPos;\nuniform mediump float u_glAdjust;\n\nin lowp vec4 color;\nin mediump float varNodeSize;\n\nout vec4 fragColor;\n\nconst float pulseCircleEdge = 0.50;\n\nvoid main(void) {\n float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n } else {\n float alpha = 1.0 - smoothstep(pulseCircleEdge - (1.0 / (varNodeSize * 2.0 * u_zoom * u_glAdjust)), pulseCircleEdge, dist);\n float pulseAlpha = 0.9 - 0.9 * u_animPos;\n fragColor = vec4(color.xyz, 1.0) * alpha * pulseAlpha;\n }\n}\n";
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\nuniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform lowp float u_animPos;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nin float a_size;\nin
|
|
1
|
+
declare const _default: "#version 300 es\nuniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform lowp float u_animPos;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nin float a_size;\nin highp vec2 a_index;\nin lowp vec4 a_color;\nin lowp float a_active;\n\nout mediump float varNodeSize;\nout lowp vec4 color;\n\nvoid main(void) {\n vec4 data = texture(u_positions, a_index);\n\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n float nodeSize = a_size * u_zoom * u_glAdjust;\n nodeSize = nodeSize * 0.8;\n\n gl_PointSize = a_active > 0.5\n ? nodeSize + 0.88 * nodeSize * u_animPos\n : 0.0;\n\n color = a_color;\n varNodeSize = a_size;\n}";
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\nprecision
|
|
1
|
+
declare const _default: "#version 300 es\nprecision mediump float;\n\nuniform lowp vec3 u_nodeBorderColor;\nuniform lowp vec3 u_selectedBorderColor;\nuniform lowp vec3 u_selectedInnerBorderColor;\nuniform lowp vec3 u_shadowColor;\nuniform lowp float u_drawDefaultBorder;\nuniform lowp sampler2DArray u_icons;\n\nin lowp vec4 color;\nin lowp float selected;\nin lowp float hovered;\nin mediump float varNodeSize;\nin mediump float iconLayer;\nin lowp float hasIcon;\n\nout vec4 fragColor;\n\nconst float circleSize = 0.40;\nconst float defaultBorderSize = 0.42;\nconst float innerSelectedRingSize = 0.43;\nconst float outerSelectedRingSize = 0.47;\nconst float shadowSize = 0.51;\n\nfloat getShadowAlpha(float size, float dist) {\n return (1.0 - smoothstep(size, shadowSize, dist)) * 0.25;\n}\n\nfloat getCircleAlpha(float ringSize, float nodeSize, float dist) {\n return color.w - smoothstep(ringSize - nodeSize, ringSize, dist);\n}\n\nvoid main() {\n float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n } else {\n float nodeSize = 1.0 / varNodeSize;\n float nodeAlpha = getCircleAlpha(circleSize, nodeSize, dist);\n float borderAlpha = getCircleAlpha(defaultBorderSize, nodeSize, dist);\n float ringAlpha = getCircleAlpha(innerSelectedRingSize, nodeSize, dist);\n vec3 finalColor = color.xyz;\n float finalAlpha = nodeAlpha;\n\n if (selected > 0.0) {\n float shadowAlpha = getShadowAlpha(outerSelectedRingSize, dist);\n float ringAlpha2 = getCircleAlpha(outerSelectedRingSize, nodeSize, dist);\n\n if (u_drawDefaultBorder > 0.0) {\n finalColor = mix(u_nodeBorderColor, finalColor, nodeAlpha);\n finalColor = mix(u_selectedInnerBorderColor, finalColor, borderAlpha);\n finalColor = mix(u_selectedBorderColor, finalColor, ringAlpha);\n finalColor = mix(u_shadowColor, finalColor, ringAlpha2);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, max(borderAlpha, ringAlpha2)));\n } else {\n finalColor = mix(u_selectedInnerBorderColor, finalColor, nodeAlpha);\n finalColor = mix(u_selectedBorderColor, finalColor, ringAlpha);\n finalColor = mix(u_shadowColor, finalColor, ringAlpha2);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, max(ringAlpha, ringAlpha2)));\n }\n } else if (hovered > 0.0) {\n if (u_drawDefaultBorder > 0.0) {\n float shadowAlpha = getShadowAlpha(defaultBorderSize, dist);\n finalColor = mix(u_nodeBorderColor, finalColor, nodeAlpha);\n finalColor = mix(u_shadowColor, finalColor, borderAlpha);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, ringAlpha));\n } else {\n float shadowAlpha = getShadowAlpha(circleSize, dist);\n finalColor = mix(u_shadowColor, finalColor, nodeAlpha);\n finalAlpha = max(shadowAlpha, nodeAlpha);\n }\n } else {\n if (u_drawDefaultBorder > 0.0) {\n finalColor = mix(u_nodeBorderColor, finalColor, nodeAlpha);\n finalAlpha = borderAlpha;\n }\n }\n\n if (hasIcon > 0.5) {\n vec2 uv = (gl_PointCoord - vec2(0.5)) / circleSize + 0.5;\n\n float inX = step(0.0, uv.x) - step(1.0, uv.x);\n float inY = step(0.0, uv.y) - step(1.0, uv.y);\n float isInside = inX * inY;\n\n vec4 ic = texture(u_icons, vec3(uv, iconLayer));\n finalColor = mix(finalColor, ic.rgb, ic.a * isInside);\n }\n\n fragColor = vec4(finalColor, 1.0) * finalAlpha;\n }\n}\n";
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\nuniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\
|
|
1
|
+
declare const _default: "#version 300 es\nuniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nin float a_size;\nin highp vec2 a_index;\nin lowp vec4 a_color;\nin lowp float a_selected;\nin lowp float a_hovered;\nin lowp float a_iconLayer;\nin lowp float a_hasIcon;\n\nout lowp vec4 color;\nout lowp float selected;\nout lowp float hovered;\nout mediump float varNodeSize;\nout mediump float iconLayer;\nout lowp float hasIcon;\n\nconst float MinNodeSize = 5.0;\n\nvoid main(void) {\n vec4 data = texture(u_positions, a_index);\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n float nodeSize = max(a_size * u_zoom * u_glAdjust, MinNodeSize);\n gl_PointSize = nodeSize;\n varNodeSize = nodeSize;\n\n color = a_color;\n selected = a_selected;\n hovered = a_hovered;\n iconLayer = a_iconLayer * 255.0;\n hasIcon = a_hasIcon;\n}";
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\nuniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_glAdjust;\n\nin vec2 a_from;\nin vec2 a_to;\nin lowp vec4 a_color;\nin lowp float a_triside;\nin float a_width;\n\nout lowp vec4 color;\n\nvoid main(void) {\n vec4 from = texture(u_positions, a_from);\n vec4 to = texture(u_positions, a_to);\n vec2 direction = normalize(to.xy - from.xy);\n
|
|
1
|
+
declare const _default: "#version 300 es\nuniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_glAdjust;\n\nin vec2 a_from;\nin vec2 a_to;\nin lowp vec4 a_color;\nin lowp float a_triside;\nin float a_width;\n\nout lowp vec4 color;\n\nvoid main(void) {\n vec4 from = texture(u_positions, a_from);\n vec4 to = texture(u_positions, a_to);\n vec2 direction = normalize(to.xy - from.xy);\n vec2 perpendicular = vec2(-direction.y, direction.x);\n\n float halfWidth = a_width * u_glAdjust * 0.25;\n float sideSign = 1.0 - 2.0 * a_triside;\n from.xy += sideSign * halfWidth * perpendicular;\n\n color = a_color;\n gl_Position = u_projection * vec4(from.xy, 0.0, 1.0);\n}\n";
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\nprecision lowp float;\n\
|
|
1
|
+
declare const _default: "#version 300 es\nprecision lowp float;\n\nuniform lowp vec4 u_minimapViewportBoxColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = u_minimapViewportBoxColor;\n}\n";
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "#version 300 es\nin vec2 coordinates;\nuniform mat4 u_projection;\
|
|
1
|
+
declare const _default: "#version 300 es\nin vec2 coordinates;\nuniform mat4 u_projection;\n\nvoid main(void) {\n gl_Position = u_projection * vec4(coordinates, 0.0, 1.0);\n}\n";
|
|
2
2
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { StyledCaption } from '../renderers/domrenderer/shared/types';
|
|
2
|
+
import type { Point } from '../utils/geometry';
|
|
2
3
|
/**
|
|
3
4
|
* The base type for graph elements.
|
|
4
5
|
* @private
|
|
@@ -97,6 +98,13 @@ interface Node extends GraphElement {
|
|
|
97
98
|
*/
|
|
98
99
|
html?: HTMLElement;
|
|
99
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* A node returned by {@link NVL.getNodes} with layout coordinates and screen position.
|
|
103
|
+
* `x` and `y` are canvas/layout space; `clientPosition` is relative to the canvas element.
|
|
104
|
+
*/
|
|
105
|
+
type NodeWithClientPosition = Node & Point & {
|
|
106
|
+
clientPosition: Point;
|
|
107
|
+
};
|
|
100
108
|
/**
|
|
101
109
|
* A node with only a subset of its properties.
|
|
102
110
|
*/
|
|
@@ -132,4 +140,4 @@ type PartialRelationship = Partial<Relationship> & {
|
|
|
132
140
|
/** The id of the relationship. */
|
|
133
141
|
id: string;
|
|
134
142
|
};
|
|
135
|
-
export type { Node, Relationship, PartialNode, PartialRelationship };
|
|
143
|
+
export type { Node, NodeWithClientPosition, Relationship, PartialNode, PartialRelationship };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Node, Relationship } from './graph-element';
|
|
1
|
+
import type { Node, NodeWithClientPosition, Relationship } from './graph-element';
|
|
2
2
|
export interface NvlWindow {
|
|
3
|
-
__Nvl_dumpNodes: (instanceId?: string) =>
|
|
3
|
+
__Nvl_dumpNodes: (instanceId?: string) => NodeWithClientPosition[];
|
|
4
4
|
__Nvl_dumpRelationships: (instanceId?: string) => Relationship[];
|
|
5
5
|
__Nvl_getNodesOnScreen: (instanceId?: string) => {
|
|
6
6
|
nodes: Node[];
|
|
@@ -6,6 +6,7 @@ export declare const Gravity = 25;
|
|
|
6
6
|
export declare const SimulationStopVelocity = 0.25;
|
|
7
7
|
export declare const MappingEnd = 999999;
|
|
8
8
|
export declare const LayoutStepIntervalMs = 13;
|
|
9
|
+
export declare const MaxLayoutStepsPerFrame = 20;
|
|
9
10
|
export declare const DefaultMaxFps = 30;
|
|
10
11
|
export declare const DefaultMinFps = 3;
|
|
11
12
|
export declare const MinAllowedFps = 1;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { Node } from '../index';
|
|
2
2
|
import type { Point } from './geometry';
|
|
3
|
+
/**
|
|
4
|
+
* Gets padding for fitting nodes, which is twice the largest node radius.
|
|
5
|
+
* @param maxNodeRadius - The largest node radius.
|
|
6
|
+
* @returns The padding for fitting nodes.
|
|
7
|
+
*/
|
|
8
|
+
declare const getFitNodesPadding: (maxNodeRadius?: number) => number;
|
|
3
9
|
declare const getExtremeLimits: (nodePositions: Point[]) => Point[];
|
|
4
10
|
declare const getMaxDistance: (extremeLimits?: Point[]) => number;
|
|
5
11
|
/**
|
|
@@ -40,7 +46,8 @@ declare const createZoomTarget: (zoomX: number, zoomY: number, minZoom?: number,
|
|
|
40
46
|
* @param nodePositions - The node positions.
|
|
41
47
|
* @param containerWidth - The width of the container NVL is displayed in.
|
|
42
48
|
* @param containerHeight - The height of the container NVL is displayed in.
|
|
43
|
-
* @param maxNodeRadius - The maximum node radius, which is added as margin to the scene
|
|
49
|
+
* @param maxNodeRadius - The maximum node radius, which is added as margin to the scene
|
|
50
|
+
* (defaults to 2 * {@link DefaultNodeSize}).
|
|
44
51
|
* @returns The zoom and pan targets.
|
|
45
52
|
*/
|
|
46
53
|
declare const getZoomTargetForNodePositions: (nodePositions: Point[], containerWidth: number, containerHeight: number, maxNodeRadius?: number) => {
|
|
@@ -55,4 +62,4 @@ declare const getFlexibleZoomLimit: (nodePositions: Point[], rect: HTMLCanvasEle
|
|
|
55
62
|
declare const getNewZoomWithinLimits: (newZoom: number, oldZoom: number, minZoom: number, maxZoom: number) => number;
|
|
56
63
|
declare const isZoomOutAtLimit: (newZoom: number, oldZoom: number, zoomOutLimit: number) => boolean;
|
|
57
64
|
declare const getDynamicZoom: (nodePositions: Point[] & Node[], minZoom: number, maxZoom: number, rect: HTMLCanvasElement, newZoom: number, currentZoom: number) => number;
|
|
58
|
-
export { getFlexibleZoomLimit, getZoomTargetForNodePositions, isZoomOutAtLimit, getNewZoomWithinLimits, getExtremeLimits, getMaxDistance, getPositionBoundaries, getZoomLevel, createZoomTarget, getDynamicZoom };
|
|
65
|
+
export { getFitNodesPadding, getFlexibleZoomLimit, getZoomTargetForNodePositions, isZoomOutAtLimit, getNewZoomWithinLimits, getExtremeLimits, getMaxDistance, getPositionBoundaries, getZoomLevel, createZoomTarget, getDynamicZoom };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/base",
|
|
3
|
-
"version": "1.2.0-
|
|
3
|
+
"version": "1.2.0-1a6a48cd",
|
|
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",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"postpack": "rm LICENSE.txt && rm CHANGELOG.md"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@neo4j-nvl/layout-workers": "1.2.0-
|
|
33
|
+
"@neo4j-nvl/layout-workers": "1.2.0-1a6a48cd",
|
|
34
34
|
"@segment/analytics-next": "1.81.1",
|
|
35
35
|
"color-string": "1.9.1",
|
|
36
36
|
"d3-force": "3.0.0",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"glsl-inject-defines": "1.0.3",
|
|
39
39
|
"lodash": "4.18.1",
|
|
40
40
|
"loglevel": "1.9.2",
|
|
41
|
-
"mobx": "
|
|
41
|
+
"mobx": "6.15.0",
|
|
42
42
|
"node-pid-controller": "1.0.1",
|
|
43
43
|
"resizelistener": "1.1.0",
|
|
44
44
|
"tinycolor2": "1.6.0",
|
|
45
|
-
"uuid": "14.0.
|
|
45
|
+
"uuid": "14.0.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@babel/core": "7.
|
|
48
|
+
"@babel/core": "7.29.7",
|
|
49
49
|
"@types/color-string": "1.5.5",
|
|
50
50
|
"@types/d3-force": "3.0.10",
|
|
51
51
|
"@types/lodash": "4.17.21",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const ForceDirectedLayoutType = "forceDirected";
|
|
2
|
-
export declare const CoseBilkentType = "coseBilkent";
|
|
3
|
-
export declare class ForceCytoLayout {
|
|
4
|
-
private readonly physLayout;
|
|
5
|
-
private readonly coseBilkentLayout;
|
|
6
|
-
private readonly state;
|
|
7
|
-
private currentLayoutType;
|
|
8
|
-
private enableCytoscape;
|
|
9
|
-
private currentLayout;
|
|
10
|
-
constructor(config: any);
|
|
11
|
-
setOptions(options: any): void;
|
|
12
|
-
private getLayout;
|
|
13
|
-
private setLayout;
|
|
14
|
-
copyLayoutPositions(nodeList: any, prevLayout: any, nextLayout: any): void;
|
|
15
|
-
update(refreshPositions?: boolean): void;
|
|
16
|
-
getShouldUpdate(): boolean;
|
|
17
|
-
getComputing(): boolean;
|
|
18
|
-
updateNodes(positionList: any): void;
|
|
19
|
-
getNodePositions(data: any): import("../..").Node[];
|
|
20
|
-
terminateUpdate(): void;
|
|
21
|
-
destroy(): void;
|
|
22
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { NvlState } from '../../../modules/state/types';
|
|
2
|
-
import type { Node, Relationship } from '../../../types/graph-element';
|
|
3
|
-
import AnimatedLayout from '../../animatedlayout/AnimatedLayout';
|
|
4
|
-
type LayoutData = {
|
|
5
|
-
elements: {
|
|
6
|
-
group: string;
|
|
7
|
-
data: {
|
|
8
|
-
id: string;
|
|
9
|
-
};
|
|
10
|
-
}[];
|
|
11
|
-
spacingFactor: number;
|
|
12
|
-
};
|
|
13
|
-
export declare class CoseBilkentLayout extends AnimatedLayout {
|
|
14
|
-
private stateDisposers;
|
|
15
|
-
cytoCompleteCallback: () => void;
|
|
16
|
-
computing: boolean;
|
|
17
|
-
pendingLayoutData: LayoutData;
|
|
18
|
-
worker: SharedWorker;
|
|
19
|
-
private workersDisabled;
|
|
20
|
-
constructor(config: {
|
|
21
|
-
state: NvlState;
|
|
22
|
-
cytoCompleteCallback?: () => void;
|
|
23
|
-
animationCompleteCallback?: () => void;
|
|
24
|
-
});
|
|
25
|
-
setOptions(): void;
|
|
26
|
-
update(refreshPositions?: boolean, updateMobXNodes?: Node[], updateMobXRelationships?: Relationship[]): void;
|
|
27
|
-
getShouldUpdate(): boolean;
|
|
28
|
-
getComputing(): boolean;
|
|
29
|
-
layout(nodes: Node[], relationships: Relationship[]): void;
|
|
30
|
-
terminateUpdate(): void;
|
|
31
|
-
destroy(): void;
|
|
32
|
-
}
|
|
33
|
-
export {};
|