quixotic-gol 0.1.13 → 0.1.14

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.mjs CHANGED
@@ -232,9 +232,9 @@ function gn(t, e) {
232
232
  for (var a = o.length, i = new Array(a), c = new Array(a), l = new Array(a), s = 0; s < a; ++s) {
233
233
  var u = n[s], d = o[s], m = d.length, w = wn(t.call(u, u && u.__data__, s, n)), _ = w.length, B = c[s] = new Array(_), V = i[s] = new Array(_), x = l[s] = new Array(m);
234
234
  r(u, d, B, V, x, w, e);
235
- for (var Q = 0, Z = 0, et, N; Q < _; ++Q)
236
- if (et = B[Q]) {
237
- for (Q >= Z && (Z = Q + 1); !(N = V[Z]) && ++Z < _; ) ;
235
+ for (var K = 0, Z = 0, et, N; K < _; ++K)
236
+ if (et = B[K]) {
237
+ for (K >= Z && (Z = K + 1); !(N = V[Z]) && ++Z < _; ) ;
238
238
  et._next = N || null;
239
239
  }
240
240
  }
@@ -1115,9 +1115,9 @@ const ni = (function t(e, r, n) {
1115
1115
  ];
1116
1116
  };
1117
1117
  else {
1118
- var Q = Math.sqrt(B), Z = (m * m - s * s + n * B) / (2 * s * r * Q), et = (m * m - s * s - n * B) / (2 * m * r * Q), N = Math.log(Math.sqrt(Z * Z + 1) - Z), $ = Math.log(Math.sqrt(et * et + 1) - et);
1118
+ var K = Math.sqrt(B), Z = (m * m - s * s + n * B) / (2 * s * r * K), et = (m * m - s * s - n * B) / (2 * m * r * K), N = Math.log(Math.sqrt(Z * Z + 1) - Z), $ = Math.log(Math.sqrt(et * et + 1) - et);
1119
1119
  x = ($ - N) / e, V = function(nt) {
1120
- var it = nt * x, A = ar(N), R = s / (r * Q) * (A * ri(e * it + N) - ei(N));
1120
+ var it = nt * x, A = ar(N), R = s / (r * K) * (A * ri(e * it + N) - ei(N));
1121
1121
  return [
1122
1122
  c + R * w,
1123
1123
  l + R * _,
@@ -1819,7 +1819,7 @@ function We() {
1819
1819
  }, x.scaleTo = function(f, b, y, D) {
1820
1820
  x.transform(f, function() {
1821
1821
  var X = e.apply(this, arguments), S = this.__zoom, z = y == null ? et(X) : typeof y == "function" ? y.apply(this, arguments) : y, G = S.invert(z), p = typeof b == "function" ? b.apply(this, arguments) : b;
1822
- return r(Z(Q(S, p), z, G), X, i);
1822
+ return r(Z(K(S, p), z, G), X, i);
1823
1823
  }, y, D);
1824
1824
  }, x.translateBy = function(f, b, y, D) {
1825
1825
  x.transform(f, function() {
@@ -1837,7 +1837,7 @@ function We() {
1837
1837
  ), S, i);
1838
1838
  }, D, X);
1839
1839
  };
1840
- function Q(f, b) {
1840
+ function K(f, b) {
1841
1841
  return b = Math.max(a[0], Math.min(a[1], b)), b === f.k ? f : new Yt(b, f.x, f.y);
1842
1842
  }
1843
1843
  function Z(f, b, y) {
@@ -1907,7 +1907,7 @@ function We() {
1907
1907
  if (D.k === X) return;
1908
1908
  y.mouse = [S, D.invert(S)], fe(this), y.start();
1909
1909
  }
1910
- Wt(f), y.wheel = setTimeout(z, _), y.zoom("mouse", r(Z(Q(D, X), y.mouse[0], y.mouse[1]), y.extent, i));
1910
+ Wt(f), y.wheel = setTimeout(z, _), y.zoom("mouse", r(Z(K(D, X), y.mouse[0], y.mouse[1]), y.extent, i));
1911
1911
  function z() {
1912
1912
  y.wheel = null, y.end();
1913
1913
  }
@@ -1929,7 +1929,7 @@ function We() {
1929
1929
  }
1930
1930
  function R(f, ...b) {
1931
1931
  if (t.apply(this, arguments)) {
1932
- var y = this.__zoom, D = Xt(f.changedTouches ? f.changedTouches[0] : f, this), X = y.invert(D), S = y.k * (f.shiftKey ? 0.5 : 2), z = r(Z(Q(y, S), D, X), e.apply(this, b), i);
1932
+ var y = this.__zoom, D = Xt(f.changedTouches ? f.changedTouches[0] : f, this), X = y.invert(D), S = y.k * (f.shiftKey ? 0.5 : 2), z = r(Z(K(y, S), D, X), e.apply(this, b), i);
1933
1933
  Wt(f), c > 0 ? at(this).transition().duration(c).call(N, z, D, f) : at(this).call(x.transform, z, D, f);
1934
1934
  }
1935
1935
  }
@@ -1950,7 +1950,7 @@ function We() {
1950
1950
  z = D[S], G = Xt(z, this), y.touch0 && y.touch0[2] === z.identifier ? y.touch0[0] = G : y.touch1 && y.touch1[2] === z.identifier && (y.touch1[0] = G);
1951
1951
  if (z = y.that.__zoom, y.touch1) {
1952
1952
  var h = y.touch0[0], C = y.touch0[1], E = y.touch1[0], Y = y.touch1[1], g = (g = E[0] - h[0]) * g + (g = E[1] - h[1]) * g, v = (v = Y[0] - C[0]) * v + (v = Y[1] - C[1]) * v;
1953
- z = Q(z, Math.sqrt(g / v)), G = [(h[0] + E[0]) / 2, (h[1] + E[1]) / 2], p = [(C[0] + Y[0]) / 2, (C[1] + Y[1]) / 2];
1953
+ z = K(z, Math.sqrt(g / v)), G = [(h[0] + E[0]) / 2, (h[1] + E[1]) / 2], p = [(C[0] + Y[0]) / 2, (C[1] + Y[1]) / 2];
1954
1954
  } else if (y.touch0) G = y.touch0[0], p = y.touch0[1];
1955
1955
  else return;
1956
1956
  y.zoom("touch", r(Z(z, G, p), y.extent, i));
@@ -2473,7 +2473,7 @@ function se(t, e, r, n = be) {
2473
2473
  V < N && (V = N);
2474
2474
  }
2475
2475
  }
2476
- const x = Math.abs(c.y - s.y) < 5, Q = (N, $) => {
2476
+ const x = Math.abs(c.y - s.y) < 5, K = (N, $) => {
2477
2477
  const nt = Math.abs(c.y - $), it = Math.abs($ - s.y), A = i === "right" ? c.x + u : c.x - u, R = i === "right" ? s.x - u : s.x + u;
2478
2478
  let U = [], W = $;
2479
2479
  switch (N) {
@@ -2600,11 +2600,11 @@ function se(t, e, r, n = be) {
2600
2600
  let Z;
2601
2601
  B ? Z = x ? ["straight", "3seg"] : ["3seg"] : Z = x ? ["straight", "3seg", "4seg", "5seg", "6seg"] : ["3seg", "4seg", "5seg", "6seg"];
2602
2602
  for (const N of Z) {
2603
- const $ = Q(N, V);
2603
+ const $ = K(N, V);
2604
2604
  if ($)
2605
2605
  return { midY: $.actualMidY, points: $.points };
2606
2606
  }
2607
- const et = Q("6seg", V);
2607
+ const et = K("6seg", V);
2608
2608
  return et ? { midY: et.actualMidY, points: et.points } : void 0;
2609
2609
  }
2610
2610
  function hr(t, e) {
@@ -2632,19 +2632,19 @@ function hr(t, e) {
2632
2632
  }
2633
2633
  function Pa(t, e, r, n = be, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, m, w, _ = !1) {
2634
2634
  var $, nt, it, A;
2635
- const B = m != null && t.edgeIndex === m, V = t.getColor(), x = e.append("g").attr("class", B ? "edge selected" : "edge").attr("id", `edge_${t._gvid}`).attr("data-edge-id", t.edgeIndex !== void 0 ? String(t.edgeIndex) : "").attr("data-is-base", t.isBaseEdge ? "true" : "false").attr("data-color", V), Q = t.getStartPoint(), Z = t.getEndPoint(), et = t.getDirection();
2635
+ const B = m != null && t.edgeIndex === m, V = t.getColor(), x = e.append("g").attr("class", B ? "edge selected" : "edge").attr("id", `edge_${t._gvid}`).attr("data-edge-id", t.edgeIndex !== void 0 ? String(t.edgeIndex) : "").attr("data-is-base", t.isBaseEdge ? "true" : "false").attr("data-color", V), K = t.getStartPoint(), Z = t.getEndPoint(), et = t.getDirection();
2636
2636
  console.log(
2637
2637
  `Edge ${t._gvid}: direction=${et}, isBase=${t.isBaseEdge}, depth=${t.depth}`,
2638
2638
  {
2639
- start: Q,
2639
+ start: K,
2640
2640
  end: Z,
2641
2641
  sourceNode: ($ = t.sourceNode) == null ? void 0 : $.name,
2642
2642
  targetNode: (nt = t.targetNode) == null ? void 0 : nt.name
2643
2643
  }
2644
2644
  );
2645
2645
  const N = n.arrowWidth;
2646
- if (n.arrowHeight, Q && Z && et) {
2647
- const R = { x: Q.x, y: r - Q.y }, U = { x: Z.x, y: r - Z.y }, W = { x: U.x, y: U.y };
2646
+ if (n.arrowHeight, K && Z && et) {
2647
+ const R = { x: K.x, y: r - K.y }, U = { x: Z.x, y: r - Z.y }, W = { x: U.x, y: U.y };
2648
2648
  let P = { x: U.x, y: U.y };
2649
2649
  et === "right" ? P = { x: U.x - N, y: U.y } : et === "left" ? P = { x: U.x + N, y: U.y } : et === "self" && (P = { x: U.x + N, y: U.y });
2650
2650
  let f;
@@ -2739,9 +2739,9 @@ function Pa(t, e, r, n = be, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, m, w, _ =
2739
2739
  if (t.label) {
2740
2740
  let h = "";
2741
2741
  (it = t.edgeContent) != null && it.elems && t.edgeContent.elems.length > 0 && (h = t.edgeContent.elems.map((st) => st.text).join(" ")), h || (h = _a(t.label).map((pt) => pt.length > 20 ? pt.slice(0, 20) + "..." : pt).join(" "));
2742
- const C = h.length > 60 ? h.slice(0, 60) + "..." : h, E = n.labelFontSize, Y = E * 0.6, g = C.length * Y, v = E, L = n.labelPadding, M = 16, F = B ? 16 : 0, q = t.edgeIndex !== void 0, ot = q && t.edgeIndex > a, K = q && t.edgeIndex < i, I = (ot ? M : 0) + (K ? M : 0) + F, k = g + L * 2 + I, O = v + L * 2, j = n.labelCornerRadius, tt = p.y, rt = p.x, J = (st) => at(`g.edge[data-edge-id="${st}"]`), H = 12, T = x.append("g").attr("class", "label-area");
2742
+ const C = h.length > 60 ? h.slice(0, 60) + "..." : h, E = n.labelFontSize, Y = E * 0.6, g = C.length * Y, v = E, L = n.labelPadding, M = 16, F = B ? 16 : 0, q = t.edgeIndex !== void 0, ot = q && t.edgeIndex > a, Q = q && t.edgeIndex < i, I = (ot ? M : 0) + (Q ? M : 0) + F, k = g + L * 2 + I, O = v + L * 2, j = n.labelCornerRadius, tt = p.y, rt = p.x, J = (st) => at(`g.edge[data-edge-id="${st}"]`), H = 12, T = x.append("g").attr("class", "label-area");
2743
2743
  T.append("rect").attr("class", "label-bg").attr("x", rt - k / 2).attr("y", tt - O / 2).attr("width", k).attr("height", O).attr("rx", j).attr("ry", j).attr("fill", "white").attr("stroke", X).attr("stroke-width", 1);
2744
- const lt = rt - k / 2 + M / 2, dt = rt + k / 2 - M / 2 - F, bt = rt + k / 2 - F / 2, ut = rt + (ot ? M / 2 : 0) - (K ? M / 2 : 0) - (B ? F / 2 : 0);
2744
+ const lt = rt - k / 2 + M / 2, dt = rt + k / 2 - M / 2 - F, bt = rt + k / 2 - F / 2, ut = rt + (ot ? M / 2 : 0) - (Q ? M / 2 : 0) - (B ? F / 2 : 0);
2745
2745
  if (q && w && x.style("cursor", "pointer").on("click", function(st) {
2746
2746
  st.stopPropagation(), !B && w(t.edgeIndex);
2747
2747
  }), (A = t.edgeContent) != null && A.elems && t.edgeContent.elems.length > 0) {
@@ -2784,7 +2784,7 @@ function Pa(t, e, r, n = be, o = !0, a = 0, i = 1 / 0, c, l, s, u, d, m, w, _ =
2784
2784
  }
2785
2785
  });
2786
2786
  }
2787
- if (K && t.edgeIndex !== void 0) {
2787
+ if (Q && t.edgeIndex !== void 0) {
2788
2788
  const st = t.edgeIndex + 1, pt = B ? dt : rt + k / 2 - M / 2, Bt = T.append("g").attr("class", "nav-btn-group next-btn-group");
2789
2789
  Bt.append("rect").attr("class", "nav-btn-area next-btn-area").attr("x", rt + k / 2 - M - F).attr("y", tt - O / 2).attr("width", M).attr("height", O).attr("fill", "transparent").attr("rx", j).style("cursor", "pointer").style("pointer-events", "all"), Bt.append("use").attr("class", "nav-icon next-icon").attr("href", "#nav-right").attr("x", pt - H / 2).attr("y", tt - H / 2).attr("width", H).attr("height", H).attr("fill", "#888"), Bt.on("click", function(wt) {
2790
2790
  wt.stopPropagation();
@@ -2847,8 +2847,8 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
2847
2847
  t.innerHTML = "";
2848
2848
  const B = ((G = e.bb) == null ? void 0 : G.split(",").map(Number)) || [0, 0, 1e3, 800];
2849
2849
  let [, , V, x] = B;
2850
- const Q = at(t).append("svg").attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${V} ${x}`).style("background", "white");
2851
- Q.append("defs").html(`
2850
+ const K = at(t).append("svg").attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${V} ${x}`).style("background", "white");
2851
+ K.append("defs").html(`
2852
2852
  <style>
2853
2853
  @keyframes selected-pulse {
2854
2854
  0%, 100% {
@@ -2920,8 +2920,8 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
2920
2920
  <path d="M22.7076 16.7071L12.7076 26.7071C12.6147 26.8 12.5044 26.8737 12.383 26.924C12.2616 26.9743 12.1315 27.0001 12.0001 27.0001C11.8687 27.0001 11.7386 26.9743 11.6172 26.924C11.4958 26.8737 11.3855 26.8 11.2926 26.7071C11.1997 26.6142 11.126 26.5039 11.0757 26.3825C11.0254 26.2611 10.9995 26.131 10.9995 25.9996C10.9995 25.8682 11.0254 25.7381 11.0757 25.6167C11.126 25.4953 11.1997 25.385 11.2926 25.2921L20.5863 15.9996L11.2926 6.70708C11.1049 6.51944 10.9995 6.26494 10.9995 5.99958C10.9995 5.73422 11.1049 5.47972 11.2926 5.29208C11.4802 5.10444 11.7347 4.99902 12.0001 4.99902C12.2654 4.99902 12.5199 5.10444 12.7076 5.29208L22.7076 15.2921C22.8005 15.385 22.8743 15.4952 22.9246 15.6166C22.975 15.738 23.0009 15.8682 23.0009 15.9996C23.0009 16.131 22.975 16.2611 22.9246 16.3825C22.8743 16.5039 22.8005 16.6142 22.7076 16.7071Z"/>
2921
2921
  </symbol>
2922
2922
  `);
2923
- const Z = Q.append("g").attr("id", "graph0");
2924
- l && Q.append("circle").attr("cx", V / 2).attr("cy", x / 2).attr("r", 8).attr("fill", "red").attr("opacity", 0.9).style("pointer-events", "none").attr("class", "debug-center-marker");
2923
+ const Z = K.append("g").attr("id", "graph0");
2924
+ l && K.append("circle").attr("cx", V / 2).attr("cy", x / 2).attr("r", 8).attr("fill", "red").attr("opacity", 0.9).style("pointer-events", "none").attr("class", "debug-center-marker");
2925
2925
  const N = (e.objects || []).map(
2926
2926
  (p) => new jr({
2927
2927
  _gvid: p._gvid,
@@ -3029,21 +3029,21 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
3029
3029
  q.pos = `${Y},${M}`, console.log(
3030
3030
  `Positioned center ${q.name} (virtual: ${q.virtualNode}) at ${q.pos}`
3031
3031
  );
3032
- let K = M + ot / 2;
3032
+ let Q = M + ot / 2;
3033
3033
  for (let I = F - 1; I >= 0; I--) {
3034
3034
  const k = E[I], O = E[I + 1], j = k.getHeightPoints(), tt = k.virtualNode || O.virtualNode ? 0 : g;
3035
- K += tt + j / 2, k.pos = `${Y},${K}`, console.log(
3035
+ Q += tt + j / 2, k.pos = `${Y},${Q}`, console.log(
3036
3036
  `Positioned ${k.name} (virtual: ${k.virtualNode}) at ${k.pos}, spacing: ${tt}`
3037
- ), K += j / 2;
3037
+ ), Q += j / 2;
3038
3038
  }
3039
- K = M - ot / 2;
3039
+ Q = M - ot / 2;
3040
3040
  for (let I = F + 1; I < E.length; I++) {
3041
3041
  const k = E[I], O = E[I - 1], j = k.getHeightPoints(), tt = k.virtualNode || O.virtualNode ? 0 : g;
3042
- K -= tt + j / 2, k.pos = `${Y},${K}`, console.log(
3042
+ Q -= tt + j / 2, k.pos = `${Y},${Q}`, console.log(
3043
3043
  `Positioned ${k.name} (virtual: ${k.virtualNode}) at ${k.pos}, spacing: ${tt}`
3044
- ), K -= j / 2;
3044
+ ), Q -= j / 2;
3045
3045
  }
3046
- }), w !== void 0 && Q.attr("viewBox", `0 0 ${V} ${x}`), R.forEach((p) => {
3046
+ }), w !== void 0 && K.attr("viewBox", `0 0 ${V} ${x}`), R.forEach((p) => {
3047
3047
  p.nodes.forEach((h) => {
3048
3048
  const C = h.getPosition();
3049
3049
  if (!C) return;
@@ -3057,8 +3057,8 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
3057
3057
  console.warn(`Failed to decode node label for ${h.name}:`, J);
3058
3058
  }
3059
3059
  F != null && F.key && M.attr("data-key", F.key);
3060
- const q = l && L, ot = (F == null ? void 0 : F.tags) || [], K = (F == null ? void 0 : F.label) || "", I = (F == null ? void 0 : F.text) || "", k = (F == null ? void 0 : F.color) || "#334155", O = (F == null ? void 0 : F.background) || "white", j = O !== "white", tt = j ? O : "#D5DFEA";
3061
- if ((ot.length > 0 || K.length > 0) && !L) {
3060
+ const q = l && L, ot = (F == null ? void 0 : F.tags) || [], Q = (F == null ? void 0 : F.label) || "", I = (F == null ? void 0 : F.text) || "", k = (F == null ? void 0 : F.color) || "#334155", O = (F == null ? void 0 : F.background) || "white", j = O !== "white", tt = j ? O : "#D5DFEA";
3061
+ if ((ot.length > 0 || Q.length > 0) && !L) {
3062
3062
  const J = v / 2, H = v / 2, T = x - Y - v / 2;
3063
3063
  M.append("rect").attr("x", E - g / 2).attr("y", T).attr("width", g).attr("height", J).attr("rx", 5).attr("ry", 0).attr("fill", j ? O : "#EDF2F7").attr("stroke", tt).attr("stroke-width", 1), j && M.append("line").attr("x1", E - g / 2).attr("y1", T + J).attr("x2", E + g / 2).attr("y2", T + J).attr("stroke", k).attr("stroke-width", 1), M.append("rect").attr("x", E - g / 2).attr("y", T + J).attr("width", g).attr("height", H).attr("rx", 0).attr("ry", 5).attr("fill", O).attr("stroke", tt).attr("stroke-width", 1);
3064
3064
  const lt = M.append("rect").attr("x", E - g / 2 - 4).attr("y", T - 4).attr("width", g + 8).attr("height", v + 8).attr("rx", 5).attr("ry", 5).attr("fill", "none").attr("stroke", "#000000").attr("stroke-width", 2).attr("opacity", 0).style("pointer-events", "none");
@@ -3072,9 +3072,9 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
3072
3072
  if (ot.forEach((wt) => {
3073
3073
  const vt = wt.length * ut + st * 2;
3074
3074
  M.append("rect").attr("x", dt).attr("y", bt - pt / 2).attr("width", vt).attr("height", pt).attr("rx", 5).attr("ry", 5).attr("fill", "#FFF8E1").attr("stroke", "#FFD66D").attr("stroke-width", 1), M.append("text").attr("x", dt + st).attr("y", bt).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-inter), Inter, Helvetica, Arial").attr("font-size", "12px").attr("font-weight", "500").attr("fill", "var(--text-warning-primary, #CD7004)").text(wt), dt += vt + Bt;
3075
- }), K) {
3075
+ }), Q) {
3076
3076
  const wt = E + g / 2 - 8 - dt, xt = M.append("text").attr("x", dt).attr("y", bt).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-inter), Inter, Helvetica, Arial").attr("font-size", "12px").attr("font-weight", "600").attr("fill", k);
3077
- Re(xt, wt, K);
3077
+ Re(xt, wt, Q);
3078
3078
  }
3079
3079
  if (I) {
3080
3080
  const wt = g - 16, xt = M.append("text").attr("x", E - g / 2 + 8).attr("y", T + J + H / 2).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-fira-code), Fira Code, monospace").attr("font-size", "12px").attr("font-weight", "400").attr("fill", k);
@@ -3092,12 +3092,12 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
3092
3092
  }
3093
3093
  if (F)
3094
3094
  if (L) {
3095
- const H = K || I;
3095
+ const H = Q || I;
3096
3096
  M.append("text").attr("x", E).attr("y", x - Y).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("font-family", "Inter, Helvetica, Arial").attr("font-size", "10px").attr("fill", "#991B1B").text(
3097
3097
  H.length > 20 ? H.slice(0, 20) + "..." : H
3098
3098
  );
3099
3099
  } else {
3100
- const H = I || K, T = g - 16, lt = M.append("text").attr("x", E - g / 2 + 8).attr("y", x - Y).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-fira-code), Fira Code, monospace").attr("font-size", "12px").attr("font-weight", "400").attr("fill", k);
3100
+ const H = I || Q, T = g - 16, lt = M.append("text").attr("x", E - g / 2 + 8).attr("y", x - Y).attr("text-anchor", "start").attr("dominant-baseline", "middle").attr("font-family", "var(--font-fira-code), Fira Code, monospace").attr("font-size", "12px").attr("font-weight", "400").attr("fill", k);
3101
3101
  Re(lt, T, H);
3102
3102
  }
3103
3103
  }
@@ -3132,8 +3132,8 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
3132
3132
  if (!M || F < 0) return;
3133
3133
  const q = M.getStartPoint(), ot = M.getEndPoint();
3134
3134
  if (!q || !ot) return;
3135
- const K = x - q.y, I = x - ot.y;
3136
- M.midY = (K + I) / 2;
3135
+ const Q = x - q.y, I = x - ot.y;
3136
+ M.midY = (Q + I) / 2;
3137
3137
  const k = se(
3138
3138
  M,
3139
3139
  x,
@@ -3210,7 +3210,7 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
3210
3210
  const lt = R.get(T);
3211
3211
  lt && ot.push(...lt.nodes);
3212
3212
  }
3213
- const K = ot.map((T) => {
3213
+ const Q = ot.map((T) => {
3214
3214
  const lt = T.getPosition();
3215
3215
  if (!lt) return null;
3216
3216
  const dt = x - lt[1], bt = T.height ? parseFloat(T.height) * 72 : 40;
@@ -3219,13 +3219,13 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
3219
3219
  (T) => T !== null
3220
3220
  ).sort((T, lt) => T.y - lt.y);
3221
3221
  let I;
3222
- if (K.length === 0)
3222
+ if (Q.length === 0)
3223
3223
  I = (Y + g) / 2;
3224
- else if (K.length % 2 === 1)
3225
- I = K[Math.floor(K.length / 2)].bottomY;
3224
+ else if (Q.length % 2 === 1)
3225
+ I = Q[Math.floor(Q.length / 2)].bottomY;
3226
3226
  else {
3227
- const T = K.length / 2;
3228
- I = (K[T - 1].bottomY + K[T].bottomY) / 2;
3227
+ const T = Q.length / 2;
3228
+ I = (Q[T - 1].bottomY + Q[T].bottomY) / 2;
3229
3229
  }
3230
3230
  const k = v.getStartPoint(), O = v.getEndPoint(), tt = (k && O ? x - (k.y + O.y) / 2 : I) < I ? "above" : "below";
3231
3231
  v.baseDirection = tt;
@@ -3253,7 +3253,7 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
3253
3253
  const h = p.transform;
3254
3254
  console.log("zoom event:", { x: h.x, y: h.y, k: h.k, isNaN: isNaN(h.x) || isNaN(h.y) || isNaN(h.k) }), !isNaN(h.x) && !isNaN(h.y) && !isNaN(h.k) && Z.attr("transform", h.toString());
3255
3255
  });
3256
- if (Q.call(S), _ || Q.on("wheel.zoom", null), it.forEach((p) => {
3256
+ if (K.call(S), _ || (K.on("wheel.zoom", null), K.on("dblclick.zoom", null)), it.forEach((p) => {
3257
3257
  if (n != null) {
3258
3258
  if (o) {
3259
3259
  if (p.depth > n) return;
@@ -3268,7 +3268,7 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
3268
3268
  D,
3269
3269
  X,
3270
3270
  S,
3271
- Q,
3271
+ K,
3272
3272
  t,
3273
3273
  V,
3274
3274
  x,
@@ -3286,14 +3286,14 @@ function Na(t, e, r, n, o = !0, a = be, i = !0, c = 14, l = !1, s, u, d, m, w, _
3286
3286
  const z = Z.node();
3287
3287
  if (z) {
3288
3288
  const p = z.getBBox(), h = 0.9 * V / p.width, C = p.x + p.width / 2, E = p.y + p.height / 2, Y = V / 2 - C * h, g = x / 2 - E * h;
3289
- Q.call(
3289
+ K.call(
3290
3290
  S.transform,
3291
3291
  $t.translate(Y, g).scale(h)
3292
3292
  );
3293
3293
  }
3294
3294
  return {
3295
3295
  zoomBehavior: S,
3296
- svgElement: Q.node(),
3296
+ svgElement: K.node(),
3297
3297
  gElement: Z.node(),
3298
3298
  baseFontSize: c,
3299
3299
  viewBoxWidth: V
@@ -3496,7 +3496,7 @@ const Oa = Tr(function({
3496
3496
  nodeWidth: B = 240,
3497
3497
  nodeHeight: V = 64,
3498
3498
  nodeColumnSpacing: x = 800,
3499
- clickPassthrough: Q = !1,
3499
+ clickPassthrough: K = !1,
3500
3500
  enableWheelZoom: Z = !0
3501
3501
  }, et) {
3502
3502
  const N = ft(null), { layout: $, cancel: nt, isLoading: it, error: A } = Sa(), R = ft(null), U = ft(null), W = ft(null), P = ft(14), f = ft(1e3), b = ft(!1), y = ft(null), D = ft(null), X = ft(null), S = ft(null), z = ft(w);
@@ -3541,14 +3541,14 @@ const Oa = Tr(function({
3541
3541
  const ut = W.current.getBBox();
3542
3542
  D.current = { x: ut.x, y: ut.y, width: ut.width, height: ut.height };
3543
3543
  }
3544
- const v = g.x + g.width / 2, L = g.y + g.height / 2, M = p / E, F = 0.9 * E / g.width, q = h * M * F, K = 16 / (h * M), I = h * M * K, k = Math.min(F, K), O = Math.max(F, K), j = Kt(U.current), tt = h * M * j.k;
3544
+ const v = g.x + g.width / 2, L = g.y + g.height / 2, M = p / E, F = 0.9 * E / g.width, q = h * M * F, Q = 16 / (h * M), I = h * M * Q, k = Math.min(F, Q), O = Math.max(F, Q), j = Kt(U.current), tt = h * M * j.k;
3545
3545
  console.log("toggleZoom debug:", {
3546
3546
  currentState: b.current ? "zoomedIn" : "zoomedOut",
3547
3547
  currentScale: j.k,
3548
3548
  currentFontSize: tt,
3549
3549
  overviewScale: F,
3550
3550
  overviewFontSize: q,
3551
- detailScale: K,
3551
+ detailScale: Q,
3552
3552
  detailFontSize: I,
3553
3553
  zoomOutScale: k,
3554
3554
  zoomInScale: O
@@ -3617,20 +3617,24 @@ const Oa = Tr(function({
3617
3617
  V,
3618
3618
  x,
3619
3619
  Z
3620
- ), R.current = Y.zoomBehavior, U.current = Y.svgElement, W.current = Y.gElement, P.current = Y.baseFontSize, f.current = Y.viewBoxWidth, Q && U.current && U.current.addEventListener("click", (g) => {
3621
- const L = document.elementsFromPoint(g.clientX, g.clientY).find((M) => {
3622
- var F;
3623
- return !((F = U.current) != null && F.contains(M)) && M !== U.current;
3620
+ ), R.current = Y.zoomBehavior, U.current = Y.svgElement, W.current = Y.gElement, P.current = Y.baseFontSize, f.current = Y.viewBoxWidth, K && U.current && U.current.addEventListener("click", (g) => {
3621
+ const v = new MouseEvent("click", {
3622
+ bubbles: !0,
3623
+ cancelable: !0,
3624
+ clientX: g.clientX,
3625
+ clientY: g.clientY,
3626
+ view: window
3627
+ }), M = document.elementsFromPoint(g.clientX, g.clientY).find((F) => {
3628
+ var q;
3629
+ return !((q = U.current) != null && q.contains(F)) && F !== U.current;
3624
3630
  });
3625
- if (L) {
3626
- const M = new MouseEvent("click", {
3627
- bubbles: !0,
3628
- cancelable: !0,
3629
- clientX: g.clientX,
3630
- clientY: g.clientY
3631
- });
3632
- L.dispatchEvent(M);
3633
- }
3631
+ M && M.dispatchEvent(v), document.body.dispatchEvent(new MouseEvent("click", {
3632
+ bubbles: !0,
3633
+ cancelable: !0,
3634
+ clientX: g.clientX,
3635
+ clientY: g.clientY,
3636
+ view: window
3637
+ }));
3634
3638
  }), W.current) {
3635
3639
  const g = W.current.getBBox();
3636
3640
  D.current = { x: g.x, y: g.y, width: g.width, height: g.height };
@@ -3672,9 +3676,9 @@ const Oa = Tr(function({
3672
3676
  attributes: !0,
3673
3677
  attributeFilter: ["transform"]
3674
3678
  });
3675
- const K = () => q();
3676
- return window.addEventListener("resize", K), () => {
3677
- ot.disconnect(), window.removeEventListener("resize", K);
3679
+ const Q = () => q();
3680
+ return window.addEventListener("resize", Q), () => {
3681
+ ot.disconnect(), window.removeEventListener("resize", Q);
3678
3682
  };
3679
3683
  }
3680
3684
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quixotic-gol",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",