@neo4j-nvl/base 1.2.0-e691fdb4 → 1.2.0-ec8b9947
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/d3forcelayout/constants.d.ts +0 -1
- package/dist/types/layouts/forcedirectedlayout/physlayout/PhysLayout.d.ts +1 -0
- package/dist/types/modules/NvlController.d.ts +2 -0
- package/dist/types/modules/state/types.d.ts +21 -9
- package/dist/types/utils/constants.d.ts +4 -2
- package/dist/types/utils/layoutSeeding.d.ts +7 -0
- package/dist/types/utils/layoutSeeding.test.d.ts +1 -0
- package/package.json +2 -2
|
@@ -12,7 +12,6 @@ export declare const BARNES_HUT_THETA = 1.2;
|
|
|
12
12
|
export declare const FORCE_LINK_DISTANCE: (relationship: SimulationLinkDatum<D3Node>) => number;
|
|
13
13
|
export declare const FORCE_LINK_STRENGTH: (link: SimulationLinkDatum<SimulationNodeDatum>, count: number[]) => number;
|
|
14
14
|
export declare const FORCE_COLLIDE_RADIUS: (node: D3Node) => number;
|
|
15
|
-
export declare const LAYOUT_RADIUS: (numberOfNodes: number) => number;
|
|
16
15
|
export declare const FORCE_CHARGE: () => number;
|
|
17
16
|
export declare const FORCE_CHARGE_START: () => number;
|
|
18
17
|
export declare const FORCE_CENTER_X = 0.03;
|
|
@@ -49,6 +49,7 @@ export default class NvlController {
|
|
|
49
49
|
private lastTimestamp;
|
|
50
50
|
private accumulator;
|
|
51
51
|
private readonly layoutTimeLimit;
|
|
52
|
+
private readonly smoothFrameBudgetMs;
|
|
52
53
|
private pixelRatio;
|
|
53
54
|
private readonly removeResizeListener;
|
|
54
55
|
private readonly removeMinimapResizeListener;
|
|
@@ -62,6 +63,7 @@ export default class NvlController {
|
|
|
62
63
|
private descriptionElement;
|
|
63
64
|
constructor(state: NvlState, frame: HTMLElement, options: NvlOptions);
|
|
64
65
|
private onWebGLContextLost;
|
|
66
|
+
private fpsToFrameBudgetMs;
|
|
65
67
|
private getLayoutNeedsToUpdate;
|
|
66
68
|
private isWithinBudget;
|
|
67
69
|
private updateMinimapZoom;
|
|
@@ -50,6 +50,11 @@ export interface ForceDirectedOptions {
|
|
|
50
50
|
* @defaultValue true
|
|
51
51
|
*/
|
|
52
52
|
enableCytoscape?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* How initial node positions are seeded before the physics simulation runs.
|
|
55
|
+
* @defaultValue 'box'
|
|
56
|
+
*/
|
|
57
|
+
seedingMethod?: 'box' | 'circle';
|
|
53
58
|
}
|
|
54
59
|
/**
|
|
55
60
|
* The options for the hierarchical layout
|
|
@@ -224,17 +229,24 @@ export interface NvlOptions {
|
|
|
224
229
|
minimapViewportBoxColor?: string;
|
|
225
230
|
};
|
|
226
231
|
/**
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
|
|
232
|
+
* Target minimum presentation rate (fps) while layout is active.
|
|
233
|
+
* Rendering will not drop below this rate at the cost of stabilization speed.
|
|
234
|
+
*
|
|
235
|
+
* @defaultValue 3
|
|
236
|
+
*
|
|
237
|
+
* @note Must be within range of 1 and 120.
|
|
238
|
+
*/
|
|
239
|
+
minFps?: number;
|
|
240
|
+
/**
|
|
241
|
+
* Target maximum presentation rate (fps) while layout is active.
|
|
242
|
+
* Rendering will not go above with rate. Any additional
|
|
243
|
+
* computation available is used to speed up layout stabilization.
|
|
244
|
+
*
|
|
245
|
+
* @defaultValue 30
|
|
234
246
|
*
|
|
235
|
-
* @
|
|
247
|
+
* @note Must be within range of 1 and 120.
|
|
236
248
|
*/
|
|
237
|
-
|
|
249
|
+
maxFps?: number;
|
|
238
250
|
/**
|
|
239
251
|
* Disables tracking of library usage
|
|
240
252
|
* @defaultValue false
|
|
@@ -6,8 +6,10 @@ 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
|
|
10
|
-
export declare const
|
|
9
|
+
export declare const DefaultMaxFps = 30;
|
|
10
|
+
export declare const DefaultMinFps = 3;
|
|
11
|
+
export declare const MinAllowedFps = 1;
|
|
12
|
+
export declare const MaxAllowedFps = 120;
|
|
11
13
|
export declare const ActiveAnimDuration = 1000;
|
|
12
14
|
export declare const DefaultNodeSize = 25;
|
|
13
15
|
export declare const DefaultNodeColor = "#FFDF81";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Point } from './geometry';
|
|
2
|
+
export type SeedingMethod = 'box' | 'circle';
|
|
3
|
+
export declare const getCircleSeedRadius: (nodeCount: number, seedSpacing: number) => number;
|
|
4
|
+
export declare const getBoxStartSize: (nodeCount: number) => number;
|
|
5
|
+
export declare const getCirclePositionsForNodeCount: (nodeCount: number, center: Point, radius: number) => Point[];
|
|
6
|
+
export declare const getBoxPositionsForNodeCount: (nodeCount: number, center: Point) => Point[];
|
|
7
|
+
export declare const getSeedPositions: (nodeCount: number, seedingMethod: SeedingMethod, center?: Point) => Point[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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-ec8b9947",
|
|
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-ec8b9947",
|
|
34
34
|
"@segment/analytics-next": "1.81.1",
|
|
35
35
|
"color-string": "1.9.1",
|
|
36
36
|
"d3-force": "3.0.0",
|