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