@graphysdk/react-renderer 1.9.0-beta.1793272487821 → 1.9.0-beta.1793288163741
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.d.ts +5 -2
- package/dist/editable.mjs +97 -87
- package/dist/{history-chords-Dhts8KCW.js → history-chords-CaoYNtzG.js} +1 -1
- package/dist/{history-chords-CD0FaaMA.cjs → history-chords-CrDziK5T.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +385 -381
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { $t as
|
|
2
|
-
import { COMPILER_STAGE_KEYS as
|
|
3
|
-
import { Component as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { useStore as
|
|
6
|
-
import { motion as
|
|
7
|
-
import { createStore as
|
|
8
|
-
import
|
|
9
|
-
import './index.css';var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
1
|
+
import { $t as ar, An as Ne, At as ir, B as cr, Bt as lr, Cn as dr, Dn as ur, Dt as mr, En as hr, Ft as Z, Ht as z, Jt as Ce, M as gr, Mn as Ie, Mt as pr, N as fr, Nt as vr, On as yr, Pn as ee, Qt as Sr, R as br, Rt as De, Sn as Er, Tn as Tr, Tt as Rr, Ut as we, V as Gr, Vt as Nr, Wt as Cr, Xt as Ir, Zt as Dr, _n as Pe, _t as wr, a as Pr, at as qr, bn as _r, ct as kr, dn as A, fn as ye, gn as Lr, h as Hr, hn as Y, i as $r, j as Mr, jn as re, jt as xr, kn as Br, ln as Ar, mn as qe, mt as Or, n as Kr, on as Fr, ot as jr, pn as _e, qt as Ur, r as Wr, rn as zr, s as Yr, t as ke, un as Se, vn as V, vt as Vr, w as Xr, wn as Qr, yn as X, z as Jr, zt as Le } from "./history-chords-CaoYNtzG.js";
|
|
2
|
+
import { COMPILER_STAGE_KEYS as ne, Geom as He, GraphCompilationSession as $e, areEditTargetsEqual as Me, buildDiagnostic as ae, createAnchorResolver as xe, createCompiler as Be, createDataLabelPlacementResolver as Ae, createSpecBuilder as Oe, createStyleResolver as be, findAnnotation as Ke, findLayerById as ie, isCompilerCachingEnabled as Fe, resolveDefinition as je, resolveGeomCornerRadiusPx as ce, setCompilerCachingEnabled as Ue, toPercent as U } from "@graphysdk/viz-engine";
|
|
3
|
+
import { Component as We, useCallback as p, useEffect as B, useId as ze, useImperativeHandle as Ye, useMemo as L, useRef as le, useState as S, useSyncExternalStore as Ve } from "react";
|
|
4
|
+
import { Fragment as Xe, jsx as c, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
import { useStore as te } from "zustand";
|
|
6
|
+
import { motion as Q } from "motion/react";
|
|
7
|
+
import { createStore as se } from "zustand/vanilla";
|
|
8
|
+
import Qe from "clsx";
|
|
9
|
+
import './index.css';var Je = "_1a5iqpb0", Ze = "_1a5iqpb1";
|
|
10
|
+
var et = "_1a5iqpb3", tt = "_1a5iqpb4", rt = "_1a5iqpb5";
|
|
11
|
+
var de = ({ errors: e }) => {
|
|
12
12
|
const [t, ...r] = e;
|
|
13
13
|
return /* @__PURE__ */ f("div", {
|
|
14
14
|
role: "alert",
|
|
15
|
-
className:
|
|
15
|
+
className: Je,
|
|
16
16
|
children: [
|
|
17
17
|
/* @__PURE__ */ c("strong", {
|
|
18
|
-
className:
|
|
18
|
+
className: Ze,
|
|
19
19
|
children: "This chart could not be rendered."
|
|
20
20
|
}),
|
|
21
|
-
t && /* @__PURE__ */ c(
|
|
21
|
+
t && /* @__PURE__ */ c(ue, { diagnostic: t }),
|
|
22
22
|
r.length > 0 && /* @__PURE__ */ c("ul", {
|
|
23
23
|
className: "_1a5iqpb2",
|
|
24
|
-
children: r.map((n, s) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c(
|
|
24
|
+
children: r.map((n, s) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ c(ue, { diagnostic: n }) }, `${n.code}-${s}`))
|
|
25
25
|
})
|
|
26
26
|
]
|
|
27
27
|
});
|
|
28
|
-
},
|
|
29
|
-
className:
|
|
28
|
+
}, ue = ({ diagnostic: e }) => /* @__PURE__ */ f("div", {
|
|
29
|
+
className: et,
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ c("span", {
|
|
32
|
-
className:
|
|
32
|
+
className: tt,
|
|
33
33
|
children: e.code
|
|
34
34
|
}),
|
|
35
35
|
/* @__PURE__ */ c("p", {
|
|
36
|
-
className:
|
|
36
|
+
className: rt,
|
|
37
37
|
children: e.message
|
|
38
38
|
}),
|
|
39
39
|
e.suggestion && /* @__PURE__ */ c("p", {
|
|
@@ -42,47 +42,47 @@ var le = ({ errors: e }) => {
|
|
|
42
42
|
})
|
|
43
43
|
]
|
|
44
44
|
});
|
|
45
|
-
function
|
|
45
|
+
function nt(e = [], t = []) {
|
|
46
46
|
return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
|
|
47
47
|
}
|
|
48
|
-
var
|
|
48
|
+
var st = class extends We {
|
|
49
49
|
constructor(...e) {
|
|
50
50
|
super(...e), this.state = { caughtDiagnostic: null };
|
|
51
51
|
}
|
|
52
52
|
static getDerivedStateFromError(e) {
|
|
53
|
-
return { caughtDiagnostic:
|
|
53
|
+
return { caughtDiagnostic: ae(e) };
|
|
54
54
|
}
|
|
55
55
|
componentDidCatch(e, t) {
|
|
56
|
-
const r =
|
|
57
|
-
|
|
56
|
+
const r = ae(e);
|
|
57
|
+
ee([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
|
|
58
58
|
}
|
|
59
59
|
componentDidUpdate(e) {
|
|
60
|
-
this.state.caughtDiagnostic && !
|
|
60
|
+
this.state.caughtDiagnostic && !nt(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
|
|
61
61
|
}
|
|
62
62
|
render() {
|
|
63
63
|
const { caughtDiagnostic: e } = this.state;
|
|
64
|
-
if (e) return /* @__PURE__ */ c(
|
|
64
|
+
if (e) return /* @__PURE__ */ c(de, { errors: [e] });
|
|
65
65
|
const { forcedErrors: t, children: r } = this.props;
|
|
66
|
-
return t && t.length > 0 ? /* @__PURE__ */ c(
|
|
66
|
+
return t && t.length > 0 ? /* @__PURE__ */ c(de, { errors: t }) : r;
|
|
67
67
|
}
|
|
68
|
-
},
|
|
69
|
-
const t =
|
|
70
|
-
return t instanceof
|
|
71
|
-
},
|
|
72
|
-
const r = e.filter((n) =>
|
|
68
|
+
}, Ee = (e) => typeof e == "object" && "geom" in e && "render" in e, Te = (e) => {
|
|
69
|
+
const t = je(e);
|
|
70
|
+
return t instanceof He ? t : null;
|
|
71
|
+
}, ot = (e, t) => {
|
|
72
|
+
const r = e.filter((n) => at(n, t));
|
|
73
73
|
return r.length === e.length ? e : r;
|
|
74
|
-
},
|
|
75
|
-
selection:
|
|
76
|
-
setSelection: (t) => e((r) =>
|
|
77
|
-
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection:
|
|
78
|
-
})),
|
|
74
|
+
}, at = (e, t) => e.kind === "annotation" ? Ke(t.annotations, e.id) !== null : e.kind === "observations" ? ie(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? ie(t.layers, e.layerId) !== void 0 : !0, me = [], it = () => se((e) => ({
|
|
75
|
+
selection: me,
|
|
76
|
+
setSelection: (t) => e((r) => ct(r.selection, t) ? r : { selection: t }),
|
|
77
|
+
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: me })
|
|
78
|
+
})), ct = (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 && Me(r, s);
|
|
81
|
+
}), lt = process.env.NODE_ENV !== "production", dt = 5, ut = (e) => {
|
|
82
|
+
if (!lt) return {
|
|
83
83
|
emit: () => {
|
|
84
84
|
},
|
|
85
|
-
subscribe: () =>
|
|
85
|
+
subscribe: () => ht,
|
|
86
86
|
getLastTrigger: () => null,
|
|
87
87
|
getLastCompile: () => null,
|
|
88
88
|
getCacheStats: () => e.getCacheStats()
|
|
@@ -104,7 +104,7 @@ var nt = class extends Ue {
|
|
|
104
104
|
getLastCompile: () => e.getLastCompile(),
|
|
105
105
|
getCacheStats: () => e.getCacheStats()
|
|
106
106
|
};
|
|
107
|
-
},
|
|
107
|
+
}, mt = () => se((e) => ({
|
|
108
108
|
lastCompile: null,
|
|
109
109
|
history: [],
|
|
110
110
|
nextId: 1,
|
|
@@ -113,20 +113,20 @@ var nt = class extends Ue {
|
|
|
113
113
|
if (n.lastSnapshot === r) return n;
|
|
114
114
|
const s = {
|
|
115
115
|
id: n.nextId,
|
|
116
|
-
label:
|
|
116
|
+
label: gt(t),
|
|
117
117
|
stages: r.stages,
|
|
118
118
|
stageDurationsMs: r.stageDurationsMs,
|
|
119
119
|
durationMs: r.durationMs
|
|
120
120
|
};
|
|
121
121
|
return {
|
|
122
122
|
lastCompile: s,
|
|
123
|
-
history:
|
|
123
|
+
history: pt(n.history, s, dt),
|
|
124
124
|
nextId: n.nextId + 1,
|
|
125
125
|
lastSnapshot: r
|
|
126
126
|
};
|
|
127
127
|
})
|
|
128
|
-
})),
|
|
129
|
-
},
|
|
128
|
+
})), ht = () => {
|
|
129
|
+
}, gt = (e) => {
|
|
130
130
|
switch (e.kind) {
|
|
131
131
|
case "init":
|
|
132
132
|
return "init";
|
|
@@ -137,14 +137,14 @@ var nt = class extends Ue {
|
|
|
137
137
|
case "command":
|
|
138
138
|
return e.command.metadata.description;
|
|
139
139
|
}
|
|
140
|
-
},
|
|
140
|
+
}, pt = (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
|
-
function
|
|
145
|
-
const t = e.filter(
|
|
144
|
+
function he(e) {
|
|
145
|
+
const t = e.filter(Ee), 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 = Te(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",
|
|
@@ -160,32 +160,32 @@ function me(e) {
|
|
|
160
160
|
const i = /* @__PURE__ */ new Map();
|
|
161
161
|
for (const l of t) {
|
|
162
162
|
if ("definition" in l) continue;
|
|
163
|
-
const d = `${l.geom}|${l.coord}`,
|
|
164
|
-
|
|
163
|
+
const d = `${l.geom}|${l.coord}`, h = i.get(d);
|
|
164
|
+
h ? h.count += 1 : i.set(d, {
|
|
165
165
|
geom: l.geom,
|
|
166
166
|
coord: l.coord,
|
|
167
167
|
count: 1
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
const a = [];
|
|
171
|
-
for (const { geom: l, coord: d, count:
|
|
172
|
-
|
|
171
|
+
for (const { geom: l, coord: d, count: h } of i.values())
|
|
172
|
+
h < 2 || a.push({
|
|
173
173
|
kind: "userInput",
|
|
174
174
|
severity: "warning",
|
|
175
175
|
code: "DUPLICATE_REGISTERED_TYPE",
|
|
176
|
-
message: `Multiple render-only overrides register ('${l}', '${d}') (${
|
|
176
|
+
message: `Multiple render-only overrides register ('${l}', '${d}') (${h} entries); the last in the array wins.`,
|
|
177
177
|
context: {
|
|
178
178
|
requested: `${l}@${d}`,
|
|
179
179
|
kind: "geom-renderer"
|
|
180
180
|
},
|
|
181
181
|
suggestion: `Keep a single render-only override for ('${l}', '${d}').`
|
|
182
182
|
});
|
|
183
|
-
return a.push(...
|
|
183
|
+
return a.push(...Gt(e)), {
|
|
184
184
|
errors: n,
|
|
185
185
|
warnings: a
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function ft(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 vt(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 || z(l) || (s.add(a.geom), i.push({
|
|
210
210
|
kind: "userInput",
|
|
211
211
|
severity: "warning",
|
|
212
212
|
code: "MISSING_RENDER_HIT_TEST",
|
|
@@ -220,7 +220,7 @@ function vt(e, t) {
|
|
|
220
220
|
}
|
|
221
221
|
return i;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function yt(e) {
|
|
224
224
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
225
225
|
for (const n of e.layers) {
|
|
226
226
|
const s = n.identityKey;
|
|
@@ -238,12 +238,12 @@ function ft(e) {
|
|
|
238
238
|
}
|
|
239
239
|
return r;
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function St(e, t) {
|
|
242
242
|
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
|
|
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 || !z(l) || (s.add(a.geom), i.push({
|
|
247
247
|
kind: "userInput",
|
|
248
248
|
severity: "warning",
|
|
249
249
|
code: "CONFLICTING_RENDER_HIT_TEST",
|
|
@@ -257,7 +257,7 @@ function yt(e, t) {
|
|
|
257
257
|
}
|
|
258
258
|
return i;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function bt(e, t) {
|
|
261
261
|
const r = /* @__PURE__ */ new Set(), n = [];
|
|
262
262
|
for (const s of e.layers)
|
|
263
263
|
s.interactive !== !1 && (s.spatialKind !== "renderHitTest" || r.has(s.geom) || t.hasCapability(s.geom) || (r.add(s.geom), n.push({
|
|
@@ -273,12 +273,12 @@ function St(e, t) {
|
|
|
273
273
|
})));
|
|
274
274
|
return n;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function Et(e, t) {
|
|
277
277
|
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
|
|
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 || !z(l) || (s.add(a.geom), i.push({
|
|
282
282
|
kind: "userInput",
|
|
283
283
|
severity: "warning",
|
|
284
284
|
code: "LIVE_RENDER_REQUIRES_RENDER_HIT_TEST",
|
|
@@ -292,9 +292,9 @@ function bt(e, t) {
|
|
|
292
292
|
}
|
|
293
293
|
return i;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function Tt(e, t) {
|
|
296
296
|
let r;
|
|
297
|
-
return e.layers.flatMap((n, s) =>
|
|
297
|
+
return e.layers.flatMap((n, s) => z(t(n.geom, e.coordSystem.type)) ? Rt(n) ? (r ??= be().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",
|
|
@@ -307,11 +307,11 @@ function Et(e, t) {
|
|
|
307
307
|
suggestion: "Remove the hovered overpaint, or paint the hover treatment in the geom's live render."
|
|
308
308
|
}]) : [] : []);
|
|
309
309
|
}
|
|
310
|
-
var
|
|
311
|
-
function
|
|
310
|
+
var Rt = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
|
|
311
|
+
function Gt(e) {
|
|
312
312
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
313
313
|
for (const n of e) {
|
|
314
|
-
const s =
|
|
314
|
+
const s = Te(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",
|
|
@@ -326,64 +326,65 @@ function Rt(e) {
|
|
|
326
326
|
}
|
|
327
327
|
return r;
|
|
328
328
|
}
|
|
329
|
-
var Nt = (e) =>
|
|
329
|
+
var Nt = (e) => se((t) => ({
|
|
330
330
|
scene: e,
|
|
331
331
|
setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
|
|
332
|
-
})),
|
|
333
|
-
const G =
|
|
334
|
-
const o =
|
|
332
|
+
})), Ct = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: i, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: h }) => {
|
|
333
|
+
const G = Z(l), N = Z(d), E = Z(h), [{ session: g, compileBus: u, findGeom: T }] = S(() => {
|
|
334
|
+
const o = Be({
|
|
335
335
|
plugins: n,
|
|
336
336
|
theme: s
|
|
337
337
|
});
|
|
338
338
|
return {
|
|
339
|
-
session: new
|
|
340
|
-
compileBus:
|
|
339
|
+
session: new $e(o),
|
|
340
|
+
compileBus: ut(o),
|
|
341
|
+
findGeom: (m) => o.findGeom(m)
|
|
341
342
|
};
|
|
342
|
-
}), [
|
|
343
|
-
const o =
|
|
343
|
+
}), [v] = S(() => {
|
|
344
|
+
const o = he(n ?? []), m = he(s?.plugins ?? []);
|
|
344
345
|
return {
|
|
345
|
-
errors: [...
|
|
346
|
-
warnings: [...
|
|
346
|
+
errors: [...m.errors, ...o.errors],
|
|
347
|
+
warnings: [...m.warnings, ...o.warnings]
|
|
347
348
|
};
|
|
348
|
-
}), R =
|
|
349
|
+
}), R = le(null), [q] = S(It), C = le(null), b = p((o) => v.errors.length === 0 ? o : [...v.errors, ...o ?? []], [v]), _ = p((o) => {
|
|
349
350
|
if (!o.ok) return o.errors;
|
|
350
|
-
if (
|
|
351
|
+
if (C.current) C.current.getState().setScene(o.scene);
|
|
351
352
|
else {
|
|
352
|
-
const
|
|
353
|
-
|
|
353
|
+
const m = Nt(o.scene);
|
|
354
|
+
m.subscribe(q.notify), C.current = m, q.notify();
|
|
354
355
|
}
|
|
355
356
|
return null;
|
|
356
|
-
}, [
|
|
357
|
+
}, [q]), [O, P] = S(() => {
|
|
357
358
|
const o = g.compile({
|
|
358
359
|
spec: e,
|
|
359
360
|
data: t,
|
|
360
361
|
colorScheme: r
|
|
361
362
|
});
|
|
362
|
-
return R.current = o,
|
|
363
|
-
}),
|
|
363
|
+
return R.current = o, b(_(o));
|
|
364
|
+
}), I = p((o) => o.ok ? [
|
|
364
365
|
...o.warnings,
|
|
365
|
-
...
|
|
366
|
+
...ft(o.scene, i),
|
|
366
367
|
...vt(o.scene, i),
|
|
367
|
-
...
|
|
368
|
-
...
|
|
369
|
-
...bt(o.scene, i),
|
|
368
|
+
...yt(o.scene),
|
|
369
|
+
...St(o.scene, i),
|
|
370
370
|
...Et(o.scene, i),
|
|
371
|
-
...
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
371
|
+
...Tt(o.scene, i),
|
|
372
|
+
...bt(o.scene, a)
|
|
373
|
+
] : o.warnings, [i, a]), D = p((o) => {
|
|
374
|
+
o.length !== 0 && (ee(o), N.current?.(o));
|
|
375
|
+
}, [N]), w = p((o) => {
|
|
376
|
+
o.length !== 0 && (ee(o), E.current?.(o));
|
|
377
|
+
}, [E]);
|
|
378
|
+
B(() => {
|
|
378
379
|
const o = R.current;
|
|
379
|
-
o && (D([...
|
|
380
|
+
o && (D([...v.errors, ...o.ok ? [] : o.errors]), w([...v.warnings, ...I(o)]), o.ok && u.emit({ kind: "init" }));
|
|
380
381
|
}, [
|
|
381
382
|
u,
|
|
382
383
|
D,
|
|
383
384
|
w,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
]),
|
|
385
|
+
v,
|
|
386
|
+
I
|
|
387
|
+
]), B(() => {
|
|
387
388
|
const o = g.update({
|
|
388
389
|
spec: e,
|
|
389
390
|
data: t,
|
|
@@ -391,64 +392,65 @@ var Nt = (e) => ne((t) => ({
|
|
|
391
392
|
});
|
|
392
393
|
if (!o) return;
|
|
393
394
|
o.committedSpec && G.current?.(o.committedSpec);
|
|
394
|
-
const
|
|
395
|
-
|
|
395
|
+
const m = _(o.result);
|
|
396
|
+
P(b(m)), m && D(m), w(I(o.result)), m || u.emit({ kind: o.hasSpecChange ? "spec" : "data" });
|
|
396
397
|
}, [
|
|
397
398
|
e,
|
|
398
399
|
t,
|
|
399
400
|
r,
|
|
400
401
|
g,
|
|
401
402
|
u,
|
|
402
|
-
|
|
403
|
+
_,
|
|
403
404
|
D,
|
|
404
405
|
w,
|
|
405
|
-
|
|
406
|
-
|
|
406
|
+
b,
|
|
407
|
+
I,
|
|
407
408
|
G
|
|
408
409
|
]);
|
|
409
|
-
const
|
|
410
|
-
|
|
410
|
+
const K = p((o) => {
|
|
411
|
+
P((m) => m === null ? m : b(null)), w(I(o));
|
|
411
412
|
}, [
|
|
412
|
-
|
|
413
|
+
b,
|
|
413
414
|
w,
|
|
414
|
-
|
|
415
|
-
]),
|
|
416
|
-
o.scene &&
|
|
415
|
+
I
|
|
416
|
+
]), H = p((o) => {
|
|
417
|
+
o.scene && C.current?.getState().setScene(o.scene), o.result && K(o.result), o.command && u.emit({
|
|
417
418
|
kind: "command",
|
|
418
419
|
command: o.command
|
|
419
420
|
}), o.spec && G.current?.(o.spec), o.errors && D([...o.errors]);
|
|
420
421
|
}, [
|
|
421
|
-
|
|
422
|
+
K,
|
|
422
423
|
u,
|
|
423
424
|
G,
|
|
424
425
|
D
|
|
425
|
-
]),
|
|
426
|
-
for (const
|
|
427
|
-
return o.some((
|
|
428
|
-
}, [
|
|
429
|
-
|
|
430
|
-
}, [g,
|
|
431
|
-
|
|
432
|
-
}, [g,
|
|
426
|
+
]), y = p((o) => {
|
|
427
|
+
for (const m of o) H(m);
|
|
428
|
+
return o.some((m) => !!m.scene);
|
|
429
|
+
}, [H]), F = p((o, m) => {
|
|
430
|
+
y(g.applyCommand(o, m));
|
|
431
|
+
}, [g, y]), k = p(() => {
|
|
432
|
+
y(g.commit());
|
|
433
|
+
}, [g, y]), j = p(() => y(g.undo()), [g, y]), $ = p(() => y(g.redo()), [g, y]), J = L(() => ({
|
|
433
434
|
stack: g.history,
|
|
434
|
-
undo:
|
|
435
|
-
redo:
|
|
435
|
+
undo: j,
|
|
436
|
+
redo: $
|
|
436
437
|
}), [
|
|
437
438
|
g,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
]),
|
|
439
|
+
j,
|
|
440
|
+
$
|
|
441
|
+
]), Ge = p(() => C.current?.getState().scene ?? null, []);
|
|
441
442
|
return {
|
|
442
|
-
store:
|
|
443
|
-
dispatch:
|
|
444
|
-
commit:
|
|
445
|
-
history:
|
|
446
|
-
subscribe:
|
|
447
|
-
getScene:
|
|
443
|
+
store: C.current,
|
|
444
|
+
dispatch: F,
|
|
445
|
+
commit: k,
|
|
446
|
+
history: J,
|
|
447
|
+
subscribe: q.subscribe,
|
|
448
|
+
getScene: Ge,
|
|
448
449
|
compileBus: u,
|
|
449
|
-
compileErrors:
|
|
450
|
+
compileErrors: O,
|
|
451
|
+
findGeom: T
|
|
450
452
|
};
|
|
451
|
-
},
|
|
453
|
+
}, It = () => {
|
|
452
454
|
const e = /* @__PURE__ */ new Set();
|
|
453
455
|
return {
|
|
454
456
|
subscribe: (t) => (e.add(t), () => {
|
|
@@ -456,87 +458,89 @@ var Nt = (e) => ne((t) => ({
|
|
|
456
458
|
}),
|
|
457
459
|
notify: () => e.forEach((t) => t())
|
|
458
460
|
};
|
|
459
|
-
},
|
|
460
|
-
const [
|
|
461
|
+
}, Dt = ({ data: e, spec: t, plugins: r = [], theme: n, formattingLocale: s, handleRef: i, onSpecChange: a, onError: l, onWarnings: d, colorScheme: h = "light", children: G }) => {
|
|
462
|
+
const [N] = S(() => n), E = N?.colorScheme ?? h, [g] = S(() => Le([...N?.plugins ?? [], ...r].filter(Ee))), u = ze(), [T] = S(() => xe(r)), [v] = S(() => Ae(r)), [R] = S(() => it()), [q] = S(() => De()), C = L(() => be({ colorScheme: E }), [E]), { store: b, dispatch: _, commit: O, history: P, subscribe: I, getScene: D, compileBus: w, compileErrors: K, findGeom: H } = Ct({
|
|
461
463
|
spec: t,
|
|
462
464
|
data: e,
|
|
463
|
-
colorScheme:
|
|
465
|
+
colorScheme: E,
|
|
464
466
|
plugins: r,
|
|
465
|
-
theme:
|
|
467
|
+
theme: N,
|
|
466
468
|
resolveRenderer: g,
|
|
467
|
-
anchorResolver:
|
|
469
|
+
anchorResolver: T,
|
|
468
470
|
onSpecChange: a,
|
|
469
471
|
onError: l,
|
|
470
472
|
onWarnings: d
|
|
471
473
|
});
|
|
472
|
-
|
|
473
|
-
if (
|
|
474
|
-
return
|
|
475
|
-
if (
|
|
476
|
-
const { selection:
|
|
477
|
-
|
|
474
|
+
B(() => {
|
|
475
|
+
if (b)
|
|
476
|
+
return b.subscribe((k, j) => {
|
|
477
|
+
if (k.scene.spec === j.scene.spec) return;
|
|
478
|
+
const { selection: $, setSelection: J } = R.getState();
|
|
479
|
+
$.length !== 0 && J(ot($, k.scene.spec));
|
|
478
480
|
});
|
|
479
|
-
}, [
|
|
480
|
-
const
|
|
481
|
-
dispatch:
|
|
482
|
-
commit:
|
|
483
|
-
}), [
|
|
484
|
-
|
|
485
|
-
commands:
|
|
486
|
-
undo:
|
|
487
|
-
redo:
|
|
488
|
-
subscribe:
|
|
489
|
-
getScene:
|
|
490
|
-
getSelection: () =>
|
|
491
|
-
setSelection: (
|
|
492
|
-
subscribeSelection:
|
|
493
|
-
canPlaceDataLabels:
|
|
494
|
-
canFormatDataLabelsAsPercentages:
|
|
481
|
+
}, [b, R]);
|
|
482
|
+
const y = L(() => ({
|
|
483
|
+
dispatch: _,
|
|
484
|
+
commit: O
|
|
485
|
+
}), [_, O]);
|
|
486
|
+
Ye(i, () => ({
|
|
487
|
+
commands: y,
|
|
488
|
+
undo: P.undo,
|
|
489
|
+
redo: P.redo,
|
|
490
|
+
subscribe: I,
|
|
491
|
+
getScene: D,
|
|
492
|
+
getSelection: () => R.getState().selection,
|
|
493
|
+
setSelection: (k) => R.getState().setSelection(k),
|
|
494
|
+
subscribeSelection: R.subscribe,
|
|
495
|
+
canPlaceDataLabels: v.hasCapability,
|
|
496
|
+
canFormatDataLabelsAsPercentages: v.hasPercentageFormat
|
|
495
497
|
}), [
|
|
496
|
-
S,
|
|
497
|
-
E,
|
|
498
|
-
D,
|
|
499
|
-
w,
|
|
500
498
|
y,
|
|
501
|
-
|
|
499
|
+
P,
|
|
500
|
+
I,
|
|
501
|
+
D,
|
|
502
|
+
R,
|
|
503
|
+
v
|
|
502
504
|
]);
|
|
503
|
-
const
|
|
505
|
+
const F = L(() => b ? {
|
|
504
506
|
chartId: u,
|
|
505
|
-
store:
|
|
506
|
-
selectionStore:
|
|
507
|
-
targetBoundaryStore:
|
|
508
|
-
commands:
|
|
509
|
-
history:
|
|
507
|
+
store: b,
|
|
508
|
+
selectionStore: R,
|
|
509
|
+
targetBoundaryStore: q,
|
|
510
|
+
commands: y,
|
|
511
|
+
history: P,
|
|
510
512
|
formattingLocale: s,
|
|
511
|
-
compileBus:
|
|
512
|
-
colorScheme:
|
|
513
|
-
styleResolver:
|
|
514
|
-
anchorResolver:
|
|
513
|
+
compileBus: w,
|
|
514
|
+
colorScheme: E,
|
|
515
|
+
styleResolver: C,
|
|
516
|
+
anchorResolver: T,
|
|
517
|
+
findGeom: H
|
|
515
518
|
} : null, [
|
|
516
519
|
u,
|
|
517
|
-
|
|
520
|
+
b,
|
|
521
|
+
R,
|
|
522
|
+
q,
|
|
518
523
|
y,
|
|
519
|
-
|
|
520
|
-
S,
|
|
521
|
-
E,
|
|
524
|
+
P,
|
|
522
525
|
s,
|
|
523
|
-
|
|
526
|
+
w,
|
|
527
|
+
E,
|
|
528
|
+
C,
|
|
524
529
|
T,
|
|
525
|
-
|
|
526
|
-
p
|
|
530
|
+
H
|
|
527
531
|
]);
|
|
528
|
-
return /* @__PURE__ */ c(
|
|
529
|
-
forcedErrors:
|
|
532
|
+
return /* @__PURE__ */ c(st, {
|
|
533
|
+
forcedErrors: K,
|
|
530
534
|
onError: l,
|
|
531
535
|
resetKeys: [t, e],
|
|
532
|
-
children:
|
|
533
|
-
value:
|
|
534
|
-
children: /* @__PURE__ */ c(
|
|
536
|
+
children: F ? /* @__PURE__ */ c(Ne.Provider, {
|
|
537
|
+
value: F,
|
|
538
|
+
children: /* @__PURE__ */ c(Ce, {
|
|
535
539
|
value: g,
|
|
536
|
-
children: /* @__PURE__ */ c(
|
|
537
|
-
value:
|
|
538
|
-
children: /* @__PURE__ */ c(
|
|
539
|
-
shapes:
|
|
540
|
+
children: /* @__PURE__ */ c(Ie, {
|
|
541
|
+
value: v,
|
|
542
|
+
children: /* @__PURE__ */ c(A, {
|
|
543
|
+
shapes: N?.shapes,
|
|
540
544
|
children: G
|
|
541
545
|
})
|
|
542
546
|
})
|
|
@@ -544,40 +548,40 @@ var Nt = (e) => ne((t) => ({
|
|
|
544
548
|
}) : null
|
|
545
549
|
});
|
|
546
550
|
};
|
|
547
|
-
function
|
|
548
|
-
const r =
|
|
551
|
+
function an({ theme: e, ...t } = {}) {
|
|
552
|
+
const r = Oe(t);
|
|
549
553
|
return {
|
|
550
554
|
...r,
|
|
551
|
-
GraphProvider: (s) => /* @__PURE__ */ c(
|
|
555
|
+
GraphProvider: (s) => /* @__PURE__ */ c(Dt, {
|
|
552
556
|
...s,
|
|
553
557
|
plugins: r.plugins,
|
|
554
558
|
theme: e
|
|
555
559
|
})
|
|
556
560
|
};
|
|
557
561
|
}
|
|
558
|
-
var
|
|
562
|
+
var x = (e, t) => {
|
|
559
563
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
560
564
|
if (!e.endsWith("%")) return null;
|
|
561
565
|
const r = Number.parseFloat(e);
|
|
562
566
|
return Number.isFinite(r) ? r / 100 * t : null;
|
|
563
|
-
},
|
|
564
|
-
const i =
|
|
567
|
+
}, cn = ({ x: e, y: t, width: r, height: n }, s) => {
|
|
568
|
+
const i = x(e, s.width), a = x(t, s.height), l = x(r, s.width), d = x(n, s.height);
|
|
565
569
|
return i === null || a === null || l === null || d === null ? null : {
|
|
566
570
|
x: i,
|
|
567
571
|
y: a,
|
|
568
572
|
width: l,
|
|
569
573
|
height: d
|
|
570
574
|
};
|
|
571
|
-
},
|
|
572
|
-
const a =
|
|
573
|
-
return e ? /* @__PURE__ */ c(
|
|
575
|
+
}, wt = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...i }) => {
|
|
576
|
+
const a = X(s);
|
|
577
|
+
return e ? /* @__PURE__ */ c(Q.circle, {
|
|
574
578
|
initial: !1,
|
|
575
579
|
animate: {
|
|
576
580
|
cx: t,
|
|
577
581
|
cy: r,
|
|
578
582
|
r: n
|
|
579
583
|
},
|
|
580
|
-
transition:
|
|
584
|
+
transition: V,
|
|
581
585
|
style: a,
|
|
582
586
|
...i
|
|
583
587
|
}) : /* @__PURE__ */ c("circle", {
|
|
@@ -587,9 +591,9 @@ var M = (e, t) => {
|
|
|
587
591
|
style: a,
|
|
588
592
|
...i
|
|
589
593
|
});
|
|
590
|
-
},
|
|
591
|
-
const l =
|
|
592
|
-
return e ? /* @__PURE__ */ c(
|
|
594
|
+
}, Pt = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: i, ...a }) => {
|
|
595
|
+
const l = X(i);
|
|
596
|
+
return e ? /* @__PURE__ */ c(Q.line, {
|
|
593
597
|
initial: !1,
|
|
594
598
|
animate: {
|
|
595
599
|
x1: t,
|
|
@@ -597,7 +601,7 @@ var M = (e, t) => {
|
|
|
597
601
|
x2: n,
|
|
598
602
|
y2: s
|
|
599
603
|
},
|
|
600
|
-
transition:
|
|
604
|
+
transition: V,
|
|
601
605
|
style: l,
|
|
602
606
|
...a
|
|
603
607
|
}) : /* @__PURE__ */ c("line", {
|
|
@@ -608,9 +612,9 @@ var M = (e, t) => {
|
|
|
608
612
|
style: l,
|
|
609
613
|
...a
|
|
610
614
|
});
|
|
611
|
-
},
|
|
612
|
-
const
|
|
613
|
-
return e ? /* @__PURE__ */ c(
|
|
615
|
+
}, qt = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: i, ry: a, effects: l, ...d }) => {
|
|
616
|
+
const h = X(l);
|
|
617
|
+
return e ? /* @__PURE__ */ c(Q.rect, {
|
|
614
618
|
initial: !1,
|
|
615
619
|
animate: {
|
|
616
620
|
attrX: t,
|
|
@@ -622,8 +626,8 @@ var M = (e, t) => {
|
|
|
622
626
|
ry: a
|
|
623
627
|
} : {}
|
|
624
628
|
},
|
|
625
|
-
transition:
|
|
626
|
-
style:
|
|
629
|
+
transition: V,
|
|
630
|
+
style: h,
|
|
627
631
|
...d
|
|
628
632
|
}) : /* @__PURE__ */ c("rect", {
|
|
629
633
|
x: t,
|
|
@@ -632,12 +636,12 @@ var M = (e, t) => {
|
|
|
632
636
|
height: s,
|
|
633
637
|
rx: i,
|
|
634
638
|
ry: a,
|
|
635
|
-
style:
|
|
639
|
+
style: h,
|
|
636
640
|
...d
|
|
637
641
|
});
|
|
638
|
-
},
|
|
639
|
-
const i =
|
|
640
|
-
return e ? /* @__PURE__ */ c(
|
|
642
|
+
}, _t = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
|
|
643
|
+
const i = X(n);
|
|
644
|
+
return e ? /* @__PURE__ */ c(kt, {
|
|
641
645
|
d: t,
|
|
642
646
|
source: r,
|
|
643
647
|
style: i,
|
|
@@ -647,56 +651,56 @@ var M = (e, t) => {
|
|
|
647
651
|
style: i,
|
|
648
652
|
...s
|
|
649
653
|
});
|
|
650
|
-
}, cn = (e) => {
|
|
651
|
-
const { Circle: t } = z();
|
|
652
|
-
return t === void 0 ? Dt(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
|
|
653
654
|
}, ln = (e) => {
|
|
654
|
-
const {
|
|
655
|
-
return t === void 0 ? wt(e) : /* @__PURE__ */ c(
|
|
656
|
-
}, dn = (
|
|
657
|
-
const {
|
|
655
|
+
const { Circle: t } = Y();
|
|
656
|
+
return t === void 0 ? wt(e) : /* @__PURE__ */ c(A, { children: /* @__PURE__ */ c(t, { ...e }) });
|
|
657
|
+
}, dn = (e) => {
|
|
658
|
+
const { Line: t } = Y();
|
|
659
|
+
return t === void 0 ? Pt(e) : /* @__PURE__ */ c(A, { children: /* @__PURE__ */ c(t, { ...e }) });
|
|
660
|
+
}, un = ({ cornerRadius: e, ...t }) => {
|
|
661
|
+
const { Rect: r } = Y(), n = ye(), s = qe(), i = {
|
|
658
662
|
...t,
|
|
659
|
-
...
|
|
663
|
+
...Lt(e, t, n, s)
|
|
660
664
|
};
|
|
661
|
-
return r === void 0 ?
|
|
662
|
-
},
|
|
663
|
-
const { Path: t } =
|
|
664
|
-
return t === void 0 ?
|
|
665
|
-
},
|
|
666
|
-
const n =
|
|
667
|
-
return /* @__PURE__ */ c(
|
|
665
|
+
return r === void 0 ? qt(i) : /* @__PURE__ */ c(A, { children: /* @__PURE__ */ c(r, { ...i }) });
|
|
666
|
+
}, mn = (e) => {
|
|
667
|
+
const { Path: t } = Y();
|
|
668
|
+
return t === void 0 ? _t(e) : /* @__PURE__ */ c(A, { children: /* @__PURE__ */ c(t, { ...e }) });
|
|
669
|
+
}, kt = ({ d: e, source: t, ...r }) => {
|
|
670
|
+
const n = Pe(e, V, t);
|
|
671
|
+
return /* @__PURE__ */ c(Q.path, {
|
|
668
672
|
d: n,
|
|
669
673
|
...r
|
|
670
674
|
});
|
|
671
|
-
},
|
|
675
|
+
}, Lt = (e, t, r, n) => {
|
|
672
676
|
if (e === void 0) return {};
|
|
673
|
-
const s =
|
|
677
|
+
const s = Ht(t, r, n);
|
|
674
678
|
if (s === null)
|
|
675
|
-
return e === "full" ? {} :
|
|
676
|
-
const i = Math.min(
|
|
679
|
+
return e === "full" ? {} : pe(ce({ cornerRadius: e }), n);
|
|
680
|
+
const i = Math.min(ce({
|
|
677
681
|
cornerRadius: e,
|
|
678
682
|
box: s
|
|
679
683
|
}), Math.min(s.width, s.height) / 2);
|
|
680
|
-
return
|
|
681
|
-
},
|
|
682
|
-
const n =
|
|
684
|
+
return pe(i, n);
|
|
685
|
+
}, Ht = (e, t, r) => {
|
|
686
|
+
const n = ge(e.width, t?.width, r.x), s = ge(e.height, t?.height, r.y);
|
|
683
687
|
return n === null || s === null ? null : {
|
|
684
688
|
width: n,
|
|
685
689
|
height: s
|
|
686
690
|
};
|
|
687
|
-
},
|
|
691
|
+
}, ge = (e, t, r) => {
|
|
688
692
|
if (typeof e == "number") return Number.isFinite(e) ? Math.abs(e) * r : null;
|
|
689
693
|
if (t === void 0) return null;
|
|
690
|
-
const n =
|
|
694
|
+
const n = x(e, t);
|
|
691
695
|
return n === null ? null : Math.abs(n);
|
|
692
|
-
},
|
|
696
|
+
}, pe = (e, t) => t.x <= 0 || t.y <= 0 ? {
|
|
693
697
|
rx: 0,
|
|
694
698
|
ry: 0
|
|
695
699
|
} : {
|
|
696
700
|
rx: e / t.x,
|
|
697
701
|
ry: e / t.y
|
|
698
|
-
},
|
|
699
|
-
const r =
|
|
702
|
+
}, hn = ({ children: e, ...t }) => {
|
|
703
|
+
const r = ye();
|
|
700
704
|
return /* @__PURE__ */ c("svg", {
|
|
701
705
|
viewBox: "0 0 1 1",
|
|
702
706
|
preserveAspectRatio: "none",
|
|
@@ -704,72 +708,72 @@ var M = (e, t) => {
|
|
|
704
708
|
height: "100%",
|
|
705
709
|
pointerEvents: "none",
|
|
706
710
|
...t,
|
|
707
|
-
children: /* @__PURE__ */ c(
|
|
711
|
+
children: /* @__PURE__ */ c(Se, {
|
|
708
712
|
size: r,
|
|
709
713
|
space: "unit",
|
|
710
714
|
children: e
|
|
711
715
|
})
|
|
712
716
|
});
|
|
713
|
-
},
|
|
714
|
-
const r =
|
|
717
|
+
}, gn = ({ box: e, children: t }) => {
|
|
718
|
+
const r = _e(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), i = L(() => n === null || s === null ? null : {
|
|
715
719
|
width: n,
|
|
716
720
|
height: s
|
|
717
721
|
}, [n, s]);
|
|
718
722
|
return /* @__PURE__ */ c("svg", {
|
|
719
|
-
x:
|
|
720
|
-
y:
|
|
721
|
-
width:
|
|
722
|
-
height:
|
|
723
|
+
x: U(e.x0),
|
|
724
|
+
y: U(e.y0),
|
|
725
|
+
width: U(e.x1 - e.x0),
|
|
726
|
+
height: U(e.y1 - e.y0),
|
|
723
727
|
overflow: "hidden",
|
|
724
728
|
pointerEvents: "none",
|
|
725
|
-
children: /* @__PURE__ */ c(
|
|
729
|
+
children: /* @__PURE__ */ c(Se, {
|
|
726
730
|
size: i,
|
|
727
731
|
children: t
|
|
728
732
|
})
|
|
729
733
|
});
|
|
730
|
-
},
|
|
731
|
-
var
|
|
732
|
-
var
|
|
734
|
+
}, $t = "drqe3u0", Mt = "drqe3u1", xt = "drqe3u2", Bt = "drqe3u3", M = "drqe3u4", At = "drqe3u5", Ot = "drqe3u6", Kt = "drqe3u7", W = "drqe3u8", Ft = "drqe3u9", jt = "drqe3ua";
|
|
735
|
+
var Ut = "drqe3uc", Wt = "drqe3ud", zt = "drqe3ue", Yt = "drqe3uf";
|
|
736
|
+
var Vt = "drqe3uh", Xt = "drqe3ui", fe = {
|
|
733
737
|
enabled: "drqe3uk drqe3uj",
|
|
734
738
|
disabled: "drqe3ul drqe3uj"
|
|
735
739
|
}, ve = {
|
|
736
740
|
ran: "drqe3un drqe3um",
|
|
737
741
|
dim: "drqe3uo drqe3um"
|
|
738
|
-
},
|
|
742
|
+
}, Re = {
|
|
739
743
|
ran: "drqe3uq drqe3up",
|
|
740
744
|
cached: "drqe3ur drqe3up",
|
|
741
745
|
untouched: "drqe3us drqe3up"
|
|
742
|
-
},
|
|
743
|
-
const { compileBus: n } =
|
|
744
|
-
|
|
745
|
-
const { recordCompile: u } = s.getState(),
|
|
746
|
-
return
|
|
746
|
+
}, pn = ({ width: e = 440, style: t, className: r } = {}) => {
|
|
747
|
+
const { compileBus: n } = re(), [s] = S(() => mt()), [i, a] = S(!1), [l, d] = S(Fe);
|
|
748
|
+
B(() => {
|
|
749
|
+
const { recordCompile: u } = s.getState(), T = n.getLastTrigger(), v = n.getLastCompile();
|
|
750
|
+
return T && v && u(T, v), n.subscribe(u);
|
|
747
751
|
}, [s, n]);
|
|
748
|
-
const
|
|
752
|
+
const h = te(s, (u) => u.lastCompile), G = te(s, (u) => u.history), N = n.getCacheStats(), E = h === null && G.length === 0, g = () => {
|
|
749
753
|
d((u) => {
|
|
750
|
-
const
|
|
751
|
-
return
|
|
754
|
+
const T = !u;
|
|
755
|
+
return Ue(T), T;
|
|
752
756
|
});
|
|
753
757
|
};
|
|
754
758
|
return /* @__PURE__ */ f("div", {
|
|
755
|
-
className:
|
|
759
|
+
className: Qe(jt, r),
|
|
756
760
|
style: {
|
|
757
761
|
width: e,
|
|
758
762
|
...t
|
|
759
763
|
},
|
|
760
764
|
children: [
|
|
761
765
|
/* @__PURE__ */ f("div", {
|
|
762
|
-
className:
|
|
766
|
+
className: $t,
|
|
763
767
|
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ c("div", {
|
|
764
|
-
className:
|
|
768
|
+
className: Mt,
|
|
765
769
|
children: "compile cache"
|
|
766
770
|
}), /* @__PURE__ */ c("div", {
|
|
767
|
-
className:
|
|
768
|
-
children:
|
|
771
|
+
className: zt,
|
|
772
|
+
children: E ? "production: stats disabled" : h ? `last: ${h.label} · ${oe(h.durationMs)}` : "awaiting first compile…"
|
|
769
773
|
})] }), /* @__PURE__ */ c("button", {
|
|
770
774
|
type: "button",
|
|
771
775
|
onClick: () => a((u) => !u),
|
|
772
|
-
className:
|
|
776
|
+
className: Yt,
|
|
773
777
|
children: i ? "▾" : "▴"
|
|
774
778
|
})]
|
|
775
779
|
}),
|
|
@@ -778,7 +782,7 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
|
|
|
778
782
|
children: [/* @__PURE__ */ f("button", {
|
|
779
783
|
type: "button",
|
|
780
784
|
onClick: g,
|
|
781
|
-
className: l ?
|
|
785
|
+
className: l ? fe.enabled : fe.disabled,
|
|
782
786
|
"aria-pressed": l,
|
|
783
787
|
children: ["cache ", l ? "enabled" : "disabled"]
|
|
784
788
|
}), /* @__PURE__ */ c("span", {
|
|
@@ -786,53 +790,53 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
|
|
|
786
790
|
children: "next compile reflects this toggle"
|
|
787
791
|
})]
|
|
788
792
|
}),
|
|
789
|
-
!i && !
|
|
790
|
-
delta:
|
|
791
|
-
durations:
|
|
792
|
-
cumulative:
|
|
793
|
-
}), /* @__PURE__ */ c(
|
|
793
|
+
!i && !E && /* @__PURE__ */ f(Xe, { children: [/* @__PURE__ */ c(Qt, {
|
|
794
|
+
delta: h?.stages,
|
|
795
|
+
durations: h?.stageDurationsMs,
|
|
796
|
+
cumulative: N
|
|
797
|
+
}), /* @__PURE__ */ c(Jt, { entries: G })] })
|
|
794
798
|
]
|
|
795
799
|
});
|
|
796
|
-
},
|
|
797
|
-
className:
|
|
800
|
+
}, Qt = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ f("table", {
|
|
801
|
+
className: xt,
|
|
798
802
|
children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ f("tr", {
|
|
799
|
-
className:
|
|
803
|
+
className: Vt,
|
|
800
804
|
children: [
|
|
801
805
|
/* @__PURE__ */ c("th", {
|
|
802
|
-
className:
|
|
806
|
+
className: Bt,
|
|
803
807
|
children: "stage"
|
|
804
808
|
}),
|
|
805
809
|
/* @__PURE__ */ c("th", {
|
|
806
|
-
className:
|
|
810
|
+
className: M,
|
|
807
811
|
children: "time"
|
|
808
812
|
}),
|
|
809
813
|
/* @__PURE__ */ c("th", {
|
|
810
|
-
className:
|
|
814
|
+
className: M,
|
|
811
815
|
children: "Δ miss"
|
|
812
816
|
}),
|
|
813
817
|
/* @__PURE__ */ c("th", {
|
|
814
|
-
className:
|
|
818
|
+
className: M,
|
|
815
819
|
children: "Δ hit"
|
|
816
820
|
}),
|
|
817
821
|
/* @__PURE__ */ c("th", {
|
|
818
|
-
className:
|
|
822
|
+
className: M,
|
|
819
823
|
children: "total miss"
|
|
820
824
|
}),
|
|
821
825
|
/* @__PURE__ */ c("th", {
|
|
822
|
-
className:
|
|
826
|
+
className: M,
|
|
823
827
|
children: "total hit"
|
|
824
828
|
})
|
|
825
829
|
]
|
|
826
|
-
}) }), /* @__PURE__ */ c("tbody", { children:
|
|
827
|
-
const s = e?.[n], i =
|
|
830
|
+
}) }), /* @__PURE__ */ c("tbody", { children: ne.map((n) => {
|
|
831
|
+
const s = e?.[n], i = Zt(s);
|
|
828
832
|
return /* @__PURE__ */ f("tr", {
|
|
829
|
-
className:
|
|
833
|
+
className: Ut,
|
|
830
834
|
children: [
|
|
831
835
|
/* @__PURE__ */ f("td", {
|
|
832
|
-
className:
|
|
836
|
+
className: At,
|
|
833
837
|
children: [
|
|
834
838
|
/* @__PURE__ */ c("span", {
|
|
835
|
-
className:
|
|
839
|
+
className: Re[i],
|
|
836
840
|
"aria-hidden": !0
|
|
837
841
|
}),
|
|
838
842
|
" ",
|
|
@@ -840,67 +844,67 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
|
|
|
840
844
|
]
|
|
841
845
|
}),
|
|
842
846
|
/* @__PURE__ */ c("td", {
|
|
843
|
-
className:
|
|
844
|
-
children: t === void 0 || i === "untouched" ? "—" :
|
|
847
|
+
className: W,
|
|
848
|
+
children: t === void 0 || i === "untouched" ? "—" : oe(t[n])
|
|
845
849
|
}),
|
|
846
850
|
/* @__PURE__ */ c("td", {
|
|
847
851
|
className: i === "ran" ? ve.ran : ve.dim,
|
|
848
852
|
children: s?.misses ?? 0
|
|
849
853
|
}),
|
|
850
854
|
/* @__PURE__ */ c("td", {
|
|
851
|
-
className:
|
|
855
|
+
className: W,
|
|
852
856
|
children: s?.hits ?? 0
|
|
853
857
|
}),
|
|
854
858
|
/* @__PURE__ */ c("td", {
|
|
855
|
-
className:
|
|
859
|
+
className: W,
|
|
856
860
|
children: r[n].misses
|
|
857
861
|
}),
|
|
858
862
|
/* @__PURE__ */ c("td", {
|
|
859
|
-
className:
|
|
863
|
+
className: W,
|
|
860
864
|
children: r[n].hits
|
|
861
865
|
})
|
|
862
866
|
]
|
|
863
867
|
}, n);
|
|
864
868
|
}) })]
|
|
865
|
-
}),
|
|
866
|
-
className:
|
|
869
|
+
}), Jt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ f("div", {
|
|
870
|
+
className: Wt,
|
|
867
871
|
children: [/* @__PURE__ */ c("div", {
|
|
868
|
-
className:
|
|
872
|
+
className: Xt,
|
|
869
873
|
children: "recent compiles"
|
|
870
874
|
}), e.map((t) => {
|
|
871
|
-
const r =
|
|
875
|
+
const r = er(t.stages, (i) => i.misses > 0), n = ne.length;
|
|
872
876
|
return /* @__PURE__ */ f("div", {
|
|
873
|
-
className:
|
|
877
|
+
className: Ot,
|
|
874
878
|
children: [
|
|
875
879
|
/* @__PURE__ */ c("span", {
|
|
876
|
-
className:
|
|
880
|
+
className: Re[r === 0 ? "cached" : "ran"],
|
|
877
881
|
"aria-hidden": !0
|
|
878
882
|
}),
|
|
879
883
|
/* @__PURE__ */ c("span", {
|
|
880
|
-
className:
|
|
884
|
+
className: Kt,
|
|
881
885
|
title: t.label,
|
|
882
886
|
children: t.label
|
|
883
887
|
}),
|
|
884
888
|
/* @__PURE__ */ f("span", {
|
|
885
|
-
className:
|
|
889
|
+
className: Ft,
|
|
886
890
|
children: [
|
|
887
891
|
r,
|
|
888
892
|
"/",
|
|
889
893
|
n,
|
|
890
894
|
" ran · ",
|
|
891
|
-
|
|
895
|
+
oe(t.durationMs)
|
|
892
896
|
]
|
|
893
897
|
})
|
|
894
898
|
]
|
|
895
899
|
}, t.id);
|
|
896
900
|
})]
|
|
897
|
-
}),
|
|
901
|
+
}), Zt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", er = (e, t) => {
|
|
898
902
|
let r = 0;
|
|
899
|
-
for (const n of
|
|
903
|
+
for (const n of ne) t(e[n]) && (r += 1);
|
|
900
904
|
return r;
|
|
901
|
-
},
|
|
902
|
-
const { history: e } =
|
|
903
|
-
return
|
|
905
|
+
}, oe = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, fn = () => {
|
|
906
|
+
const { history: e } = re(), { stack: t, undo: r, redo: n } = e, s = p((l) => t.subscribe(l), [t]), i = p(() => t.getSnapshot(), [t]), a = Ve(s, i, i);
|
|
907
|
+
return L(() => ({
|
|
904
908
|
...a,
|
|
905
909
|
undo: r,
|
|
906
910
|
redo: n
|
|
@@ -909,7 +913,7 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
|
|
|
909
913
|
r,
|
|
910
914
|
n
|
|
911
915
|
]);
|
|
912
|
-
},
|
|
916
|
+
}, tr = /* @__PURE__ */ new Set([
|
|
913
917
|
"button",
|
|
914
918
|
"checkbox",
|
|
915
919
|
"color",
|
|
@@ -922,12 +926,12 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
|
|
|
922
926
|
"submit"
|
|
923
927
|
]), vn = (e, t = {}) => {
|
|
924
928
|
const { target: r, enabled: n = !0 } = t;
|
|
925
|
-
|
|
926
|
-
const s =
|
|
929
|
+
B(() => {
|
|
930
|
+
const s = rr(r);
|
|
927
931
|
if (!n || !s) return;
|
|
928
932
|
const i = (a) => {
|
|
929
|
-
if (!
|
|
930
|
-
const l =
|
|
933
|
+
if (!nr(a) || a.defaultPrevented || sr(a.target)) return;
|
|
934
|
+
const l = ke(a);
|
|
931
935
|
if (!l) return;
|
|
932
936
|
const d = e.current;
|
|
933
937
|
d && (l === "undo" ? d.undo() : d.redo()) && a.preventDefault();
|
|
@@ -938,78 +942,78 @@ var Yt = "drqe3uh", Vt = "drqe3ui", pe = {
|
|
|
938
942
|
r,
|
|
939
943
|
n
|
|
940
944
|
]);
|
|
941
|
-
},
|
|
942
|
-
const { targetBoundaryStore: e } =
|
|
943
|
-
return
|
|
945
|
+
}, rr = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, nr = (e) => "key" in e, sr = (e) => e instanceof HTMLInputElement ? !tr.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, yn = () => {
|
|
946
|
+
const { targetBoundaryStore: e } = re();
|
|
947
|
+
return te(e, (t) => t.boundary);
|
|
944
948
|
};
|
|
945
949
|
export {
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
950
|
+
Sr as CanvasTextMeasurer,
|
|
951
|
+
Jr as DefaultFooter,
|
|
952
|
+
wt as DefaultGeomCircle,
|
|
953
|
+
Pt as DefaultGeomLine,
|
|
954
|
+
_t as DefaultGeomPath,
|
|
955
|
+
qt as DefaultGeomRect,
|
|
956
|
+
Yr as DefaultGrid,
|
|
957
|
+
br as DefaultHeader,
|
|
958
|
+
Ur as DefaultSwatch,
|
|
959
|
+
jr as DefaultTooltip,
|
|
960
|
+
pn as DevToolsPanel,
|
|
961
|
+
Rr as GRAPH_MODES,
|
|
962
|
+
ln as GeomCircle,
|
|
963
|
+
dn as GeomLine,
|
|
964
|
+
xr as GeomOverpaint,
|
|
965
|
+
mn as GeomPath,
|
|
966
|
+
un as GeomRect,
|
|
967
|
+
st as GraphErrorBoundary,
|
|
968
|
+
de as GraphErrorPanel,
|
|
969
|
+
Dt as GraphProvider,
|
|
970
|
+
Pr as GraphRenderer,
|
|
971
|
+
cr as GraphyBadge,
|
|
968
972
|
vr as HoverProvider,
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
973
|
+
Cr as IntroFade,
|
|
974
|
+
Lr as IntroWipeClip,
|
|
975
|
+
Ir as TextMeasurerProvider,
|
|
976
|
+
Or as ThemeProvider,
|
|
977
|
+
gn as UnitBoxSvg,
|
|
978
|
+
hn as UnitSpaceSvg,
|
|
979
|
+
Er as buildDotsEditOutlineShapes,
|
|
980
|
+
an as createGraphyKit,
|
|
981
|
+
wr as darkTheme,
|
|
982
|
+
lr as defineGeomRenderer,
|
|
979
983
|
Nr as getBuiltInEditOutlineShapes,
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
984
|
+
Vr as lightTheme,
|
|
985
|
+
zr as lightenCss,
|
|
986
|
+
Qr as projectPointCartesian,
|
|
987
|
+
ot as pruneSelection,
|
|
988
|
+
x as readPositionPixels,
|
|
989
|
+
cn as readRectPixels,
|
|
990
|
+
Gr as resolveGraphyBadgeVariant,
|
|
991
|
+
_r as resolvePathStroke,
|
|
992
|
+
dr as scalePointToPanel,
|
|
993
|
+
Mr as stampAxisEditTarget,
|
|
994
|
+
gr as stampGridEditTarget,
|
|
995
|
+
fr as stampLegendEditTarget,
|
|
996
|
+
mr as useElementScreenRect,
|
|
997
|
+
pr as useGeomHitTest,
|
|
998
|
+
ir as useGeomHover,
|
|
999
|
+
_e as useGeomPanelSize,
|
|
1000
|
+
Tr as useGeomReaderTree,
|
|
1001
|
+
hr as useGeomStyleReader,
|
|
1002
|
+
Kr as useGraphCommands,
|
|
1003
|
+
$r as useGraphHandle,
|
|
1004
|
+
fn as useGraphHistory,
|
|
1001
1005
|
vn as useGraphHistoryShortcuts,
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1006
|
+
qr as useGraphLocale,
|
|
1007
|
+
Hr as useGraphSelection,
|
|
1008
|
+
Xr as useGuidesTakePress,
|
|
1009
|
+
Wr as useHandleScene,
|
|
1010
|
+
kr as useHoverState,
|
|
1011
|
+
Ar as usePaintDefs,
|
|
1012
|
+
ar as useResolvedStyle,
|
|
1013
|
+
Br as useSceneSelector,
|
|
1014
|
+
ur as useStyleReaderTree,
|
|
1015
|
+
yr as useStyleResolver,
|
|
1016
|
+
yn as useTargetBoundary,
|
|
1017
|
+
Dr as useTextMeasurer,
|
|
1018
|
+
Fr as vars
|
|
1015
1019
|
};
|