@html-graph/html-graph 8.21.0 → 8.21.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.
@@ -1275,6 +1275,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1275
1275
  to: { x: to.x - x, y: to.y - y }
1276
1276
  };
1277
1277
  };
1278
+ const halfCube = 0.5 * 0.5 * 0.5;
1279
+ const halfCube3 = 3 * halfCube;
1278
1280
  class BezierEdgePath {
1279
1281
  constructor(params) {
1280
1282
  __publicField(this, "path");
@@ -1289,9 +1291,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1289
1291
  hasSourceArrow,
1290
1292
  hasTargetArrow
1291
1293
  } = params;
1292
- const centerX = (from.x + to.x) / 2;
1293
- const centerY = (from.y + to.y) / 2;
1294
- this.midpoint = { x: centerX, y: centerY };
1295
1294
  const begin = createRotatedPoint(
1296
1295
  { x: from.x + arrowLength, y: from.y },
1297
1296
  fromDir,
@@ -1310,6 +1309,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1310
1309
  x: end.x - toDir.x * curvature,
1311
1310
  y: end.y - toDir.y * curvature
1312
1311
  };
1312
+ const centerX = halfCube * begin.x + halfCube3 * bezierBegin.x + halfCube3 * bezierEnd.x + halfCube * end.x;
1313
+ const centerY = halfCube * begin.y + halfCube3 * bezierBegin.y + halfCube3 * bezierEnd.y + halfCube * end.y;
1314
+ this.midpoint = { x: centerX, y: centerY };
1313
1315
  const curve = `M ${begin.x} ${begin.y} C ${bezierBegin.x} ${bezierBegin.y}, ${bezierEnd.x} ${bezierEnd.y}, ${end.x} ${end.y}`;
1314
1316
  const preLine = hasSourceArrow ? "" : `M ${from.x} ${from.y} L ${begin.x} ${begin.y} `;
1315
1317
  const postLine = hasTargetArrow ? "" : ` M ${end.x} ${end.y} L ${to.x} ${to.y}`;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@html-graph/html-graph",
3
3
  "author": "Dmitry Marov <d.marov94@gmail.com>",
4
4
  "private": false,
5
- "version": "8.21.0",
5
+ "version": "8.21.1",
6
6
  "type": "module",
7
7
  "main": "dist/html-graph.js",
8
8
  "types": "dist/html-graph.d.ts",
@@ -70,5 +70,10 @@
70
70
  "vite": "^5.4.1",
71
71
  "vite-plugin-checker": "^0.7.2",
72
72
  "vite-plugin-dts": "^4.0.3"
73
- }
73
+ },
74
+ "os": [
75
+ "darwin",
76
+ "linux",
77
+ "win32"
78
+ ]
74
79
  }