@graphysdk/react-renderer 1.9.0-beta.1791811201637 → 1.9.0-beta.1791876510484
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/editable.cjs +1 -1
- package/dist/editable.css +1 -1
- package/dist/editable.mjs +2324 -2282
- package/dist/{history-chords-Dhoww4aF.cjs → history-chords-CsbxL8c8.cjs} +2 -2
- package/dist/{history-chords-DQsyAPsK.js → history-chords-D7UfzNjK.js} +46 -43
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +22 -22
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ANNOTATION_TOOLTIP_MARKER_GAP_PX as cs, CachedTextMeasurer as Hn, DATA_LABEL_ROLES as us, DEFAULT_GEOM_COLOR as Wr, DEFAULT_HOVER_AFFORDANCE_COLOR as Gr, DEFAULT_POINT_SIZE_PX as $e, GROUP_VARIABLES as ne, HeuristicTextMeasurer as hs, HoverEngine as vs, InternalError as gs, LayoutCompiler as fs, NAMED_WEIGHTS as ct, POLAR_RIM_LABEL_GAP_PX as ps, POSITION_VARIABLES as ut, RESOLVED_DATA_LABEL_POSITIONS as ms, RESTING_HOVER_STATE as Wt, VISUAL_VARIABLES as Fn, alignUnitFractions as Oo, applyTextTransform as St, areAnchorsEqual as ys, areEditMenuTriggersEqual as As, areEditTargetsEqual as pt, areEndpointsComparable as Dn, arePointerRegionListsEqual as xs, arePredicatesEqual as No, buildAverageLineSymbols as bs, buildBarRectBounds as Ss, buildCalloutHitRegions as ws, buildColumnKey as Vr, buildDataLabelsContent as ks, buildFontString as Es, buildHeadlineItemRows as Ho, buildLayerIntroPlan as Ps, buildObservationsTarget as Rs, buildPointSymbolInBox as Cs, buildPointSymbolPath as Bs, buildPolarBarArcPath as De, buildSliceGroupKey as zr, buildTooltipContent as Is, compositeColor as mr, computeArrow as Ls, computeDifferenceArrow as Ts, computeDirectLabelsLayout as Ms, computeLetterSpacingWidth as Os, computeLineBoxHeight as We, computePanelBorderPaths as Ns, computePanelBorderSizes as Hs, countLayerGeoms as Fs, createAreaPathGenerators as Ur, createDataLabelPlacementResolver as Ds, createLayerYValueFormatter as Ws, createLineFillAreaGenerator as Gs, createLinePathGenerator as Yr, createPinnedNumberValueFormatter as Vs, createSegmentYReader as zs, createStableCellKeyGenerator as Us, createStableKeyGenerator as Se, ensureReadableTextColor as jr, findAnnotation as Ys, findLayerById as Xt, findPointerRegion as Wn, formatHeadline as js, formatLegends as Ks, formatRuleValue as Qs, getAestheticFromScaleAestheticKey as xe, getAlpha as Fo, getAngleExtent as Xs, getBarRectBounds as qt, getBoundingRect as qs, getDifferenceArrowLabelBox as Js, getGroup as ze, getHoverGuideLineProps as Zs, getHoverGuideRectProps as $s, getPaintedTileRect as Kr, getPointSymbolOuterRadius as _s, getPolarHoverGuideArcProps as el, getRadiusExtent as Do, getShapeAnnotationStroke as tl, getSize as rl, getStackRole as nl, getUnionExtent as Wo, getX as q, getXMax as Go, getY as _, getYMax as Jt, isAnnotationMovable as ol, isFullTurnSweep as Qr, isGradientPaint as Vo, isImagePaint as al, isOpaquePaint as il, isPatternPaint as Xr, isPositionScale as Gn, isSafeUrl as qr, orderPointerRegions as sl, paintKey as kr, paintsInDonutHole as ll, pickFilters as dl, pickReadableTextColor as zo, placeCallouts as cl, polarToUnit as ul, positionToAngle as hl, prepareAreaObservations as Jr, prepareLineObservations as Zr, projectAnchorToPanel as xt, projectRegionToPanel as $r, readAnchoredObservation as Uo, readColorGroupObservation as vl, readGeomColor as Zt, readGeomEffects as J, readMainAxis as wt, readPresentedGroupColor as Yo, removeAlpha as gl, resolveArrowAnnotationStyle as fl, resolveArrowColor as pl, resolveBarBorderTreatment as kt, resolveBarCornerRadiiPx as ml, resolveBarCornerRadiusPx as _r, resolveBarPaintOrigin as yl, resolveCalloutAnnotationStyle as Er, resolveChromeMargins as Al, resolveDataLabelStyle as xl, resolveDeferredAnchors as bl, resolveDifferenceArrowAnnotationStyle as jo, resolveDirectLabelStyle as Ko, resolveGraphPadding as Sl, resolveHeadlineItemStyle as Dt, resolveHeadlineNumberStyle as Qo, resolveHeadlinePlacement as wl, resolveLegendItemStyle as $t, resolvePanelBorderStyle as Xo, resolvePolarBarCornerRadiusUnit as kl, resolveRuleLabelStyle as El, resolveSwatchGeomPaint as qo, resolveTooltipStyle as Pl, toFontSpec as te, toPaintColor as V, toPanelCursor as Rl, toPercent as C, toStrokeDasharray as ve, toViewBoxX as Jo, toViewBoxY as Zo, truncateToWidth as $o, withAlpha as Cl } from "@graphysdk/viz-engine";
|
|
2
|
-
import { Fragment as _t, createContext as
|
|
2
|
+
import { Fragment as _t, createContext as j, memo as ge, useCallback as ue, useContext as W, useEffect as G, useId as K, useLayoutEffect as Bl, useMemo as b, useRef as F, useState as Y, useSyncExternalStore as Il } from "react";
|
|
3
3
|
import { Fragment as L, jsx as s, jsxs as S } from "react/jsx-runtime";
|
|
4
4
|
import { useStore as _e } from "zustand";
|
|
5
5
|
import { animate as Pe, motion as z, useMotionValue as ye, useReducedMotion as Ll, useTransform as Ot } from "motion/react";
|
|
@@ -22,12 +22,12 @@ import './history-chords.css';var Vn = Object.defineProperty, Hl = (e, t) => {
|
|
|
22
22
|
});
|
|
23
23
|
return t || Vn(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
24
24
|
};
|
|
25
|
-
typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.reactRenderer = "1.9.0-beta.
|
|
25
|
+
typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.reactRenderer = "1.9.0-beta.1791876510484");
|
|
26
26
|
function Fl(e) {
|
|
27
27
|
for (const t of e) (t.severity === "error" ? console.error : console.warn)(`[graphy] ${t.code}: ${t.message}`, t);
|
|
28
28
|
}
|
|
29
|
-
var ta =
|
|
30
|
-
var ra =
|
|
29
|
+
var ta = j(null), Fy = ta.Provider, Dl = null, tn = () => W(ta) ?? (Dl ??= Ds());
|
|
30
|
+
var ra = j(null), ee = () => {
|
|
31
31
|
const e = W(ra);
|
|
32
32
|
if (!e) throw new Error("useGraph* hooks must be used inside a <GraphProvider>");
|
|
33
33
|
return e;
|
|
@@ -37,7 +37,7 @@ var ra = Y(null), ee = () => {
|
|
|
37
37
|
}, et = (e) => e === "none" ? "none" : `${e.offsetX}px ${e.offsetY}px ${e.blur}px ${e.color}`, Wl = (e) => e === "none" ? "none" : `${e.offsetX}px ${e.offsetY}px ${e.blur}px ${e.color}`, Ue = (e) => {
|
|
38
38
|
if (e !== "none")
|
|
39
39
|
return `drop-shadow(${e.offsetX}px ${e.offsetY}px ${e.blur}px ${e.color})`;
|
|
40
|
-
}, tr =
|
|
40
|
+
}, tr = j(null), zn = [
|
|
41
41
|
"shadow",
|
|
42
42
|
"blendMode",
|
|
43
43
|
"alpha",
|
|
@@ -257,13 +257,16 @@ var ra = Y(null), ee = () => {
|
|
|
257
257
|
"data-testid": "companion-point"
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
|
-
var Un = 10 ** 2,
|
|
260
|
+
var Un = 10 ** 2, U = (e) => Math.round(e * Un) / Un, Dy = (e, t) => {
|
|
261
|
+
const r = U(t), n = U(2 * t), o = `a${r},${r} 0 1,0 ${n},0a${r},${r} 0 1,0 ${-n},0Z`;
|
|
262
|
+
return e.map(({ x: a, y: i }) => `M${U(a - t)},${U(i)}${o}`).join("");
|
|
263
|
+
}, Zl = (e, t, r) => {
|
|
261
264
|
const n = r.axis === "x", o = n ? e.y : e.x, a = n ? e.x : e.y, i = n ? e.height : e.width, l = n ? e.width : e.height, d = Math.max(Math.min(r.from, r.to), a), c = Math.min(Math.max(r.from, r.to), a + l);
|
|
262
265
|
if (c - d <= 0 || i <= 0) return "";
|
|
263
266
|
const u = Math.max(0, Math.min(t, i / 2)), h = Math.max(0, Math.min(t, l / 2)), g = a + h, f = a + l - h, v = o + i, m = n ? 0 : 1, p = (E, T) => {
|
|
264
267
|
const [O, $] = n ? [T, E] : [E, T];
|
|
265
|
-
return `${
|
|
266
|
-
}, [x, A] = (n ? [h, u] : [u, h]).map(
|
|
268
|
+
return `${U(O)},${U($)}`;
|
|
269
|
+
}, [x, A] = (n ? [h, u] : [u, h]).map(U), w = (E, T) => `A${x},${A} 0 0 ${m} ${p(E, T)}`, k = (E) => {
|
|
267
270
|
if (u <= 0 || h <= 0) return 0;
|
|
268
271
|
const T = E < g ? g - E : E > f ? E - f : 0, O = Math.min(1, T / h);
|
|
269
272
|
return u * (1 - Math.sqrt(1 - O * O));
|
|
@@ -320,7 +323,7 @@ var Un = 10 ** 2, j = (e) => Math.round(e * Un) / Un, Dy = (e) => e.map(({ x: t,
|
|
|
320
323
|
centers: n,
|
|
321
324
|
size: r
|
|
322
325
|
}));
|
|
323
|
-
}, sa = (e, t, { origin: r, scaleX: n, scaleY: o }) => `${
|
|
326
|
+
}, sa = (e, t, { origin: r, scaleX: n, scaleY: o }) => `${U(r.x + e * n)},${U(r.y + t * o)}`, _l = ({ layer: e, coordSystem: t, panelRect: r, shouldAnimateTransitions: n }) => {
|
|
324
327
|
const { areaGenerator: o } = Ur(t, e.params), a = {
|
|
325
328
|
origin: {
|
|
326
329
|
x: 0,
|
|
@@ -725,7 +728,7 @@ var Kn = "\0", ga = (e, t) => {
|
|
|
725
728
|
} : null);
|
|
726
729
|
}, r.onerror = () => t(null), r.src = e;
|
|
727
730
|
}), ot = (e) => {
|
|
728
|
-
const t = [...new Set(e.map(Qn).filter((i) => i !== void 0))].join(Kn), [r, n] =
|
|
731
|
+
const t = [...new Set(e.map(Qn).filter((i) => i !== void 0))].join(Kn), [r, n] = Y(() => /* @__PURE__ */ new Map()), o = F(/* @__PURE__ */ new Set()), a = F(/* @__PURE__ */ new Set());
|
|
729
732
|
return G(() => () => {
|
|
730
733
|
o.current = /* @__PURE__ */ new Set();
|
|
731
734
|
}, []), G(() => {
|
|
@@ -960,14 +963,14 @@ var xd = 1 / 3, bd = {
|
|
|
960
963
|
width: Math.max(0, e.width + t * 2),
|
|
961
964
|
height: Math.max(0, e.height + t * 2)
|
|
962
965
|
}), Ie = (e, t) => {
|
|
963
|
-
const r =
|
|
966
|
+
const r = U(e.x), n = U(e.y), o = U(e.x + e.width), a = U(e.y + e.height), i = U(Math.max(0, Math.min(t, e.width / 2))), l = U(Math.max(0, Math.min(t, e.height / 2)));
|
|
964
967
|
if (i <= 0 || l <= 0) return `M${r},${n}H${o}V${a}H${r}Z`;
|
|
965
968
|
const d = `A${i},${l} 0 0 1 `, [c, u, h, g] = [
|
|
966
969
|
`${r}`,
|
|
967
970
|
`${n}`,
|
|
968
971
|
`${o}`,
|
|
969
972
|
`${a}`
|
|
970
|
-
], f = `${
|
|
973
|
+
], f = `${U(r + i)}`, v = `${U(o - i)}`, m = `${U(n + l)}`, p = `${U(a - l)}`;
|
|
971
974
|
return `M${f},${u}H${v}${d}${h},${m}V${p}${d}${v},${g}H${f}${d}${c},${p}V${m}${d}${f},${u}Z`;
|
|
972
975
|
}, Id = ({ observation: e, mainAxis: t, styleReaders: r, column: n, panelRect: o, fill: a }) => {
|
|
973
976
|
const i = K(), l = K(), d = qt(t, e);
|
|
@@ -2221,7 +2224,7 @@ var yr = 3, Yd = ({ layer: e, coordSystem: t, primary: r, panelRect: n }) => {
|
|
|
2221
2224
|
...e === "dark" ? uc : pc,
|
|
2222
2225
|
...r
|
|
2223
2226
|
};
|
|
2224
|
-
}, La = (e, t = {}, r) => ({ fonts: nc(ln(e, t), r) }), mc = Object.freeze(La("light")), Ta =
|
|
2227
|
+
}, La = (e, t = {}, r) => ({ fonts: nc(ln(e, t), r) }), mc = Object.freeze(La("light")), Ta = j(mc), yc = ({ metrics: e, children: t }) => /* @__PURE__ */ s(Ta.Provider, {
|
|
2225
2228
|
value: e,
|
|
2226
2229
|
children: t
|
|
2227
2230
|
}), Ye = () => W(Ta), ir = (e, t, r) => {
|
|
@@ -2300,8 +2303,8 @@ var yr = 3, Yd = ({ layer: e, coordSystem: t, primary: r, panelRect: n }) => {
|
|
|
2300
2303
|
}, Sc = (e) => {
|
|
2301
2304
|
const t = wc();
|
|
2302
2305
|
return t ? (t.style.font = e, t.getBoundingClientRect().width) : null;
|
|
2303
|
-
}, wc = () => typeof document > "u" ? null : (Ee || (Ee = document.createElement("span"), Ee.style.position = "absolute", Ee.style.visibility = "hidden", Ee.style.whiteSpace = "nowrap", Ee.style.left = "-9999px", Ee.textContent = Ma, document.body.appendChild(Ee)), Ee), Na =
|
|
2304
|
-
const [r, n] =
|
|
2306
|
+
}, wc = () => typeof document > "u" ? null : (Ee || (Ee = document.createElement("span"), Ee.style.position = "absolute", Ee.style.visibility = "hidden", Ee.style.whiteSpace = "nowrap", Ee.style.left = "-9999px", Ee.textContent = Ma, document.body.appendChild(Ee)), Ee), Na = j(null), Zn = 3e3, kc = ({ children: e, measurer: t }) => {
|
|
2307
|
+
const [r, n] = Y(null);
|
|
2305
2308
|
G(() => {
|
|
2306
2309
|
if (t !== void 0) return;
|
|
2307
2310
|
let a = !1;
|
|
@@ -2336,7 +2339,7 @@ var yr = 3, Yd = ({ layer: e, coordSystem: t, primary: r, panelRect: n }) => {
|
|
|
2336
2339
|
} catch {
|
|
2337
2340
|
return new Hn(new hs());
|
|
2338
2341
|
}
|
|
2339
|
-
}, Ha =
|
|
2342
|
+
}, Ha = j(null), Uy = Ha.Provider, Pc = null, Ce = () => W(Ha) ?? (Pc ??= Gu()), Rc = 11.7, Cc = 0.75, $n = 21.6, Bc = "0 0 10 18", Ic = "M2.48935 16.9323L9.07098 9.82964C9.51595 9.34944 9.51504 8.60728 9.0689 8.12818L2.48866 1.06172C1.85811 0.384586 0.974477 0 0.049217 0H0V18H0.0443689C0.972463 18 1.85854 17.6131 2.48935 16.9323Z", Lc = "_16vokpr0", Tc = (e, t) => e.mapping.y !== void 0 != (t.mainAxis === "y"), Mc = (e, t) => {
|
|
2340
2343
|
const r = C(e ? 1 - t : t);
|
|
2341
2344
|
return e ? {
|
|
2342
2345
|
x1: "0%",
|
|
@@ -2363,7 +2366,7 @@ var yr = 3, Yd = ({ layer: e, coordSystem: t, primary: r, panelRect: n }) => {
|
|
|
2363
2366
|
}, Nc = (e, t) => Nt(e) && Nt(t) ? `${e}: ${t}` : Nt(e) ? e : Nt(t) ? t : null, Hc = (e) => e ? 14 : 0, Fc = (e, t) => e * Cc - Hc(t) - 10, Dc = (e, t, r) => {
|
|
2364
2367
|
const n = e * r, o = -13 - n, a = r + 13 - n - t;
|
|
2365
2368
|
return a < o ? o : Math.min(Math.max(-t / 2, o), a);
|
|
2366
|
-
}, Nt = (e) => e != null && e.trim() !== "", Fa = Object.freeze({}), dn =
|
|
2369
|
+
}, Nt = (e) => e != null && e.trim() !== "", Fa = Object.freeze({}), dn = j(Fa), Wc = ({ slots: e, children: t }) => /* @__PURE__ */ s(dn.Provider, {
|
|
2367
2370
|
value: e ?? Fa,
|
|
2368
2371
|
children: t
|
|
2369
2372
|
});
|
|
@@ -3780,11 +3783,11 @@ var Vu = [
|
|
|
3780
3783
|
}
|
|
3781
3784
|
o.update(r);
|
|
3782
3785
|
}, [o, r]), o;
|
|
3783
|
-
}, $a =
|
|
3786
|
+
}, $a = j(null), Ku = ({ children: e }) => {
|
|
3784
3787
|
const { layers: t, coordSystem: r } = M(se((l) => ({
|
|
3785
3788
|
layers: l.layers,
|
|
3786
3789
|
coordSystem: l.coordSystem
|
|
3787
|
-
}))), n = ju(t, r), [o] =
|
|
3790
|
+
}))), n = ju(t, r), [o] = Y(() => Uu()), a = F(null), i = F(null);
|
|
3788
3791
|
return i.current === null && (i.current = {
|
|
3789
3792
|
engine: n,
|
|
3790
3793
|
store: o,
|
|
@@ -3826,7 +3829,7 @@ var Xu = ({ hitTest: e, input: t }) => {
|
|
|
3826
3829
|
},
|
|
3827
3830
|
children: o
|
|
3828
3831
|
}), r), $u = ({ rect: e, children: t }) => {
|
|
3829
|
-
const [r] =
|
|
3832
|
+
const [r] = Y(_a);
|
|
3830
3833
|
return /* @__PURE__ */ s(Zu, {
|
|
3831
3834
|
rect: e,
|
|
3832
3835
|
zIndex: gt.panelOverlay,
|
|
@@ -3862,7 +3865,7 @@ var Xu = ({ hitTest: e, input: t }) => {
|
|
|
3862
3865
|
height: 0,
|
|
3863
3866
|
isDefault: !0
|
|
3864
3867
|
}, ei = ({ debounce: e = 0, onResize: t } = {}) => {
|
|
3865
|
-
const [r, n] =
|
|
3868
|
+
const [r, n] = Y(eh), o = F(null), a = _u((c) => {
|
|
3866
3869
|
const u = o.current;
|
|
3867
3870
|
u && u.width === c.width && u.height === c.height || (o.current = {
|
|
3868
3871
|
width: c.width,
|
|
@@ -3885,7 +3888,7 @@ var Xu = ({ hitTest: e, input: t }) => {
|
|
|
3885
3888
|
};
|
|
3886
3889
|
};
|
|
3887
3890
|
function th() {
|
|
3888
|
-
const [e, t] =
|
|
3891
|
+
const [e, t] = Y(null), r = F(null), n = F(null), o = F(null), a = ue(() => {
|
|
3889
3892
|
o.current = null;
|
|
3890
3893
|
const c = n.current;
|
|
3891
3894
|
if (!c) return;
|
|
@@ -4245,7 +4248,7 @@ var nh = ({ render: e, input: t }) => {
|
|
|
4245
4248
|
if (!e) return t;
|
|
4246
4249
|
const r = e.trim().replace("_", "-").toLowerCase();
|
|
4247
4250
|
return Object.keys(gn).find((n) => n.toLowerCase() === r) ?? t;
|
|
4248
|
-
}, ti =
|
|
4251
|
+
}, ti = j(null), bh = [gn], ri = () => wh().translator, Sh = ({ locale: e, children: t, i18nOverrides: r, dictionaries: n = bh }) => {
|
|
4249
4252
|
const o = xh(e), a = b(() => ({
|
|
4250
4253
|
translator: mh({
|
|
4251
4254
|
locale: o,
|
|
@@ -4362,7 +4365,7 @@ var nh = ({ render: e, input: t }) => {
|
|
|
4362
4365
|
if (e.alpha === void 0 || e.alpha >= 1) return e.image;
|
|
4363
4366
|
const r = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${t.width} ${t.height}" preserveAspectRatio="none"><image href="${Rh(e.image)}" width="${t.width}" height="${t.height}" opacity="${e.alpha}" preserveAspectRatio="none"/></svg>`;
|
|
4364
4367
|
return `data:image/svg+xml,${encodeURIComponent(r)}`;
|
|
4365
|
-
}, Rh = (e) => e.replace(/&/gu, "&").replace(/</gu, "<").replace(/>/gu, ">").replace(/"/gu, """), co = (e) => `url("${e.replace(/[\\"]/gu, "\\$&").replace(/[\n\r\f]/gu, (t) => `\\${t.charCodeAt(0).toString(16)} `)}")`, Ch = "bow4tg0", Bh = "bow4tg1", Ih = "bow4tg2", Lh = "bow4tg3", Th = "bow4tg4", oi = "_1ii3bsb0", Mh = "_1ii3bsb1", ai =
|
|
4368
|
+
}, Rh = (e) => e.replace(/&/gu, "&").replace(/</gu, "<").replace(/>/gu, ">").replace(/"/gu, """), co = (e) => `url("${e.replace(/[\\"]/gu, "\\$&").replace(/[\n\r\f]/gu, (t) => `\\${t.charCodeAt(0).toString(16)} `)}")`, Ch = "bow4tg0", Bh = "bow4tg1", Ih = "bow4tg2", Lh = "bow4tg3", Th = "bow4tg4", oi = "_1ii3bsb0", Mh = "_1ii3bsb1", ai = j({
|
|
4366
4369
|
colorScheme: "light",
|
|
4367
4370
|
themeClass: oi,
|
|
4368
4371
|
inlineVarsStyle: {},
|
|
@@ -4533,17 +4536,17 @@ var Yt = {
|
|
|
4533
4536
|
}, $h = {
|
|
4534
4537
|
...Yt,
|
|
4535
4538
|
isWaitingForView: !0
|
|
4536
|
-
}, hr =
|
|
4539
|
+
}, hr = j(Yt), li = 0.4, _h = ({ intro: e, panelRect: t, children: r }) => {
|
|
4537
4540
|
const { layers: n, coordSystem: o, scales: a } = M(se((h) => ({
|
|
4538
4541
|
layers: h.layers,
|
|
4539
4542
|
coordSystem: h.coordSystem,
|
|
4540
4543
|
scales: h.scales
|
|
4541
|
-
}))), [i, l] =
|
|
4544
|
+
}))), [i, l] = Y(() => vo(e) ? $h : go({
|
|
4542
4545
|
layers: n,
|
|
4543
4546
|
coordSystem: o,
|
|
4544
4547
|
scales: a,
|
|
4545
4548
|
intro: e
|
|
4546
|
-
})), [d, c] =
|
|
4549
|
+
})), [d, c] = Y(null), u = tv(d) || !vo(e);
|
|
4547
4550
|
return i.isWaitingForView && u && l(go({
|
|
4548
4551
|
layers: n,
|
|
4549
4552
|
coordSystem: o,
|
|
@@ -4563,7 +4566,7 @@ var Yt = {
|
|
|
4563
4566
|
}, `${t.width}x${t.height}`), r]
|
|
4564
4567
|
});
|
|
4565
4568
|
}, it = () => W(hr).isWaitingForView, ev = () => {
|
|
4566
|
-
const { introEndsAtMs: e } = W(hr), [t] =
|
|
4569
|
+
const { introEndsAtMs: e } = W(hr), [t] = Y(() => nv(e) / 1e3);
|
|
4567
4570
|
return t;
|
|
4568
4571
|
}, di = (e) => {
|
|
4569
4572
|
const { plansByLayerId: t, coordKey: r } = W(hr), n = M((o) => ci(o.coordSystem));
|
|
@@ -4593,7 +4596,7 @@ var Yt = {
|
|
|
4593
4596
|
isWaitingForView: !1
|
|
4594
4597
|
};
|
|
4595
4598
|
}, tv = (e) => {
|
|
4596
|
-
const [t, r] =
|
|
4599
|
+
const [t, r] = Y(!1);
|
|
4597
4600
|
return G(() => {
|
|
4598
4601
|
if (e === null) return;
|
|
4599
4602
|
const n = new IntersectionObserver((o) => {
|
|
@@ -4602,7 +4605,7 @@ var Yt = {
|
|
|
4602
4605
|
return n.observe(e), () => n.disconnect();
|
|
4603
4606
|
}, [e]), t;
|
|
4604
4607
|
}, rv = ({ intersectionRatio: e, intersectionRect: t }) => t.width > 0 && t.height > 0 && e >= li, nv = (e) => Math.max(0, e - performance.now()), ci = (e) => e.type === "cartesian" ? `cartesian-${e.mainAxis}` : e.type, ov = (e) => {
|
|
4605
|
-
const { overlayRef: t } = je(), r = F(null), [n, o] =
|
|
4608
|
+
const { overlayRef: t } = je(), r = F(null), [n, o] = Y(!1), a = Nr(e);
|
|
4606
4609
|
return G(() => {
|
|
4607
4610
|
const i = t.current;
|
|
4608
4611
|
if (!i) return;
|
|
@@ -5031,9 +5034,9 @@ var Yt = {
|
|
|
5031
5034
|
}, Mv = (e) => !e.isVisible || e.ticks.length === 0, Ov = (e) => e.items.length === 0, Nv = () => {
|
|
5032
5035
|
const { formattingLocale: e } = ee(), t = M((r) => r.config.parsingLocale);
|
|
5033
5036
|
return e ?? t;
|
|
5034
|
-
}, po = 0.5, mi =
|
|
5035
|
-
}), Ai =
|
|
5036
|
-
const [t, r] =
|
|
5037
|
+
}, po = 0.5, mi = j(/* @__PURE__ */ new Map()), yi = j(() => {
|
|
5038
|
+
}), Ai = j(/* @__PURE__ */ new Set()), Hv = ({ children: e }) => {
|
|
5039
|
+
const [t, r] = Y(() => /* @__PURE__ */ new Map()), [n] = Y(() => /* @__PURE__ */ new Set()), o = F(/* @__PURE__ */ new Map()), a = ue((i, l, d) => {
|
|
5037
5040
|
const c = o.current.get(i) ?? /* @__PURE__ */ new Set();
|
|
5038
5041
|
if (d !== null) {
|
|
5039
5042
|
c.add(l), o.current.set(i, c), r((u) => Vv(u, i, d));
|
|
@@ -5166,8 +5169,8 @@ var Yt = {
|
|
|
5166
5169
|
editor: t
|
|
5167
5170
|
} }),
|
|
5168
5171
|
setPressedObservation: (t) => e((r) => qv(r.pressedObservation, t) ? r : { pressedObservation: t })
|
|
5169
|
-
})), $v = (e, t) => e === t ? !0 : e === null || t === null ? !1 : pt(e.target, t.target) && e.frameScale === t.frameScale && Mr(e.frame, t.frame) && Or(e.frameSpans, t.frameSpans), xn =
|
|
5170
|
-
const [t] =
|
|
5172
|
+
})), $v = (e, t) => e === t ? !0 : e === null || t === null ? !1 : pt(e.target, t.target) && e.frameScale === t.frameScale && Mr(e.frame, t.frame) && Or(e.frameSpans, t.frameSpans), xn = j(null), _v = Si(), t0 = ({ children: e }) => {
|
|
5173
|
+
const [t] = Y(() => Si());
|
|
5171
5174
|
return /* @__PURE__ */ s(xn.Provider, {
|
|
5172
5175
|
value: t,
|
|
5173
5176
|
children: e
|
|
@@ -5180,7 +5183,7 @@ var Yt = {
|
|
|
5180
5183
|
function Le(e) {
|
|
5181
5184
|
return _e(W(xn) ?? _v, e);
|
|
5182
5185
|
}
|
|
5183
|
-
var wi =
|
|
5186
|
+
var wi = j(null), eg = ({ panelRect: e, children: t }) => {
|
|
5184
5187
|
const r = rg(e);
|
|
5185
5188
|
return /* @__PURE__ */ s(wi.Provider, {
|
|
5186
5189
|
value: r,
|
|
@@ -5339,7 +5342,7 @@ var cg = "vultop2", ug = "vultop3", hg = "vultop4", vg = "vultop5", gg = "vultop
|
|
|
5339
5342
|
})]
|
|
5340
5343
|
})]
|
|
5341
5344
|
});
|
|
5342
|
-
}, Ei =
|
|
5345
|
+
}, Ei = j({
|
|
5343
5346
|
Title: null,
|
|
5344
5347
|
Caption: null,
|
|
5345
5348
|
TextAnnotation: null
|
|
@@ -5728,7 +5731,7 @@ var Qg = ({ segment: e, itemStyle: t }) => {
|
|
|
5728
5731
|
default:
|
|
5729
5732
|
return null;
|
|
5730
5733
|
}
|
|
5731
|
-
}, Hi =
|
|
5734
|
+
}, Hi = j(Re.readonly);
|
|
5732
5735
|
function It() {
|
|
5733
5736
|
return W(Hi);
|
|
5734
5737
|
}
|
|
@@ -5926,7 +5929,7 @@ var Cf = "_1dw9dgx0", xr = "\0", Bf = (e, t) => {
|
|
|
5926
5929
|
}
|
|
5927
5930
|
}), /* @__PURE__ */ s("span", { children: e.formattedLabel })] });
|
|
5928
5931
|
}, zi = (e, t) => e === void 0 ? void 0 : t, xo = { [Oi]: "" }, Mf = ({ hiddenPills: e, placement: t }) => {
|
|
5929
|
-
const r = ri(), [n, o] =
|
|
5932
|
+
const r = ri(), [n, o] = Y(!1), a = N(), i = I($t, a), l = I(vi, a), d = Ne(), c = ot([i.item.fill, l.popover.fill]), u = c(i.item.fill), h = Di(i.item, u), g = Of(e.length, i.item), f = g === null ? void 0 : {
|
|
5930
5933
|
...Fi(i.item, u),
|
|
5931
5934
|
opacity: yf * (i.item.alpha ?? 1)
|
|
5932
5935
|
}, { refs: v, floatingStyles: m } = ea({
|
|
@@ -8203,7 +8206,7 @@ var Vm = 4, zm = ({ renderer: e, layer: t, matchedLayer: r, overlayCandidates: n
|
|
|
8203
8206
|
height: 0
|
|
8204
8207
|
}
|
|
8205
8208
|
}, sy = () => {
|
|
8206
|
-
const [e, t] =
|
|
8209
|
+
const [e, t] = Y(null), [r, n] = Y(null), [o, a] = Y(wr);
|
|
8207
8210
|
return Bl(() => {
|
|
8208
8211
|
const i = () => {
|
|
8209
8212
|
const d = e ? {
|
|
@@ -8324,7 +8327,7 @@ var hy = [], vy = ({ graphChrome: e, isEditable: t, mode: r, style: n, contentRe
|
|
|
8324
8327
|
headlineConfig: de.config.headline,
|
|
8325
8328
|
content: de.config.content,
|
|
8326
8329
|
overflowStrategy: de.config.panel.overflow
|
|
8327
|
-
}))), { intro: A, transitions: w } = dh(r, c), { headerRef: k, footerRef: P, measurements: R } = sy(), { formattingLocale: B, colorScheme: E } = ee(), T = Oe[i], O = T.editorSurface, [$, oe] =
|
|
8330
|
+
}))), { intro: A, transitions: w } = dh(r, c), { headerRef: k, footerRef: P, measurements: R } = sy(), { formattingLocale: B, colorScheme: E } = ee(), T = Oe[i], O = T.editorSurface, [$, oe] = Y(null), Q = Ae("Header", Tg), Be = Ae("Footer", Eg), Zi = Ae("Legend", Xf), $i = Ae("Headline", _g), _i = Ae("EditorSurface", dy), Rn = b(() => Ks({
|
|
8328
8331
|
legends: d,
|
|
8329
8332
|
numberFormat: u,
|
|
8330
8333
|
parsingLocale: h,
|
|
@@ -8588,7 +8591,7 @@ export {
|
|
|
8588
8591
|
Fl as bn,
|
|
8589
8592
|
Re as bt,
|
|
8590
8593
|
Qt as c,
|
|
8591
|
-
|
|
8594
|
+
$l as cn,
|
|
8592
8595
|
Hh as ct,
|
|
8593
8596
|
l0 as d,
|
|
8594
8597
|
tt as dn,
|
|
@@ -8632,7 +8635,7 @@ export {
|
|
|
8632
8635
|
le as rn,
|
|
8633
8636
|
Fv as rt,
|
|
8634
8637
|
Bm as s,
|
|
8635
|
-
|
|
8638
|
+
Dy as sn,
|
|
8636
8639
|
yt as st,
|
|
8637
8640
|
v0 as t,
|
|
8638
8641
|
Ie as tn,
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const a=require("./history-chords-Dhoww4aF.cjs");let g=require("@graphysdk/viz-engine"),l=require("react"),o=require("react/jsx-runtime"),Y=require("zustand"),K=require("motion/react"),z=require("zustand/vanilla"),V=require("clsx");V=a.__toESM(V,1);var pe="_1a5iqpb0",ve="_1a5iqpb1";var fe="_1a5iqpb3",Se="_1a5iqpb4",ye="_1a5iqpb5";var W=({errors:e})=>{const[t,...r]=e;return(0,o.jsxs)("div",{role:"alert",className:pe,children:[(0,o.jsx)("strong",{className:ve,children:"This chart could not be rendered."}),t&&(0,o.jsx)(Q,{diagnostic:t}),r.length>0&&(0,o.jsx)("ul",{className:"_1a5iqpb2",children:r.map((s,n)=>(0,o.jsx)("li",{children:(0,o.jsx)(Q,{diagnostic:s})},`${s.code}-${n}`))})]})},Q=({diagnostic:e})=>(0,o.jsxs)("div",{className:fe,children:[(0,o.jsx)("span",{className:Se,children:e.code}),(0,o.jsx)("p",{className:ye,children:e.message}),e.suggestion&&(0,o.jsx)("p",{className:"_1a5iqpb6",children:e.suggestion})]});function be(e=[],t=[]){return e.length===t.length&&e.every((r,s)=>Object.is(r,t[s]))}var re=class extends l.Component{constructor(...e){super(...e),this.state={caughtDiagnostic:null}}static getDerivedStateFromError(e){return{caughtDiagnostic:(0,g.buildDiagnostic)(e)}}componentDidCatch(e,t){const r=(0,g.buildDiagnostic)(e);a.logDiagnostics([r]),this.props.onError?.([r]),console.error("Chart render component stack:",t.componentStack)}componentDidUpdate(e){this.state.caughtDiagnostic&&!be(e.resetKeys,this.props.resetKeys)&&this.setState({caughtDiagnostic:null})}render(){const{caughtDiagnostic:e}=this.state;if(e)return(0,o.jsx)(W,{errors:[e]});const{forcedErrors:t,children:r}=this.props;return t&&t.length>0?(0,o.jsx)(W,{errors:t}):r}},se={},ne=(0,l.createContext)(se),M=({shapes:e=se,children:t})=>(0,o.jsx)(ne.Provider,{value:e,children:t}),U=()=>(0,l.useContext)(ne),oe=e=>typeof e=="object"&&"geom"in e&&"render"in e,ae=e=>{const t=(0,g.resolveDefinition)(e);return t instanceof g.Geom?t:null},ie=(e,t)=>{const r=e.filter(s=>Ee(s,t));return r.length===e.length?e:r},Ee=(e,t)=>e.kind==="annotation"?(0,g.findAnnotation)(t.annotations,e.id)!==null:e.kind==="observations"||e.kind==="layer"&&e.layerId!==void 0?(0,g.findLayerById)(t.layers,e.layerId)!==void 0:!0,J=[],Te=()=>(0,z.createStore)(e=>({selection:J,setSelection:t=>e(r=>xe(r.selection,t)?r:{selection:t}),clearSelection:()=>e(t=>t.selection.length===0?t:{selection:J})})),xe=(e,t)=>e===t?!0:e.length!==t.length?!1:e.every((r,s)=>{const n=t[s];return n!==void 0&&(0,g.areEditTargetsEqual)(r,n)}),Ge=process.env.NODE_ENV!=="production",Re=5,Ce=e=>{if(!Ge)return{emit:()=>{},subscribe:()=>Ne,getLastTrigger:()=>null,getLastCompile:()=>null,getCacheStats:()=>e.getCacheStats()};const t=new Set;let r=null;return{emit:s=>{const n=e.getLastCompile();if(n){r=s;for(const d of t)d(s,n)}},subscribe:s=>(t.add(s),()=>{t.delete(s)}),getLastTrigger:()=>r,getLastCompile:()=>e.getLastCompile(),getCacheStats:()=>e.getCacheStats()}},je=()=>(0,z.createStore)(e=>({lastCompile:null,history:[],nextId:1,lastSnapshot:null,recordCompile:(t,r)=>e(s=>{if(s.lastSnapshot===r)return s;const n={id:s.nextId,label:De(t),stages:r.stages,stageDurationsMs:r.stageDurationsMs,durationMs:r.durationMs};return{lastCompile:n,history:Pe(s.history,n,Re),nextId:s.nextId+1,lastSnapshot:r}})})),Ne=()=>{},De=e=>{switch(e.kind){case"init":return"init";case"spec":return"spec change";case"data":return"data change";case"command":return e.command.metadata.description}},Pe=(e,t,r)=>{const s=e.length>=r?e.length-(r-1):0;return[...e.slice(s),t]};function _e(e,t){let r;return e.layers.flatMap((s,n)=>a.isOverlayHosted(t(s.geom,e.coordSystem.type))?He(s)?(r??=(0,g.createStyleResolver)().readers(e),Ae(s,r.geom(s))?[{kind:"user-input",severity:"warning",code:"INVALID_STYLE_RULE",message:`Style 'overlay' is not supported on portal-rendered geom '${s.geom}' (layer '${s.id}'); it is ignored.`,context:{param:"overlay",layerIndex:n,requested:s.geom},suggestion:"Remove the geom overlay or use a renderer that paints inside the panel SVG."}]:[]):[]:[])}function Z(e){const t=e.filter(oe),r=new Set([...Object.keys(a.BUILT_IN_GEOM_RENDERERS),...t.map(u=>u.geom)]),s=[],n=new Set;for(const u of e){const h=ae(u);h===null||r.has(h.type)||n.has(h.type)||(n.add(h.type),s.push({kind:"user-input",severity:"error",code:"MISSING_GEOM_RENDERER",message:`Custom geom '${h.type}' is registered but has no renderer.`,context:{requested:h.type,kind:"geom-renderer"},suggestion:`Add a render half for it: \`defineGeomRenderer(${h.type}Geom, { coord, render })\`, then include it in \`plugins\`.`}))}const d=new Map;for(const u of t){if("definition"in u)continue;const h=`${u.geom}|${u.coord}`,v=d.get(h);v?v.count+=1:d.set(h,{geom:u.geom,coord:u.coord,count:1})}const c=[];for(const{geom:u,coord:h,count:v}of d.values())v<2||c.push({kind:"user-input",severity:"warning",code:"DUPLICATE_REGISTERED_TYPE",message:`Multiple render-only overrides register ('${u}', '${h}') (${v} entries); the last in the array wins.`,context:{requested:`${u}@${h}`,kind:"geom-renderer"},suggestion:`Keep a single render-only override for ('${u}', '${h}').`});return c.push(...Oe(e)),{errors:s,warnings:c}}function Ie(e,t){const{coordSystem:r,layers:s}=e,n=new Set,d=[];for(const c of s)t(c.geom,r.type)!==null||n.has(c.geom)||(n.add(c.geom),d.push({kind:"user-input",severity:"warning",code:"MISSING_GEOM_RENDERER",message:`No renderer for geom '${c.geom}' under ${r.type} coords; the layer is not painted.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:`Register a renderer for ('${c.geom}', '${r.type}') via \`defineGeomRenderer\`.`}));return d}function ke(e,t){const{coordSystem:r,layers:s}=e,n=new Set,d=[];for(const c of s){if(c.interactive===!1||c.spatialKind!=="render-hit-test"||n.has(c.geom))continue;const u=t(c.geom,r.type);u===null||u.hitTest||a.isOverlayHosted(u)||(n.add(c.geom),d.push({kind:"user-input",severity:"warning",code:"MISSING_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:`Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${c.geom}', '${r.type}').`}))}return d}function qe(e){const t=new Set,r=[];for(const s of e.layers){const n=s.identityKey;s.interactive!==!1&&(s.spatialKind!=="render-hit-test"||typeof n!="object"||t.has(s.geom)||s.data.hasVariable(n.variable)||(t.add(s.geom),r.push({kind:"user-input",severity:"warning",code:"RENDER_HIT_TEST_IDENTITY",message:`Geom '${s.geom}' keys its identity on '${n.variable}', a column its compile output does not emit; its hover lookup is empty.`,context:{requested:s.geom,kind:"geom-renderer"},suggestion:`Emit the '${n.variable}' column from the geom's \`compile()\`, or point \`identityKey\` at a column it does emit.`})))}return r}function Le(e,t){const{coordSystem:r,layers:s}=e,n=new Set,d=[];for(const c of s){if(c.interactive===!1||c.spatialKind!=="render-hit-test"||n.has(c.geom))continue;const u=t(c.geom,r.type);u===null||!u.hitTest||!a.isOverlayHosted(u)||(n.add(c.geom),d.push({kind:"user-input",severity:"warning",code:"CONFLICTING_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares both a \`hitTest\` factory and an overlay render; these are alternatives, so only the overlay is used.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:"Keep one: a `hitTest` factory for precomputed geometry, OR an overlay render (`{ fn, options: { overlay: true } }`) for a live simulation."}))}return d}function we(e,t){const r=new Set,s=[];for(const n of e.layers)n.interactive!==!1&&(n.spatialKind!=="render-hit-test"||r.has(n.geom)||t.hasCapability(n.geom)||(r.add(n.geom),s.push({kind:"user-input",severity:"warning",code:"MISSING_ANCHOR_CAPABILITY",message:`Geom '${n.geom}' declares no \`resolveAnchorPosition\`; its observations cannot be annotated, so the editor overlay paints no creation trigger on them.`,context:{requested:n.geom,kind:"geom-renderer"},suggestion:"Implement `resolveAnchorPosition(observation, context)` on the geom, returning the normalised panel position an annotation on that observation belongs at."})));return s}function Me(e,t){const{coordSystem:r,layers:s}=e,n=new Set,d=[];for(const c of s){if(c.interactive===!1||c.spatialKind==="render-hit-test"||n.has(c.geom))continue;const u=t(c.geom,r.type);u===null||!a.isOverlayHosted(u)||(n.add(c.geom),d.push({kind:"user-input",severity:"warning",code:"OVERLAY_REQUIRES_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares an overlay render but its layer's spatialKind is '${c.spatialKind}', not 'render-hit-test'; the overlay's push-path hover resolves to nothing.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:"Have the geom's manifest yield spatialKind 'render-hit-test' so the scene layer carries the `byKey` index the overlay's `pushHover` resolves against."}))}return d}var He=e=>[e.styles.defaults,e.styles.overrides].some(t=>t.some(r=>(r.declarations.overlay?.length??0)>0)),Ae=(e,t)=>{const[r]=e.data;if(r===void 0)return!1;if((t.get("overlay",r)?.length??0)>0)return!0;for(const s of e.data)if((t.get("overlay",s,"hovered")?.length??0)>0)return!0;return!1};function Oe(e){const t=new Set,r=[];for(const s of e){const n=ae(s);n===null||t.has(n.type)||n.dataLabelCoordTypes.length===0||n.getDataLabelPlacements!==void 0||(t.add(n.type),r.push({kind:"user-input",severity:"warning",code:"MISSING_DATA_LABEL_PLACEMENT",message:`Geom '${n.type}' declares \`dataLabelCoordTypes\` but implements no \`getDataLabelPlacements\`; its layers paint no data labels.`,context:{requested:n.type,kind:"geom-renderer"},suggestion:"Implement `getDataLabelPlacements(context)` on the geom, or drop `dataLabelCoordTypes` so the compiler warns the author off the flag."}))}return r}var $e=e=>(0,z.createStore)(t=>({scene:e,setScene:r=>t(s=>s.scene===r?s:{scene:r})})),Be=({spec:e,data:t,customPalettes:r,colorScheme:s,plugins:n,theme:d,resolveRenderer:c,anchorResolver:u,onSpecChange:h,onError:v,onWarnings:_})=>{const N=a.useLatestRef(h),T=a.useLatestRef(v),x=a.useLatestRef(_),[{session:m,compileBus:f}]=(0,l.useState)(()=>{const i=(0,g.createCompiler)({plugins:n,theme:d});return{session:new g.GraphCompilationSession(i),compileBus:Ce(i)}}),[S]=(0,l.useState)(()=>{const i=Z(n??[]),p=Z(d?.plugins??[]);return{errors:[...p.errors,...i.errors],warnings:[...p.warnings,...i.warnings]}}),P=(0,l.useRef)(null),[y]=(0,l.useState)(Ke),R=(0,l.useRef)(null),D=(0,l.useCallback)(i=>S.errors.length===0?i:[...S.errors,...i??[]],[S]),G=(0,l.useCallback)(i=>{if(!i.ok)return i.errors;if(R.current)R.current.getState().setScene(i.scene);else{const p=$e(i.scene);p.subscribe(y.notify),R.current=p,y.notify()}return null},[y]),[H,k]=(0,l.useState)(()=>{const i=m.compile({spec:e,data:t,customPalettes:r,colorScheme:s});return P.current=i,D(G(i))}),E=(0,l.useCallback)(i=>i.ok?[...i.warnings,...Ie(i.scene,c),...ke(i.scene,c),...qe(i.scene),...Le(i.scene,c),...Me(i.scene,c),..._e(i.scene,c),...we(i.scene,u)]:i.warnings,[c,u]),C=(0,l.useCallback)(i=>{i.length!==0&&(a.logDiagnostics(i),T.current?.(i))},[T]),j=(0,l.useCallback)(i=>{i.length!==0&&(a.logDiagnostics(i),x.current?.(i))},[x]);(0,l.useEffect)(()=>{const i=P.current;i&&(C([...S.errors,...i.ok?[]:i.errors]),j([...S.warnings,...E(i)]),i.ok&&f.emit({kind:"init"}))},[f,C,j,S,E]),(0,l.useEffect)(()=>{const i=m.update({spec:e,data:t,customPalettes:r,colorScheme:s});if(!i)return;i.committedSpec&&N.current?.(i.committedSpec);const p=G(i.result);k(D(p)),p&&C(p),j(E(i.result)),p||f.emit({kind:i.specChanged?"spec":"data"})},[e,t,r,s,m,f,G,C,j,D,E,N]);const q=(0,l.useCallback)(i=>{k(p=>p===null?p:D(null)),j(E(i))},[D,j,E]),A=(0,l.useCallback)(i=>{i.scene&&R.current?.getState().setScene(i.scene),i.result&&q(i.result),i.command&&f.emit({kind:"command",command:i.command}),i.spec&&N.current?.(i.spec),i.errors&&C([...i.errors])},[q,f,N,C]),b=(0,l.useCallback)(i=>{for(const p of i)A(p);return i.some(p=>!!p.scene)},[A]),O=(0,l.useCallback)((i,p)=>{b(m.applyCommand(i,p))},[m,b]),I=(0,l.useCallback)(()=>{b(m.commit())},[m,b]),$=(0,l.useCallback)(()=>b(m.undo()),[m,b]),L=(0,l.useCallback)(()=>b(m.redo()),[m,b]),F=(0,l.useMemo)(()=>({stack:m.history,undo:$,redo:L}),[m,$,L]),ge=(0,l.useCallback)(()=>R.current?.getState().scene??null,[]);return{store:R.current,dispatch:O,commit:I,history:F,subscribe:y.subscribe,getScene:ge,compileBus:f,compileErrors:H}},Ke=()=>{const e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),notify:()=>e.forEach(t=>t())}},ce=({data:e,spec:t,plugins:r=[],theme:s,formattingLocale:n,handleRef:d,onSpecChange:c,onError:u,onWarnings:h,customPalettes:v,colorScheme:_="light",children:N})=>{const[T]=(0,l.useState)(()=>s),x=T?.colorScheme??_,[m]=(0,l.useState)(()=>a.createGeomRendererResolver([...T?.plugins??[],...r].filter(oe))),f=(0,l.useId)(),[S]=(0,l.useState)(()=>(0,g.createAnchorResolver)(r)),[P]=(0,l.useState)(()=>(0,g.createDataLabelPlacementResolver)(r)),[y]=(0,l.useState)(()=>Te()),[R]=(0,l.useState)(()=>a.createTargetBoundaryStore()),D=(0,l.useMemo)(()=>(0,g.createStyleResolver)({colorScheme:x}),[x]),{store:G,dispatch:H,commit:k,history:E,subscribe:C,getScene:j,compileBus:q,compileErrors:A}=Be({spec:t,data:e,customPalettes:v,colorScheme:x,plugins:r,theme:T,resolveRenderer:m,anchorResolver:S,onSpecChange:c,onError:u,onWarnings:h});(0,l.useEffect)(()=>{if(G)return G.subscribe((I,$)=>{if(I.scene.spec===$.scene.spec)return;const{selection:L,setSelection:F}=y.getState();L.length!==0&&F(ie(L,I.scene.spec))})},[G,y]);const b=(0,l.useMemo)(()=>({dispatch:H,commit:k}),[H,k]);(0,l.useImperativeHandle)(d,()=>({commands:b,undo:E.undo,redo:E.redo,subscribe:C,getScene:j,getSelection:()=>y.getState().selection,setSelection:I=>y.getState().setSelection(I),subscribeSelection:y.subscribe,canPlaceDataLabels:P.hasCapability,canFormatDataLabelsAsPercentages:P.hasPercentageFormat}),[b,E,C,j,y,P]);const O=(0,l.useMemo)(()=>G?{chartId:f,store:G,selectionStore:y,targetBoundaryStore:R,commands:b,history:E,formattingLocale:n,compileBus:q,colorScheme:x,styleResolver:D,anchorResolver:S}:null,[f,G,y,R,b,E,n,q,x,D,S]);return(0,o.jsx)(re,{forcedErrors:A,onError:u,resetKeys:[t,e],children:O?(0,o.jsx)(a.GraphContext.Provider,{value:O,children:(0,o.jsx)(a.GeomRendererResolverProvider,{value:m,children:(0,o.jsx)(a.DataLabelPlacementResolverProvider,{value:P,children:(0,o.jsx)(M,{shapes:T?.shapes,children:N})})})}):null})};function Ue({theme:e,...t}={}){const r=(0,g.createSpecBuilder)(t);return{...r,GraphProvider:n=>(0,o.jsx)(ce,{...n,plugins:r.plugins,theme:e})}}var le=({shouldAnimateTransitions:e,cx:t,cy:r,r:s,...n})=>e?(0,o.jsx)(K.motion.circle,{initial:!1,animate:{cx:t,cy:r,r:s},transition:a.DEFAULT_SPRING_TRANSITION,...n}):(0,o.jsx)("circle",{cx:t,cy:r,r:s,...n}),de=({shouldAnimateTransitions:e,x1:t,y1:r,x2:s,y2:n,...d})=>e?(0,o.jsx)(K.motion.line,{initial:!1,animate:{x1:t,y1:r,x2:s,y2:n},transition:a.DEFAULT_SPRING_TRANSITION,...d}):(0,o.jsx)("line",{x1:t,y1:r,x2:s,y2:n,...d}),ue=({shouldAnimateTransitions:e,x:t,y:r,width:s,height:n,...d})=>e?(0,o.jsx)(K.motion.rect,{initial:!1,animate:{attrX:t,attrY:r,width:s,height:n},transition:a.DEFAULT_SPRING_TRANSITION,...d}):(0,o.jsx)("rect",{x:t,y:r,width:s,height:n,...d}),me=({shouldAnimateTransitions:e,d:t,source:r,...s})=>e?(0,o.jsx)(ze,{d:t,source:r,...s}):(0,o.jsx)("path",{d:t,...s}),Fe=e=>{const{Circle:t}=U();return t===void 0?le(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},Ye=e=>{const{Line:t}=U();return t===void 0?de(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},Ve=e=>{const{Rect:t}=U();return t===void 0?ue(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},We=e=>{const{Path:t}=U();return t===void 0?me(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},ze=({d:e,source:t,...r})=>{const s=a.useSvgPathMorph(e,a.DEFAULT_SPRING_TRANSITION,t);return(0,o.jsx)(K.motion.path,{d:s,...r})},Xe=({children:e,...t})=>(0,o.jsx)("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%",pointerEvents:"none",...t,children:e}),Qe=({box:e,children:t})=>(0,o.jsx)("svg",{x:(0,g.toPercent)(e.x0),y:(0,g.toPercent)(e.y0),width:(0,g.toPercent)(e.x1-e.x0),height:(0,g.toPercent)(e.y1-e.y0),overflow:"hidden",pointerEvents:"none",children:t}),Je="drqe3u0",Ze="drqe3u1",et="drqe3u2",tt="drqe3u3",w="drqe3u4",rt="drqe3u5",st="drqe3u6",nt="drqe3u7",B="drqe3u8",ot="drqe3u9",at="drqe3ua";var it="drqe3uc",ct="drqe3ud",lt="drqe3ue",dt="drqe3uf";var ut="drqe3uh",mt="drqe3ui",ee={enabled:"drqe3uk drqe3uj",disabled:"drqe3ul drqe3uj"},te={ran:"drqe3un drqe3um",dim:"drqe3uo drqe3um"},he={ran:"drqe3uq drqe3up",cached:"drqe3ur drqe3up",untouched:"drqe3us drqe3up"},ht=({width:e=440,style:t,className:r}={})=>{const{compileBus:s}=a.useGraphContext(),[n]=(0,l.useState)(()=>je()),[d,c]=(0,l.useState)(!1),[u,h]=(0,l.useState)(g.isCompilerCachingEnabled);(0,l.useEffect)(()=>{const{recordCompile:m}=n.getState(),f=s.getLastTrigger(),S=s.getLastCompile();return f&&S&&m(f,S),s.subscribe(m)},[n,s]);const v=(0,Y.useStore)(n,m=>m.lastCompile),_=(0,Y.useStore)(n,m=>m.history),N=s.getCacheStats(),T=v===null&&_.length===0,x=()=>{h(m=>{const f=!m;return(0,g.setCompilerCachingEnabled)(f),f})};return(0,o.jsxs)("div",{className:(0,V.default)(at,r),style:{width:e,...t},children:[(0,o.jsxs)("div",{className:Je,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:Ze,children:"compile cache"}),(0,o.jsx)("div",{className:lt,children:T?"production: stats disabled":v?`last: ${v.label} · ${X(v.durationMs)}`:"awaiting first compile…"})]}),(0,o.jsx)("button",{type:"button",onClick:()=>c(m=>!m),className:dt,children:d?"▾":"▴"})]}),!d&&(0,o.jsxs)("div",{className:"drqe3ub",children:[(0,o.jsxs)("button",{type:"button",onClick:x,className:u?ee.enabled:ee.disabled,"aria-pressed":u,children:["cache ",u?"enabled":"disabled"]}),(0,o.jsx)("span",{className:"drqe3ug",children:"next compile reflects this toggle"})]}),!d&&!T&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(gt,{delta:v?.stages,durations:v?.stageDurationsMs,cumulative:N}),(0,o.jsx)(pt,{entries:_})]})]})},gt=({delta:e,durations:t,cumulative:r})=>(0,o.jsxs)("table",{className:et,children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{className:ut,children:[(0,o.jsx)("th",{className:tt,children:"stage"}),(0,o.jsx)("th",{className:w,children:"time"}),(0,o.jsx)("th",{className:w,children:"Δ miss"}),(0,o.jsx)("th",{className:w,children:"Δ hit"}),(0,o.jsx)("th",{className:w,children:"total miss"}),(0,o.jsx)("th",{className:w,children:"total hit"})]})}),(0,o.jsx)("tbody",{children:g.COMPILER_STAGE_KEYS.map(s=>{const n=e?.[s],d=vt(n);return(0,o.jsxs)("tr",{className:it,children:[(0,o.jsxs)("td",{className:rt,children:[(0,o.jsx)("span",{className:he[d],"aria-hidden":!0})," ",s]}),(0,o.jsx)("td",{className:B,children:t===void 0||d==="untouched"?"—":X(t[s])}),(0,o.jsx)("td",{className:d==="ran"?te.ran:te.dim,children:n?.misses??0}),(0,o.jsx)("td",{className:B,children:n?.hits??0}),(0,o.jsx)("td",{className:B,children:r[s].misses}),(0,o.jsx)("td",{className:B,children:r[s].hits})]},s)})})]}),pt=({entries:e})=>e.length===0?null:(0,o.jsxs)("div",{className:ct,children:[(0,o.jsx)("div",{className:mt,children:"recent compiles"}),e.map(t=>{const r=ft(t.stages,d=>d.misses>0),s=g.COMPILER_STAGE_KEYS.length,n=r===0?"cached":"ran";return(0,o.jsxs)("div",{className:st,children:[(0,o.jsx)("span",{className:he[n],"aria-hidden":!0}),(0,o.jsx)("span",{className:nt,title:t.label,children:t.label}),(0,o.jsxs)("span",{className:ot,children:[r,"/",s," ran · ",X(t.durationMs)]})]},t.id)})]}),vt=e=>!e||e.hits===0&&e.misses===0?"untouched":e.misses>0?"ran":"cached",ft=(e,t)=>{let r=0;for(const s of g.COMPILER_STAGE_KEYS)t(e[s])&&(r+=1);return r},X=e=>e<.1?"<0.1ms":e>=10?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`,St=()=>{const{history:e}=a.useGraphContext(),{stack:t,undo:r,redo:s}=e,n=(0,l.useCallback)(u=>t.subscribe(u),[t]),d=(0,l.useCallback)(()=>t.getSnapshot(),[t]),c=(0,l.useSyncExternalStore)(n,d,d);return(0,l.useMemo)(()=>({...c,undo:r,redo:s}),[c,r,s])},yt=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),bt=(e,t={})=>{const{target:r,enabled:s=!0}=t;(0,l.useEffect)(()=>{const n=Et(r);if(!s||!n)return;const d=c=>{if(!Tt(c)||c.defaultPrevented||xt(c.target))return;const u=a.resolveHistoryStep(c);if(!u)return;const h=e.current;h&&(u==="undo"?h.undo():h.redo())&&c.preventDefault()};return n.addEventListener("keydown",d),()=>n.removeEventListener("keydown",d)},[e,r,s])},Et=e=>e===void 0?window:e!==null&&"current"in e?e.current:e,Tt=e=>"key"in e,xt=e=>e instanceof HTMLInputElement?!yt.has(e.type):e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA":!1,Gt=()=>{const{targetBoundaryStore:e}=a.useGraphContext();return(0,Y.useStore)(e,t=>t.boundary)};exports.BrandMark=a.BrandMark;exports.CanvasTextMeasurer=a.CanvasTextMeasurer;exports.DefaultFooter=a.DefaultFooter;exports.DefaultGeomCircle=le;exports.DefaultGeomLine=de;exports.DefaultGeomPath=me;exports.DefaultGeomRect=ue;exports.DefaultGrid=a.DefaultGrid;exports.DefaultHeader=a.DefaultHeader;exports.DefaultSwatch=a.DefaultSwatch;exports.DefaultTooltip=a.DefaultTooltip;exports.DevToolsPanel=ht;exports.GRAPH_MODES=a.GRAPH_MODES;exports.GeomCircle=Fe;exports.GeomLine=Ye;exports.GeomPath=We;exports.GeomRect=Ve;exports.GraphErrorBoundary=re;exports.GraphErrorPanel=W;exports.GraphProvider=ce;exports.GraphRenderer=a.GraphRenderer;exports.HoverProvider=a.HoverProvider;exports.IntroFade=a.IntroFade;exports.IntroWipeClip=a.IntroWipeClip;exports.TextMeasurerProvider=a.TextMeasurerProvider;exports.ThemeProvider=a.ThemeProvider;exports.UnitBoxSvg=Qe;exports.UnitSpaceSvg=Xe;exports.buildDotsEditOutlineShapes=a.buildDotsEditOutlineShapes;exports.createGraphyKit=Ue;exports.darkTheme=a.darkTheme;exports.defineGeomRenderer=a.defineGeomRenderer;exports.lightTheme=a.lightTheme;exports.lightenCss=a.lightenCss;exports.projectPointCartesian=a.projectPointCartesian;exports.pruneSelection=ie;exports.resolveBrandMarkVisual=a.resolveBrandMarkVisual;exports.scalePointToPanel=a.scalePointToPanel;exports.stampAxisEditTarget=a.stampAxisEditTarget;exports.stampGridEditTarget=a.stampGridEditTarget;exports.stampLegendEditTarget=a.stampLegendEditTarget;exports.useElementScreenRect=a.useElementScreenRect;exports.useGeomHitTest=a.useGeomHitTest;exports.useGeomHover=a.useGeomHover;exports.useGeomReaderTree=a.useGeomReaderTree;exports.useGeomStyleReader=a.useGeomStyleReader;exports.useGraphCommands=a.useGraphCommands;exports.useGraphHandle=a.useGraphHandle;exports.useGraphHistory=St;exports.useGraphHistoryShortcuts=bt;exports.useGraphLocale=a.useGraphLocale;exports.useGraphSelection=a.useGraphSelection;exports.useGuidesTakePress=a.useGuidesTakePress;exports.useHandleScene=a.useHandleScene;exports.useHoverState=a.useHoverState;exports.usePaintDefs=a.usePaintDefs;exports.useResolvedStyle=a.useResolvedStyle;exports.useSceneSelector=a.useSceneSelector;exports.useStyleReaderTree=a.useStyleReaderTree;exports.useStyleResolver=a.useStyleResolver;exports.useTargetBoundary=Gt;exports.useTextMeasurer=a.useTextMeasurer;exports.vars=a.vars;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const a=require("./history-chords-CsbxL8c8.cjs");let g=require("@graphysdk/viz-engine"),l=require("react"),o=require("react/jsx-runtime"),Y=require("zustand"),K=require("motion/react"),z=require("zustand/vanilla"),V=require("clsx");V=a.__toESM(V,1);var pe="_1a5iqpb0",ve="_1a5iqpb1";var fe="_1a5iqpb3",Se="_1a5iqpb4",ye="_1a5iqpb5";var W=({errors:e})=>{const[t,...r]=e;return(0,o.jsxs)("div",{role:"alert",className:pe,children:[(0,o.jsx)("strong",{className:ve,children:"This chart could not be rendered."}),t&&(0,o.jsx)(Q,{diagnostic:t}),r.length>0&&(0,o.jsx)("ul",{className:"_1a5iqpb2",children:r.map((s,n)=>(0,o.jsx)("li",{children:(0,o.jsx)(Q,{diagnostic:s})},`${s.code}-${n}`))})]})},Q=({diagnostic:e})=>(0,o.jsxs)("div",{className:fe,children:[(0,o.jsx)("span",{className:Se,children:e.code}),(0,o.jsx)("p",{className:ye,children:e.message}),e.suggestion&&(0,o.jsx)("p",{className:"_1a5iqpb6",children:e.suggestion})]});function be(e=[],t=[]){return e.length===t.length&&e.every((r,s)=>Object.is(r,t[s]))}var re=class extends l.Component{constructor(...e){super(...e),this.state={caughtDiagnostic:null}}static getDerivedStateFromError(e){return{caughtDiagnostic:(0,g.buildDiagnostic)(e)}}componentDidCatch(e,t){const r=(0,g.buildDiagnostic)(e);a.logDiagnostics([r]),this.props.onError?.([r]),console.error("Chart render component stack:",t.componentStack)}componentDidUpdate(e){this.state.caughtDiagnostic&&!be(e.resetKeys,this.props.resetKeys)&&this.setState({caughtDiagnostic:null})}render(){const{caughtDiagnostic:e}=this.state;if(e)return(0,o.jsx)(W,{errors:[e]});const{forcedErrors:t,children:r}=this.props;return t&&t.length>0?(0,o.jsx)(W,{errors:t}):r}},se={},ne=(0,l.createContext)(se),M=({shapes:e=se,children:t})=>(0,o.jsx)(ne.Provider,{value:e,children:t}),U=()=>(0,l.useContext)(ne),oe=e=>typeof e=="object"&&"geom"in e&&"render"in e,ae=e=>{const t=(0,g.resolveDefinition)(e);return t instanceof g.Geom?t:null},ie=(e,t)=>{const r=e.filter(s=>Ee(s,t));return r.length===e.length?e:r},Ee=(e,t)=>e.kind==="annotation"?(0,g.findAnnotation)(t.annotations,e.id)!==null:e.kind==="observations"||e.kind==="layer"&&e.layerId!==void 0?(0,g.findLayerById)(t.layers,e.layerId)!==void 0:!0,J=[],Te=()=>(0,z.createStore)(e=>({selection:J,setSelection:t=>e(r=>xe(r.selection,t)?r:{selection:t}),clearSelection:()=>e(t=>t.selection.length===0?t:{selection:J})})),xe=(e,t)=>e===t?!0:e.length!==t.length?!1:e.every((r,s)=>{const n=t[s];return n!==void 0&&(0,g.areEditTargetsEqual)(r,n)}),Ge=process.env.NODE_ENV!=="production",Re=5,Ce=e=>{if(!Ge)return{emit:()=>{},subscribe:()=>Ne,getLastTrigger:()=>null,getLastCompile:()=>null,getCacheStats:()=>e.getCacheStats()};const t=new Set;let r=null;return{emit:s=>{const n=e.getLastCompile();if(n){r=s;for(const d of t)d(s,n)}},subscribe:s=>(t.add(s),()=>{t.delete(s)}),getLastTrigger:()=>r,getLastCompile:()=>e.getLastCompile(),getCacheStats:()=>e.getCacheStats()}},je=()=>(0,z.createStore)(e=>({lastCompile:null,history:[],nextId:1,lastSnapshot:null,recordCompile:(t,r)=>e(s=>{if(s.lastSnapshot===r)return s;const n={id:s.nextId,label:De(t),stages:r.stages,stageDurationsMs:r.stageDurationsMs,durationMs:r.durationMs};return{lastCompile:n,history:Pe(s.history,n,Re),nextId:s.nextId+1,lastSnapshot:r}})})),Ne=()=>{},De=e=>{switch(e.kind){case"init":return"init";case"spec":return"spec change";case"data":return"data change";case"command":return e.command.metadata.description}},Pe=(e,t,r)=>{const s=e.length>=r?e.length-(r-1):0;return[...e.slice(s),t]};function _e(e,t){let r;return e.layers.flatMap((s,n)=>a.isOverlayHosted(t(s.geom,e.coordSystem.type))?He(s)?(r??=(0,g.createStyleResolver)().readers(e),Ae(s,r.geom(s))?[{kind:"user-input",severity:"warning",code:"INVALID_STYLE_RULE",message:`Style 'overlay' is not supported on portal-rendered geom '${s.geom}' (layer '${s.id}'); it is ignored.`,context:{param:"overlay",layerIndex:n,requested:s.geom},suggestion:"Remove the geom overlay or use a renderer that paints inside the panel SVG."}]:[]):[]:[])}function Z(e){const t=e.filter(oe),r=new Set([...Object.keys(a.BUILT_IN_GEOM_RENDERERS),...t.map(u=>u.geom)]),s=[],n=new Set;for(const u of e){const h=ae(u);h===null||r.has(h.type)||n.has(h.type)||(n.add(h.type),s.push({kind:"user-input",severity:"error",code:"MISSING_GEOM_RENDERER",message:`Custom geom '${h.type}' is registered but has no renderer.`,context:{requested:h.type,kind:"geom-renderer"},suggestion:`Add a render half for it: \`defineGeomRenderer(${h.type}Geom, { coord, render })\`, then include it in \`plugins\`.`}))}const d=new Map;for(const u of t){if("definition"in u)continue;const h=`${u.geom}|${u.coord}`,v=d.get(h);v?v.count+=1:d.set(h,{geom:u.geom,coord:u.coord,count:1})}const c=[];for(const{geom:u,coord:h,count:v}of d.values())v<2||c.push({kind:"user-input",severity:"warning",code:"DUPLICATE_REGISTERED_TYPE",message:`Multiple render-only overrides register ('${u}', '${h}') (${v} entries); the last in the array wins.`,context:{requested:`${u}@${h}`,kind:"geom-renderer"},suggestion:`Keep a single render-only override for ('${u}', '${h}').`});return c.push(...Oe(e)),{errors:s,warnings:c}}function Ie(e,t){const{coordSystem:r,layers:s}=e,n=new Set,d=[];for(const c of s)t(c.geom,r.type)!==null||n.has(c.geom)||(n.add(c.geom),d.push({kind:"user-input",severity:"warning",code:"MISSING_GEOM_RENDERER",message:`No renderer for geom '${c.geom}' under ${r.type} coords; the layer is not painted.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:`Register a renderer for ('${c.geom}', '${r.type}') via \`defineGeomRenderer\`.`}));return d}function ke(e,t){const{coordSystem:r,layers:s}=e,n=new Set,d=[];for(const c of s){if(c.interactive===!1||c.spatialKind!=="render-hit-test"||n.has(c.geom))continue;const u=t(c.geom,r.type);u===null||u.hitTest||a.isOverlayHosted(u)||(n.add(c.geom),d.push({kind:"user-input",severity:"warning",code:"MISSING_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:`Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${c.geom}', '${r.type}').`}))}return d}function qe(e){const t=new Set,r=[];for(const s of e.layers){const n=s.identityKey;s.interactive!==!1&&(s.spatialKind!=="render-hit-test"||typeof n!="object"||t.has(s.geom)||s.data.hasVariable(n.variable)||(t.add(s.geom),r.push({kind:"user-input",severity:"warning",code:"RENDER_HIT_TEST_IDENTITY",message:`Geom '${s.geom}' keys its identity on '${n.variable}', a column its compile output does not emit; its hover lookup is empty.`,context:{requested:s.geom,kind:"geom-renderer"},suggestion:`Emit the '${n.variable}' column from the geom's \`compile()\`, or point \`identityKey\` at a column it does emit.`})))}return r}function Le(e,t){const{coordSystem:r,layers:s}=e,n=new Set,d=[];for(const c of s){if(c.interactive===!1||c.spatialKind!=="render-hit-test"||n.has(c.geom))continue;const u=t(c.geom,r.type);u===null||!u.hitTest||!a.isOverlayHosted(u)||(n.add(c.geom),d.push({kind:"user-input",severity:"warning",code:"CONFLICTING_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares both a \`hitTest\` factory and an overlay render; these are alternatives, so only the overlay is used.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:"Keep one: a `hitTest` factory for precomputed geometry, OR an overlay render (`{ fn, options: { overlay: true } }`) for a live simulation."}))}return d}function we(e,t){const r=new Set,s=[];for(const n of e.layers)n.interactive!==!1&&(n.spatialKind!=="render-hit-test"||r.has(n.geom)||t.hasCapability(n.geom)||(r.add(n.geom),s.push({kind:"user-input",severity:"warning",code:"MISSING_ANCHOR_CAPABILITY",message:`Geom '${n.geom}' declares no \`resolveAnchorPosition\`; its observations cannot be annotated, so the editor overlay paints no creation trigger on them.`,context:{requested:n.geom,kind:"geom-renderer"},suggestion:"Implement `resolveAnchorPosition(observation, context)` on the geom, returning the normalised panel position an annotation on that observation belongs at."})));return s}function Me(e,t){const{coordSystem:r,layers:s}=e,n=new Set,d=[];for(const c of s){if(c.interactive===!1||c.spatialKind==="render-hit-test"||n.has(c.geom))continue;const u=t(c.geom,r.type);u===null||!a.isOverlayHosted(u)||(n.add(c.geom),d.push({kind:"user-input",severity:"warning",code:"OVERLAY_REQUIRES_RENDER_HIT_TEST",message:`Geom '${c.geom}' declares an overlay render but its layer's spatialKind is '${c.spatialKind}', not 'render-hit-test'; the overlay's push-path hover resolves to nothing.`,context:{requested:c.geom,kind:"geom-renderer"},suggestion:"Have the geom's manifest yield spatialKind 'render-hit-test' so the scene layer carries the `byKey` index the overlay's `pushHover` resolves against."}))}return d}var He=e=>[e.styles.defaults,e.styles.overrides].some(t=>t.some(r=>(r.declarations.overlay?.length??0)>0)),Ae=(e,t)=>{const[r]=e.data;if(r===void 0)return!1;if((t.get("overlay",r)?.length??0)>0)return!0;for(const s of e.data)if((t.get("overlay",s,"hovered")?.length??0)>0)return!0;return!1};function Oe(e){const t=new Set,r=[];for(const s of e){const n=ae(s);n===null||t.has(n.type)||n.dataLabelCoordTypes.length===0||n.getDataLabelPlacements!==void 0||(t.add(n.type),r.push({kind:"user-input",severity:"warning",code:"MISSING_DATA_LABEL_PLACEMENT",message:`Geom '${n.type}' declares \`dataLabelCoordTypes\` but implements no \`getDataLabelPlacements\`; its layers paint no data labels.`,context:{requested:n.type,kind:"geom-renderer"},suggestion:"Implement `getDataLabelPlacements(context)` on the geom, or drop `dataLabelCoordTypes` so the compiler warns the author off the flag."}))}return r}var $e=e=>(0,z.createStore)(t=>({scene:e,setScene:r=>t(s=>s.scene===r?s:{scene:r})})),Be=({spec:e,data:t,customPalettes:r,colorScheme:s,plugins:n,theme:d,resolveRenderer:c,anchorResolver:u,onSpecChange:h,onError:v,onWarnings:_})=>{const N=a.useLatestRef(h),T=a.useLatestRef(v),x=a.useLatestRef(_),[{session:m,compileBus:f}]=(0,l.useState)(()=>{const i=(0,g.createCompiler)({plugins:n,theme:d});return{session:new g.GraphCompilationSession(i),compileBus:Ce(i)}}),[S]=(0,l.useState)(()=>{const i=Z(n??[]),p=Z(d?.plugins??[]);return{errors:[...p.errors,...i.errors],warnings:[...p.warnings,...i.warnings]}}),P=(0,l.useRef)(null),[y]=(0,l.useState)(Ke),R=(0,l.useRef)(null),D=(0,l.useCallback)(i=>S.errors.length===0?i:[...S.errors,...i??[]],[S]),G=(0,l.useCallback)(i=>{if(!i.ok)return i.errors;if(R.current)R.current.getState().setScene(i.scene);else{const p=$e(i.scene);p.subscribe(y.notify),R.current=p,y.notify()}return null},[y]),[H,k]=(0,l.useState)(()=>{const i=m.compile({spec:e,data:t,customPalettes:r,colorScheme:s});return P.current=i,D(G(i))}),E=(0,l.useCallback)(i=>i.ok?[...i.warnings,...Ie(i.scene,c),...ke(i.scene,c),...qe(i.scene),...Le(i.scene,c),...Me(i.scene,c),..._e(i.scene,c),...we(i.scene,u)]:i.warnings,[c,u]),C=(0,l.useCallback)(i=>{i.length!==0&&(a.logDiagnostics(i),T.current?.(i))},[T]),j=(0,l.useCallback)(i=>{i.length!==0&&(a.logDiagnostics(i),x.current?.(i))},[x]);(0,l.useEffect)(()=>{const i=P.current;i&&(C([...S.errors,...i.ok?[]:i.errors]),j([...S.warnings,...E(i)]),i.ok&&f.emit({kind:"init"}))},[f,C,j,S,E]),(0,l.useEffect)(()=>{const i=m.update({spec:e,data:t,customPalettes:r,colorScheme:s});if(!i)return;i.committedSpec&&N.current?.(i.committedSpec);const p=G(i.result);k(D(p)),p&&C(p),j(E(i.result)),p||f.emit({kind:i.specChanged?"spec":"data"})},[e,t,r,s,m,f,G,C,j,D,E,N]);const q=(0,l.useCallback)(i=>{k(p=>p===null?p:D(null)),j(E(i))},[D,j,E]),A=(0,l.useCallback)(i=>{i.scene&&R.current?.getState().setScene(i.scene),i.result&&q(i.result),i.command&&f.emit({kind:"command",command:i.command}),i.spec&&N.current?.(i.spec),i.errors&&C([...i.errors])},[q,f,N,C]),b=(0,l.useCallback)(i=>{for(const p of i)A(p);return i.some(p=>!!p.scene)},[A]),O=(0,l.useCallback)((i,p)=>{b(m.applyCommand(i,p))},[m,b]),I=(0,l.useCallback)(()=>{b(m.commit())},[m,b]),$=(0,l.useCallback)(()=>b(m.undo()),[m,b]),L=(0,l.useCallback)(()=>b(m.redo()),[m,b]),F=(0,l.useMemo)(()=>({stack:m.history,undo:$,redo:L}),[m,$,L]),ge=(0,l.useCallback)(()=>R.current?.getState().scene??null,[]);return{store:R.current,dispatch:O,commit:I,history:F,subscribe:y.subscribe,getScene:ge,compileBus:f,compileErrors:H}},Ke=()=>{const e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),notify:()=>e.forEach(t=>t())}},ce=({data:e,spec:t,plugins:r=[],theme:s,formattingLocale:n,handleRef:d,onSpecChange:c,onError:u,onWarnings:h,customPalettes:v,colorScheme:_="light",children:N})=>{const[T]=(0,l.useState)(()=>s),x=T?.colorScheme??_,[m]=(0,l.useState)(()=>a.createGeomRendererResolver([...T?.plugins??[],...r].filter(oe))),f=(0,l.useId)(),[S]=(0,l.useState)(()=>(0,g.createAnchorResolver)(r)),[P]=(0,l.useState)(()=>(0,g.createDataLabelPlacementResolver)(r)),[y]=(0,l.useState)(()=>Te()),[R]=(0,l.useState)(()=>a.createTargetBoundaryStore()),D=(0,l.useMemo)(()=>(0,g.createStyleResolver)({colorScheme:x}),[x]),{store:G,dispatch:H,commit:k,history:E,subscribe:C,getScene:j,compileBus:q,compileErrors:A}=Be({spec:t,data:e,customPalettes:v,colorScheme:x,plugins:r,theme:T,resolveRenderer:m,anchorResolver:S,onSpecChange:c,onError:u,onWarnings:h});(0,l.useEffect)(()=>{if(G)return G.subscribe((I,$)=>{if(I.scene.spec===$.scene.spec)return;const{selection:L,setSelection:F}=y.getState();L.length!==0&&F(ie(L,I.scene.spec))})},[G,y]);const b=(0,l.useMemo)(()=>({dispatch:H,commit:k}),[H,k]);(0,l.useImperativeHandle)(d,()=>({commands:b,undo:E.undo,redo:E.redo,subscribe:C,getScene:j,getSelection:()=>y.getState().selection,setSelection:I=>y.getState().setSelection(I),subscribeSelection:y.subscribe,canPlaceDataLabels:P.hasCapability,canFormatDataLabelsAsPercentages:P.hasPercentageFormat}),[b,E,C,j,y,P]);const O=(0,l.useMemo)(()=>G?{chartId:f,store:G,selectionStore:y,targetBoundaryStore:R,commands:b,history:E,formattingLocale:n,compileBus:q,colorScheme:x,styleResolver:D,anchorResolver:S}:null,[f,G,y,R,b,E,n,q,x,D,S]);return(0,o.jsx)(re,{forcedErrors:A,onError:u,resetKeys:[t,e],children:O?(0,o.jsx)(a.GraphContext.Provider,{value:O,children:(0,o.jsx)(a.GeomRendererResolverProvider,{value:m,children:(0,o.jsx)(a.DataLabelPlacementResolverProvider,{value:P,children:(0,o.jsx)(M,{shapes:T?.shapes,children:N})})})}):null})};function Ue({theme:e,...t}={}){const r=(0,g.createSpecBuilder)(t);return{...r,GraphProvider:n=>(0,o.jsx)(ce,{...n,plugins:r.plugins,theme:e})}}var le=({shouldAnimateTransitions:e,cx:t,cy:r,r:s,...n})=>e?(0,o.jsx)(K.motion.circle,{initial:!1,animate:{cx:t,cy:r,r:s},transition:a.DEFAULT_SPRING_TRANSITION,...n}):(0,o.jsx)("circle",{cx:t,cy:r,r:s,...n}),de=({shouldAnimateTransitions:e,x1:t,y1:r,x2:s,y2:n,...d})=>e?(0,o.jsx)(K.motion.line,{initial:!1,animate:{x1:t,y1:r,x2:s,y2:n},transition:a.DEFAULT_SPRING_TRANSITION,...d}):(0,o.jsx)("line",{x1:t,y1:r,x2:s,y2:n,...d}),ue=({shouldAnimateTransitions:e,x:t,y:r,width:s,height:n,...d})=>e?(0,o.jsx)(K.motion.rect,{initial:!1,animate:{attrX:t,attrY:r,width:s,height:n},transition:a.DEFAULT_SPRING_TRANSITION,...d}):(0,o.jsx)("rect",{x:t,y:r,width:s,height:n,...d}),me=({shouldAnimateTransitions:e,d:t,source:r,...s})=>e?(0,o.jsx)(ze,{d:t,source:r,...s}):(0,o.jsx)("path",{d:t,...s}),Fe=e=>{const{Circle:t}=U();return t===void 0?le(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},Ye=e=>{const{Line:t}=U();return t===void 0?de(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},Ve=e=>{const{Rect:t}=U();return t===void 0?ue(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},We=e=>{const{Path:t}=U();return t===void 0?me(e):(0,o.jsx)(M,{children:(0,o.jsx)(t,{...e})})},ze=({d:e,source:t,...r})=>{const s=a.useSvgPathMorph(e,a.DEFAULT_SPRING_TRANSITION,t);return(0,o.jsx)(K.motion.path,{d:s,...r})},Xe=({children:e,...t})=>(0,o.jsx)("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%",pointerEvents:"none",...t,children:e}),Qe=({box:e,children:t})=>(0,o.jsx)("svg",{x:(0,g.toPercent)(e.x0),y:(0,g.toPercent)(e.y0),width:(0,g.toPercent)(e.x1-e.x0),height:(0,g.toPercent)(e.y1-e.y0),overflow:"hidden",pointerEvents:"none",children:t}),Je="drqe3u0",Ze="drqe3u1",et="drqe3u2",tt="drqe3u3",w="drqe3u4",rt="drqe3u5",st="drqe3u6",nt="drqe3u7",B="drqe3u8",ot="drqe3u9",at="drqe3ua";var it="drqe3uc",ct="drqe3ud",lt="drqe3ue",dt="drqe3uf";var ut="drqe3uh",mt="drqe3ui",ee={enabled:"drqe3uk drqe3uj",disabled:"drqe3ul drqe3uj"},te={ran:"drqe3un drqe3um",dim:"drqe3uo drqe3um"},he={ran:"drqe3uq drqe3up",cached:"drqe3ur drqe3up",untouched:"drqe3us drqe3up"},ht=({width:e=440,style:t,className:r}={})=>{const{compileBus:s}=a.useGraphContext(),[n]=(0,l.useState)(()=>je()),[d,c]=(0,l.useState)(!1),[u,h]=(0,l.useState)(g.isCompilerCachingEnabled);(0,l.useEffect)(()=>{const{recordCompile:m}=n.getState(),f=s.getLastTrigger(),S=s.getLastCompile();return f&&S&&m(f,S),s.subscribe(m)},[n,s]);const v=(0,Y.useStore)(n,m=>m.lastCompile),_=(0,Y.useStore)(n,m=>m.history),N=s.getCacheStats(),T=v===null&&_.length===0,x=()=>{h(m=>{const f=!m;return(0,g.setCompilerCachingEnabled)(f),f})};return(0,o.jsxs)("div",{className:(0,V.default)(at,r),style:{width:e,...t},children:[(0,o.jsxs)("div",{className:Je,children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:Ze,children:"compile cache"}),(0,o.jsx)("div",{className:lt,children:T?"production: stats disabled":v?`last: ${v.label} · ${X(v.durationMs)}`:"awaiting first compile…"})]}),(0,o.jsx)("button",{type:"button",onClick:()=>c(m=>!m),className:dt,children:d?"▾":"▴"})]}),!d&&(0,o.jsxs)("div",{className:"drqe3ub",children:[(0,o.jsxs)("button",{type:"button",onClick:x,className:u?ee.enabled:ee.disabled,"aria-pressed":u,children:["cache ",u?"enabled":"disabled"]}),(0,o.jsx)("span",{className:"drqe3ug",children:"next compile reflects this toggle"})]}),!d&&!T&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(gt,{delta:v?.stages,durations:v?.stageDurationsMs,cumulative:N}),(0,o.jsx)(pt,{entries:_})]})]})},gt=({delta:e,durations:t,cumulative:r})=>(0,o.jsxs)("table",{className:et,children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{className:ut,children:[(0,o.jsx)("th",{className:tt,children:"stage"}),(0,o.jsx)("th",{className:w,children:"time"}),(0,o.jsx)("th",{className:w,children:"Δ miss"}),(0,o.jsx)("th",{className:w,children:"Δ hit"}),(0,o.jsx)("th",{className:w,children:"total miss"}),(0,o.jsx)("th",{className:w,children:"total hit"})]})}),(0,o.jsx)("tbody",{children:g.COMPILER_STAGE_KEYS.map(s=>{const n=e?.[s],d=vt(n);return(0,o.jsxs)("tr",{className:it,children:[(0,o.jsxs)("td",{className:rt,children:[(0,o.jsx)("span",{className:he[d],"aria-hidden":!0})," ",s]}),(0,o.jsx)("td",{className:B,children:t===void 0||d==="untouched"?"—":X(t[s])}),(0,o.jsx)("td",{className:d==="ran"?te.ran:te.dim,children:n?.misses??0}),(0,o.jsx)("td",{className:B,children:n?.hits??0}),(0,o.jsx)("td",{className:B,children:r[s].misses}),(0,o.jsx)("td",{className:B,children:r[s].hits})]},s)})})]}),pt=({entries:e})=>e.length===0?null:(0,o.jsxs)("div",{className:ct,children:[(0,o.jsx)("div",{className:mt,children:"recent compiles"}),e.map(t=>{const r=ft(t.stages,d=>d.misses>0),s=g.COMPILER_STAGE_KEYS.length,n=r===0?"cached":"ran";return(0,o.jsxs)("div",{className:st,children:[(0,o.jsx)("span",{className:he[n],"aria-hidden":!0}),(0,o.jsx)("span",{className:nt,title:t.label,children:t.label}),(0,o.jsxs)("span",{className:ot,children:[r,"/",s," ran · ",X(t.durationMs)]})]},t.id)})]}),vt=e=>!e||e.hits===0&&e.misses===0?"untouched":e.misses>0?"ran":"cached",ft=(e,t)=>{let r=0;for(const s of g.COMPILER_STAGE_KEYS)t(e[s])&&(r+=1);return r},X=e=>e<.1?"<0.1ms":e>=10?`${e.toFixed(0)}ms`:`${e.toFixed(2)}ms`,St=()=>{const{history:e}=a.useGraphContext(),{stack:t,undo:r,redo:s}=e,n=(0,l.useCallback)(u=>t.subscribe(u),[t]),d=(0,l.useCallback)(()=>t.getSnapshot(),[t]),c=(0,l.useSyncExternalStore)(n,d,d);return(0,l.useMemo)(()=>({...c,undo:r,redo:s}),[c,r,s])},yt=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),bt=(e,t={})=>{const{target:r,enabled:s=!0}=t;(0,l.useEffect)(()=>{const n=Et(r);if(!s||!n)return;const d=c=>{if(!Tt(c)||c.defaultPrevented||xt(c.target))return;const u=a.resolveHistoryStep(c);if(!u)return;const h=e.current;h&&(u==="undo"?h.undo():h.redo())&&c.preventDefault()};return n.addEventListener("keydown",d),()=>n.removeEventListener("keydown",d)},[e,r,s])},Et=e=>e===void 0?window:e!==null&&"current"in e?e.current:e,Tt=e=>"key"in e,xt=e=>e instanceof HTMLInputElement?!yt.has(e.type):e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA":!1,Gt=()=>{const{targetBoundaryStore:e}=a.useGraphContext();return(0,Y.useStore)(e,t=>t.boundary)};exports.BrandMark=a.BrandMark;exports.CanvasTextMeasurer=a.CanvasTextMeasurer;exports.DefaultFooter=a.DefaultFooter;exports.DefaultGeomCircle=le;exports.DefaultGeomLine=de;exports.DefaultGeomPath=me;exports.DefaultGeomRect=ue;exports.DefaultGrid=a.DefaultGrid;exports.DefaultHeader=a.DefaultHeader;exports.DefaultSwatch=a.DefaultSwatch;exports.DefaultTooltip=a.DefaultTooltip;exports.DevToolsPanel=ht;exports.GRAPH_MODES=a.GRAPH_MODES;exports.GeomCircle=Fe;exports.GeomLine=Ye;exports.GeomPath=We;exports.GeomRect=Ve;exports.GraphErrorBoundary=re;exports.GraphErrorPanel=W;exports.GraphProvider=ce;exports.GraphRenderer=a.GraphRenderer;exports.HoverProvider=a.HoverProvider;exports.IntroFade=a.IntroFade;exports.IntroWipeClip=a.IntroWipeClip;exports.TextMeasurerProvider=a.TextMeasurerProvider;exports.ThemeProvider=a.ThemeProvider;exports.UnitBoxSvg=Qe;exports.UnitSpaceSvg=Xe;exports.buildDotsEditOutlineShapes=a.buildDotsEditOutlineShapes;exports.createGraphyKit=Ue;exports.darkTheme=a.darkTheme;exports.defineGeomRenderer=a.defineGeomRenderer;exports.lightTheme=a.lightTheme;exports.lightenCss=a.lightenCss;exports.projectPointCartesian=a.projectPointCartesian;exports.pruneSelection=ie;exports.resolveBrandMarkVisual=a.resolveBrandMarkVisual;exports.scalePointToPanel=a.scalePointToPanel;exports.stampAxisEditTarget=a.stampAxisEditTarget;exports.stampGridEditTarget=a.stampGridEditTarget;exports.stampLegendEditTarget=a.stampLegendEditTarget;exports.useElementScreenRect=a.useElementScreenRect;exports.useGeomHitTest=a.useGeomHitTest;exports.useGeomHover=a.useGeomHover;exports.useGeomReaderTree=a.useGeomReaderTree;exports.useGeomStyleReader=a.useGeomStyleReader;exports.useGraphCommands=a.useGraphCommands;exports.useGraphHandle=a.useGraphHandle;exports.useGraphHistory=St;exports.useGraphHistoryShortcuts=bt;exports.useGraphLocale=a.useGraphLocale;exports.useGraphSelection=a.useGraphSelection;exports.useGuidesTakePress=a.useGuidesTakePress;exports.useHandleScene=a.useHandleScene;exports.useHoverState=a.useHoverState;exports.usePaintDefs=a.usePaintDefs;exports.useResolvedStyle=a.useResolvedStyle;exports.useSceneSelector=a.useSceneSelector;exports.useStyleReaderTree=a.useStyleReaderTree;exports.useStyleResolver=a.useStyleResolver;exports.useTargetBoundary=Gt;exports.useTextMeasurer=a.useTextMeasurer;exports.vars=a.vars;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as er, At as Z, B as tr, Ct as rr, Dt as nr, Ft as sr, Gt as or, Ht as be, It as Y, Kt as ar, L as ir, Lt as Ee, M as cr, Nt as Te, Ot as lr, Pt as Re, R as dr, Rt as ur, St as mr, V as hr, Vt as gr, Wt as pr, Zt as fr, _n as ee, a as vr, an as Ne, at as yr, bn as z, bt as Sr,
|
|
1
|
+
import { A as er, At as Z, B as tr, Ct as rr, Dt as nr, Ft as sr, Gt as or, Ht as be, It as Y, Kt as ar, L as ir, Lt as Ee, M as cr, Nt as Te, Ot as lr, Pt as Re, R as dr, Rt as ur, St as mr, V as hr, Vt as gr, Wt as pr, Zt as fr, _n as ee, a as vr, an as Ne, at as yr, bn as z, bt as Sr, cn as br, dn as Er, en as Tr, fn as Rr, ft as Nr, gn as Ce, h as Cr, hn as Gr, ht as Dr, i as qr, in as Ir, it as wr, j as _r, ln as Pr, mn as kr, mt as Lr, n as $r, on as V, pn as Mr, qt as Hr, r as xr, rn as Ar, s as Br, st as Or, t as Ge, un as Kr, vn as De, w as Fr } from "./history-chords-D7UfzNjK.js";
|
|
2
2
|
import { COMPILER_STAGE_KEYS as te, Geom as qe, GraphCompilationSession as Ie, areEditTargetsEqual as we, buildDiagnostic as se, createAnchorResolver as _e, createCompiler as Pe, createDataLabelPlacementResolver as ke, createSpecBuilder as Le, createStyleResolver as he, findAnnotation as $e, findLayerById as oe, isCompilerCachingEnabled as Me, resolveDefinition as He, setCompilerCachingEnabled as xe, toPercent as U } from "@graphysdk/viz-engine";
|
|
3
3
|
import { Component as Ae, createContext as Be, useCallback as p, useContext as Oe, useEffect as x, useId as Ke, useImperativeHandle as Fe, useMemo as H, useRef as ae, useState as b, useSyncExternalStore as Ue } from "react";
|
|
4
4
|
import { Fragment as je, jsx as a, jsxs as f } from "react/jsx-runtime";
|
|
@@ -878,7 +878,7 @@ export {
|
|
|
878
878
|
Gt as DefaultGeomLine,
|
|
879
879
|
qt as DefaultGeomPath,
|
|
880
880
|
Dt as DefaultGeomRect,
|
|
881
|
-
|
|
881
|
+
Br as DefaultGrid,
|
|
882
882
|
ir as DefaultHeader,
|
|
883
883
|
gr as DefaultSwatch,
|
|
884
884
|
yr as DefaultTooltip,
|
|
@@ -894,44 +894,44 @@ export {
|
|
|
894
894
|
vr as GraphRenderer,
|
|
895
895
|
lr as HoverProvider,
|
|
896
896
|
ur as IntroFade,
|
|
897
|
-
|
|
897
|
+
Ir as IntroWipeClip,
|
|
898
898
|
pr as TextMeasurerProvider,
|
|
899
|
-
|
|
899
|
+
Nr as ThemeProvider,
|
|
900
900
|
nn as UnitBoxSvg,
|
|
901
901
|
rn as UnitSpaceSvg,
|
|
902
|
-
|
|
902
|
+
br as buildDotsEditOutlineShapes,
|
|
903
903
|
Zr as createGraphyKit,
|
|
904
|
-
|
|
904
|
+
Lr as darkTheme,
|
|
905
905
|
sr as defineGeomRenderer,
|
|
906
|
-
|
|
906
|
+
Dr as lightTheme,
|
|
907
907
|
fr as lightenCss,
|
|
908
908
|
Kr as projectPointCartesian,
|
|
909
909
|
et as pruneSelection,
|
|
910
910
|
hr as resolveBrandMarkVisual,
|
|
911
|
-
|
|
911
|
+
Pr as scalePointToPanel,
|
|
912
912
|
er as stampAxisEditTarget,
|
|
913
|
-
|
|
913
|
+
_r as stampGridEditTarget,
|
|
914
914
|
cr as stampLegendEditTarget,
|
|
915
915
|
rr as useElementScreenRect,
|
|
916
916
|
nr as useGeomHitTest,
|
|
917
917
|
mr as useGeomHover,
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
918
|
+
Er as useGeomReaderTree,
|
|
919
|
+
Rr as useGeomStyleReader,
|
|
920
|
+
$r as useGraphCommands,
|
|
921
|
+
qr as useGraphHandle,
|
|
922
922
|
on as useGraphHistory,
|
|
923
923
|
an as useGraphHistoryShortcuts,
|
|
924
|
-
|
|
925
|
-
|
|
924
|
+
wr as useGraphLocale,
|
|
925
|
+
Cr as useGraphSelection,
|
|
926
926
|
Fr as useGuidesTakePress,
|
|
927
|
-
|
|
927
|
+
xr as useHandleScene,
|
|
928
928
|
Or as useHoverState,
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
929
|
+
Ar as usePaintDefs,
|
|
930
|
+
Hr as useResolvedStyle,
|
|
931
|
+
Gr as useSceneSelector,
|
|
932
|
+
Mr as useStyleReaderTree,
|
|
933
|
+
kr as useStyleResolver,
|
|
934
934
|
cn as useTargetBoundary,
|
|
935
935
|
or as useTextMeasurer,
|
|
936
|
-
|
|
936
|
+
Tr as vars
|
|
937
937
|
};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"visualization",
|
|
12
12
|
"renderer"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.9.0-beta.
|
|
14
|
+
"version": "1.9.0-beta.1791876510484",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"sideEffects": [
|
|
17
17
|
"**/*.css.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-colorful": "^5.6.1",
|
|
51
51
|
"react-intl": "^8.1.3",
|
|
52
52
|
"zustand": "^5.0.12",
|
|
53
|
-
"@graphysdk/viz-engine": "1.9.0-beta.
|
|
53
|
+
"@graphysdk/viz-engine": "1.9.0-beta.1791876510484"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@tiptap/core": "^3.0.0",
|
|
@@ -150,8 +150,8 @@
|
|
|
150
150
|
"vite-plugin-dts": "^4.5.4",
|
|
151
151
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
152
152
|
"vitest": "^4.1.11",
|
|
153
|
-
"@graphytools/eslint-plugin-graphy": "1.0.0",
|
|
154
153
|
"@graphytools/eslint-config": "0.0.1",
|
|
154
|
+
"@graphytools/eslint-plugin-graphy": "1.0.0",
|
|
155
155
|
"@graphytools/typescript-config": "0.0.1",
|
|
156
156
|
"@graphytools/vitest-config": "1.0.0"
|
|
157
157
|
},
|