@neo4j-nvl/base 0.3.4 → 0.3.5-5eb1770c
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/index.d.ts +2 -7
- package/dist/types/layouts/forcedirectedlayout/ForceCytoLayout.d.ts +1 -1
- package/dist/types/layouts/forcedirectedlayout/cosebilkentlayout/CoseBilkentLayout.d.ts +2 -2
- package/dist/types/layouts/forcedirectedlayout/physlayout/solarmerger/SolarMerger.d.ts +1 -1
- package/dist/types/layouts/gridLayout/GridLayout.d.ts +1 -1
- package/dist/types/layouts/hierarchicallayout/HierarchicalLayout.d.ts +1 -1
- package/dist/types/modules/ExternalCallbackHandler.d.ts +3 -0
- package/dist/types/modules/NvlController.d.ts +2 -1
- package/dist/types/modules/ZoomTransitionHandler.d.ts +2 -4
- package/dist/types/modules/performance.d.ts +2 -2
- package/dist/types/modules/state.d.ts +2 -0
- package/package.json +6 -13
package/dist/types/index.d.ts
CHANGED
|
@@ -24,10 +24,7 @@ interface NvlMouseEvent extends MouseEvent {
|
|
|
24
24
|
* const nodes = [{ id: '1' }, { id: '2' }]
|
|
25
25
|
* const relationships = [{ id: '12', from: '1', to: '2' }]
|
|
26
26
|
*
|
|
27
|
-
* const options = {
|
|
28
|
-
* layout: 'forceDirected',
|
|
29
|
-
* initialZoom: 0.5
|
|
30
|
-
* }
|
|
27
|
+
* const options = { initialZoom: 0.5 }
|
|
31
28
|
*
|
|
32
29
|
* const callbacks = {
|
|
33
30
|
* onLayoutDone: () => console.log('Layout done')
|
|
@@ -35,8 +32,6 @@ interface NvlMouseEvent extends MouseEvent {
|
|
|
35
32
|
*
|
|
36
33
|
* const nvl = new NVL(document.getElementById('frame'), nodes, relationships, options, callbacks)
|
|
37
34
|
* ```
|
|
38
|
-
*
|
|
39
|
-
* For more examples, head to the {@link https://neo4j.com/docs/nvl/current/core-library/ NVL Base documentation page}.
|
|
40
35
|
*/
|
|
41
36
|
declare class NVL {
|
|
42
37
|
#private;
|
|
@@ -190,7 +185,7 @@ declare class NVL {
|
|
|
190
185
|
* the zoom level will be set to the closest valid zoom level,
|
|
191
186
|
* even if the given nodes do not fit the viewport yet.
|
|
192
187
|
*/
|
|
193
|
-
fit(nodeIds: string[], zoomOptions
|
|
188
|
+
fit(nodeIds: string[], zoomOptions?: NvlState['zoomOptions']): void;
|
|
194
189
|
/**
|
|
195
190
|
* Resets the zoom of the viewport back to the default zoom level of 0.75
|
|
196
191
|
*/
|
|
@@ -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): import("
|
|
19
|
+
getNodePositions(data: any): import("../../types/graph-element").Node[];
|
|
20
20
|
terminateUpdate(): void;
|
|
21
21
|
destroy(): void;
|
|
22
22
|
}
|
|
@@ -15,13 +15,13 @@ export declare class CoseBilkentLayout extends AnimatedLayout {
|
|
|
15
15
|
cytoCompleteCallback: () => void;
|
|
16
16
|
computing: boolean;
|
|
17
17
|
pendingLayoutData: LayoutData;
|
|
18
|
-
worker: SharedWorker
|
|
18
|
+
worker: SharedWorker;
|
|
19
19
|
constructor(config: {
|
|
20
20
|
state: NvlState;
|
|
21
21
|
cytoCompleteCallback?: () => void;
|
|
22
22
|
animationCompleteCallback?: () => void;
|
|
23
23
|
});
|
|
24
|
-
setupWorker(): Promise<
|
|
24
|
+
setupWorker(): Promise<SharedWorker>;
|
|
25
25
|
setOptions(): void;
|
|
26
26
|
update(refreshPositions?: boolean, updateMobXNodes?: Node[], updateMobXRelationships?: Relationship[]): void;
|
|
27
27
|
getShouldUpdate(): boolean;
|
|
@@ -7,7 +7,7 @@ export class GridLayout {
|
|
|
7
7
|
setOptions(options: any): void;
|
|
8
8
|
updateNodes(positionList: any): void;
|
|
9
9
|
update(refreshPositions?: boolean): void;
|
|
10
|
-
layout(
|
|
10
|
+
layout(mobxNodes: any, nodeIds: any, idToPosition: any, rels: any): void;
|
|
11
11
|
getNodePositions(nodeList: any): any[];
|
|
12
12
|
getShouldUpdate(): boolean;
|
|
13
13
|
getComputing(): boolean;
|
|
@@ -15,7 +15,7 @@ export declare class HierarchicalLayout extends AnimatedLayout {
|
|
|
15
15
|
private directionChanged;
|
|
16
16
|
private packingChanged;
|
|
17
17
|
constructor(config: HierarchicalLayoutConfig);
|
|
18
|
-
setupWorker(): Promise<
|
|
18
|
+
setupWorker(): Promise<SharedWorker>;
|
|
19
19
|
setOptions(options: LayoutOptions): void;
|
|
20
20
|
update(refreshPositions?: boolean): void;
|
|
21
21
|
getShouldUpdate(): boolean;
|
|
@@ -12,12 +12,15 @@ export interface ExternalCallbacks {
|
|
|
12
12
|
/** Triggered when a asynchronous layout calculation starts/stops. */
|
|
13
13
|
onLayoutComputing?: (isComputing: boolean) => void;
|
|
14
14
|
onWebGLContextLost?: (webGLContextEvent: WebGLContextEvent) => void;
|
|
15
|
+
/** Triggered when a zoom transition (e.g. {@link NVL.fit} or {@link NVL.resetZoom}) function is done. */
|
|
16
|
+
onZoomTransitionDone?: () => void;
|
|
15
17
|
restart?: () => void;
|
|
16
18
|
}
|
|
17
19
|
export declare const isExternalCallback: (callback: unknown) => callback is keyof ExternalCallbacks;
|
|
18
20
|
export default class ExternalCallbackHandler {
|
|
19
21
|
callbacks: ExternalCallbacks;
|
|
20
22
|
constructor(externalCallbacks?: ExternalCallbacks);
|
|
23
|
+
onZoomTransitionDone(): void;
|
|
21
24
|
onLayoutDone(): void;
|
|
22
25
|
onLayoutStep(p: Node[]): void;
|
|
23
26
|
onLayoutComputing(isComputing: boolean): void;
|
|
@@ -8,6 +8,7 @@ type SaveToFileOptions = {
|
|
|
8
8
|
backgroundColor?: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const EVENT_ERROR = "onError";
|
|
11
|
+
export declare const EVENT_ZOOM_TRANSITION_DONE = "onZoomTransitionDone";
|
|
11
12
|
export declare const EVENT_LAYOUT_DONE = "onLayoutDone";
|
|
12
13
|
export declare const EVENT_LAYOUT_STEP = "onLayoutStep";
|
|
13
14
|
export declare const EVENT_LAYOUT_COMPUTING = "onLayoutComputing";
|
|
@@ -95,7 +96,7 @@ export default class NvlController {
|
|
|
95
96
|
setZoomLevel(_newLevel: number): void;
|
|
96
97
|
setPanCoordinates(panX: number, panY: number): void;
|
|
97
98
|
setZoomAndPan(zoom: number, panX: number, panY: number): void;
|
|
98
|
-
fit(nodeIds: string[], zoomOptions
|
|
99
|
+
fit(nodeIds: string[], zoomOptions?: ZoomOptions): void;
|
|
99
100
|
resetZoom(): void;
|
|
100
101
|
setRenderer(renderer: string): void;
|
|
101
102
|
on(name: keyof ExternalCallbacks, callback: (args: unknown) => void): void;
|
|
@@ -9,16 +9,14 @@ export default class ZoomTransitionHandler {
|
|
|
9
9
|
private firstUpdate;
|
|
10
10
|
private readonly state;
|
|
11
11
|
private readonly canvas;
|
|
12
|
-
private readonly defaultZoomLevel;
|
|
13
12
|
private readonly stateDisposers;
|
|
14
|
-
constructor({ state, getNodePositions, canvas
|
|
13
|
+
constructor({ state, getNodePositions, canvas }: {
|
|
15
14
|
state: NvlState;
|
|
16
15
|
getNodePositions: (data: Node[]) => Node[];
|
|
17
16
|
canvas: HTMLCanvasElement;
|
|
18
|
-
defaultZoomLevel: number;
|
|
19
17
|
});
|
|
20
18
|
needsToRun(): boolean;
|
|
21
|
-
update(layoutActive: boolean): void;
|
|
19
|
+
update(layoutActive: boolean, onTransitionCompleted?: () => void): void;
|
|
22
20
|
destroy(): void;
|
|
23
21
|
private recalculateTarget;
|
|
24
22
|
private allNodesAreVisible;
|
|
@@ -13,10 +13,10 @@ export default class PerformanceTester {
|
|
|
13
13
|
/**
|
|
14
14
|
* Starts a performance measurement. Every call to this method must be followed
|
|
15
15
|
* by a call to endTest(). Tests can be nested.
|
|
16
|
-
* @param {String}
|
|
16
|
+
* @param {String} measurement String identifying this measurement. Only used for printing, so
|
|
17
17
|
* keep it human readable.
|
|
18
18
|
*/
|
|
19
|
-
startTest(
|
|
19
|
+
startTest(measurement: string): void;
|
|
20
20
|
/**
|
|
21
21
|
* Ends the last started test, giving it an end time.
|
|
22
22
|
*/
|
|
@@ -196,6 +196,8 @@ export type ZoomOptions = {
|
|
|
196
196
|
minZoom?: number;
|
|
197
197
|
/** The maximum zoom value for the fit-to-zoom operation. */
|
|
198
198
|
maxZoom?: number;
|
|
199
|
+
/** If true, will not animate the zoom/pan transition. */
|
|
200
|
+
animated?: boolean;
|
|
199
201
|
};
|
|
200
202
|
export interface NvlState {
|
|
201
203
|
zoom: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/base",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5-5eb1770c",
|
|
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",
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "tsc && webpack",
|
|
22
|
+
"build": "yarn global:tsc && webpack",
|
|
23
23
|
"watch": "concurrently 'tsc -w' 'webpack -w' -k -n 'tsc,webpack' -c 'cyan,magenta'",
|
|
24
|
-
"test": "jest",
|
|
25
|
-
"eslint": "eslint ./src/
|
|
24
|
+
"test": "yarn global:jest",
|
|
25
|
+
"eslint": "yarn global:eslint ./src/",
|
|
26
26
|
"coverage": "yarn test --coverage --silent",
|
|
27
27
|
"prepack": "cp ../../LICENSE.txt ./",
|
|
28
28
|
"postpack": "rm LICENSE.txt"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@neo4j-nvl/layout-workers": "0.3.
|
|
31
|
+
"@neo4j-nvl/layout-workers": "0.3.5-5eb1770c",
|
|
32
32
|
"@segment/analytics-next": "^1.70.0",
|
|
33
33
|
"color-string": "^1.9.1",
|
|
34
34
|
"d3-force": "^3.0.0",
|
|
@@ -50,16 +50,9 @@
|
|
|
50
50
|
"@types/tinycolor2": "^1.4.6",
|
|
51
51
|
"babel-loader": "^8.2.5",
|
|
52
52
|
"copy-webpack-plugin": "^11.0.0",
|
|
53
|
-
"eslint": "^8.38.0",
|
|
54
|
-
"jest": "^29.7.0",
|
|
55
53
|
"typedoc": "^0.23.15",
|
|
56
|
-
"typescript": "^5.4.5",
|
|
57
54
|
"webpack": "^5.75.0",
|
|
58
55
|
"webpack-cli": "^5.0.0"
|
|
59
56
|
},
|
|
60
|
-
"
|
|
61
|
-
"eslint": "*",
|
|
62
|
-
"jest": "*",
|
|
63
|
-
"typescript": "*"
|
|
64
|
-
}
|
|
57
|
+
"stableVersion": "0.3.5"
|
|
65
58
|
}
|