@knowvah/dot-engine 1.3.0 → 1.5.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,11 +53441,14 @@ 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) {
53437
53450
  const bb = sg.info.bb;
53438
- return {
53451
+ const geom = {
53439
53452
  name: sg.name,
53440
53453
  x: bb.ll.x,
53441
53454
  // 'up' keeps the lower-left y; 'down' flips the upper-right y to the
@@ -53444,6 +53457,16 @@ function snapshotCluster(sg, yAxis, flipY) {
53444
53457
  width: bb.ur.x - bb.ll.x,
53445
53458
  height: bb.ur.y - bb.ll.y
53446
53459
  };
53460
+ const lab = sg.info.label;
53461
+ if (lab !== void 0) {
53462
+ geom.label = {
53463
+ x: lab.pos.x,
53464
+ y: flipY(lab.pos.y),
53465
+ width: lab.dimen.x,
53466
+ height: lab.dimen.y
53467
+ };
53468
+ }
53469
+ return geom;
53447
53470
  }
53448
53471
  function collectClusters3(sg, yAxis, flipY, out) {
53449
53472
  for (const c of sg.info.clust ?? []) {