@neo4j-nvl/base 1.2.0 → 1.2.1

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.
@@ -43,6 +43,9 @@ export interface ForceDirectedOptions {
43
43
  * rendering problems on Intel graphics hardware.
44
44
  *
45
45
  * @remarks Requires a restart of NVL as shaders need to be recompiled.
46
+ *
47
+ * @deprecated This option will be removed in a future release, where WebGL will be upgraded to WebGL2,
48
+ * which resolves the compatibility issues with Intel GPUs.
46
49
  */
47
50
  intelWorkaround?: boolean;
48
51
  /**
@@ -18,20 +18,6 @@ export declare const calculateLabelDimensions: (fullCaption: string, measureWidt
18
18
  label: string;
19
19
  width: number;
20
20
  };
21
- /**
22
- * Calculate label transform including rotation and flip adjustments.
23
- *
24
- * @param angle - The base rotation angle in radians
25
- * @param fontSize - The font size in pixels (including pixel ratio scaling)
26
- * @param flip - Whether to flip the label (applies additional rotation)
27
- * @param point - The base point (used to calculate offset in flip case)
28
- * @returns object with final position and angle
29
- */
30
- export declare const calculateLabelTransform: (angle: number, fontSize: number, flip: boolean, point: Point) => {
31
- finalX: number;
32
- finalY: number;
33
- finalAngle: number;
34
- };
35
21
  /**
36
22
  * Calculate vertical alignment offset for label based on caption alignment.
37
23
  *
@@ -55,7 +41,7 @@ export declare const calculateLabelHeightAlign: (captionAlign: string, fontSize:
55
41
  * @param flip - Whether the label is flipped
56
42
  * @returns object with position, rotation, width, and height for hit detection
57
43
  */
58
- export declare const calculateLabelGeometry: (point: Point, angle: number, maxWidth: number, fontSize: number, heightAlign: number, padding: number, pixelRatio: number, flip: boolean) => {
44
+ export declare const calculateLabelGeometry: (point: Point, angle: number, maxWidth: number, fontSize: number, heightAlign: number, padding: number, pixelRatio: number) => {
59
45
  position: {
60
46
  x: number;
61
47
  y: number;
@@ -164,5 +150,5 @@ export declare const drawLoop: (ctx: CanvasRenderingContext2D, fromPoint: Point,
164
150
  * @param fontColor - The font color to use
165
151
  * @param flip - Whether to flip the label orientation (default false)
166
152
  */
167
- export declare const drawLabel: (ctx: CanvasRenderingContext2D, point: Point, angle: number, maxWidth: number, rel: Relationship, bundle: ArrowBundle, disabledItemStyles: DisabledItemStyles, fontColor: string, flip?: boolean) => void;
153
+ export declare const drawLabel: (ctx: CanvasRenderingContext2D, point: Point, angle: number, maxWidth: number, rel: Relationship, bundle: ArrowBundle, disabledItemStyles: DisabledItemStyles, fontColor: string) => void;
168
154
  export {};
@@ -44,12 +44,8 @@ export declare const getSelfArrowControlPoints: (rel: Relationship, node: Node,
44
44
  };
45
45
  nodeGap: number;
46
46
  };
47
- /**
48
- * Calculates position, angle and flip for a self-referencing relationship label.
49
- * Used by both Canvas and SVG renderers to ensure consistent positioning.
50
- * This function handles all the math internally including headAngle and headSelectedAdjustment calculations.
51
- */
52
- export declare const getSelfArrowLabelPosition: (apexPoint: Point, angle: number, endPoint: Point, control2Point: Point, isSelected: boolean, selectionRings: BorderStyle["rings"], relWidth?: number) => {
47
+ /** Calculates anchor position and readable rotation for a self-referencing relationship label. */
48
+ export declare const getSelfArrowLabelPosition: (apexPoint: Point, angle: number, endPoint: Point, control2Point: Point, isSelected: boolean, selectionRings: BorderStyle["rings"], relWidth?: number, captionSize?: number) => {
53
49
  x: number;
54
50
  y: number;
55
51
  angle: number;
@@ -173,3 +169,5 @@ export declare const getOverlayIconAlignment: (position: [number, number], width
173
169
  widthAlign: number;
174
170
  heightAlign: number;
175
171
  };
172
+ /** Vertical offset for a self-loop caption; `top`/`bottom` mean outside/inside the loop. */
173
+ export declare const getSelfLoopHeightAlign: (captionAlign: string, fontSize: number, lineWidth: number, padding: number, flip: 1 | -1) => number;
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.1",
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.1",
34
34
  "@segment/analytics-next": "1.81.1",
35
35
  "color-string": "1.9.1",
36
36
  "d3-force": "3.0.0",
@@ -42,10 +42,10 @@
42
42
  "node-pid-controller": "1.0.1",
43
43
  "resizelistener": "1.1.0",
44
44
  "tinycolor2": "1.6.0",
45
- "uuid": "14.0.0"
45
+ "uuid": "14.0.1"
46
46
  },
47
47
  "devDependencies": {
48
- "@babel/core": "7.28.5",
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",