@graphysdk/react-renderer 1.9.0-beta.1794417595407 → 1.9.0-beta.1794476284639
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.d.ts +23 -1
- package/dist/editable.mjs +3521 -3437
- package/dist/history-chords-0wGEdU66.cjs +2 -0
- package/dist/{history-chords-AhpkUcV4.js → history-chords-Pmq8rl9a.js} +2201 -2185
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +169 -169
- package/package.json +4 -4
- package/dist/history-chords-CzNRYJ_2.cjs +0 -2
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $n as
|
|
2
|
-
import { COMPILER_STAGE_KEYS as ie, DEFAULT_LOCALE as
|
|
3
|
-
import { Component as ut, useCallback as f, useEffect as
|
|
1
|
+
import { $n as oe, $t as Pr, An as Le, Bn as qe, Cn as Dr, Ct as Lr, Dn as _e, Dt as qr, E as _r, En as kr, Et as $r, F as Hr, Fn as xr, Ft as Mr, Gn as ke, Gt as Ar, H as Or, Hn as Br, I as Fr, Jn as Kr, Kn as Ge, Ln as Ur, Mn as $e, Nn as F, On as ee, P as zr, Pn as K, Qn as He, Qt as Wr, Rn as Vr, Rt as Yr, Sn as jr, Tn as Re, U as Xr, Un as xe, Ut as Qr, V as Zr, Vn as Me, Vt as Jr, W as en, Wt as tn, Xn as rn, Xt as Ae, Yn as nn, Zn as Oe, Zt as Be, _ as sn, _t as on, a as an, an as cn, cn as ln, dn, en as te, er as Fe, hn as un, ht as mn, i as hn, jn as gn, kn as we, kt as fn, ln as pn, mt as vn, n as yn, nn as Sn, nr as J, on as Ke, pt as bn, qn as Tn, qt as Z, r as En, s as Gn, sn as Ue, t as ze, tn as We, un as Rn, wn as U, yn as wn, zn as Ve } from "./history-chords-Pmq8rl9a.js";
|
|
2
|
+
import { COMPILER_STAGE_KEYS as ie, DEFAULT_LOCALE as Ye, Geom as je, GraphCompilationSession as Xe, areEditTargetsEqual as Qe, buildDiagnostic as de, buildPointSymbolPath as Ze, canonicalizeLocale as Je, createAnchorResolver as et, createCompiler as tt, createDataLabelPlacementResolver as rt, createSpecBuilder as nt, createStyleResolver as Ie, findAnnotation as st, findIntlLocale as ot, findLayerById as ue, foldGeomCornerRadii as it, isCompilerCachingEnabled as at, isGeometricSymbol as ae, isImageSymbol as ct, resolveDefinition as lt, resolveGeomCornerRadiusPx as me, setCompilerCachingEnabled as dt, toPercent as X } from "@graphysdk/viz-engine";
|
|
3
|
+
import { Component as ut, useCallback as f, useEffect as _, useId as mt, useImperativeHandle as ht, useMemo as H, useRef as he, useState as S, useSyncExternalStore as gt } from "react";
|
|
4
4
|
import { Fragment as ft, jsx as c, jsxs as v } from "react/jsx-runtime";
|
|
5
5
|
import { useStore as se } from "zustand";
|
|
6
6
|
import { motion as re } from "motion/react";
|
|
@@ -54,7 +54,7 @@ var Gt = class extends ut {
|
|
|
54
54
|
}
|
|
55
55
|
componentDidCatch(e, t) {
|
|
56
56
|
const r = de(e);
|
|
57
|
-
|
|
57
|
+
J([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
|
|
58
58
|
}
|
|
59
59
|
componentDidUpdate(e) {
|
|
60
60
|
this.state.caughtDiagnostic && !Et(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
|
|
@@ -65,7 +65,7 @@ var Gt = class extends ut {
|
|
|
65
65
|
const { forcedErrors: t, children: r } = this.props;
|
|
66
66
|
return t && t.length > 0 ? /* @__PURE__ */ c(ge, { errors: t }) : r;
|
|
67
67
|
}
|
|
68
|
-
}, Ne = (e) => typeof e == "object" && "geom" in e && "render" in e,
|
|
68
|
+
}, Ne = (e) => typeof e == "object" && "geom" in e && "render" in e, Ce = (e) => {
|
|
69
69
|
const t = lt(e);
|
|
70
70
|
return t instanceof je ? t : null;
|
|
71
71
|
}, Rt = (e, t) => {
|
|
@@ -77,9 +77,9 @@ var Gt = class extends ut {
|
|
|
77
77
|
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: pe })
|
|
78
78
|
})), Nt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
|
|
79
79
|
const s = t[n];
|
|
80
|
-
return s !== void 0 &&
|
|
81
|
-
}),
|
|
82
|
-
if (!
|
|
80
|
+
return s !== void 0 && Qe(r, s);
|
|
81
|
+
}), Ct = 5, Pt = (e) => {
|
|
82
|
+
if (!Ge) return {
|
|
83
83
|
emit: () => {
|
|
84
84
|
},
|
|
85
85
|
subscribe: () => Lt,
|
|
@@ -120,7 +120,7 @@ var Gt = class extends ut {
|
|
|
120
120
|
};
|
|
121
121
|
return {
|
|
122
122
|
lastCompile: s,
|
|
123
|
-
history:
|
|
123
|
+
history: _t(n.history, s, Ct),
|
|
124
124
|
nextId: n.nextId + 1,
|
|
125
125
|
lastSnapshot: r
|
|
126
126
|
};
|
|
@@ -137,14 +137,14 @@ var Gt = class extends ut {
|
|
|
137
137
|
case "command":
|
|
138
138
|
return e.command.metadata.description;
|
|
139
139
|
}
|
|
140
|
-
},
|
|
140
|
+
}, _t = (e, t, r) => {
|
|
141
141
|
const n = e.length >= r ? e.length - (r - 1) : 0;
|
|
142
142
|
return [...e.slice(n), t];
|
|
143
143
|
};
|
|
144
144
|
function ve(e) {
|
|
145
|
-
const t = e.filter(Ne), r = /* @__PURE__ */ new Set([...Object.keys(
|
|
145
|
+
const t = e.filter(Ne), r = /* @__PURE__ */ new Set([...Object.keys(We), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
|
|
146
146
|
for (const l of e) {
|
|
147
|
-
const d =
|
|
147
|
+
const d = Ce(l);
|
|
148
148
|
d === null || r.has(d.type) || s.has(d.type) || (s.add(d.type), n.push({
|
|
149
149
|
kind: "userInput",
|
|
150
150
|
severity: "error",
|
|
@@ -185,7 +185,7 @@ function ve(e) {
|
|
|
185
185
|
warnings: a
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function kt(e, t) {
|
|
189
189
|
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
|
|
190
190
|
for (const a of n)
|
|
191
191
|
t(a.geom, r.type) !== null || s.has(a.geom) || (s.add(a.geom), i.push({
|
|
@@ -206,7 +206,7 @@ function $t(e, t) {
|
|
|
206
206
|
for (const a of n) {
|
|
207
207
|
if (a.interactive === !1 || a.spatialKind !== "renderHitTest" || s.has(a.geom)) continue;
|
|
208
208
|
const l = t(a.geom, r.type);
|
|
209
|
-
l === null || l.hitTest ||
|
|
209
|
+
l === null || l.hitTest || te(l) || (s.add(a.geom), i.push({
|
|
210
210
|
kind: "userInput",
|
|
211
211
|
severity: "warning",
|
|
212
212
|
code: "MISSING_RENDER_HIT_TEST",
|
|
@@ -243,7 +243,7 @@ function xt(e, t) {
|
|
|
243
243
|
for (const a of n) {
|
|
244
244
|
if (a.interactive === !1 || a.spatialKind !== "renderHitTest" || s.has(a.geom)) continue;
|
|
245
245
|
const l = t(a.geom, r.type);
|
|
246
|
-
l === null || !l.hitTest || !
|
|
246
|
+
l === null || !l.hitTest || !te(l) || (s.add(a.geom), i.push({
|
|
247
247
|
kind: "userInput",
|
|
248
248
|
severity: "warning",
|
|
249
249
|
code: "CONFLICTING_RENDER_HIT_TEST",
|
|
@@ -278,7 +278,7 @@ function At(e, t) {
|
|
|
278
278
|
for (const a of n) {
|
|
279
279
|
if (a.interactive === !1 || a.spatialKind === "renderHitTest" || s.has(a.geom)) continue;
|
|
280
280
|
const l = t(a.geom, r.type);
|
|
281
|
-
l === null || !
|
|
281
|
+
l === null || !te(l) || (s.add(a.geom), i.push({
|
|
282
282
|
kind: "userInput",
|
|
283
283
|
severity: "warning",
|
|
284
284
|
code: "LIVE_RENDER_REQUIRES_RENDER_HIT_TEST",
|
|
@@ -294,7 +294,7 @@ function At(e, t) {
|
|
|
294
294
|
}
|
|
295
295
|
function Ot(e, t) {
|
|
296
296
|
let r;
|
|
297
|
-
return e.layers.flatMap((n, s) =>
|
|
297
|
+
return e.layers.flatMap((n, s) => te(t(n.geom, e.coordSystem.type)) ? Bt(n) ? (r ??= Ie().readers(e), (r.geom(n).get("overpaint", void 0, "hovered")?.length ?? 0) === 0 ? [] : [{
|
|
298
298
|
kind: "userInput",
|
|
299
299
|
severity: "warning",
|
|
300
300
|
code: "INVALID_STYLE_RULE",
|
|
@@ -311,7 +311,7 @@ var Bt = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) =
|
|
|
311
311
|
function Ft(e) {
|
|
312
312
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
313
313
|
for (const n of e) {
|
|
314
|
-
const s =
|
|
314
|
+
const s = Ce(n);
|
|
315
315
|
s === null || t.has(s.type) || s.dataLabelCoordTypes.length === 0 || s.getDataLabelPlacements !== void 0 || (t.add(s.type), r.push({
|
|
316
316
|
kind: "userInput",
|
|
317
317
|
severity: "warning",
|
|
@@ -329,15 +329,15 @@ function Ft(e) {
|
|
|
329
329
|
var Kt = (e) => ce((t) => ({
|
|
330
330
|
scene: e,
|
|
331
331
|
setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
|
|
332
|
-
})),
|
|
333
|
-
const b =
|
|
332
|
+
})), Ut = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: i, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: g }) => {
|
|
333
|
+
const b = Z(l), P = Z(d), G = Z(g), [{ session: m, compileBus: h, findGeom: T }] = S(() => {
|
|
334
334
|
const o = tt({
|
|
335
335
|
plugins: n,
|
|
336
336
|
theme: s
|
|
337
337
|
});
|
|
338
338
|
return {
|
|
339
339
|
session: new Xe(o),
|
|
340
|
-
compileBus:
|
|
340
|
+
compileBus: Pt(o),
|
|
341
341
|
findGeom: (u) => o.findGeom(u)
|
|
342
342
|
};
|
|
343
343
|
}), [p] = S(() => {
|
|
@@ -346,7 +346,7 @@ var Kt = (e) => ce((t) => ({
|
|
|
346
346
|
errors: [...u.errors, ...o.errors],
|
|
347
347
|
warnings: [...u.warnings, ...o.warnings]
|
|
348
348
|
};
|
|
349
|
-
}), x = he(null), [D] = S(
|
|
349
|
+
}), x = he(null), [D] = S(zt), E = he(null), y = f((o) => p.errors.length === 0 ? o : [...p.errors, ...o ?? []], [p]), k = f((o) => {
|
|
350
350
|
if (!o.ok) return o.errors;
|
|
351
351
|
if (E.current) E.current.getState().setScene(o.scene);
|
|
352
352
|
else {
|
|
@@ -354,16 +354,16 @@ var Kt = (e) => ce((t) => ({
|
|
|
354
354
|
u.subscribe(D.notify), E.current = u, D.notify();
|
|
355
355
|
}
|
|
356
356
|
return null;
|
|
357
|
-
}, [D]), [
|
|
357
|
+
}, [D]), [z, w] = S(() => {
|
|
358
358
|
const o = m.compile({
|
|
359
359
|
spec: e,
|
|
360
360
|
data: t,
|
|
361
361
|
colorScheme: r
|
|
362
362
|
});
|
|
363
|
-
return x.current = o, y(
|
|
363
|
+
return x.current = o, y(k(o));
|
|
364
364
|
}), I = f((o) => o.ok ? [
|
|
365
365
|
...o.warnings,
|
|
366
|
-
...
|
|
366
|
+
...kt(o.scene, i),
|
|
367
367
|
...$t(o.scene, i),
|
|
368
368
|
...Ht(o.scene),
|
|
369
369
|
...xt(o.scene, i),
|
|
@@ -371,20 +371,20 @@ var Kt = (e) => ce((t) => ({
|
|
|
371
371
|
...Ot(o.scene, i),
|
|
372
372
|
...Mt(o.scene, a)
|
|
373
373
|
] : o.warnings, [i, a]), N = f((o) => {
|
|
374
|
-
o.length !== 0 && (
|
|
375
|
-
}, [
|
|
376
|
-
o.length !== 0 && (
|
|
374
|
+
o.length !== 0 && (J(o), P.current?.(o));
|
|
375
|
+
}, [P]), C = f((o) => {
|
|
376
|
+
o.length !== 0 && (J(o), G.current?.(o));
|
|
377
377
|
}, [G]);
|
|
378
|
-
|
|
378
|
+
_(() => {
|
|
379
379
|
const o = x.current;
|
|
380
|
-
o && (N([...p.errors, ...o.ok ? [] : o.errors]),
|
|
380
|
+
o && (N([...p.errors, ...o.ok ? [] : o.errors]), C([...p.warnings, ...I(o)]), o.ok && h.emit({ kind: "init" }));
|
|
381
381
|
}, [
|
|
382
382
|
h,
|
|
383
383
|
N,
|
|
384
|
-
|
|
384
|
+
C,
|
|
385
385
|
p,
|
|
386
386
|
I
|
|
387
|
-
]),
|
|
387
|
+
]), _(() => {
|
|
388
388
|
const o = m.update({
|
|
389
389
|
spec: e,
|
|
390
390
|
data: t,
|
|
@@ -392,26 +392,26 @@ var Kt = (e) => ce((t) => ({
|
|
|
392
392
|
});
|
|
393
393
|
if (!o) return;
|
|
394
394
|
o.committedSpec && b.current?.(o.committedSpec);
|
|
395
|
-
const u =
|
|
396
|
-
w(y(u)), u && N(u),
|
|
395
|
+
const u = k(o.result);
|
|
396
|
+
w(y(u)), u && N(u), C(I(o.result)), u || h.emit({ kind: o.hasSpecChange ? "spec" : "data" });
|
|
397
397
|
}, [
|
|
398
398
|
e,
|
|
399
399
|
t,
|
|
400
400
|
r,
|
|
401
401
|
m,
|
|
402
402
|
h,
|
|
403
|
-
|
|
403
|
+
k,
|
|
404
404
|
N,
|
|
405
|
-
|
|
405
|
+
C,
|
|
406
406
|
y,
|
|
407
407
|
I,
|
|
408
408
|
b
|
|
409
409
|
]);
|
|
410
410
|
const M = f((o) => {
|
|
411
|
-
w((u) => u === null ? u : y(null)),
|
|
411
|
+
w((u) => u === null ? u : y(null)), C(I(o));
|
|
412
412
|
}, [
|
|
413
413
|
y,
|
|
414
|
-
|
|
414
|
+
C,
|
|
415
415
|
I
|
|
416
416
|
]), L = f((o) => {
|
|
417
417
|
o.scene && E.current?.getState().setScene(o.scene), o.result && M(o.result), o.command && h.emit({
|
|
@@ -428,9 +428,9 @@ var Kt = (e) => ce((t) => ({
|
|
|
428
428
|
return o.some((u) => !!u.scene);
|
|
429
429
|
}, [L]), W = f((o, u) => {
|
|
430
430
|
R(m.applyCommand(o, u));
|
|
431
|
-
}, [m, R]),
|
|
431
|
+
}, [m, R]), V = f(() => {
|
|
432
432
|
R(m.commit());
|
|
433
|
-
}, [m, R]),
|
|
433
|
+
}, [m, R]), Y = f(() => R(m.undo()), [m, R]), A = f(() => R(m.redo()), [m, R]), $ = f((o) => {
|
|
434
434
|
const u = m.preview(o).find((De) => De.scene)?.scene;
|
|
435
435
|
return u ? (E.current?.getState().setScene(u), !0) : !1;
|
|
436
436
|
}, [m]), j = f(() => {
|
|
@@ -438,27 +438,27 @@ var Kt = (e) => ce((t) => ({
|
|
|
438
438
|
o && E.current?.getState().setScene(o);
|
|
439
439
|
}, [m]), q = H(() => ({
|
|
440
440
|
stack: m.history,
|
|
441
|
-
undo:
|
|
441
|
+
undo: Y,
|
|
442
442
|
redo: A
|
|
443
443
|
}), [
|
|
444
444
|
m,
|
|
445
|
-
|
|
445
|
+
Y,
|
|
446
446
|
A
|
|
447
447
|
]), ne = f(() => E.current?.getState().scene ?? null, []);
|
|
448
448
|
return {
|
|
449
449
|
store: E.current,
|
|
450
450
|
dispatch: W,
|
|
451
|
-
commit:
|
|
451
|
+
commit: V,
|
|
452
452
|
paintPreview: $,
|
|
453
453
|
clearPreview: j,
|
|
454
454
|
history: q,
|
|
455
455
|
subscribe: D.subscribe,
|
|
456
456
|
getScene: ne,
|
|
457
457
|
compileBus: h,
|
|
458
|
-
compileErrors:
|
|
458
|
+
compileErrors: z,
|
|
459
459
|
findGeom: T
|
|
460
460
|
};
|
|
461
|
-
},
|
|
461
|
+
}, zt = () => {
|
|
462
462
|
const e = /* @__PURE__ */ new Set();
|
|
463
463
|
return {
|
|
464
464
|
subscribe: (t) => (e.add(t), () => {
|
|
@@ -466,10 +466,10 @@ var Kt = (e) => ce((t) => ({
|
|
|
466
466
|
}),
|
|
467
467
|
notify: () => e.forEach((t) => t())
|
|
468
468
|
};
|
|
469
|
-
}, Wt = ["cartesian", "polar"],
|
|
470
|
-
const G = Xt(i, g), [m] = S(() => n), [h] = S(() =>
|
|
469
|
+
}, Wt = ["cartesian", "polar"], Vt = ({ data: e, spec: t, plugins: r = [], theme: n, glyphs: s, formattingLocale: i, handleRef: a, onSpecChange: l, onError: d, onWarnings: g, colorScheme: b = "light", children: P }) => {
|
|
470
|
+
const G = Xt(i, g), [m] = S(() => n), [h] = S(() => xe(n?.glyphs, s)), T = m?.colorScheme ?? b, [p] = S(() => Be([...m?.plugins ?? [], ...r].filter(Ne)));
|
|
471
471
|
jt(p, h);
|
|
472
|
-
const x = mt(), [D] = S(() => et(r)), [E] = S(() => rt(r)), [y] = S(() => It()), [
|
|
472
|
+
const x = mt(), [D] = S(() => et(r)), [E] = S(() => rt(r)), [y] = S(() => It()), [k] = S(() => Ae()), z = H(() => Ie({ colorScheme: T }), [T]), { store: w, dispatch: I, commit: N, paintPreview: C, clearPreview: M, history: L, subscribe: R, getScene: W, compileBus: V, compileErrors: Y, findGeom: A } = Ut({
|
|
473
473
|
spec: t,
|
|
474
474
|
data: e,
|
|
475
475
|
colorScheme: T,
|
|
@@ -481,7 +481,7 @@ var Kt = (e) => ce((t) => ({
|
|
|
481
481
|
onError: d,
|
|
482
482
|
onWarnings: g
|
|
483
483
|
});
|
|
484
|
-
|
|
484
|
+
_(() => {
|
|
485
485
|
if (w)
|
|
486
486
|
return w.subscribe((q, ne) => {
|
|
487
487
|
if (q.scene.spec === ne.scene.spec) return;
|
|
@@ -492,12 +492,12 @@ var Kt = (e) => ce((t) => ({
|
|
|
492
492
|
const $ = H(() => ({
|
|
493
493
|
dispatch: I,
|
|
494
494
|
commit: N,
|
|
495
|
-
paintPreview:
|
|
495
|
+
paintPreview: C,
|
|
496
496
|
clearPreview: M
|
|
497
497
|
}), [
|
|
498
498
|
I,
|
|
499
499
|
N,
|
|
500
|
-
|
|
500
|
+
C,
|
|
501
501
|
M
|
|
502
502
|
]);
|
|
503
503
|
ht(a, () => ({
|
|
@@ -529,74 +529,74 @@ var Kt = (e) => ce((t) => ({
|
|
|
529
529
|
chartId: x,
|
|
530
530
|
store: w,
|
|
531
531
|
selectionStore: y,
|
|
532
|
-
targetBoundaryStore:
|
|
532
|
+
targetBoundaryStore: k,
|
|
533
533
|
commands: $,
|
|
534
534
|
history: L,
|
|
535
535
|
formattingLocale: G,
|
|
536
|
-
compileBus:
|
|
536
|
+
compileBus: V,
|
|
537
537
|
colorScheme: T,
|
|
538
|
-
styleResolver:
|
|
538
|
+
styleResolver: z,
|
|
539
539
|
anchorResolver: D,
|
|
540
540
|
findGeom: A
|
|
541
541
|
} : null, [
|
|
542
542
|
x,
|
|
543
543
|
w,
|
|
544
544
|
y,
|
|
545
|
-
|
|
545
|
+
k,
|
|
546
546
|
$,
|
|
547
547
|
L,
|
|
548
548
|
G,
|
|
549
|
-
|
|
549
|
+
V,
|
|
550
550
|
T,
|
|
551
|
-
|
|
551
|
+
z,
|
|
552
552
|
D,
|
|
553
553
|
A
|
|
554
554
|
]);
|
|
555
555
|
return /* @__PURE__ */ c(Gt, {
|
|
556
|
-
forcedErrors:
|
|
556
|
+
forcedErrors: Y,
|
|
557
557
|
onError: d,
|
|
558
558
|
resetKeys: [t, e],
|
|
559
|
-
children: j ? /* @__PURE__ */ c(
|
|
559
|
+
children: j ? /* @__PURE__ */ c(He.Provider, {
|
|
560
560
|
value: j,
|
|
561
|
-
children: /* @__PURE__ */ c(
|
|
561
|
+
children: /* @__PURE__ */ c(Ke, {
|
|
562
562
|
value: p,
|
|
563
563
|
children: /* @__PURE__ */ c(Fe, {
|
|
564
564
|
value: E,
|
|
565
|
-
children: /* @__PURE__ */ c(
|
|
565
|
+
children: /* @__PURE__ */ c(U, {
|
|
566
566
|
shapes: m?.shapes,
|
|
567
|
-
children: /* @__PURE__ */ c(
|
|
567
|
+
children: /* @__PURE__ */ c(Me, {
|
|
568
568
|
glyphs: h,
|
|
569
|
-
children:
|
|
569
|
+
children: P
|
|
570
570
|
})
|
|
571
571
|
})
|
|
572
572
|
})
|
|
573
573
|
})
|
|
574
574
|
}) : null
|
|
575
575
|
});
|
|
576
|
-
},
|
|
577
|
-
|
|
578
|
-
if (!
|
|
576
|
+
}, Yt = (e, t) => (e ?? []).filter((r) => !ae(r) && !t.has(r)), jt = (e, t) => {
|
|
577
|
+
_(() => {
|
|
578
|
+
if (!Ge) return;
|
|
579
579
|
const r = new Set(t.map(({ name: n }) => n));
|
|
580
|
-
for (const n of Wt) for (const s of
|
|
580
|
+
for (const n of Wt) for (const s of Yt(e("point", n)?.symbols, r)) console.warn(`[graphy] The ${n} point renderer lists "${s}", but no glyph has that name. The shape menu offers it, and SymbolFigure draws the first listed symbol in its place.`);
|
|
581
581
|
}, [e, t]);
|
|
582
582
|
}, Xt = (e, t) => {
|
|
583
|
-
const r =
|
|
584
|
-
return
|
|
583
|
+
const r = Z(t);
|
|
584
|
+
return _(() => {
|
|
585
585
|
if (e === void 0 || ot(e) !== void 0) return;
|
|
586
586
|
const n = [{
|
|
587
587
|
severity: "warning",
|
|
588
588
|
kind: "userInput",
|
|
589
589
|
code: "INVALID_FORMATTING_LOCALE",
|
|
590
|
-
message: `formattingLocale '${e}' is not a tag Intl can format in, so the chart formats in ${
|
|
590
|
+
message: `formattingLocale '${e}' is not a tag Intl can format in, so the chart formats in ${Ye}.`
|
|
591
591
|
}];
|
|
592
|
-
|
|
593
|
-
}, [e, r]), e === void 0 ? void 0 :
|
|
592
|
+
J(n), r.current?.(n);
|
|
593
|
+
}, [e, r]), e === void 0 ? void 0 : Je(e);
|
|
594
594
|
};
|
|
595
|
-
function
|
|
595
|
+
function _n({ theme: e, glyphs: t, ...r } = {}) {
|
|
596
596
|
const n = nt(r);
|
|
597
597
|
return {
|
|
598
598
|
...n,
|
|
599
|
-
GraphProvider: (i) => /* @__PURE__ */ c(
|
|
599
|
+
GraphProvider: (i) => /* @__PURE__ */ c(Vt, {
|
|
600
600
|
...i,
|
|
601
601
|
plugins: n.plugins,
|
|
602
602
|
theme: e,
|
|
@@ -609,7 +609,7 @@ var B = (e, t) => {
|
|
|
609
609
|
if (!e.endsWith("%")) return null;
|
|
610
610
|
const r = Number.parseFloat(e);
|
|
611
611
|
return Number.isFinite(r) ? r / 100 * t : null;
|
|
612
|
-
},
|
|
612
|
+
}, kn = ({ x: e, y: t, width: r, height: n }, s) => {
|
|
613
613
|
const i = B(e, s.width), a = B(t, s.height), l = B(r, s.width), d = B(n, s.height);
|
|
614
614
|
return i === null || a === null || l === null || d === null ? null : {
|
|
615
615
|
x: i,
|
|
@@ -617,7 +617,7 @@ var B = (e, t) => {
|
|
|
617
617
|
width: l,
|
|
618
618
|
height: d
|
|
619
619
|
};
|
|
620
|
-
},
|
|
620
|
+
}, Qt = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...i }) => {
|
|
621
621
|
const a = K(s);
|
|
622
622
|
return e ? /* @__PURE__ */ c(re.circle, {
|
|
623
623
|
initial: !1,
|
|
@@ -636,7 +636,7 @@ var B = (e, t) => {
|
|
|
636
636
|
style: a,
|
|
637
637
|
...i
|
|
638
638
|
});
|
|
639
|
-
},
|
|
639
|
+
}, Zt = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: i, ...a }) => {
|
|
640
640
|
const l = K(i);
|
|
641
641
|
return e ? /* @__PURE__ */ c(re.line, {
|
|
642
642
|
initial: !1,
|
|
@@ -657,7 +657,7 @@ var B = (e, t) => {
|
|
|
657
657
|
style: l,
|
|
658
658
|
...a
|
|
659
659
|
});
|
|
660
|
-
},
|
|
660
|
+
}, Jt = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: i, ry: a, effects: l, ...d }) => {
|
|
661
661
|
const g = K(l);
|
|
662
662
|
return e ? /* @__PURE__ */ c(re.rect, {
|
|
663
663
|
initial: !1,
|
|
@@ -697,11 +697,11 @@ var B = (e, t) => {
|
|
|
697
697
|
...s
|
|
698
698
|
});
|
|
699
699
|
}, $n = (e) => {
|
|
700
|
-
const { Circle: t } =
|
|
700
|
+
const { Circle: t } = ee(), { symbol: r, ...n } = e;
|
|
701
701
|
return r !== void 0 && r !== "circle" ? /* @__PURE__ */ c("g", {
|
|
702
702
|
style: K(e.effects),
|
|
703
703
|
"data-testid": e["data-testid"],
|
|
704
|
-
children: /* @__PURE__ */ c(
|
|
704
|
+
children: /* @__PURE__ */ c(Ve, {
|
|
705
705
|
symbol: r,
|
|
706
706
|
cx: ye(e.cx),
|
|
707
707
|
cy: ye(e.cy),
|
|
@@ -718,21 +718,21 @@ var B = (e, t) => {
|
|
|
718
718
|
fadesIn: !1
|
|
719
719
|
} : null
|
|
720
720
|
})
|
|
721
|
-
}) : t === void 0 ?
|
|
721
|
+
}) : t === void 0 ? Qt(n) : /* @__PURE__ */ c(U, { children: /* @__PURE__ */ c(t, { ...n }) });
|
|
722
722
|
}, Hn = (e) => {
|
|
723
|
-
const { Line: t } =
|
|
724
|
-
return t === void 0 ?
|
|
723
|
+
const { Line: t } = ee();
|
|
724
|
+
return t === void 0 ? Zt(e) : /* @__PURE__ */ c(U, { children: /* @__PURE__ */ c(t, { ...e }) });
|
|
725
725
|
}, xn = ({ cornerRadius: e, ...t }) => {
|
|
726
|
-
const { Rect: r } =
|
|
726
|
+
const { Rect: r } = ee(), n = we()?.size ?? null, s = _e(), i = {
|
|
727
727
|
...t,
|
|
728
728
|
...rr(e, t, n, s)
|
|
729
729
|
};
|
|
730
|
-
return r === void 0 ?
|
|
730
|
+
return r === void 0 ? Jt(i) : /* @__PURE__ */ c(U, { children: /* @__PURE__ */ c(r, { ...i }) });
|
|
731
731
|
}, Mn = (e) => {
|
|
732
|
-
const { Path: t } =
|
|
733
|
-
return t === void 0 ? er(e) : /* @__PURE__ */ c(
|
|
732
|
+
const { Path: t } = ee();
|
|
733
|
+
return t === void 0 ? er(e) : /* @__PURE__ */ c(U, { children: /* @__PURE__ */ c(t, { ...e }) });
|
|
734
734
|
}, ye = (e) => typeof e == "number" ? `${e}px` : e, tr = ({ d: e, source: t, ...r }) => {
|
|
735
|
-
const n =
|
|
735
|
+
const n = $e(e, F, t);
|
|
736
736
|
return /* @__PURE__ */ c(re.path, {
|
|
737
737
|
d: n,
|
|
738
738
|
...r
|
|
@@ -767,7 +767,7 @@ var B = (e, t) => {
|
|
|
767
767
|
rx: e / t.x,
|
|
768
768
|
ry: e / t.y
|
|
769
769
|
}, An = ({ symbol: e, size: t, fill: r, fillOpacity: n, stroke: s, strokeOpacity: i, strokeWidth: a }) => {
|
|
770
|
-
const l =
|
|
770
|
+
const l = ke(), d = Ue(), g = Oe((G) => G.coordSystem.type), b = sr(e, d("point", g)?.symbols ?? [], l), P = {
|
|
771
771
|
size: t,
|
|
772
772
|
fill: r,
|
|
773
773
|
fillOpacity: n,
|
|
@@ -776,20 +776,20 @@ var B = (e, t) => {
|
|
|
776
776
|
strokeWidth: a
|
|
777
777
|
};
|
|
778
778
|
return ae(b) ? /* @__PURE__ */ c("path", {
|
|
779
|
-
d:
|
|
779
|
+
d: Ze(b, t),
|
|
780
780
|
fill: r,
|
|
781
781
|
fillOpacity: n,
|
|
782
782
|
stroke: s,
|
|
783
783
|
strokeOpacity: i,
|
|
784
784
|
strokeWidth: a,
|
|
785
785
|
strokeLinejoin: "round"
|
|
786
|
-
}) : /* @__PURE__ */ c(
|
|
786
|
+
}) : /* @__PURE__ */ c(qe, {
|
|
787
787
|
symbol: b,
|
|
788
788
|
glyphs: l,
|
|
789
|
-
...
|
|
789
|
+
...P
|
|
790
790
|
});
|
|
791
791
|
}, sr = (e, t, r) => ct(e) || t.includes(e) || !ae(e) && r.has(e) ? e : t[0] ?? "circle", On = ({ children: e, ...t }) => {
|
|
792
|
-
const r =
|
|
792
|
+
const r = we()?.size ?? null;
|
|
793
793
|
return /* @__PURE__ */ c("svg", {
|
|
794
794
|
viewBox: "0 0 1 1",
|
|
795
795
|
preserveAspectRatio: "none",
|
|
@@ -804,7 +804,7 @@ var B = (e, t) => {
|
|
|
804
804
|
})
|
|
805
805
|
});
|
|
806
806
|
}, Bn = ({ box: e, children: t }) => {
|
|
807
|
-
const r =
|
|
807
|
+
const r = Le(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), i = H(() => n === null || s === null ? null : {
|
|
808
808
|
width: n,
|
|
809
809
|
height: s
|
|
810
810
|
}, [n, s]);
|
|
@@ -820,7 +820,7 @@ var B = (e, t) => {
|
|
|
820
820
|
children: t
|
|
821
821
|
})
|
|
822
822
|
});
|
|
823
|
-
}, or = "drqe3u0", ir = "drqe3u1", ar = "drqe3u2", cr = "drqe3u3", O = "drqe3u4", lr = "drqe3u5", dr = "drqe3u6", ur = "drqe3u7",
|
|
823
|
+
}, or = "drqe3u0", ir = "drqe3u1", ar = "drqe3u2", cr = "drqe3u3", O = "drqe3u4", lr = "drqe3u5", dr = "drqe3u6", ur = "drqe3u7", Q = "drqe3u8", mr = "drqe3u9", hr = "drqe3ua";
|
|
824
824
|
var gr = "drqe3uc", fr = "drqe3ud", pr = "drqe3ue", vr = "drqe3uf";
|
|
825
825
|
var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
826
826
|
enabled: "drqe3uk drqe3uj",
|
|
@@ -828,17 +828,17 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
828
828
|
}, Ee = {
|
|
829
829
|
ran: "drqe3un drqe3um",
|
|
830
830
|
dim: "drqe3uo drqe3um"
|
|
831
|
-
},
|
|
831
|
+
}, Pe = {
|
|
832
832
|
ran: "drqe3uq drqe3up",
|
|
833
833
|
cached: "drqe3ur drqe3up",
|
|
834
834
|
untouched: "drqe3us drqe3up"
|
|
835
835
|
}, Fn = ({ width: e = 440, style: t, className: r } = {}) => {
|
|
836
836
|
const { compileBus: n } = oe(), [s] = S(() => Dt()), [i, a] = S(!1), [l, d] = S(at);
|
|
837
|
-
|
|
837
|
+
_(() => {
|
|
838
838
|
const { recordCompile: h } = s.getState(), T = n.getLastTrigger(), p = n.getLastCompile();
|
|
839
839
|
return T && p && h(T, p), n.subscribe(h);
|
|
840
840
|
}, [s, n]);
|
|
841
|
-
const g = se(s, (h) => h.lastCompile), b = se(s, (h) => h.history),
|
|
841
|
+
const g = se(s, (h) => h.lastCompile), b = se(s, (h) => h.history), P = n.getCacheStats(), G = g === null && b.length === 0, m = () => {
|
|
842
842
|
d((h) => {
|
|
843
843
|
const T = !h;
|
|
844
844
|
return dt(T), T;
|
|
@@ -882,7 +882,7 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
882
882
|
!i && !G && /* @__PURE__ */ v(ft, { children: [/* @__PURE__ */ c(br, {
|
|
883
883
|
delta: g?.stages,
|
|
884
884
|
durations: g?.stageDurationsMs,
|
|
885
|
-
cumulative:
|
|
885
|
+
cumulative: P
|
|
886
886
|
}), /* @__PURE__ */ c(Tr, { entries: b })] })
|
|
887
887
|
]
|
|
888
888
|
});
|
|
@@ -925,7 +925,7 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
925
925
|
className: lr,
|
|
926
926
|
children: [
|
|
927
927
|
/* @__PURE__ */ c("span", {
|
|
928
|
-
className:
|
|
928
|
+
className: Pe[i],
|
|
929
929
|
"aria-hidden": !0
|
|
930
930
|
}),
|
|
931
931
|
" ",
|
|
@@ -933,7 +933,7 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
933
933
|
]
|
|
934
934
|
}),
|
|
935
935
|
/* @__PURE__ */ c("td", {
|
|
936
|
-
className:
|
|
936
|
+
className: Q,
|
|
937
937
|
children: t === void 0 || i === "untouched" ? "—" : le(t[n])
|
|
938
938
|
}),
|
|
939
939
|
/* @__PURE__ */ c("td", {
|
|
@@ -941,15 +941,15 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
941
941
|
children: s?.misses ?? 0
|
|
942
942
|
}),
|
|
943
943
|
/* @__PURE__ */ c("td", {
|
|
944
|
-
className:
|
|
944
|
+
className: Q,
|
|
945
945
|
children: s?.hits ?? 0
|
|
946
946
|
}),
|
|
947
947
|
/* @__PURE__ */ c("td", {
|
|
948
|
-
className:
|
|
948
|
+
className: Q,
|
|
949
949
|
children: r[n].misses
|
|
950
950
|
}),
|
|
951
951
|
/* @__PURE__ */ c("td", {
|
|
952
|
-
className:
|
|
952
|
+
className: Q,
|
|
953
953
|
children: r[n].hits
|
|
954
954
|
})
|
|
955
955
|
]
|
|
@@ -966,7 +966,7 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
966
966
|
className: dr,
|
|
967
967
|
children: [
|
|
968
968
|
/* @__PURE__ */ c("span", {
|
|
969
|
-
className:
|
|
969
|
+
className: Pe[r === 0 ? "cached" : "ran"],
|
|
970
970
|
"aria-hidden": !0
|
|
971
971
|
}),
|
|
972
972
|
/* @__PURE__ */ c("span", {
|
|
@@ -1013,14 +1013,14 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
1013
1013
|
"range",
|
|
1014
1014
|
"reset",
|
|
1015
1015
|
"submit"
|
|
1016
|
-
]),
|
|
1016
|
+
]), Un = (e, t = {}) => {
|
|
1017
1017
|
const { target: r, enabled: n = !0 } = t;
|
|
1018
|
-
|
|
1018
|
+
_(() => {
|
|
1019
1019
|
const s = wr(r);
|
|
1020
1020
|
if (!n || !s) return;
|
|
1021
1021
|
const i = (a) => {
|
|
1022
1022
|
if (!Ir(a) || a.defaultPrevented || Nr(a.target)) return;
|
|
1023
|
-
const l =
|
|
1023
|
+
const l = ze(a);
|
|
1024
1024
|
if (!l) return;
|
|
1025
1025
|
const d = e.current;
|
|
1026
1026
|
d && (l === "undo" ? d.undo() : d.redo()) && a.preventDefault();
|
|
@@ -1031,83 +1031,83 @@ var yr = "drqe3uh", Sr = "drqe3ui", Te = {
|
|
|
1031
1031
|
r,
|
|
1032
1032
|
n
|
|
1033
1033
|
]);
|
|
1034
|
-
}, wr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, Ir = (e) => "key" in e, Nr = (e) => e instanceof HTMLInputElement ? !Rr.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1,
|
|
1034
|
+
}, wr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, Ir = (e) => "key" in e, Nr = (e) => e instanceof HTMLInputElement ? !Rr.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, zn = () => {
|
|
1035
1035
|
const { targetBoundaryStore: e } = oe();
|
|
1036
1036
|
return se(e, (t) => t.boundary);
|
|
1037
1037
|
};
|
|
1038
1038
|
export {
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1039
|
+
Rn as CanvasTextMeasurer,
|
|
1040
|
+
Or as DefaultFooter,
|
|
1041
|
+
Qt as DefaultGeomCircle,
|
|
1042
|
+
Zt as DefaultGeomLine,
|
|
1043
1043
|
er as DefaultGeomPath,
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1044
|
+
Jt as DefaultGeomRect,
|
|
1045
|
+
Gn as DefaultGrid,
|
|
1046
|
+
Zr as DefaultHeader,
|
|
1047
|
+
cn as DefaultSwatch,
|
|
1048
|
+
mn as DefaultTooltip,
|
|
1049
1049
|
Fn as DevToolsPanel,
|
|
1050
|
-
|
|
1050
|
+
Jr as GRAPH_MODES,
|
|
1051
1051
|
$n as GeomCircle,
|
|
1052
1052
|
Hn as GeomLine,
|
|
1053
|
-
|
|
1054
|
-
|
|
1053
|
+
Qr as GeomOverpaint,
|
|
1054
|
+
Dr as GeomPanelSizeProvider,
|
|
1055
1055
|
Mn as GeomPath,
|
|
1056
1056
|
xn as GeomRect,
|
|
1057
1057
|
Gt as GraphErrorBoundary,
|
|
1058
1058
|
ge as GraphErrorPanel,
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1059
|
+
Vt as GraphProvider,
|
|
1060
|
+
an as GraphRenderer,
|
|
1061
|
+
Xr as GraphyBadge,
|
|
1062
|
+
Ar as HoverProvider,
|
|
1063
|
+
fn as IntlProvider,
|
|
1064
|
+
Sn as IntroFade,
|
|
1065
|
+
gn as IntroWipeClip,
|
|
1066
1066
|
An as SymbolFigure,
|
|
1067
|
-
|
|
1068
|
-
|
|
1067
|
+
ln as TextMeasurerProvider,
|
|
1068
|
+
Lr as ThemeProvider,
|
|
1069
1069
|
Bn as UnitBoxSvg,
|
|
1070
1070
|
On as UnitSpaceSvg,
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1071
|
+
Ur as buildDotsEditOutlineShapes,
|
|
1072
|
+
_n as createGraphyKit,
|
|
1073
|
+
$r as darkTheme,
|
|
1074
|
+
Wr as defineGeomRenderer,
|
|
1075
|
+
Br as defineGlyph,
|
|
1076
|
+
Pr as getBuiltInEditOutlineShapes,
|
|
1077
|
+
qr as lightTheme,
|
|
1078
|
+
un as lightenCss,
|
|
1079
1079
|
Rt as pruneSelection,
|
|
1080
1080
|
B as readPositionPixels,
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1081
|
+
kn as readRectPixels,
|
|
1082
|
+
en as resolveGraphyBadgeVariant,
|
|
1083
|
+
xr as resolvePathStroke,
|
|
1084
|
+
Vr as scalePointToPanel,
|
|
1085
|
+
zr as stampAxisEditTarget,
|
|
1086
|
+
Hr as stampGridEditTarget,
|
|
1087
|
+
Fr as stampLegendEditTarget,
|
|
1088
|
+
Mr as useElementScreenRect,
|
|
1089
|
+
bn as useFormattingLocale,
|
|
1090
|
+
tn as useGeomHitTest,
|
|
1091
|
+
Yr as useGeomHover,
|
|
1092
|
+
kr as useGeomPanelSize,
|
|
1093
|
+
Tn as useGeomReaderTree,
|
|
1094
|
+
Kr as useGeomStyleReader,
|
|
1095
|
+
Le as useGeomViewportSize,
|
|
1096
|
+
yn as useGraphCommands,
|
|
1097
|
+
hn as useGraphHandle,
|
|
1098
1098
|
Kn as useGraphHistory,
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1099
|
+
Un as useGraphHistoryShortcuts,
|
|
1100
|
+
vn as useGraphLocale,
|
|
1101
|
+
sn as useGraphSelection,
|
|
1102
|
+
_r as useGuidesTakePress,
|
|
1103
|
+
En as useHandleScene,
|
|
1104
|
+
on as useHoverState,
|
|
1105
|
+
jr as usePaintDefs,
|
|
1106
|
+
dn as useResolvedStyle,
|
|
1107
|
+
Oe as useSceneSelector,
|
|
1108
|
+
nn as useStyleReaderTree,
|
|
1109
|
+
rn as useStyleResolver,
|
|
1110
|
+
zn as useTargetBoundary,
|
|
1111
|
+
pn as useTextMeasurer,
|
|
1112
|
+
wn as vars
|
|
1113
1113
|
};
|