@neo4j-nvl/base 0.3.6 → 0.3.7-5790f700
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/CHANGELOG.md +152 -0
- package/README.md +1 -0
- package/dist/base.mjs +1 -1
- package/dist/types/index.d.ts +6 -3
- package/dist/types/layouts/animatedlayout/AnimatedLayout.d.ts +1 -1
- package/dist/types/layouts/forcedirectedlayout/cosebilkentlayout/CoseBilkentLayout.d.ts +2 -2
- package/dist/types/layouts/forcedirectedlayout/physlayout/PhysLayout.d.ts +1 -1
- package/dist/types/layouts/forcedirectedlayout/physlayout/shaders/multilevel-repulsive-fragment-verlet.d.ts +1 -1
- package/dist/types/layouts/freeLayout/FreeLayout.d.ts +1 -1
- package/dist/types/layouts/hierarchicallayout/HierarchicalLayout.d.ts +2 -2
- package/dist/types/layouts/hierarchicallayout/constants.d.ts +1 -1
- package/dist/types/modules/NvlController.d.ts +2 -1
- package/dist/types/modules/ZoomTransitionHandler.d.ts +1 -1
- package/dist/types/modules/state/constants.d.ts +9 -0
- package/dist/types/modules/state/state.d.ts +8 -0
- package/dist/types/modules/{state.d.ts → state/types.d.ts} +70 -16
- package/dist/types/modules/state/utils.d.ts +44 -0
- package/dist/types/modules/state/utils.test.d.ts +1 -0
- package/dist/types/renderers/canvasrenderer/CanvasRenderer.d.ts +2 -1
- package/dist/types/renderers/canvasrenderer/arrows/arrows.d.ts +8 -5
- package/dist/types/renderers/canvasrenderer/arrows/constants.d.ts +1 -6
- package/dist/types/renderers/canvasrenderer/nodes/nodes.d.ts +3 -2
- package/dist/types/renderers/canvasrenderer/util.d.ts +2 -2
- package/dist/types/renderers/canvasrenderer/wordwrap.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/Controller.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/Renderer.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/viewport-box-fragment.d.ts +1 -1
- package/dist/types/renderers/webglrenderer/viewport-box-vertex.d.ts +1 -1
- package/dist/types/utils/ariaUtils.d.ts +3 -0
- package/dist/types/utils/ariaUtils.test.d.ts +1 -0
- package/dist/types/utils/colorUtils.d.ts +14 -0
- package/dist/types/utils/colorUtils.test.d.ts +1 -0
- package/dist/types/utils/constants.d.ts +10 -3
- package/dist/types/utils/graphObjectUtils.d.ts +2 -1
- package/dist/types/utils/hittest.d.ts +1 -1
- package/dist/types/utils/jsDriverResultTransformer.d.ts +4 -1
- package/dist/types/utils/webWorkerUtils.d.ts +3 -0
- package/dist/types/utils/webWorkerUtils.test.d.ts +1 -0
- package/dist/types/utils/zoomFunctions.d.ts +32 -1
- package/package.json +6 -5
- package/dist/types/utils/colorMapperFunctions.d.ts +0 -6
- /package/dist/types/modules/{state.test.d.ts → state/state.test.d.ts} +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExternalCallbacks } from './modules/ExternalCallbackHandler';
|
|
2
|
-
import type { ForceDirectedOptions, HierarchicalOptions, Layout, LayoutOptions, NvlOptions, NvlState, Renderer, ZoomOptions } from './modules/state';
|
|
3
|
-
import { CanvasRendererType, ForceDirectedLayoutType, FreeLayoutType, GridLayoutType, HierarchicalLayoutType, WebGLRendererType, d3ForceLayoutType } from './modules/state';
|
|
2
|
+
import type { ForceDirectedOptions, HierarchicalOptions, Layout, LayoutOptions, NvlOptions, NvlState, Renderer, ZoomOptions } from './modules/state/types';
|
|
3
|
+
import { CanvasRendererType, ForceDirectedLayoutType, FreeLayoutType, GridLayoutType, HierarchicalLayoutType, WebGLRendererType, d3ForceLayoutType } from './modules/state/types';
|
|
4
4
|
import type { StyledCaption } from './renderers/canvasrenderer/types';
|
|
5
5
|
import { drawCircleBand } from './renderers/canvasrenderer/util';
|
|
6
6
|
import type { Node, PartialNode, PartialRelationship, Relationship } from './types/graph-element';
|
|
@@ -8,6 +8,7 @@ import { CompatibilityError } from './utils/errors';
|
|
|
8
8
|
import type { Point } from './utils/geometry';
|
|
9
9
|
import type { HitTargetNode, HitTargetRelationship, HitTargets } from './utils/hittest';
|
|
10
10
|
import { nvlResultTransformer } from './utils/jsDriverResultTransformer';
|
|
11
|
+
import { getZoomTargetForNodePositions } from './utils/zoomFunctions';
|
|
11
12
|
/**
|
|
12
13
|
* Extends the MouseEvent interface with the {@link HitTargets} property.
|
|
13
14
|
* The result of a _.{@link NVL.getHits} call.
|
|
@@ -249,6 +250,8 @@ declare class NVL {
|
|
|
249
250
|
* @param {Node[]} data The positions that the nodes should be set to.
|
|
250
251
|
* @param {boolean} updateLayout whether or not the current layout algorithm
|
|
251
252
|
* should update the graph after setting the node positions.
|
|
253
|
+
* For node positions to be unaffected by layout algorithms, use the {@link FreeLayoutType}
|
|
254
|
+
* or use {@link pinNode} to pin the nodes that should remain still.
|
|
252
255
|
* False by default.
|
|
253
256
|
*/
|
|
254
257
|
setNodePositions(data: Node[], updateLayout?: boolean): void;
|
|
@@ -364,4 +367,4 @@ declare const colorMapperFunctions: {
|
|
|
364
367
|
};
|
|
365
368
|
export default NVL;
|
|
366
369
|
export type { NvlOptions, Renderer, Node, Relationship, PartialNode, PartialRelationship, Layout, LayoutOptions, ForceDirectedOptions, HierarchicalOptions, ExternalCallbacks, HitTargets, HitTargetNode, HitTargetRelationship, Point, NvlMouseEvent, ZoomOptions, StyledCaption, WebGLRendererType, CanvasRendererType };
|
|
367
|
-
export { NVL, colorMapperFunctions, CompatibilityError, ForceDirectedLayoutType, HierarchicalLayoutType, GridLayoutType, FreeLayoutType, d3ForceLayoutType, drawCircleBand, nvlResultTransformer };
|
|
370
|
+
export { NVL, colorMapperFunctions, CompatibilityError, ForceDirectedLayoutType, HierarchicalLayoutType, GridLayoutType, FreeLayoutType, d3ForceLayoutType, drawCircleBand, nvlResultTransformer, getZoomTargetForNodePositions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NvlState } from '../../../modules/state';
|
|
1
|
+
import type { NvlState } from '../../../modules/state/types';
|
|
2
2
|
import type { Node, Relationship } from '../../../types/graph-element';
|
|
3
3
|
import AnimatedLayout from '../../animatedlayout/AnimatedLayout';
|
|
4
4
|
type LayoutData = {
|
|
@@ -16,12 +16,12 @@ export declare class CoseBilkentLayout extends AnimatedLayout {
|
|
|
16
16
|
computing: boolean;
|
|
17
17
|
pendingLayoutData: LayoutData;
|
|
18
18
|
worker: SharedWorker;
|
|
19
|
+
private workersDisabled;
|
|
19
20
|
constructor(config: {
|
|
20
21
|
state: NvlState;
|
|
21
22
|
cytoCompleteCallback?: () => void;
|
|
22
23
|
animationCompleteCallback?: () => void;
|
|
23
24
|
});
|
|
24
|
-
setupWorker(): Promise<SharedWorker>;
|
|
25
25
|
setOptions(): void;
|
|
26
26
|
update(refreshPositions?: boolean, updateMobXNodes?: Node[], updateMobXRelationships?: Relationship[]): void;
|
|
27
27
|
getShouldUpdate(): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ForceDirectedOptions, NvlState } from '../../../modules/state';
|
|
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
4
|
export declare class PhysLayout {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "precision mediump float;\nuniform sampler2D u_physData;\nuniform sampler2D u_clusterData;\nuniform sampler2D u_finestIndexes;\nuniform sampler2D u_prevForce;\n\nuniform float u_baseLength;\nuniform float u_numNodes;\nuniform float u_iterationMultiplier;\nuniform float u_isTopLevel;\n\nfloat PI = 3.1415926535897932384626433832795;\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 0
|
|
1
|
+
declare const _default: "precision mediump float;\nuniform sampler2D u_physData;\nuniform sampler2D u_clusterData;\nuniform sampler2D u_finestIndexes;\nuniform sampler2D u_prevForce;\n\nuniform float u_baseLength;\nuniform float u_numNodes;\nuniform float u_iterationMultiplier;\nuniform float u_isTopLevel;\n\nfloat PI = 3.1415926535897932384626433832795;\nfloat TIMESTEP = 1.0 / 30.0;\nfloat VELOCITYDECAY = 1.0;\n\nvec4 getTextureData(sampler2D texture, float index, float base) {\n float x = mod(index, base);\n float y = (index - x) / base;\n return texture2D(texture, vec2(x + 0.5, y + 0.5) / base);\n}\n\nfloat getSquaredLogClusterWeight(float value) {\n return pow(log(value), 2.0);\n}\n\nvoid main(void) {\n float index = (gl_FragCoord.x - 0.5) + (gl_FragCoord.y - 0.5) * 256.0;\n\n if (index >= u_numNodes) {\n discard;\n }\n\n vec4 clusterData = getTextureData(u_clusterData, index, 256.0);\n\n float clusterIndex = clusterData.x;\n float clusterStartIndex = clusterData.y;\n float clusterSize = clusterData.z;\n float clusterArea = pow(clusterSize + u_baseLength * 2.0, 2.0);\n\n float finestIndex = getTextureData(u_finestIndexes, index, 256.0).a;\n vec4 myPosition = getTextureData(u_physData, finestIndex, 256.0);\n vec4 previousForce = getTextureData(u_prevForce, clusterIndex, 256.0);\n float fScale = 1.0 + sqrt(u_iterationMultiplier);\n\n vec2 acceleration = previousForce.xy;\n\n // Repulsion & Collision Detection\n for (float i = 0.0; i < 256.0 * 256.0; i++) {\n if (i >= clusterStartIndex + clusterSize || i >= u_numNodes) {\n break;\n }\n if (i < clusterStartIndex || i == index) {\n continue;\n }\n\n vec4 otherClusterData = getTextureData(u_clusterData, i, 256.0);\n float otherClusterWeight = getSquaredLogClusterWeight(otherClusterData.w);\n\n float otherFinestIndex = getTextureData(u_finestIndexes, i, 256.0).a;\n vec4 otherPosition = getTextureData(u_physData, otherFinestIndex, 256.0);\n\n vec2 delta = myPosition.xy - otherPosition.xy;\n float dist = max(length(delta), 0.0000001);\n float maxDist = 25.0;\n float repulsionForceScale = 0.1;\n\n float F = (clusterArea * fScale) / (dist * dist);\n\n if (u_isTopLevel == 1.0) {\n repulsionForceScale = 0.2;\n }\n\n acceleration += ((delta / sqrt(dist)) * F) * repulsionForceScale * otherClusterWeight;\n\n if (dist < maxDist) {\n float collide = (maxDist - dist) / (dist * dist);\n acceleration += delta * collide * fScale * maxDist / (maxDist + 1.0);\n }\n }\n\n gl_FragColor = vec4(acceleration, vec2(finestIndex, 0));\n}";
|
|
2
2
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HierarchicalOptions, type LayoutOptions, type NvlState } from '../../modules/state';
|
|
1
|
+
import { type HierarchicalOptions, type LayoutOptions, type NvlState } from '../../modules/state/types';
|
|
2
2
|
import AnimatedLayout from '../animatedlayout/AnimatedLayout';
|
|
3
3
|
type HierarchicalLayoutConfig = {
|
|
4
4
|
state: NvlState;
|
|
@@ -14,8 +14,8 @@ export declare class HierarchicalLayout extends AnimatedLayout {
|
|
|
14
14
|
private worker;
|
|
15
15
|
private directionChanged;
|
|
16
16
|
private packingChanged;
|
|
17
|
+
private workersDisabled;
|
|
17
18
|
constructor(config: HierarchicalLayoutConfig);
|
|
18
|
-
setupWorker(): Promise<SharedWorker>;
|
|
19
19
|
setOptions(options: LayoutOptions): void;
|
|
20
20
|
update(refreshPositions?: boolean): void;
|
|
21
21
|
getShouldUpdate(): boolean;
|
|
@@ -2,7 +2,7 @@ import type { Node, Relationship } from '../types/graph-element';
|
|
|
2
2
|
import '../types/nvl-window-functions';
|
|
3
3
|
import type { Point } from '../utils/geometry';
|
|
4
4
|
import type { ExternalCallbacks } from './ExternalCallbackHandler';
|
|
5
|
-
import type { Layout, LayoutOptions, NvlOptions, NvlState, ZoomOptions } from './state';
|
|
5
|
+
import type { Layout, LayoutOptions, NvlOptions, NvlState, ZoomOptions } from './state/types';
|
|
6
6
|
type SaveToFileOptions = {
|
|
7
7
|
filename?: string;
|
|
8
8
|
backgroundColor?: string;
|
|
@@ -53,6 +53,7 @@ export default class NvlController {
|
|
|
53
53
|
private layoutDoneCallback;
|
|
54
54
|
private layoutComputingCallback;
|
|
55
55
|
private currentLayoutType;
|
|
56
|
+
private descriptionElement;
|
|
56
57
|
constructor(state: NvlState, options: NvlOptions);
|
|
57
58
|
private onWebGLContextLost;
|
|
58
59
|
private updateMinimapZoom;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import PIDController from 'node-pid-controller';
|
|
2
2
|
import type { Node } from '../types/graph-element';
|
|
3
|
-
import type { NvlState } from './state';
|
|
3
|
+
import type { NvlState } from './state/types';
|
|
4
4
|
export default class ZoomTransitionHandler {
|
|
5
5
|
xCtrl: PIDController;
|
|
6
6
|
yCtrl: PIDController;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BorderStyles, NvlState } from './types';
|
|
2
|
+
export declare const NodeBorderStyles: BorderStyles;
|
|
3
|
+
export declare const RelationshipBorderStyles: BorderStyles;
|
|
4
|
+
export declare const DefaultZoomLevel = 0.75;
|
|
5
|
+
export declare const DefaultMaxZoom = 10;
|
|
6
|
+
export declare const DefaultMinZoom = 0.075;
|
|
7
|
+
export declare const DefaultMinimapMaxZoom = 0.2;
|
|
8
|
+
export declare const DefaultMinimapMinZoom = 0;
|
|
9
|
+
export declare const DefaultZoomOptions: NvlState['zoomOptions'];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NvlOptions, NvlState } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Create a new NVL state
|
|
4
|
+
*
|
|
5
|
+
* @param {NvlOptions} options - The options for the new state
|
|
6
|
+
* @returns {NvlState} - The state object
|
|
7
|
+
*/
|
|
8
|
+
export declare const createState: (options: NvlOptions) => NvlState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LogLevelDesc } from 'loglevel';
|
|
2
|
-
import type { WaypointPath } from '
|
|
3
|
-
import type { ExternalCallbacks } from '
|
|
4
|
-
import type { NodeDataSet, RelationshipDataSet } from '
|
|
2
|
+
import type { WaypointPath } from '../../renderers/canvasrenderer/types';
|
|
3
|
+
import type { ExternalCallbacks } from '../ExternalCallbackHandler';
|
|
4
|
+
import type { NodeDataSet, RelationshipDataSet } from '../dataset';
|
|
5
5
|
type RingStyle = {
|
|
6
6
|
width?: number;
|
|
7
7
|
widthFactor?: number;
|
|
@@ -23,9 +23,13 @@ export type BorderStyles = {
|
|
|
23
23
|
selected: BorderStyle;
|
|
24
24
|
default: BorderStyle;
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export type DisabledItemStyles = {
|
|
30
|
+
color: string;
|
|
31
|
+
fontColor: string;
|
|
32
|
+
};
|
|
29
33
|
/**
|
|
30
34
|
* The options for the force directed layout
|
|
31
35
|
*/
|
|
@@ -130,7 +134,12 @@ export interface NvlOptions {
|
|
|
130
134
|
* The DOM element in which to render the graph visualization
|
|
131
135
|
*/
|
|
132
136
|
frame?: HTMLElement;
|
|
133
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* The DOM container in which to render the minimap.
|
|
139
|
+
*
|
|
140
|
+
* @note When using a React ref, make sure the attached element is rendered before the NVL instance is created.
|
|
141
|
+
* Otherwise, the minimap will not be displayed.
|
|
142
|
+
*/
|
|
134
143
|
minimapContainer?: HTMLElement;
|
|
135
144
|
/** Configuration for the current layout */
|
|
136
145
|
layoutOptions?: LayoutOptions;
|
|
@@ -171,10 +180,44 @@ export interface NvlOptions {
|
|
|
171
180
|
*/
|
|
172
181
|
relationshipThreshold?: number;
|
|
173
182
|
callbacks?: ExternalCallbacks;
|
|
174
|
-
|
|
183
|
+
styling?: {
|
|
184
|
+
defaultNodeColor?: string;
|
|
185
|
+
defaultRelationshipColor?: string;
|
|
186
|
+
/** The color to use for the default border of nodes */
|
|
187
|
+
nodeDefaultBorderColor?: string;
|
|
188
|
+
/** The color to use for the selected border of nodes and relationships */
|
|
189
|
+
selectedBorderColor?: string;
|
|
190
|
+
/** The color to use for the selected inner border of nodes and relationships */
|
|
191
|
+
selectedInnerBorderColor?: string;
|
|
192
|
+
/** The color to use for the drop shadow of selected/hovered nodes and relationships */
|
|
193
|
+
dropShadowColor?: string;
|
|
194
|
+
/** The color to use for the disabled nodes and relationships */
|
|
195
|
+
disabledItemColor?: string;
|
|
196
|
+
/** The color to use for the labels of the disabled nodes and relationships */
|
|
197
|
+
disabledItemFontColor?: string;
|
|
198
|
+
/** The color to use for the viewport box in the minimap */
|
|
199
|
+
minimapViewportBoxColor?: string;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* The color to use for the default border of nodes
|
|
203
|
+
* @deprecated Use {@link styling.nodeDefaultBorderColor} instead
|
|
204
|
+
*/
|
|
175
205
|
nodeDefaultBorderColor?: string;
|
|
176
|
-
/**
|
|
206
|
+
/**
|
|
207
|
+
* The color to use for the selected border of nodes
|
|
208
|
+
* @deprecated Use {@link styling.selectedBorderColor} instead
|
|
209
|
+
*/
|
|
177
210
|
selectedBorderColor?: string;
|
|
211
|
+
/**
|
|
212
|
+
* The color to use for the disabled nodes and relationships
|
|
213
|
+
* @deprecated Use {@link styling.disabledItemColor} instead
|
|
214
|
+
*/
|
|
215
|
+
disabledItemColor?: string;
|
|
216
|
+
/**
|
|
217
|
+
* The color to use for the labels of the disabled nodes and relationships
|
|
218
|
+
* @deprecated Use {@link styling.disabledItemFontColor} instead
|
|
219
|
+
*/
|
|
220
|
+
disabledItemFontColor?: string;
|
|
178
221
|
/**
|
|
179
222
|
* @internal
|
|
180
223
|
* Defines a time limit for how long layout iterations may run
|
|
@@ -185,6 +228,19 @@ export interface NvlOptions {
|
|
|
185
228
|
* @defaultValue false
|
|
186
229
|
*/
|
|
187
230
|
disableTelemetry?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Disables the use of {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers | web workers} for the layout calculations.
|
|
233
|
+
*/
|
|
234
|
+
disableWebWorkers?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Disables {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA | ARIA} attributes on the graph.
|
|
237
|
+
* By default, NVL adds ARIA attributes to the graph container to make it more accessible.
|
|
238
|
+
* Attributes include `role="image"`, `aria-label="Graph visualization"`
|
|
239
|
+
* and `aria-describedby="nvl-${instanceId}-description"`.
|
|
240
|
+
* The description element is a live region that will announce changes to the graph.
|
|
241
|
+
* @defaultValue false
|
|
242
|
+
*/
|
|
243
|
+
disableAria?: boolean;
|
|
188
244
|
}
|
|
189
245
|
/** Options that influence how fit-to-zoom should behave */
|
|
190
246
|
export type ZoomOptions = {
|
|
@@ -214,6 +270,7 @@ export interface NvlState {
|
|
|
214
270
|
webGLVisible: boolean;
|
|
215
271
|
renderer: Renderer;
|
|
216
272
|
disableWebGL: boolean;
|
|
273
|
+
disableWebWorkers: boolean;
|
|
217
274
|
disableTelemetry: boolean;
|
|
218
275
|
fitMovement: number;
|
|
219
276
|
layout: Layout;
|
|
@@ -249,12 +306,9 @@ export interface NvlState {
|
|
|
249
306
|
reaction: Function;
|
|
250
307
|
nodeBorderStyles: BorderStyles;
|
|
251
308
|
relationshipBorderStyles: BorderStyles;
|
|
309
|
+
disabledItemStyles: DisabledItemStyles;
|
|
310
|
+
defaultNodeColor: string;
|
|
311
|
+
defaultRelationshipColor: string;
|
|
312
|
+
minimapViewportBoxColor: string;
|
|
252
313
|
}
|
|
253
|
-
/**
|
|
254
|
-
* Create a new NVL state
|
|
255
|
-
*
|
|
256
|
-
* @param {NvlOptions} options - The options for the new state
|
|
257
|
-
* @returns {NvlState} - The state object
|
|
258
|
-
*/
|
|
259
|
-
export declare const createState: (options: NvlOptions) => NvlState;
|
|
260
314
|
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { NvlOptions } from './types';
|
|
2
|
+
export declare const processColorStyles: (styling: NvlOptions['styling'], { legacyNodeDefaultBorderColor, legacySelectedBorderColor, legacyDisabledItemColor, legacyDisabledItemFontColor }: {
|
|
3
|
+
legacyNodeDefaultBorderColor?: string;
|
|
4
|
+
legacySelectedBorderColor?: string;
|
|
5
|
+
legacyDisabledItemColor?: string;
|
|
6
|
+
legacyDisabledItemFontColor?: string;
|
|
7
|
+
}) => {
|
|
8
|
+
nodeBorderStyles: {
|
|
9
|
+
default: {
|
|
10
|
+
rings?: {
|
|
11
|
+
width?: number;
|
|
12
|
+
widthFactor?: number;
|
|
13
|
+
color: string;
|
|
14
|
+
}[];
|
|
15
|
+
shadow?: import("./types").ShadowStyle;
|
|
16
|
+
};
|
|
17
|
+
selected: {
|
|
18
|
+
rings?: {
|
|
19
|
+
width?: number;
|
|
20
|
+
widthFactor?: number;
|
|
21
|
+
color: string;
|
|
22
|
+
}[];
|
|
23
|
+
shadow?: import("./types").ShadowStyle;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
relationshipBorderStyles: {
|
|
27
|
+
default: import("./types").BorderStyle;
|
|
28
|
+
selected: {
|
|
29
|
+
rings?: {
|
|
30
|
+
width?: number;
|
|
31
|
+
widthFactor?: number;
|
|
32
|
+
color: string;
|
|
33
|
+
}[];
|
|
34
|
+
shadow?: import("./types").ShadowStyle;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
disabledItemStyles: {
|
|
38
|
+
color: string;
|
|
39
|
+
fontColor: string;
|
|
40
|
+
};
|
|
41
|
+
defaultNodeColor: string;
|
|
42
|
+
defaultRelationshipColor: string;
|
|
43
|
+
minimapViewportBoxColor: string;
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NvlState } from '../../modules/state';
|
|
1
|
+
import type { NvlState } from '../../modules/state/types';
|
|
2
2
|
import type { Node } from '../../types/graph-element';
|
|
3
3
|
import type { Point } from '../../utils/geometry';
|
|
4
4
|
import type { HitTargetNode, HitTargetRelationship } from '../../utils/hittest';
|
|
@@ -17,6 +17,7 @@ export default class CanvasRenderer {
|
|
|
17
17
|
private nodeVersion;
|
|
18
18
|
private relVersion;
|
|
19
19
|
private waypointVersion;
|
|
20
|
+
private ellipsisWidth;
|
|
20
21
|
/**
|
|
21
22
|
* Creates a new CanvasRenderer.
|
|
22
23
|
* @param canvas {HTMLCanvasElement} - The canvas to render on.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BorderStyle } from '../../../modules/state';
|
|
1
|
+
import type { BorderStyle, DisabledItemStyles } from '../../../modules/state/types';
|
|
2
2
|
import type { Node, Relationship } from '../../../types/graph-element';
|
|
3
3
|
import type { Point } from '../../../utils/geometry';
|
|
4
4
|
import type ImageCache from '../ImageCache';
|
|
@@ -32,12 +32,15 @@ export declare const getPointsForStraight: (rel: Relationship, bundle: ArrowBund
|
|
|
32
32
|
* @param {number} angle - the angle of the label
|
|
33
33
|
* @param {number} maxWidth - the maximum width of the label
|
|
34
34
|
* @param {Relationship} rel - the relationship
|
|
35
|
+
* @param {ArrowBundle} bundle - the arrow bundle
|
|
36
|
+
* @param {DisabledItemStyles} disabledItemStyles - the styles for disabled items
|
|
37
|
+
* @param {string} fontColor - the color of the font
|
|
35
38
|
* @param {boolean} flip - whether to flip the label
|
|
36
39
|
*/
|
|
37
|
-
export declare const drawLabel: (ctx: CanvasRenderingContext2D, point: Point, angle: number, maxWidth: number, rel: Relationship, bundle: ArrowBundle, flip?: boolean) => void;
|
|
38
|
-
export declare const renderWaypointArrow: (ctx: CanvasRenderingContext2D, rel: Relationship, from: Node, to: Node, bundle: ArrowBundle, imageCache: ImageCache, showLabel: boolean, drawCurves: boolean, selectedBorderStyle: BorderStyle) => void;
|
|
39
|
-
export declare const renderSelfArrow: (ctx: CanvasRenderingContext2D, rel: Relationship, node: Node, bundle: ArrowBundle, imageCache: ImageCache, showLabel: boolean, selectedBorderStyle: BorderStyle) => void;
|
|
40
|
-
export declare const renderArrow: (ctx: CanvasRenderingContext2D, rel: Relationship, fromNode: Node, toNode: Node, bundle: ArrowBundle, imageCache: ImageCache, showLabel: boolean, selectedBorderStyle: BorderStyle, drawCurves?: boolean) => void;
|
|
40
|
+
export declare const drawLabel: (ctx: CanvasRenderingContext2D, point: Point, angle: number, maxWidth: number, rel: Relationship, bundle: ArrowBundle, disabledItemStyles: DisabledItemStyles, fontColor: string, flip?: boolean) => void;
|
|
41
|
+
export declare const renderWaypointArrow: (ctx: CanvasRenderingContext2D, rel: Relationship, from: Node, to: Node, bundle: ArrowBundle, imageCache: ImageCache, showLabel: boolean, drawCurves: boolean, selectedBorderStyle: BorderStyle, disabledItemStyles: DisabledItemStyles, defaultRelationshipColor?: string) => void;
|
|
42
|
+
export declare const renderSelfArrow: (ctx: CanvasRenderingContext2D, rel: Relationship, node: Node, bundle: ArrowBundle, imageCache: ImageCache, showLabel: boolean, selectedBorderStyle: BorderStyle, disabledItemStyles: DisabledItemStyles, defaultRelationshipColor?: string) => void;
|
|
43
|
+
export declare const renderArrow: (ctx: CanvasRenderingContext2D, rel: Relationship, fromNode: Node, toNode: Node, bundle: ArrowBundle, imageCache: ImageCache, showLabel: boolean, selectedBorderStyle: BorderStyle, disabledItemStyles: DisabledItemStyles, defaultRelationshipColor: string, drawCurves?: boolean) => void;
|
|
41
44
|
export declare const distanceToEdge: (pos: Point, rel: Relationship, fromNode: Node, toNode: Node, bundle: ArrowBundle, showLabel: boolean, drawCurves?: boolean) => number;
|
|
42
45
|
/**
|
|
43
46
|
* Returns the bounding box of the arrow.
|
|
@@ -9,7 +9,7 @@ export declare const HeadHeight = 9;
|
|
|
9
9
|
/** The chin height of arrows. */
|
|
10
10
|
export declare const HeadChinHeight = 2;
|
|
11
11
|
/** The default color of relationships. */
|
|
12
|
-
export declare const RelColor = "#
|
|
12
|
+
export declare const RelColor = "#818790";
|
|
13
13
|
/** The length of the curve of a curved relationship. */
|
|
14
14
|
export declare const TaperRelLength = 30;
|
|
15
15
|
/** The distance of the starting points of relationships in a bundle. */
|
|
@@ -28,11 +28,6 @@ export declare const SelfRefHeight = 35;
|
|
|
28
28
|
export declare const SelfRefLabelMaxWidth = 40;
|
|
29
29
|
/** Width increase when a relationship is selected. */
|
|
30
30
|
export declare const SelectedWidthFactor = 1.5;
|
|
31
|
-
/** The style properties of a disabled relationship. */
|
|
32
|
-
export declare const Disabled: {
|
|
33
|
-
color: string;
|
|
34
|
-
fontColor: string;
|
|
35
|
-
};
|
|
36
31
|
/** The font styles for relationship captions. */
|
|
37
32
|
export declare const Font: {
|
|
38
33
|
size: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BorderStyles } from '../../../modules/state';
|
|
1
|
+
import type { BorderStyles, DisabledItemStyles } from '../../../modules/state/types';
|
|
2
2
|
import type { Node } from '../../../types/graph-element';
|
|
3
3
|
import type AnimationHandler from '../AnimationHandler';
|
|
4
4
|
type RingStyle = {
|
|
@@ -52,7 +52,8 @@ export declare const findMinLength: (lines: any[], ctx: CanvasRenderingContext2D
|
|
|
52
52
|
* @param imageCache {any} - The image cache to use.
|
|
53
53
|
* @param animationHandler {AnimationHandler} - The animation handler.
|
|
54
54
|
* @param nodeBorderStyles {BorderStyles} - The node border styles.
|
|
55
|
+
* @param disabledItemStyles {DisabledItemStyles} - The styles for the disabled items.
|
|
55
56
|
* @param zoomLevel {number} - The current zoom level.
|
|
56
57
|
*/
|
|
57
|
-
export declare const drawNode: (ctx: CanvasRenderingContext2D, node: Node, imageCache: any, animationHandler: AnimationHandler, nodeBorderStyles: BorderStyles, zoomLevel?: number) => void;
|
|
58
|
+
export declare const drawNode: (ctx: CanvasRenderingContext2D, node: Node, imageCache: any, animationHandler: AnimationHandler, nodeBorderStyles: BorderStyles, disabledItemStyles: DisabledItemStyles, defaultNodeColor?: string, ellipsisWidth?: number, zoomLevel?: number) => void;
|
|
58
59
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Point } from '../../utils/geometry';
|
|
2
2
|
import type { TextSegment } from './types';
|
|
3
|
-
export declare const fontThresholds: number
|
|
3
|
+
export declare const fontThresholds: [number, number][];
|
|
4
4
|
/**
|
|
5
5
|
* This function takes color in hex format or rgb() or rgba() format and overrides the opacity. Returns rgba() string.
|
|
6
6
|
* @param {string} color
|
|
@@ -65,5 +65,5 @@ export declare function getIndividualInfoLevels(r: number, zoomLevel: number): {
|
|
|
65
65
|
/**
|
|
66
66
|
* Prints the caption for a node
|
|
67
67
|
*/
|
|
68
|
-
export declare const drawNodeCaption: (ctx: CanvasRenderingContext2D, lines: TextSegment[], stylesPerChar: string[][], initialYPos: number, fontSize: number, fontFace: string, lineDistance: number, x: number, y: number) => void;
|
|
68
|
+
export declare const drawNodeCaption: (ctx: CanvasRenderingContext2D, lines: TextSegment[], stylesPerChar: string[][], initialYPos: number, fontSize: number, fontFace: string, lineDistance: number, x: number, y: number, ellipsisWidth: number) => void;
|
|
69
69
|
export {};
|
|
@@ -30,7 +30,7 @@ export declare const tryBreakingOnSpaces: (text: string, measureWidth: (text: st
|
|
|
30
30
|
*
|
|
31
31
|
* @return array of text lines
|
|
32
32
|
*/
|
|
33
|
-
export declare const getLines: (ctx: CanvasRenderingContext2D, text: string, fontFace: string, fontSize: string | number, maxWidth: number, hasIcon: boolean,
|
|
33
|
+
export declare const getLines: (ctx: CanvasRenderingContext2D, text: string, fontFace: string, fontSize: string | number, maxWidth: number, hasIcon: boolean, maxNoLines: number, align: string) => TextSegment[];
|
|
34
34
|
/**
|
|
35
35
|
* Returns the styles by char for a group of property values
|
|
36
36
|
* @param {array} captions = array of captions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Node, Relationship } from '../../index';
|
|
2
2
|
import type { DataSet } from '../../modules/dataset';
|
|
3
|
-
import type { NvlState } from '../../modules/state';
|
|
3
|
+
import type { NvlState } from '../../modules/state/types';
|
|
4
4
|
import type Renderer from './Renderer';
|
|
5
5
|
export interface ControllerInterface {
|
|
6
6
|
mainSceneRenderer: Renderer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mat4 } from 'gl-matrix';
|
|
2
2
|
import type { DataSet } from '../../modules/dataset';
|
|
3
|
-
import type { NvlState } from '../../modules/state';
|
|
3
|
+
import type { NvlState } from '../../modules/state/types';
|
|
4
4
|
import type { Node, Relationship } from '../../types/graph-element';
|
|
5
5
|
export default class Renderer {
|
|
6
6
|
private readonly nodeShader;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "uniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nvarying lowp vec4 color;\nvarying lowp float drawDefaultBorder;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\n\nmediump float circleSize = 0.40;\nmediump float
|
|
1
|
+
declare const _default: "uniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\n\nvarying lowp vec4 color;\nvarying lowp float drawDefaultBorder;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp vec3 selectedInnerBorderColor;\nvarying lowp vec3 shadowColor;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\n\nmediump float circleSize = 0.40;\nmediump float defaultBoderSize = 0.42;\nmediump float innerSelectedRingSize = 0.43;\nmediump float outerSelectedRingSize = 0.47;\nmediump float shadowSize = 0.51;\n\nlowp float getShadowAlpha(lowp float size, lowp float dist) {\n return (1.0 - smoothstep(size, shadowSize, dist)) * 0.25;\n}\n\nlowp float getCircleAlpha(lowp float ringSize, lowp float nodeSize, lowp float dist) {\n return color.w - smoothstep(ringSize - nodeSize, ringSize, dist);\n}\n\nvoid main() {\n lowp float dist = distance(gl_PointCoord, vec2(0.5));\n\n if (dist > 0.51) {\n discard;\n }\n else {\n lowp float nodeSize = 1.0 / varNodeSize;\n lowp float nodeAlpha = getCircleAlpha(circleSize, nodeSize, dist);\n lowp float borderAlpha = getCircleAlpha(defaultBoderSize, nodeSize, dist);\n lowp float ringAlpha = getCircleAlpha(innerSelectedRingSize, nodeSize, dist);\n lowp vec3 finalColor = color.xyz;\n lowp float finalAlpha = nodeAlpha;\n\n if (selected > 0.0) {\n lowp float shadowAlpha = getShadowAlpha(outerSelectedRingSize, dist);\n lowp float ringAlpha2 = getCircleAlpha(outerSelectedRingSize, nodeSize, dist);\n\n if (drawDefaultBorder > 0.0) {\n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalColor = mix(selectedInnerBorderColor, finalColor, borderAlpha);\n finalColor = mix(selectedBorderColor, finalColor, ringAlpha);\n finalColor = mix(shadowColor, finalColor, ringAlpha2);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, max(borderAlpha, ringAlpha2)));\n } else {\n finalColor = mix(selectedInnerBorderColor, finalColor, nodeAlpha);\n finalColor = mix(selectedBorderColor, finalColor, ringAlpha);\n finalColor = mix(shadowColor, finalColor, ringAlpha2);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, max(ringAlpha, ringAlpha2)));\n }\n } else if (hovered > 0.0) {\n if (drawDefaultBorder > 0.0) {\n lowp float shadowAlpha = getShadowAlpha(defaultBoderSize, dist);\n \n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalColor = mix(shadowColor, finalColor, borderAlpha);\n finalAlpha = max(shadowAlpha, max(nodeAlpha, ringAlpha));\n } else {\n lowp float shadowAlpha = getShadowAlpha(circleSize, dist);\n\n finalColor = mix(shadowColor, finalColor, nodeAlpha);\n finalAlpha = max(shadowAlpha, nodeAlpha);\n }\n } else {\n if (drawDefaultBorder > 0.0) {\n finalColor = mix(nodeBorderColor, finalColor, nodeAlpha);\n finalAlpha = borderAlpha;\n }\n }\n gl_FragColor = vec4(finalColor, 1.0) * finalAlpha;\n }\n}\n";
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\nuniform lowp vec3 u_nodeBorderColor;\nuniform lowp vec3 u_selectedBorderColor;\nuniform lowp float u_drawDefaultBorder;\n\nattribute float a_size;\nattribute lowp vec2 a_index;\nattribute lowp vec4 a_color;\nattribute lowp float a_selected;\nattribute lowp float a_hovered;\n\nvarying lowp float window;\nvarying lowp vec4 color;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp float drawDefaultBorder;\n\nlowp float MinNodeSize = 5.0;\n\nvoid main(void) {\n vec4 data = texture2D(u_positions, a_index);\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n lowp float nodeSize = a_size * u_zoom * u_glAdjust;\n if (nodeSize < MinNodeSize) {\n gl_PointSize = MinNodeSize;\n varNodeSize = MinNodeSize;\n } else {\n gl_PointSize = nodeSize;\n varNodeSize = nodeSize;\n }\n\n color = a_color;\n selected = a_selected;\n hovered = a_hovered;\n nodeBorderColor = u_nodeBorderColor;\n selectedBorderColor = u_selectedBorderColor;\n drawDefaultBorder = u_drawDefaultBorder;\n}";
|
|
1
|
+
declare const _default: "uniform mat4 u_projection;\nuniform sampler2D u_positions;\nuniform mediump float u_zoom;\nuniform mediump float u_glAdjust;\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;\n\nattribute float a_size;\nattribute lowp vec2 a_index;\nattribute lowp vec4 a_color;\nattribute lowp float a_selected;\nattribute lowp float a_hovered;\n\nvarying lowp float window;\nvarying lowp vec4 color;\nvarying lowp float selected;\nvarying lowp float hovered;\nvarying lowp float varNodeSize;\nvarying lowp vec3 nodeBorderColor;\nvarying lowp vec3 selectedBorderColor;\nvarying lowp vec3 selectedInnerBorderColor;\nvarying lowp vec3 shadowColor;\nvarying lowp float drawDefaultBorder;\n\nlowp float MinNodeSize = 5.0;\n\nvoid main(void) {\n vec4 data = texture2D(u_positions, a_index);\n gl_Position = u_projection * vec4(data.xy, 0.0, 1.0);\n\n lowp float nodeSize = a_size * u_zoom * u_glAdjust;\n if (nodeSize < MinNodeSize) {\n gl_PointSize = MinNodeSize;\n varNodeSize = MinNodeSize;\n } else {\n gl_PointSize = nodeSize;\n varNodeSize = nodeSize;\n }\n\n color = a_color;\n selected = a_selected;\n hovered = a_hovered;\n nodeBorderColor = u_nodeBorderColor;\n selectedBorderColor = u_selectedBorderColor;\n selectedInnerBorderColor = u_selectedInnerBorderColor;\n shadowColor = u_shadowColor;\n drawDefaultBorder = u_drawDefaultBorder;\n}";
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "
|
|
1
|
+
declare const _default: "\nvarying lowp vec4 minimapViewportBoxColor;\n\nvoid main(void) {\n gl_FragColor = minimapViewportBoxColor;\n}\n";
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "
|
|
1
|
+
declare const _default: "\nattribute vec2 coordinates;\nuniform mat4 u_projection;\nuniform lowp vec4 u_minimapViewportBoxColor;\n\nvarying lowp vec4 minimapViewportBoxColor;\n\nvoid main(void) {\n gl_Position = u_projection * vec4(coordinates, 0.0, 1.0);\n minimapViewportBoxColor = u_minimapViewportBoxColor;\n}\n";
|
|
2
2
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import colorString from 'color-string';
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether a black or white font color is more readable for a given background color
|
|
4
|
+
* @param {string} color The background color
|
|
5
|
+
* @returns {string} The font color that should be used @defaultValue '#fff'
|
|
6
|
+
*/
|
|
7
|
+
export declare const textColorForBackground: (color: string) => string;
|
|
8
|
+
export declare const colorToRGB: (color: string) => colorString.Color;
|
|
9
|
+
export declare const isValidColor: (color: unknown) => boolean;
|
|
10
|
+
export declare const rgbaToVec4: (rgba: number[]) => number[];
|
|
11
|
+
export declare const rgbToVec3: (rgb: number[]) => number[];
|
|
12
|
+
export declare const colorToUIntArray: (color: string) => number;
|
|
13
|
+
export declare const colorToVec3: (color: string) => number[];
|
|
14
|
+
export declare const colorToVec4: (color: string) => number[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,13 +4,20 @@ export declare const MaxIndexBuffer = 65536;
|
|
|
4
4
|
export declare const MinRelLength = 100;
|
|
5
5
|
export declare const Gravity = 100;
|
|
6
6
|
export declare const SimulationStopVelocity = 100;
|
|
7
|
-
export declare const VerletSimulationStopVelocity = 0.
|
|
7
|
+
export declare const VerletSimulationStopVelocity = 0.25;
|
|
8
8
|
export declare const MappingEnd = 999999;
|
|
9
9
|
export declare const ActiveAnimDuration = 1000;
|
|
10
10
|
export declare const DefaultNodeSize = 25;
|
|
11
|
-
export declare const DefaultNodeColor = "#
|
|
11
|
+
export declare const DefaultNodeColor = "#FFDF81";
|
|
12
|
+
export declare const DefaultRelColor = "#818790";
|
|
12
13
|
export declare const DefaultRelWidth = 1;
|
|
13
|
-
export declare const
|
|
14
|
+
export declare const DisabledItemColor = "#EDEDED";
|
|
15
|
+
export declare const DisabledItemFontColor = "#DDDDDD";
|
|
16
|
+
export declare const DefaultShadowColor = "#CFD1D4";
|
|
17
|
+
export declare const DefaultSelectedInnerColor = "#F5F6F6";
|
|
18
|
+
export declare const DefaultSelectedOuterColor = "#8FE3E8";
|
|
19
|
+
export declare const TextColor = "#1A1B1D";
|
|
20
|
+
export declare const TextColorInverse = "#FFFFFF";
|
|
14
21
|
export declare const absFillStyle: {
|
|
15
22
|
position: string;
|
|
16
23
|
top: number;
|
|
@@ -9,9 +9,10 @@ export type FlatRel = Omit<Relationship & {
|
|
|
9
9
|
* Falls back to default rel color when relationships between two nodes have varying colors.
|
|
10
10
|
* Sums widths of relationships when more than one relationship exists between two nodes.
|
|
11
11
|
* @param {Relationship[]} relItems List of all relationships and their connected ids.
|
|
12
|
+
* @param {string} [disabledItemColor] The color to use for the disabled relationships
|
|
12
13
|
* @return {FlatRel[]} A flattened list of relationships.
|
|
13
14
|
*/
|
|
14
|
-
export declare const relItemsToFlatList: (relItems: Relationship[]) => FlatRel[];
|
|
15
|
+
export declare const relItemsToFlatList: (relItems: Relationship[], disabledItemColor?: string) => FlatRel[];
|
|
15
16
|
export declare const getAdjNodesMapAndRelMap: (rels: Relationship[]) => {
|
|
16
17
|
adjNodesMap: Record<string, Set<string>>;
|
|
17
18
|
relMap: Record<string, Relationship[]>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Node as DriverNode, Relationship as DriverRelationship, Path, Record } from 'neo4j-driver';
|
|
2
2
|
export declare const recordMapper: (record: Record) => any[];
|
|
3
|
-
|
|
3
|
+
type GraphElement = DriverNode | DriverRelationship | Path;
|
|
4
|
+
type NestedGraphElements = GraphElement | NestedGraphElements[];
|
|
5
|
+
export declare const recordCollector: (graphElements: NestedGraphElements[]) => {
|
|
4
6
|
recordObjectMap: Map<any, any>;
|
|
5
7
|
nodes: any[];
|
|
6
8
|
relationships: any[];
|
|
@@ -30,3 +32,4 @@ export declare const nvlResultTransformer: import("neo4j-driver-core/types/resul
|
|
|
30
32
|
nodes: any[];
|
|
31
33
|
relationships: any[];
|
|
32
34
|
}>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|