@neo4j-nvl/base 0.3.1-dd1304e0 → 0.3.1-ed2633f2

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.
@@ -1,6 +1,7 @@
1
1
  import type { ExternalCallbacks } from './modules/ExternalCallbackHandler';
2
2
  import type { ForceDirectedOptions, HierarchicalOptions, Layout, LayoutOptions, NvlOptions, NvlState, Renderer, ZoomOptions } from './modules/state';
3
3
  import { ForceDirectedLayoutType, FreeLayoutType, GridLayoutType, HierarchicalLayoutType, d3ForceLayoutType } from './modules/state';
4
+ import type { StyledCaption } from './renderers/canvasrenderer/types';
4
5
  import { drawCircleBand } from './renderers/canvasrenderer/util';
5
6
  import type { Node, PartialNode, PartialRelationship, Relationship } from './types/graph-element';
6
7
  import { CompatibilityError } from './utils/errors';
@@ -375,5 +376,5 @@ declare const colorMapperFunctions: {
375
376
  textColorForBackground: (color: string) => string;
376
377
  };
377
378
  export default NVL;
378
- export type { NvlOptions, Renderer, Node, Relationship, PartialNode, PartialRelationship, Layout, LayoutOptions, ForceDirectedOptions, HierarchicalOptions, ExternalCallbacks, HitTargets, HitTargetNode, HitTargetRelationship, Point, NvlMouseEvent, ZoomOptions };
379
+ export type { NvlOptions, Renderer, Node, Relationship, PartialNode, PartialRelationship, Layout, LayoutOptions, ForceDirectedOptions, HierarchicalOptions, ExternalCallbacks, HitTargets, HitTargetNode, HitTargetRelationship, Point, NvlMouseEvent, ZoomOptions, StyledCaption };
379
380
  export { NVL, colorMapperFunctions, CompatibilityError, ForceDirectedLayoutType, HierarchicalLayoutType, GridLayoutType, FreeLayoutType, d3ForceLayoutType, drawCircleBand };
@@ -1,4 +1,4 @@
1
- import type { SimulationLinkDatum } from 'd3-force';
1
+ import type { SimulationLinkDatum, SimulationNodeDatum } from 'd3-force';
2
2
  import type { D3Node } from './types';
3
3
  export declare const VELOCITY_DECAY = 0.4;
4
4
  export declare const DEFAULT_ALPHA = 1;
@@ -10,6 +10,7 @@ export declare const MAX_STABILIZE_TICKS = 100;
10
10
  export declare const LINK_DISTANCE = 45;
11
11
  export declare const BARNES_HUT_THETA = 1.2;
12
12
  export declare const FORCE_LINK_DISTANCE: (relationship: SimulationLinkDatum<D3Node>) => number;
13
+ export declare const FORCE_LINK_STRENGTH: (link: SimulationLinkDatum<SimulationNodeDatum>, count: number[]) => number;
13
14
  export declare const FORCE_COLLIDE_RADIUS: (node: D3Node) => number;
14
15
  export declare const LAYOUT_RADIUS: (numberOfNodes: number) => number;
15
16
  export declare const FORCE_CHARGE: () => number;
@@ -8,9 +8,12 @@ export class d3ForceLayout {
8
8
  x: number;
9
9
  y: number;
10
10
  };
11
+ nodeRelCount: any[];
11
12
  simulation: import("d3-force").Simulation<import("d3-force").SimulationNodeDatum, undefined>;
12
13
  simulationStopped: boolean;
13
14
  shouldUpdate: boolean;
15
+ shouldReheatNodes: boolean;
16
+ shouldCountNodeRels: boolean;
14
17
  stateDisposers: any[];
15
18
  setOptions(options: any): void;
16
19
  updateNodes(positionList: any): void;
@@ -26,4 +29,5 @@ export class d3ForceLayout {
26
29
  terminateUpdate(): void;
27
30
  destroy(): void;
28
31
  setAlpha(alpha: any): void;
32
+ countNodeRels(): any[];
29
33
  }
@@ -116,7 +116,6 @@ export class PhysLayout {
116
116
  _dumpTexture(framebuffer: any, numItems: any, msg: any): void;
117
117
  _getScaleNumber(iterationNo: any, delayedDecayFormula?: (iterationNo: any, p: any, lowerBar: any) => any): any;
118
118
  _getBaseLength(subGraphNodeCount: any): number;
119
- _hasSizeChanged(updates?: any[]): boolean;
120
119
  _checkForUpdates(fullRefresh?: boolean): void;
121
120
  _getNodePosition(nodeIndex: any): {
122
121
  x: any;
@@ -142,7 +142,13 @@ export interface NvlOptions {
142
142
  * @note will be ignored when {@link renderer} is set
143
143
  */
144
144
  useWebGL?: boolean;
145
- /** What renderer to use */
145
+ /**
146
+ * What renderer to use
147
+ * Possible values are 'webgl' or 'canvas'
148
+ * @defaultValue 'webgl'
149
+ * @note WebGL renderer uses GPU and has better performance.
150
+ * Captions and arrowheads are only displayed when using the canvas renderer.
151
+ */
146
152
  renderer?: Renderer;
147
153
  /**
148
154
  * @internal
@@ -29,7 +29,10 @@ interface GraphElement {
29
29
  * @note Has no affect on self-referring relationships.
30
30
  */
31
31
  captionAlign?: 'top' | 'bottom' | 'center';
32
- /** The caption text and font style.*/
32
+ /**
33
+ * The caption text and font style.
34
+ * @note Captions are only visible when using the 'canvas' renderer.
35
+ */
33
36
  captions?: StyledCaption[];
34
37
  /**
35
38
  * An icon to be displayed anywhere on top of the graph element.
@@ -7,3 +7,4 @@ export function getConnectedNodesAndRels(addedNodes: any, addedRels: any, nodes:
7
7
  connectedNodes: {};
8
8
  connectedRels: {};
9
9
  };
10
+ export function hasSizeChanged(graphObjectUpdates?: any[]): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-nvl/base",
3
- "version": "0.3.1-dd1304e0",
3
+ "version": "0.3.1-ed2633f2",
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",
@@ -33,7 +33,7 @@
33
33
  "tsconfig": "./tsconfig.json"
34
34
  },
35
35
  "dependencies": {
36
- "@neo4j-nvl/layout-workers": "^0.3.1-dd1304e0",
36
+ "@neo4j-nvl/layout-workers": "^0.3.1-ed2633f2",
37
37
  "color-string": "^1.9.1",
38
38
  "contrast": "1.0.1",
39
39
  "d3-force": "^3.0.0",