@knowvah/dot-engine 1.3.0 → 1.4.0

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/index.js CHANGED
@@ -53417,6 +53417,16 @@ function placedLabelPos(lbl, flipY) {
53417
53417
  if (lbl === void 0 || !lbl.set) return void 0;
53418
53418
  return { x: lbl.pos.x, y: flipY(lbl.pos.y) };
53419
53419
  }
53420
+ function arrowAttachPoints(edge, flipY) {
53421
+ const spl = edge.info.spl;
53422
+ if (spl === void 0 || spl.size === 0) return {};
53423
+ const out = {};
53424
+ const first = spl.list[0];
53425
+ if (first.sflag !== 0) out.sp = { x: first.sp.x, y: flipY(first.sp.y) };
53426
+ const last = spl.list[spl.size - 1];
53427
+ if (last.eflag !== 0) out.ep = { x: last.ep.x, y: flipY(last.ep.y) };
53428
+ return out;
53429
+ }
53420
53430
  function snapshotEdge(edge, flipY) {
53421
53431
  const geom = {
53422
53432
  tail: edge.tail.name,
@@ -53431,6 +53441,9 @@ function snapshotEdge(edge, flipY) {
53431
53441
  if (tailLabel !== void 0) geom.tailLabel = tailLabel;
53432
53442
  const headLabel = placedLabelPos(edge.info.head_label, flipY);
53433
53443
  if (headLabel !== void 0) geom.headLabel = headLabel;
53444
+ const { sp, ep } = arrowAttachPoints(edge, flipY);
53445
+ if (sp !== void 0) geom.sp = sp;
53446
+ if (ep !== void 0) geom.ep = ep;
53434
53447
  return geom;
53435
53448
  }
53436
53449
  function snapshotCluster(sg, yAxis, flipY) {