@graphysdk/react-renderer 1.9.0-beta.1791303306567 → 1.9.0-beta.1791327466935
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editable.cjs +1 -1
- package/dist/editable.css +1 -1
- package/dist/editable.mjs +2921 -2920
- package/dist/{history-chords-BgKeog7X.js → history-chords-BV1yY--v.js} +3222 -3129
- package/dist/history-chords-BsgbwtJX.cjs +2 -0
- package/dist/history-chords.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +107 -53
- package/dist/index.mjs +573 -517
- package/package.json +2 -2
- package/dist/history-chords-BE-OsMiJ.cjs +0 -2
package/dist/index.mjs
CHANGED
|
@@ -1,133 +1,136 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { n as
|
|
3
|
-
import { COMPILER_STAGE_KEYS as
|
|
4
|
-
import { Component as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { useStore as
|
|
7
|
-
import { motion as
|
|
8
|
-
import { createStore as
|
|
9
|
-
import
|
|
10
|
-
import './index.css';var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
const [t, ...
|
|
14
|
-
return /* @__PURE__ */
|
|
1
|
+
import { A as er, B as tr, Bt as rr, Dt as nr, Et as sr, Ft as Y, Gt as or, I as ar, It as be, Kt as ir, L as cr, Lt as lr, M as dr, Mt as Ee, Nt as Te, Pt as ur, St as mr, Ut as hr, Vt as Re, Wt as gr, Zt as pr, _n as Z, a as fr, an as vr, at as yr, cn as Sr, dn as br, dt as Er, fn as Tr, gn as Ne, h as Rr, hn as ee, i as Nr, in as V, j as Cr, kt as Q, ln as Gr, mn as Ce, mt as Dr, n as qr, nn as Ir, ot as wr, pn as _r, pt as Pr, r as kr, rn as Ge, rt as Lr, s as $r, sn as Mr, t as De, tn as xr, un as Hr, w as Ar, xt as Br, yt as Or, z as Kr } from "./history-chords-BV1yY--v.js";
|
|
2
|
+
import { n as Ur } from "./theme.contract.css-AyXDNf0F.js";
|
|
3
|
+
import { COMPILER_STAGE_KEYS as te, Geom as qe, GraphCompilationSession as Ie, areEditTargetsEqual as we, buildDiagnostic as se, createAnchorResolver as _e, createCompiler as Pe, createDataLabelPlacementResolver as ke, createSpecBuilder as Le, createStyleResolver as he, findAnnotation as $e, findLayerById as oe, isCompilerCachingEnabled as Me, resolveDefinition as xe, setCompilerCachingEnabled as He, toPercent as U } from "@graphysdk/viz-engine";
|
|
4
|
+
import { Component as Ae, createContext as Be, useCallback as p, useContext as Oe, useEffect as H, useId as Ke, useImperativeHandle as Fe, useMemo as x, useRef as ae, useState as b, useSyncExternalStore as Ue } from "react";
|
|
5
|
+
import { Fragment as je, jsx as a, jsxs as f } from "react/jsx-runtime";
|
|
6
|
+
import { useStore as J } from "zustand";
|
|
7
|
+
import { motion as W } from "motion/react";
|
|
8
|
+
import { createStore as re } from "zustand/vanilla";
|
|
9
|
+
import Ye from "clsx";
|
|
10
|
+
import './index.css';var Ve = "_1a5iqpb0", We = "_1a5iqpb1";
|
|
11
|
+
var Xe = "_1a5iqpb3", ze = "_1a5iqpb4", Qe = "_1a5iqpb5";
|
|
12
|
+
var ie = ({ errors: e }) => {
|
|
13
|
+
const [t, ...r] = e;
|
|
14
|
+
return /* @__PURE__ */ f("div", {
|
|
15
15
|
role: "alert",
|
|
16
|
-
className:
|
|
16
|
+
className: Ve,
|
|
17
17
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
className:
|
|
18
|
+
/* @__PURE__ */ a("strong", {
|
|
19
|
+
className: We,
|
|
20
20
|
children: "This chart could not be rendered."
|
|
21
21
|
}),
|
|
22
|
-
t && /* @__PURE__ */
|
|
23
|
-
|
|
22
|
+
t && /* @__PURE__ */ a(ce, { diagnostic: t }),
|
|
23
|
+
r.length > 0 && /* @__PURE__ */ a("ul", {
|
|
24
24
|
className: "_1a5iqpb2",
|
|
25
|
-
children:
|
|
25
|
+
children: r.map((n, s) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(ce, { diagnostic: n }) }, `${n.code}-${s}`))
|
|
26
26
|
})
|
|
27
27
|
]
|
|
28
28
|
});
|
|
29
|
-
},
|
|
30
|
-
className:
|
|
29
|
+
}, ce = ({ diagnostic: e }) => /* @__PURE__ */ f("div", {
|
|
30
|
+
className: Xe,
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
className:
|
|
32
|
+
/* @__PURE__ */ a("span", {
|
|
33
|
+
className: ze,
|
|
34
34
|
children: e.code
|
|
35
35
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
className:
|
|
36
|
+
/* @__PURE__ */ a("p", {
|
|
37
|
+
className: Qe,
|
|
38
38
|
children: e.message
|
|
39
39
|
}),
|
|
40
|
-
e.suggestion && /* @__PURE__ */
|
|
40
|
+
e.suggestion && /* @__PURE__ */ a("p", {
|
|
41
41
|
className: "_1a5iqpb6",
|
|
42
42
|
children: e.suggestion
|
|
43
43
|
})
|
|
44
44
|
]
|
|
45
45
|
});
|
|
46
|
-
function
|
|
47
|
-
return e.length === t.length && e.every((
|
|
46
|
+
function Ze(e = [], t = []) {
|
|
47
|
+
return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
|
|
48
48
|
}
|
|
49
|
-
var
|
|
49
|
+
var Je = class extends Ae {
|
|
50
50
|
constructor(...e) {
|
|
51
51
|
super(...e), this.state = { caughtDiagnostic: null };
|
|
52
52
|
}
|
|
53
53
|
static getDerivedStateFromError(e) {
|
|
54
|
-
return { caughtDiagnostic:
|
|
54
|
+
return { caughtDiagnostic: se(e) };
|
|
55
55
|
}
|
|
56
56
|
componentDidCatch(e, t) {
|
|
57
|
-
const
|
|
58
|
-
|
|
57
|
+
const r = se(e);
|
|
58
|
+
Z([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
|
|
59
59
|
}
|
|
60
60
|
componentDidUpdate(e) {
|
|
61
|
-
this.state.caughtDiagnostic && !
|
|
61
|
+
this.state.caughtDiagnostic && !Ze(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
|
|
62
62
|
}
|
|
63
63
|
render() {
|
|
64
64
|
const { caughtDiagnostic: e } = this.state;
|
|
65
|
-
if (e) return /* @__PURE__ */
|
|
66
|
-
const { forcedErrors: t, children:
|
|
67
|
-
return t && t.length > 0 ? /* @__PURE__ */
|
|
65
|
+
if (e) return /* @__PURE__ */ a(ie, { errors: [e] });
|
|
66
|
+
const { forcedErrors: t, children: r } = this.props;
|
|
67
|
+
return t && t.length > 0 ? /* @__PURE__ */ a(ie, { errors: t }) : r;
|
|
68
68
|
}
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
const
|
|
74
|
-
return
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}),
|
|
83
|
-
|
|
69
|
+
}, ge = {}, pe = Be(ge), A = ({ shapes: e = ge, children: t }) => /* @__PURE__ */ a(pe.Provider, {
|
|
70
|
+
value: e,
|
|
71
|
+
children: t
|
|
72
|
+
}), X = () => Oe(pe), fe = (e) => typeof e == "object" && "geom" in e && "render" in e, ve = (e) => {
|
|
73
|
+
const t = xe(e);
|
|
74
|
+
return t instanceof qe ? t : null;
|
|
75
|
+
}, et = (e, t) => {
|
|
76
|
+
const r = e.filter((n) => tt(n, t));
|
|
77
|
+
return r.length === e.length ? e : r;
|
|
78
|
+
}, tt = (e, t) => e.kind === "annotation" ? $e(t.annotations, e.id) !== null : e.kind === "observations" ? oe(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? oe(t.layers, e.layerId) !== void 0 : !0, le = [], rt = () => re((e) => ({
|
|
79
|
+
selection: le,
|
|
80
|
+
setSelection: (t) => e((r) => nt(r.selection, t) ? r : { selection: t }),
|
|
81
|
+
clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: le })
|
|
82
|
+
})), nt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
|
|
83
|
+
const s = t[n];
|
|
84
|
+
return s !== void 0 && we(r, s);
|
|
85
|
+
}), st = process.env.NODE_ENV !== "production", ot = 5, at = (e) => {
|
|
86
|
+
if (!st) return {
|
|
84
87
|
emit: () => {
|
|
85
88
|
},
|
|
86
|
-
subscribe: () =>
|
|
89
|
+
subscribe: () => ct,
|
|
87
90
|
getLastTrigger: () => null,
|
|
88
91
|
getLastCompile: () => null,
|
|
89
92
|
getCacheStats: () => e.getCacheStats()
|
|
90
93
|
};
|
|
91
94
|
const t = /* @__PURE__ */ new Set();
|
|
92
|
-
let
|
|
95
|
+
let r = null;
|
|
93
96
|
return {
|
|
94
|
-
emit: (
|
|
97
|
+
emit: (n) => {
|
|
95
98
|
const s = e.getLastCompile();
|
|
96
99
|
if (s) {
|
|
97
|
-
|
|
98
|
-
for (const c of t) c(
|
|
100
|
+
r = n;
|
|
101
|
+
for (const c of t) c(n, s);
|
|
99
102
|
}
|
|
100
103
|
},
|
|
101
|
-
subscribe: (
|
|
102
|
-
t.delete(
|
|
104
|
+
subscribe: (n) => (t.add(n), () => {
|
|
105
|
+
t.delete(n);
|
|
103
106
|
}),
|
|
104
|
-
getLastTrigger: () =>
|
|
107
|
+
getLastTrigger: () => r,
|
|
105
108
|
getLastCompile: () => e.getLastCompile(),
|
|
106
109
|
getCacheStats: () => e.getCacheStats()
|
|
107
110
|
};
|
|
108
|
-
},
|
|
111
|
+
}, it = () => re((e) => ({
|
|
109
112
|
lastCompile: null,
|
|
110
113
|
history: [],
|
|
111
114
|
nextId: 1,
|
|
112
115
|
lastSnapshot: null,
|
|
113
|
-
recordCompile: (t,
|
|
114
|
-
if (
|
|
116
|
+
recordCompile: (t, r) => e((n) => {
|
|
117
|
+
if (n.lastSnapshot === r) return n;
|
|
115
118
|
const s = {
|
|
116
|
-
id:
|
|
117
|
-
label:
|
|
118
|
-
stages:
|
|
119
|
-
stageDurationsMs:
|
|
120
|
-
durationMs:
|
|
119
|
+
id: n.nextId,
|
|
120
|
+
label: lt(t),
|
|
121
|
+
stages: r.stages,
|
|
122
|
+
stageDurationsMs: r.stageDurationsMs,
|
|
123
|
+
durationMs: r.durationMs
|
|
121
124
|
};
|
|
122
125
|
return {
|
|
123
126
|
lastCompile: s,
|
|
124
|
-
history:
|
|
125
|
-
nextId:
|
|
126
|
-
lastSnapshot:
|
|
127
|
+
history: dt(n.history, s, ot),
|
|
128
|
+
nextId: n.nextId + 1,
|
|
129
|
+
lastSnapshot: r
|
|
127
130
|
};
|
|
128
131
|
})
|
|
129
|
-
})),
|
|
130
|
-
},
|
|
132
|
+
})), ct = () => {
|
|
133
|
+
}, lt = (e) => {
|
|
131
134
|
switch (e.kind) {
|
|
132
135
|
case "init":
|
|
133
136
|
return "init";
|
|
@@ -138,119 +141,134 @@ var je = class extends Pe {
|
|
|
138
141
|
case "command":
|
|
139
142
|
return e.command.metadata.description;
|
|
140
143
|
}
|
|
141
|
-
},
|
|
142
|
-
const
|
|
143
|
-
return [...e.slice(
|
|
144
|
+
}, dt = (e, t, r) => {
|
|
145
|
+
const n = e.length >= r ? e.length - (r - 1) : 0;
|
|
146
|
+
return [...e.slice(n), t];
|
|
144
147
|
};
|
|
145
|
-
function
|
|
146
|
-
|
|
148
|
+
function ut(e, t) {
|
|
149
|
+
let r;
|
|
150
|
+
return e.layers.flatMap((n, s) => Y(t(n.geom, e.coordSystem.type)) ? yt(n) ? (r ??= he().readers(e), St(n, r.geom(n)) ? [{
|
|
151
|
+
kind: "user-input",
|
|
152
|
+
severity: "warning",
|
|
153
|
+
code: "INVALID_STYLE_RULE",
|
|
154
|
+
message: `Style 'overlay' is not supported on portal-rendered geom '${n.geom}' (layer '${n.id}'); it is ignored.`,
|
|
155
|
+
context: {
|
|
156
|
+
param: "overlay",
|
|
157
|
+
layerIndex: s,
|
|
158
|
+
requested: n.geom
|
|
159
|
+
},
|
|
160
|
+
suggestion: "Remove the geom overlay or use a renderer that paints inside the panel SVG."
|
|
161
|
+
}] : []) : [] : []);
|
|
162
|
+
}
|
|
163
|
+
function de(e) {
|
|
164
|
+
const t = e.filter(fe), r = /* @__PURE__ */ new Set([...Object.keys(be), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
|
|
147
165
|
for (const l of e) {
|
|
148
|
-
const
|
|
149
|
-
|
|
166
|
+
const u = ve(l);
|
|
167
|
+
u === null || r.has(u.type) || s.has(u.type) || (s.add(u.type), n.push({
|
|
150
168
|
kind: "user-input",
|
|
151
169
|
severity: "error",
|
|
152
170
|
code: "MISSING_GEOM_RENDERER",
|
|
153
|
-
message: `Custom geom '${
|
|
171
|
+
message: `Custom geom '${u.type}' is registered but has no renderer.`,
|
|
154
172
|
context: {
|
|
155
|
-
requested:
|
|
173
|
+
requested: u.type,
|
|
156
174
|
kind: "geom-renderer"
|
|
157
175
|
},
|
|
158
|
-
suggestion: `Add a render half for it: \`defineGeomRenderer(${
|
|
176
|
+
suggestion: `Add a render half for it: \`defineGeomRenderer(${u.type}Geom, { coord, render })\`, then include it in \`plugins\`.`
|
|
159
177
|
}));
|
|
160
178
|
}
|
|
161
179
|
const c = /* @__PURE__ */ new Map();
|
|
162
180
|
for (const l of t) {
|
|
163
181
|
if ("definition" in l) continue;
|
|
164
|
-
const
|
|
165
|
-
|
|
182
|
+
const u = `${l.geom}|${l.coord}`, h = c.get(u);
|
|
183
|
+
h ? h.count += 1 : c.set(u, {
|
|
166
184
|
geom: l.geom,
|
|
167
185
|
coord: l.coord,
|
|
168
186
|
count: 1
|
|
169
187
|
});
|
|
170
188
|
}
|
|
171
|
-
const
|
|
172
|
-
for (const { geom: l, coord:
|
|
173
|
-
|
|
189
|
+
const i = [];
|
|
190
|
+
for (const { geom: l, coord: u, count: h } of c.values())
|
|
191
|
+
h < 2 || i.push({
|
|
174
192
|
kind: "user-input",
|
|
175
193
|
severity: "warning",
|
|
176
194
|
code: "DUPLICATE_REGISTERED_TYPE",
|
|
177
|
-
message: `Multiple render-only overrides register ('${l}', '${
|
|
195
|
+
message: `Multiple render-only overrides register ('${l}', '${u}') (${h} entries); the last in the array wins.`,
|
|
178
196
|
context: {
|
|
179
|
-
requested: `${l}@${
|
|
197
|
+
requested: `${l}@${u}`,
|
|
180
198
|
kind: "geom-renderer"
|
|
181
199
|
},
|
|
182
|
-
suggestion: `Keep a single render-only override for ('${l}', '${
|
|
200
|
+
suggestion: `Keep a single render-only override for ('${l}', '${u}').`
|
|
183
201
|
});
|
|
184
|
-
return
|
|
185
|
-
errors:
|
|
186
|
-
warnings:
|
|
202
|
+
return i.push(...bt(e)), {
|
|
203
|
+
errors: n,
|
|
204
|
+
warnings: i
|
|
187
205
|
};
|
|
188
206
|
}
|
|
189
|
-
function
|
|
190
|
-
const { coordSystem:
|
|
191
|
-
for (const
|
|
192
|
-
t(
|
|
207
|
+
function mt(e, t) {
|
|
208
|
+
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), c = [];
|
|
209
|
+
for (const i of n)
|
|
210
|
+
t(i.geom, r.type) !== null || s.has(i.geom) || (s.add(i.geom), c.push({
|
|
193
211
|
kind: "user-input",
|
|
194
212
|
severity: "warning",
|
|
195
213
|
code: "MISSING_GEOM_RENDERER",
|
|
196
|
-
message: `No renderer for geom '${
|
|
214
|
+
message: `No renderer for geom '${i.geom}' under ${r.type} coords; the layer is not painted.`,
|
|
197
215
|
context: {
|
|
198
|
-
requested:
|
|
216
|
+
requested: i.geom,
|
|
199
217
|
kind: "geom-renderer"
|
|
200
218
|
},
|
|
201
|
-
suggestion: `Register a renderer for ('${
|
|
219
|
+
suggestion: `Register a renderer for ('${i.geom}', '${r.type}') via \`defineGeomRenderer\`.`
|
|
202
220
|
}));
|
|
203
221
|
return c;
|
|
204
222
|
}
|
|
205
|
-
function
|
|
206
|
-
const { coordSystem:
|
|
207
|
-
for (const
|
|
208
|
-
if (
|
|
209
|
-
const l = t(
|
|
210
|
-
l === null || l.hitTest ||
|
|
223
|
+
function ht(e, t) {
|
|
224
|
+
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), c = [];
|
|
225
|
+
for (const i of n) {
|
|
226
|
+
if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || s.has(i.geom)) continue;
|
|
227
|
+
const l = t(i.geom, r.type);
|
|
228
|
+
l === null || l.hitTest || Y(l) || (s.add(i.geom), c.push({
|
|
211
229
|
kind: "user-input",
|
|
212
230
|
severity: "warning",
|
|
213
231
|
code: "MISSING_RENDER_HIT_TEST",
|
|
214
|
-
message: `Geom '${
|
|
232
|
+
message: `Geom '${i.geom}' declares spatialKind 'render-hit-test' but its renderer provides no hit-test; the layer has no hover.`,
|
|
215
233
|
context: {
|
|
216
|
-
requested:
|
|
234
|
+
requested: i.geom,
|
|
217
235
|
kind: "geom-renderer"
|
|
218
236
|
},
|
|
219
|
-
suggestion: `Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${
|
|
237
|
+
suggestion: `Add a \`hitTest\` factory (precomputed geometry) or an overlay render (\`{ fn, options: { overlay: true } }\`, live simulation) to the renderer for ('${i.geom}', '${r.type}').`
|
|
220
238
|
}));
|
|
221
239
|
}
|
|
222
240
|
return c;
|
|
223
241
|
}
|
|
224
|
-
function
|
|
225
|
-
const t = /* @__PURE__ */ new Set(),
|
|
226
|
-
for (const
|
|
227
|
-
const s =
|
|
228
|
-
|
|
242
|
+
function gt(e) {
|
|
243
|
+
const t = /* @__PURE__ */ new Set(), r = [];
|
|
244
|
+
for (const n of e.layers) {
|
|
245
|
+
const s = n.identityKey;
|
|
246
|
+
n.interactive !== !1 && (n.spatialKind !== "render-hit-test" || typeof s != "object" || t.has(n.geom) || n.data.hasVariable(s.variable) || (t.add(n.geom), r.push({
|
|
229
247
|
kind: "user-input",
|
|
230
248
|
severity: "warning",
|
|
231
249
|
code: "RENDER_HIT_TEST_IDENTITY",
|
|
232
|
-
message: `Geom '${
|
|
250
|
+
message: `Geom '${n.geom}' keys its identity on '${s.variable}', a column its compile output does not emit; its hover lookup is empty.`,
|
|
233
251
|
context: {
|
|
234
|
-
requested:
|
|
252
|
+
requested: n.geom,
|
|
235
253
|
kind: "geom-renderer"
|
|
236
254
|
},
|
|
237
255
|
suggestion: `Emit the '${s.variable}' column from the geom's \`compile()\`, or point \`identityKey\` at a column it does emit.`
|
|
238
256
|
})));
|
|
239
257
|
}
|
|
240
|
-
return
|
|
258
|
+
return r;
|
|
241
259
|
}
|
|
242
|
-
function
|
|
243
|
-
const { coordSystem:
|
|
244
|
-
for (const
|
|
245
|
-
if (
|
|
246
|
-
const l = t(
|
|
247
|
-
l === null || !l.hitTest || !
|
|
260
|
+
function pt(e, t) {
|
|
261
|
+
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), c = [];
|
|
262
|
+
for (const i of n) {
|
|
263
|
+
if (i.interactive === !1 || i.spatialKind !== "render-hit-test" || s.has(i.geom)) continue;
|
|
264
|
+
const l = t(i.geom, r.type);
|
|
265
|
+
l === null || !l.hitTest || !Y(l) || (s.add(i.geom), c.push({
|
|
248
266
|
kind: "user-input",
|
|
249
267
|
severity: "warning",
|
|
250
268
|
code: "CONFLICTING_RENDER_HIT_TEST",
|
|
251
|
-
message: `Geom '${
|
|
269
|
+
message: `Geom '${i.geom}' declares both a \`hitTest\` factory and an overlay render; these are alternatives, so only the overlay is used.`,
|
|
252
270
|
context: {
|
|
253
|
-
requested:
|
|
271
|
+
requested: i.geom,
|
|
254
272
|
kind: "geom-renderer"
|
|
255
273
|
},
|
|
256
274
|
suggestion: "Keep one: a `hitTest` factory for precomputed geometry, OR an overlay render (`{ fn, options: { overlay: true } }`) for a live simulation."
|
|
@@ -258,10 +276,10 @@ function it(e, t) {
|
|
|
258
276
|
}
|
|
259
277
|
return c;
|
|
260
278
|
}
|
|
261
|
-
function
|
|
262
|
-
const
|
|
279
|
+
function ft(e, t) {
|
|
280
|
+
const r = /* @__PURE__ */ new Set(), n = [];
|
|
263
281
|
for (const s of e.layers)
|
|
264
|
-
s.interactive !== !1 && (s.spatialKind !== "render-hit-test" ||
|
|
282
|
+
s.interactive !== !1 && (s.spatialKind !== "render-hit-test" || r.has(s.geom) || t.hasCapability(s.geom) || (r.add(s.geom), n.push({
|
|
265
283
|
kind: "user-input",
|
|
266
284
|
severity: "warning",
|
|
267
285
|
code: "MISSING_ANCHOR_CAPABILITY",
|
|
@@ -272,20 +290,20 @@ function ct(e, t) {
|
|
|
272
290
|
},
|
|
273
291
|
suggestion: "Implement `resolveAnchorPosition(observation, context)` on the geom, returning the normalised panel position an annotation on that observation belongs at."
|
|
274
292
|
})));
|
|
275
|
-
return
|
|
293
|
+
return n;
|
|
276
294
|
}
|
|
277
|
-
function
|
|
278
|
-
const { coordSystem:
|
|
279
|
-
for (const
|
|
280
|
-
if (
|
|
281
|
-
const l = t(
|
|
282
|
-
l === null || !
|
|
295
|
+
function vt(e, t) {
|
|
296
|
+
const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), c = [];
|
|
297
|
+
for (const i of n) {
|
|
298
|
+
if (i.interactive === !1 || i.spatialKind === "render-hit-test" || s.has(i.geom)) continue;
|
|
299
|
+
const l = t(i.geom, r.type);
|
|
300
|
+
l === null || !Y(l) || (s.add(i.geom), c.push({
|
|
283
301
|
kind: "user-input",
|
|
284
302
|
severity: "warning",
|
|
285
303
|
code: "OVERLAY_REQUIRES_RENDER_HIT_TEST",
|
|
286
|
-
message: `Geom '${
|
|
304
|
+
message: `Geom '${i.geom}' declares an overlay render but its layer's spatialKind is '${i.spatialKind}', not 'render-hit-test'; the overlay's push-path hover resolves to nothing.`,
|
|
287
305
|
context: {
|
|
288
|
-
requested:
|
|
306
|
+
requested: i.geom,
|
|
289
307
|
kind: "geom-renderer"
|
|
290
308
|
},
|
|
291
309
|
suggestion: "Have the geom's manifest yield spatialKind 'render-hit-test' so the scene layer carries the `byKey` index the overlay's `pushHover` resolves against."
|
|
@@ -293,11 +311,18 @@ function lt(e, t) {
|
|
|
293
311
|
}
|
|
294
312
|
return c;
|
|
295
313
|
}
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
314
|
+
var yt = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => (r.declarations.overlay?.length ?? 0) > 0)), St = (e, t) => {
|
|
315
|
+
const [r] = e.data;
|
|
316
|
+
if (r === void 0) return !1;
|
|
317
|
+
if ((t.get("overlay", r)?.length ?? 0) > 0) return !0;
|
|
318
|
+
for (const n of e.data) if ((t.get("overlay", n, "hovered")?.length ?? 0) > 0) return !0;
|
|
319
|
+
return !1;
|
|
320
|
+
};
|
|
321
|
+
function bt(e) {
|
|
322
|
+
const t = /* @__PURE__ */ new Set(), r = [];
|
|
323
|
+
for (const n of e) {
|
|
324
|
+
const s = ve(n);
|
|
325
|
+
s === null || t.has(s.type) || s.dataLabelCoordTypes.length === 0 || s.getDataLabelPlacements !== void 0 || (t.add(s.type), r.push({
|
|
301
326
|
kind: "user-input",
|
|
302
327
|
severity: "warning",
|
|
303
328
|
code: "MISSING_DATA_LABEL_PLACEMENT",
|
|
@@ -309,124 +334,134 @@ function dt(e) {
|
|
|
309
334
|
suggestion: "Implement `getDataLabelPlacements(context)` on the geom, or drop `dataLabelCoordTypes` so the compiler warns the author off the flag."
|
|
310
335
|
}));
|
|
311
336
|
}
|
|
312
|
-
return
|
|
337
|
+
return r;
|
|
313
338
|
}
|
|
314
|
-
var
|
|
339
|
+
var Et = (e) => re((t) => ({
|
|
315
340
|
scene: e,
|
|
316
|
-
setScene: (
|
|
317
|
-
})),
|
|
318
|
-
const
|
|
319
|
-
const
|
|
341
|
+
setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
|
|
342
|
+
})), Tt = ({ spec: e, data: t, customPalettes: r, colorScheme: n, plugins: s, theme: c, resolveRenderer: i, anchorResolver: l, onSpecChange: u, onError: h, onWarnings: _ }) => {
|
|
343
|
+
const q = Q(u), T = Q(h), R = Q(_), [{ session: d, compileBus: g }] = b(() => {
|
|
344
|
+
const o = Pe({
|
|
345
|
+
plugins: s,
|
|
346
|
+
theme: c
|
|
347
|
+
});
|
|
348
|
+
return {
|
|
349
|
+
session: new Ie(o),
|
|
350
|
+
compileBus: at(o)
|
|
351
|
+
};
|
|
352
|
+
}), [v] = b(() => {
|
|
353
|
+
const o = de(s ?? []), m = de(c?.plugins ?? []);
|
|
320
354
|
return {
|
|
321
|
-
|
|
322
|
-
|
|
355
|
+
errors: [...m.errors, ...o.errors],
|
|
356
|
+
warnings: [...m.warnings, ...o.warnings]
|
|
323
357
|
};
|
|
324
|
-
}),
|
|
325
|
-
if (!
|
|
326
|
-
if (
|
|
358
|
+
}), w = ae(null), [y] = b(Rt), C = ae(null), I = p((o) => v.errors.length === 0 ? o : [...v.errors, ...o ?? []], [v]), N = p((o) => {
|
|
359
|
+
if (!o.ok) return o.errors;
|
|
360
|
+
if (C.current) C.current.getState().setScene(o.scene);
|
|
327
361
|
else {
|
|
328
|
-
const
|
|
329
|
-
|
|
362
|
+
const m = Et(o.scene);
|
|
363
|
+
m.subscribe(y.notify), C.current = m, y.notify();
|
|
330
364
|
}
|
|
331
365
|
return null;
|
|
332
|
-
}, [
|
|
333
|
-
const
|
|
366
|
+
}, [y]), [B, k] = b(() => {
|
|
367
|
+
const o = d.compile({
|
|
334
368
|
spec: e,
|
|
335
369
|
data: t,
|
|
336
|
-
customPalettes:
|
|
337
|
-
colorScheme:
|
|
370
|
+
customPalettes: r,
|
|
371
|
+
colorScheme: n
|
|
338
372
|
});
|
|
339
|
-
return
|
|
340
|
-
}),
|
|
341
|
-
...
|
|
342
|
-
...
|
|
343
|
-
...
|
|
344
|
-
...
|
|
345
|
-
...
|
|
346
|
-
...
|
|
347
|
-
...
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
373
|
+
return w.current = o, I(N(o));
|
|
374
|
+
}), E = p((o) => o.ok ? [
|
|
375
|
+
...o.warnings,
|
|
376
|
+
...mt(o.scene, i),
|
|
377
|
+
...ht(o.scene, i),
|
|
378
|
+
...gt(o.scene),
|
|
379
|
+
...pt(o.scene, i),
|
|
380
|
+
...vt(o.scene, i),
|
|
381
|
+
...ut(o.scene, i),
|
|
382
|
+
...ft(o.scene, l)
|
|
383
|
+
] : o.warnings, [i, l]), G = p((o) => {
|
|
384
|
+
o.length !== 0 && (Z(o), T.current?.(o));
|
|
385
|
+
}, [T]), D = p((o) => {
|
|
386
|
+
o.length !== 0 && (Z(o), R.current?.(o));
|
|
387
|
+
}, [R]);
|
|
353
388
|
H(() => {
|
|
354
|
-
const
|
|
355
|
-
|
|
389
|
+
const o = w.current;
|
|
390
|
+
o && (G([...v.errors, ...o.ok ? [] : o.errors]), D([...v.warnings, ...E(o)]), o.ok && g.emit({ kind: "init" }));
|
|
356
391
|
}, [
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
392
|
+
g,
|
|
393
|
+
G,
|
|
394
|
+
D,
|
|
395
|
+
v,
|
|
396
|
+
E
|
|
362
397
|
]), H(() => {
|
|
363
|
-
const
|
|
398
|
+
const o = d.update({
|
|
364
399
|
spec: e,
|
|
365
400
|
data: t,
|
|
366
|
-
customPalettes:
|
|
367
|
-
colorScheme:
|
|
401
|
+
customPalettes: r,
|
|
402
|
+
colorScheme: n
|
|
368
403
|
});
|
|
369
|
-
if (!
|
|
370
|
-
|
|
371
|
-
const
|
|
372
|
-
|
|
404
|
+
if (!o) return;
|
|
405
|
+
o.committedSpec && q.current?.(o.committedSpec);
|
|
406
|
+
const m = N(o.result);
|
|
407
|
+
k(I(m)), m && G(m), D(E(o.result)), m || g.emit({ kind: o.specChanged ? "spec" : "data" });
|
|
373
408
|
}, [
|
|
374
409
|
e,
|
|
375
410
|
t,
|
|
376
|
-
n,
|
|
377
411
|
r,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
q,
|
|
412
|
+
n,
|
|
413
|
+
d,
|
|
414
|
+
g,
|
|
415
|
+
N,
|
|
383
416
|
G,
|
|
384
|
-
|
|
385
|
-
|
|
417
|
+
D,
|
|
418
|
+
I,
|
|
419
|
+
E,
|
|
420
|
+
q
|
|
386
421
|
]);
|
|
387
|
-
const
|
|
388
|
-
|
|
422
|
+
const L = p((o) => {
|
|
423
|
+
k((m) => m === null ? m : I(null)), D(E(o));
|
|
389
424
|
}, [
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
]),
|
|
394
|
-
|
|
425
|
+
I,
|
|
426
|
+
D,
|
|
427
|
+
E
|
|
428
|
+
]), O = p((o) => {
|
|
429
|
+
o.scene && C.current?.getState().setScene(o.scene), o.result && L(o.result), o.command && g.emit({
|
|
395
430
|
kind: "command",
|
|
396
|
-
command:
|
|
397
|
-
}),
|
|
431
|
+
command: o.command
|
|
432
|
+
}), o.spec && q.current?.(o.spec), o.errors && G([...o.errors]);
|
|
398
433
|
}, [
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
]), S =
|
|
404
|
-
for (const
|
|
405
|
-
return
|
|
406
|
-
}, [
|
|
407
|
-
S(
|
|
408
|
-
}, [
|
|
409
|
-
S(
|
|
410
|
-
}, [
|
|
411
|
-
stack:
|
|
412
|
-
undo:
|
|
413
|
-
redo:
|
|
434
|
+
L,
|
|
435
|
+
g,
|
|
436
|
+
q,
|
|
437
|
+
G
|
|
438
|
+
]), S = p((o) => {
|
|
439
|
+
for (const m of o) O(m);
|
|
440
|
+
return o.some((m) => !!m.scene);
|
|
441
|
+
}, [O]), K = p((o, m) => {
|
|
442
|
+
S(d.applyCommand(o, m));
|
|
443
|
+
}, [d, S]), P = p(() => {
|
|
444
|
+
S(d.commit());
|
|
445
|
+
}, [d, S]), F = p(() => S(d.undo()), [d, S]), $ = p(() => S(d.redo()), [d, S]), z = x(() => ({
|
|
446
|
+
stack: d.history,
|
|
447
|
+
undo: F,
|
|
448
|
+
redo: $
|
|
414
449
|
}), [
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
]),
|
|
450
|
+
d,
|
|
451
|
+
F,
|
|
452
|
+
$
|
|
453
|
+
]), Se = p(() => C.current?.getState().scene ?? null, []);
|
|
419
454
|
return {
|
|
420
|
-
store:
|
|
421
|
-
dispatch:
|
|
422
|
-
commit:
|
|
423
|
-
history:
|
|
424
|
-
subscribe:
|
|
425
|
-
getScene:
|
|
426
|
-
compileBus:
|
|
427
|
-
compileErrors:
|
|
455
|
+
store: C.current,
|
|
456
|
+
dispatch: K,
|
|
457
|
+
commit: P,
|
|
458
|
+
history: z,
|
|
459
|
+
subscribe: y.subscribe,
|
|
460
|
+
getScene: Se,
|
|
461
|
+
compileBus: g,
|
|
462
|
+
compileErrors: B
|
|
428
463
|
};
|
|
429
|
-
},
|
|
464
|
+
}, Rt = () => {
|
|
430
465
|
const e = /* @__PURE__ */ new Set();
|
|
431
466
|
return {
|
|
432
467
|
subscribe: (t) => (e.add(t), () => {
|
|
@@ -434,161 +469,178 @@ var ut = (e) => Q((t) => ({
|
|
|
434
469
|
}),
|
|
435
470
|
notify: () => e.forEach((t) => t())
|
|
436
471
|
};
|
|
437
|
-
},
|
|
438
|
-
const [
|
|
472
|
+
}, Nt = ({ data: e, spec: t, plugins: r = [], theme: n, formattingLocale: s, handleRef: c, onSpecChange: i, onError: l, onWarnings: u, customPalettes: h, colorScheme: _ = "light", children: q }) => {
|
|
473
|
+
const [T] = b(() => n), R = T?.colorScheme ?? _, [d] = b(() => Te([...T?.plugins ?? [], ...r].filter(fe))), g = Ke(), [v] = b(() => _e(r)), [w] = b(() => ke(r)), [y] = b(() => rt()), [C] = b(() => Ee()), I = x(() => he({ colorScheme: R }), [R]), { store: N, dispatch: B, commit: k, history: E, subscribe: G, getScene: D, compileBus: L, compileErrors: O } = Tt({
|
|
439
474
|
spec: t,
|
|
440
475
|
data: e,
|
|
441
|
-
customPalettes:
|
|
442
|
-
colorScheme:
|
|
443
|
-
plugins:
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
476
|
+
customPalettes: h,
|
|
477
|
+
colorScheme: R,
|
|
478
|
+
plugins: r,
|
|
479
|
+
theme: T,
|
|
480
|
+
resolveRenderer: d,
|
|
481
|
+
anchorResolver: v,
|
|
482
|
+
onSpecChange: i,
|
|
483
|
+
onError: l,
|
|
484
|
+
onWarnings: u
|
|
449
485
|
});
|
|
450
486
|
H(() => {
|
|
451
|
-
if (
|
|
452
|
-
return
|
|
453
|
-
if (
|
|
454
|
-
const { selection:
|
|
455
|
-
|
|
487
|
+
if (N)
|
|
488
|
+
return N.subscribe((P, F) => {
|
|
489
|
+
if (P.scene.spec === F.scene.spec) return;
|
|
490
|
+
const { selection: $, setSelection: z } = y.getState();
|
|
491
|
+
$.length !== 0 && z(et($, P.scene.spec));
|
|
456
492
|
});
|
|
457
|
-
}, [
|
|
458
|
-
const
|
|
459
|
-
dispatch:
|
|
460
|
-
commit:
|
|
461
|
-
}), [
|
|
462
|
-
|
|
463
|
-
commands:
|
|
464
|
-
undo:
|
|
465
|
-
redo:
|
|
466
|
-
subscribe:
|
|
467
|
-
getScene:
|
|
468
|
-
getSelection: () =>
|
|
469
|
-
setSelection: (
|
|
470
|
-
subscribeSelection:
|
|
471
|
-
canPlaceDataLabels:
|
|
472
|
-
canFormatDataLabelsAsPercentages:
|
|
493
|
+
}, [N, y]);
|
|
494
|
+
const S = x(() => ({
|
|
495
|
+
dispatch: B,
|
|
496
|
+
commit: k
|
|
497
|
+
}), [B, k]);
|
|
498
|
+
Fe(c, () => ({
|
|
499
|
+
commands: S,
|
|
500
|
+
undo: E.undo,
|
|
501
|
+
redo: E.redo,
|
|
502
|
+
subscribe: G,
|
|
503
|
+
getScene: D,
|
|
504
|
+
getSelection: () => y.getState().selection,
|
|
505
|
+
setSelection: (P) => y.getState().setSelection(P),
|
|
506
|
+
subscribeSelection: y.subscribe,
|
|
507
|
+
canPlaceDataLabels: w.hasCapability,
|
|
508
|
+
canFormatDataLabelsAsPercentages: w.hasPercentageFormat
|
|
473
509
|
}), [
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
510
|
+
S,
|
|
511
|
+
E,
|
|
512
|
+
G,
|
|
513
|
+
D,
|
|
514
|
+
y,
|
|
515
|
+
w
|
|
480
516
|
]);
|
|
481
|
-
const
|
|
482
|
-
chartId:
|
|
483
|
-
store:
|
|
484
|
-
selectionStore:
|
|
517
|
+
const K = x(() => N ? {
|
|
518
|
+
chartId: g,
|
|
519
|
+
store: N,
|
|
520
|
+
selectionStore: y,
|
|
485
521
|
targetBoundaryStore: C,
|
|
486
|
-
commands:
|
|
487
|
-
history:
|
|
488
|
-
formattingLocale:
|
|
489
|
-
compileBus:
|
|
490
|
-
colorScheme:
|
|
522
|
+
commands: S,
|
|
523
|
+
history: E,
|
|
524
|
+
formattingLocale: s,
|
|
525
|
+
compileBus: L,
|
|
526
|
+
colorScheme: R,
|
|
491
527
|
styleResolver: I,
|
|
492
|
-
anchorResolver:
|
|
528
|
+
anchorResolver: v
|
|
493
529
|
} : null, [
|
|
530
|
+
g,
|
|
494
531
|
N,
|
|
495
532
|
y,
|
|
496
|
-
m,
|
|
497
533
|
C,
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
534
|
+
S,
|
|
535
|
+
E,
|
|
536
|
+
s,
|
|
537
|
+
L,
|
|
501
538
|
R,
|
|
502
|
-
g,
|
|
503
539
|
I,
|
|
504
|
-
|
|
540
|
+
v
|
|
505
541
|
]);
|
|
506
|
-
return /* @__PURE__ */
|
|
507
|
-
forcedErrors:
|
|
508
|
-
onError:
|
|
542
|
+
return /* @__PURE__ */ a(Je, {
|
|
543
|
+
forcedErrors: O,
|
|
544
|
+
onError: l,
|
|
509
545
|
resetKeys: [t, e],
|
|
510
|
-
children:
|
|
511
|
-
value:
|
|
512
|
-
children: /* @__PURE__ */
|
|
513
|
-
value:
|
|
514
|
-
children: /* @__PURE__ */
|
|
515
|
-
value:
|
|
516
|
-
children:
|
|
546
|
+
children: K ? /* @__PURE__ */ a(Ce.Provider, {
|
|
547
|
+
value: K,
|
|
548
|
+
children: /* @__PURE__ */ a(Re, {
|
|
549
|
+
value: d,
|
|
550
|
+
children: /* @__PURE__ */ a(Ne, {
|
|
551
|
+
value: w,
|
|
552
|
+
children: /* @__PURE__ */ a(A, {
|
|
553
|
+
shapes: T?.shapes,
|
|
554
|
+
children: q
|
|
555
|
+
})
|
|
517
556
|
})
|
|
518
557
|
})
|
|
519
558
|
}) : null
|
|
520
559
|
});
|
|
521
560
|
};
|
|
522
|
-
function
|
|
523
|
-
const
|
|
561
|
+
function Zr({ theme: e, ...t } = {}) {
|
|
562
|
+
const r = Le(t);
|
|
524
563
|
return {
|
|
525
|
-
...
|
|
526
|
-
GraphProvider: (
|
|
527
|
-
...
|
|
528
|
-
plugins:
|
|
564
|
+
...r,
|
|
565
|
+
GraphProvider: (s) => /* @__PURE__ */ a(Nt, {
|
|
566
|
+
...s,
|
|
567
|
+
plugins: r.plugins,
|
|
568
|
+
theme: e
|
|
529
569
|
})
|
|
530
570
|
};
|
|
531
571
|
}
|
|
532
|
-
var
|
|
572
|
+
var Ct = ({ shouldAnimateTransitions: e, cx: t, cy: r, r: n, ...s }) => e ? /* @__PURE__ */ a(W.circle, {
|
|
533
573
|
initial: !1,
|
|
534
574
|
animate: {
|
|
535
575
|
cx: t,
|
|
536
|
-
cy:
|
|
537
|
-
r
|
|
576
|
+
cy: r,
|
|
577
|
+
r: n
|
|
538
578
|
},
|
|
539
|
-
transition:
|
|
579
|
+
transition: V,
|
|
540
580
|
...s
|
|
541
|
-
}) : /* @__PURE__ */
|
|
581
|
+
}) : /* @__PURE__ */ a("circle", {
|
|
542
582
|
cx: t,
|
|
543
|
-
cy:
|
|
544
|
-
r,
|
|
583
|
+
cy: r,
|
|
584
|
+
r: n,
|
|
545
585
|
...s
|
|
546
|
-
}),
|
|
586
|
+
}), Gt = ({ shouldAnimateTransitions: e, x1: t, y1: r, x2: n, y2: s, ...c }) => e ? /* @__PURE__ */ a(W.line, {
|
|
547
587
|
initial: !1,
|
|
548
588
|
animate: {
|
|
549
589
|
x1: t,
|
|
550
|
-
y1:
|
|
551
|
-
x2:
|
|
590
|
+
y1: r,
|
|
591
|
+
x2: n,
|
|
552
592
|
y2: s
|
|
553
593
|
},
|
|
554
|
-
transition:
|
|
594
|
+
transition: V,
|
|
555
595
|
...c
|
|
556
|
-
}) : /* @__PURE__ */
|
|
596
|
+
}) : /* @__PURE__ */ a("line", {
|
|
557
597
|
x1: t,
|
|
558
|
-
y1:
|
|
559
|
-
x2:
|
|
598
|
+
y1: r,
|
|
599
|
+
x2: n,
|
|
560
600
|
y2: s,
|
|
561
601
|
...c
|
|
562
|
-
}),
|
|
602
|
+
}), Dt = ({ shouldAnimateTransitions: e, x: t, y: r, width: n, height: s, ...c }) => e ? /* @__PURE__ */ a(W.rect, {
|
|
563
603
|
initial: !1,
|
|
564
604
|
animate: {
|
|
565
605
|
attrX: t,
|
|
566
|
-
attrY:
|
|
567
|
-
width:
|
|
606
|
+
attrY: r,
|
|
607
|
+
width: n,
|
|
568
608
|
height: s
|
|
569
609
|
},
|
|
570
|
-
transition:
|
|
610
|
+
transition: V,
|
|
571
611
|
...c
|
|
572
|
-
}) : /* @__PURE__ */
|
|
612
|
+
}) : /* @__PURE__ */ a("rect", {
|
|
573
613
|
x: t,
|
|
574
|
-
y:
|
|
575
|
-
width:
|
|
614
|
+
y: r,
|
|
615
|
+
width: n,
|
|
576
616
|
height: s,
|
|
577
617
|
...c
|
|
578
|
-
}),
|
|
618
|
+
}), qt = ({ shouldAnimateTransitions: e, d: t, source: r, ...n }) => e ? /* @__PURE__ */ a(It, {
|
|
579
619
|
d: t,
|
|
580
|
-
source:
|
|
581
|
-
...
|
|
582
|
-
}) : /* @__PURE__ */
|
|
620
|
+
source: r,
|
|
621
|
+
...n
|
|
622
|
+
}) : /* @__PURE__ */ a("path", {
|
|
583
623
|
d: t,
|
|
584
|
-
...
|
|
585
|
-
}),
|
|
586
|
-
const
|
|
587
|
-
return /* @__PURE__ */
|
|
588
|
-
|
|
589
|
-
|
|
624
|
+
...n
|
|
625
|
+
}), Jr = (e) => {
|
|
626
|
+
const { Circle: t } = X();
|
|
627
|
+
return t === void 0 ? Ct(e) : /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(t, { ...e }) });
|
|
628
|
+
}, en = (e) => {
|
|
629
|
+
const { Line: t } = X();
|
|
630
|
+
return t === void 0 ? Gt(e) : /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(t, { ...e }) });
|
|
631
|
+
}, tn = (e) => {
|
|
632
|
+
const { Rect: t } = X();
|
|
633
|
+
return t === void 0 ? Dt(e) : /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(t, { ...e }) });
|
|
634
|
+
}, rn = (e) => {
|
|
635
|
+
const { Path: t } = X();
|
|
636
|
+
return t === void 0 ? qt(e) : /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(t, { ...e }) });
|
|
637
|
+
}, It = ({ d: e, source: t, ...r }) => {
|
|
638
|
+
const n = Ge(e, V, t);
|
|
639
|
+
return /* @__PURE__ */ a(W.path, {
|
|
640
|
+
d: n,
|
|
641
|
+
...r
|
|
590
642
|
});
|
|
591
|
-
},
|
|
643
|
+
}, nn = ({ children: e, ...t }) => /* @__PURE__ */ a("svg", {
|
|
592
644
|
viewBox: "0 0 1 1",
|
|
593
645
|
preserveAspectRatio: "none",
|
|
594
646
|
width: "100%",
|
|
@@ -596,197 +648,197 @@ var Br = ({ shouldAnimateTransitions: e, cx: t, cy: n, r, ...s }) => e ? /* @__P
|
|
|
596
648
|
pointerEvents: "none",
|
|
597
649
|
...t,
|
|
598
650
|
children: e
|
|
599
|
-
}),
|
|
600
|
-
x:
|
|
601
|
-
y:
|
|
602
|
-
width:
|
|
603
|
-
height:
|
|
651
|
+
}), sn = ({ box: e, children: t }) => /* @__PURE__ */ a("svg", {
|
|
652
|
+
x: U(e.x0),
|
|
653
|
+
y: U(e.y0),
|
|
654
|
+
width: U(e.x1 - e.x0),
|
|
655
|
+
height: U(e.y1 - e.y0),
|
|
604
656
|
overflow: "hidden",
|
|
605
657
|
pointerEvents: "none",
|
|
606
658
|
children: t
|
|
607
|
-
}),
|
|
608
|
-
var
|
|
609
|
-
var
|
|
659
|
+
}), wt = "drqe3u0", _t = "drqe3u1", Pt = "drqe3u2", kt = "drqe3u3", M = "drqe3u4", Lt = "drqe3u5", $t = "drqe3u6", Mt = "drqe3u7", j = "drqe3u8", xt = "drqe3u9", Ht = "drqe3ua";
|
|
660
|
+
var At = "drqe3uc", Bt = "drqe3ud", Ot = "drqe3ue", Kt = "drqe3uf";
|
|
661
|
+
var Ft = "drqe3uh", Ut = "drqe3ui", ue = {
|
|
610
662
|
enabled: "drqe3uk drqe3uj",
|
|
611
663
|
disabled: "drqe3ul drqe3uj"
|
|
612
|
-
},
|
|
664
|
+
}, me = {
|
|
613
665
|
ran: "drqe3un drqe3um",
|
|
614
666
|
dim: "drqe3uo drqe3um"
|
|
615
|
-
},
|
|
667
|
+
}, ye = {
|
|
616
668
|
ran: "drqe3uq drqe3up",
|
|
617
669
|
cached: "drqe3ur drqe3up",
|
|
618
670
|
untouched: "drqe3us drqe3up"
|
|
619
|
-
},
|
|
620
|
-
const { compileBus:
|
|
671
|
+
}, on = ({ width: e = 440, style: t, className: r } = {}) => {
|
|
672
|
+
const { compileBus: n } = ee(), [s] = b(() => it()), [c, i] = b(!1), [l, u] = b(Me);
|
|
621
673
|
H(() => {
|
|
622
|
-
const { recordCompile:
|
|
623
|
-
return
|
|
624
|
-
}, [s,
|
|
625
|
-
const
|
|
626
|
-
|
|
627
|
-
const
|
|
628
|
-
return
|
|
674
|
+
const { recordCompile: d } = s.getState(), g = n.getLastTrigger(), v = n.getLastCompile();
|
|
675
|
+
return g && v && d(g, v), n.subscribe(d);
|
|
676
|
+
}, [s, n]);
|
|
677
|
+
const h = J(s, (d) => d.lastCompile), _ = J(s, (d) => d.history), q = n.getCacheStats(), T = h === null && _.length === 0, R = () => {
|
|
678
|
+
u((d) => {
|
|
679
|
+
const g = !d;
|
|
680
|
+
return He(g), g;
|
|
629
681
|
});
|
|
630
682
|
};
|
|
631
|
-
return /* @__PURE__ */
|
|
632
|
-
className:
|
|
683
|
+
return /* @__PURE__ */ f("div", {
|
|
684
|
+
className: Ye(Ht, r),
|
|
633
685
|
style: {
|
|
634
686
|
width: e,
|
|
635
687
|
...t
|
|
636
688
|
},
|
|
637
689
|
children: [
|
|
638
|
-
/* @__PURE__ */
|
|
639
|
-
className:
|
|
640
|
-
children: [/* @__PURE__ */
|
|
641
|
-
className:
|
|
690
|
+
/* @__PURE__ */ f("div", {
|
|
691
|
+
className: wt,
|
|
692
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ a("div", {
|
|
693
|
+
className: _t,
|
|
642
694
|
children: "compile cache"
|
|
643
|
-
}), /* @__PURE__ */
|
|
644
|
-
className:
|
|
645
|
-
children:
|
|
646
|
-
})] }), /* @__PURE__ */
|
|
695
|
+
}), /* @__PURE__ */ a("div", {
|
|
696
|
+
className: Ot,
|
|
697
|
+
children: T ? "production: stats disabled" : h ? `last: ${h.label} · ${ne(h.durationMs)}` : "awaiting first compile…"
|
|
698
|
+
})] }), /* @__PURE__ */ a("button", {
|
|
647
699
|
type: "button",
|
|
648
|
-
onClick: () =>
|
|
649
|
-
className:
|
|
700
|
+
onClick: () => i((d) => !d),
|
|
701
|
+
className: Kt,
|
|
650
702
|
children: c ? "▾" : "▴"
|
|
651
703
|
})]
|
|
652
704
|
}),
|
|
653
|
-
!c && /* @__PURE__ */
|
|
705
|
+
!c && /* @__PURE__ */ f("div", {
|
|
654
706
|
className: "drqe3ub",
|
|
655
|
-
children: [/* @__PURE__ */
|
|
707
|
+
children: [/* @__PURE__ */ f("button", {
|
|
656
708
|
type: "button",
|
|
657
|
-
onClick:
|
|
658
|
-
className: l ?
|
|
709
|
+
onClick: R,
|
|
710
|
+
className: l ? ue.enabled : ue.disabled,
|
|
659
711
|
"aria-pressed": l,
|
|
660
712
|
children: ["cache ", l ? "enabled" : "disabled"]
|
|
661
|
-
}), /* @__PURE__ */
|
|
713
|
+
}), /* @__PURE__ */ a("span", {
|
|
662
714
|
className: "drqe3ug",
|
|
663
715
|
children: "next compile reflects this toggle"
|
|
664
716
|
})]
|
|
665
717
|
}),
|
|
666
|
-
!c && !
|
|
667
|
-
delta:
|
|
668
|
-
durations:
|
|
669
|
-
cumulative:
|
|
670
|
-
}), /* @__PURE__ */
|
|
718
|
+
!c && !T && /* @__PURE__ */ f(je, { children: [/* @__PURE__ */ a(jt, {
|
|
719
|
+
delta: h?.stages,
|
|
720
|
+
durations: h?.stageDurationsMs,
|
|
721
|
+
cumulative: q
|
|
722
|
+
}), /* @__PURE__ */ a(Yt, { entries: _ })] })
|
|
671
723
|
]
|
|
672
724
|
});
|
|
673
|
-
},
|
|
674
|
-
className:
|
|
675
|
-
children: [/* @__PURE__ */
|
|
676
|
-
className:
|
|
725
|
+
}, jt = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ f("table", {
|
|
726
|
+
className: Pt,
|
|
727
|
+
children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ f("tr", {
|
|
728
|
+
className: Ft,
|
|
677
729
|
children: [
|
|
678
|
-
/* @__PURE__ */
|
|
679
|
-
className:
|
|
730
|
+
/* @__PURE__ */ a("th", {
|
|
731
|
+
className: kt,
|
|
680
732
|
children: "stage"
|
|
681
733
|
}),
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
className:
|
|
734
|
+
/* @__PURE__ */ a("th", {
|
|
735
|
+
className: M,
|
|
684
736
|
children: "time"
|
|
685
737
|
}),
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
className:
|
|
738
|
+
/* @__PURE__ */ a("th", {
|
|
739
|
+
className: M,
|
|
688
740
|
children: "Δ miss"
|
|
689
741
|
}),
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
className:
|
|
742
|
+
/* @__PURE__ */ a("th", {
|
|
743
|
+
className: M,
|
|
692
744
|
children: "Δ hit"
|
|
693
745
|
}),
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
className:
|
|
746
|
+
/* @__PURE__ */ a("th", {
|
|
747
|
+
className: M,
|
|
696
748
|
children: "total miss"
|
|
697
749
|
}),
|
|
698
|
-
/* @__PURE__ */
|
|
699
|
-
className:
|
|
750
|
+
/* @__PURE__ */ a("th", {
|
|
751
|
+
className: M,
|
|
700
752
|
children: "total hit"
|
|
701
753
|
})
|
|
702
754
|
]
|
|
703
|
-
}) }), /* @__PURE__ */
|
|
704
|
-
const s = e?.[
|
|
705
|
-
return /* @__PURE__ */
|
|
706
|
-
className:
|
|
755
|
+
}) }), /* @__PURE__ */ a("tbody", { children: te.map((n) => {
|
|
756
|
+
const s = e?.[n], c = Vt(s);
|
|
757
|
+
return /* @__PURE__ */ f("tr", {
|
|
758
|
+
className: At,
|
|
707
759
|
children: [
|
|
708
|
-
/* @__PURE__ */
|
|
709
|
-
className:
|
|
760
|
+
/* @__PURE__ */ f("td", {
|
|
761
|
+
className: Lt,
|
|
710
762
|
children: [
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
className:
|
|
763
|
+
/* @__PURE__ */ a("span", {
|
|
764
|
+
className: ye[c],
|
|
713
765
|
"aria-hidden": !0
|
|
714
766
|
}),
|
|
715
767
|
" ",
|
|
716
|
-
|
|
768
|
+
n
|
|
717
769
|
]
|
|
718
770
|
}),
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
className:
|
|
721
|
-
children: t === void 0 || c === "untouched" ? "—" :
|
|
771
|
+
/* @__PURE__ */ a("td", {
|
|
772
|
+
className: j,
|
|
773
|
+
children: t === void 0 || c === "untouched" ? "—" : ne(t[n])
|
|
722
774
|
}),
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
className: c === "ran" ?
|
|
775
|
+
/* @__PURE__ */ a("td", {
|
|
776
|
+
className: c === "ran" ? me.ran : me.dim,
|
|
725
777
|
children: s?.misses ?? 0
|
|
726
778
|
}),
|
|
727
|
-
/* @__PURE__ */
|
|
728
|
-
className:
|
|
779
|
+
/* @__PURE__ */ a("td", {
|
|
780
|
+
className: j,
|
|
729
781
|
children: s?.hits ?? 0
|
|
730
782
|
}),
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
className:
|
|
733
|
-
children: n
|
|
783
|
+
/* @__PURE__ */ a("td", {
|
|
784
|
+
className: j,
|
|
785
|
+
children: r[n].misses
|
|
734
786
|
}),
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
className:
|
|
737
|
-
children: n
|
|
787
|
+
/* @__PURE__ */ a("td", {
|
|
788
|
+
className: j,
|
|
789
|
+
children: r[n].hits
|
|
738
790
|
})
|
|
739
791
|
]
|
|
740
|
-
},
|
|
792
|
+
}, n);
|
|
741
793
|
}) })]
|
|
742
|
-
}),
|
|
743
|
-
className:
|
|
744
|
-
children: [/* @__PURE__ */
|
|
745
|
-
className:
|
|
794
|
+
}), Yt = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ f("div", {
|
|
795
|
+
className: Bt,
|
|
796
|
+
children: [/* @__PURE__ */ a("div", {
|
|
797
|
+
className: Ut,
|
|
746
798
|
children: "recent compiles"
|
|
747
799
|
}), e.map((t) => {
|
|
748
|
-
const
|
|
749
|
-
return /* @__PURE__ */
|
|
750
|
-
className:
|
|
800
|
+
const r = Wt(t.stages, (c) => c.misses > 0), n = te.length;
|
|
801
|
+
return /* @__PURE__ */ f("div", {
|
|
802
|
+
className: $t,
|
|
751
803
|
children: [
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
className:
|
|
804
|
+
/* @__PURE__ */ a("span", {
|
|
805
|
+
className: ye[r === 0 ? "cached" : "ran"],
|
|
754
806
|
"aria-hidden": !0
|
|
755
807
|
}),
|
|
756
|
-
/* @__PURE__ */
|
|
757
|
-
className:
|
|
808
|
+
/* @__PURE__ */ a("span", {
|
|
809
|
+
className: Mt,
|
|
758
810
|
title: t.label,
|
|
759
811
|
children: t.label
|
|
760
812
|
}),
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
className:
|
|
813
|
+
/* @__PURE__ */ f("span", {
|
|
814
|
+
className: xt,
|
|
763
815
|
children: [
|
|
764
|
-
n,
|
|
765
|
-
"/",
|
|
766
816
|
r,
|
|
817
|
+
"/",
|
|
818
|
+
n,
|
|
767
819
|
" ran · ",
|
|
768
|
-
|
|
820
|
+
ne(t.durationMs)
|
|
769
821
|
]
|
|
770
822
|
})
|
|
771
823
|
]
|
|
772
824
|
}, t.id);
|
|
773
825
|
})]
|
|
774
|
-
}),
|
|
775
|
-
let
|
|
776
|
-
for (const
|
|
777
|
-
return
|
|
778
|
-
},
|
|
779
|
-
const { history: e } =
|
|
780
|
-
return
|
|
781
|
-
...
|
|
782
|
-
undo:
|
|
783
|
-
redo:
|
|
826
|
+
}), Vt = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", Wt = (e, t) => {
|
|
827
|
+
let r = 0;
|
|
828
|
+
for (const n of te) t(e[n]) && (r += 1);
|
|
829
|
+
return r;
|
|
830
|
+
}, ne = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, an = () => {
|
|
831
|
+
const { history: e } = ee(), { stack: t, undo: r, redo: n } = e, s = p((l) => t.subscribe(l), [t]), c = p(() => t.getSnapshot(), [t]), i = Ue(s, c, c);
|
|
832
|
+
return x(() => ({
|
|
833
|
+
...i,
|
|
834
|
+
undo: r,
|
|
835
|
+
redo: n
|
|
784
836
|
}), [
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
837
|
+
i,
|
|
838
|
+
r,
|
|
839
|
+
n
|
|
788
840
|
]);
|
|
789
|
-
},
|
|
841
|
+
}, Xt = /* @__PURE__ */ new Set([
|
|
790
842
|
"button",
|
|
791
843
|
"checkbox",
|
|
792
844
|
"color",
|
|
@@ -797,86 +849,90 @@ var It = "drqe3uh", kt = "drqe3ui", oe = {
|
|
|
797
849
|
"range",
|
|
798
850
|
"reset",
|
|
799
851
|
"submit"
|
|
800
|
-
]),
|
|
801
|
-
const { target:
|
|
852
|
+
]), cn = (e, t = {}) => {
|
|
853
|
+
const { target: r, enabled: n = !0 } = t;
|
|
802
854
|
H(() => {
|
|
803
|
-
const s =
|
|
804
|
-
if (!
|
|
805
|
-
const c = (
|
|
806
|
-
if (!
|
|
807
|
-
const l =
|
|
855
|
+
const s = zt(r);
|
|
856
|
+
if (!n || !s) return;
|
|
857
|
+
const c = (i) => {
|
|
858
|
+
if (!Qt(i) || i.defaultPrevented || Zt(i.target)) return;
|
|
859
|
+
const l = De(i);
|
|
808
860
|
if (!l) return;
|
|
809
|
-
const
|
|
810
|
-
|
|
861
|
+
const u = e.current;
|
|
862
|
+
u && (l === "undo" ? u.undo() : u.redo()) && i.preventDefault();
|
|
811
863
|
};
|
|
812
864
|
return s.addEventListener("keydown", c), () => s.removeEventListener("keydown", c);
|
|
813
865
|
}, [
|
|
814
866
|
e,
|
|
815
|
-
|
|
816
|
-
|
|
867
|
+
r,
|
|
868
|
+
n
|
|
817
869
|
]);
|
|
818
|
-
},
|
|
819
|
-
const { targetBoundaryStore: e } =
|
|
820
|
-
return
|
|
870
|
+
}, zt = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, Qt = (e) => "key" in e, Zt = (e) => e instanceof HTMLInputElement ? !Xt.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, ln = () => {
|
|
871
|
+
const { targetBoundaryStore: e } = ee();
|
|
872
|
+
return J(e, (t) => t.boundary);
|
|
821
873
|
};
|
|
822
874
|
export {
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
Or as
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
Rr as
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
875
|
+
Kr as BrandMark,
|
|
876
|
+
or as CanvasTextMeasurer,
|
|
877
|
+
cr as DefaultFooter,
|
|
878
|
+
Ct as DefaultGeomCircle,
|
|
879
|
+
Gt as DefaultGeomLine,
|
|
880
|
+
qt as DefaultGeomPath,
|
|
881
|
+
Dt as DefaultGeomRect,
|
|
882
|
+
$r as DefaultGrid,
|
|
883
|
+
ar as DefaultHeader,
|
|
884
|
+
rr as DefaultSwatch,
|
|
885
|
+
yr as DefaultTooltip,
|
|
886
|
+
on as DevToolsPanel,
|
|
887
|
+
Or as GRAPH_MODES,
|
|
888
|
+
Jr as GeomCircle,
|
|
889
|
+
en as GeomLine,
|
|
890
|
+
rn as GeomPath,
|
|
891
|
+
tn as GeomRect,
|
|
892
|
+
Je as GraphErrorBoundary,
|
|
893
|
+
ie as GraphErrorPanel,
|
|
894
|
+
Nt as GraphProvider,
|
|
895
|
+
fr as GraphRenderer,
|
|
896
|
+
nr as HoverProvider,
|
|
897
|
+
lr as IntroFade,
|
|
898
|
+
Ir as IntroWipeClip,
|
|
899
|
+
hr as TextMeasurerProvider,
|
|
900
|
+
Er as ThemeProvider,
|
|
901
|
+
sn as UnitBoxSvg,
|
|
902
|
+
nn as UnitSpaceSvg,
|
|
903
|
+
vr as buildDotsEditOutlineShapes,
|
|
904
|
+
Zr as createGraphyKit,
|
|
905
|
+
Pr as darkTheme,
|
|
906
|
+
ur as defineGeomRenderer,
|
|
907
|
+
Dr as lightTheme,
|
|
908
|
+
pr as lightenCss,
|
|
909
|
+
Sr as projectPointCartesian,
|
|
910
|
+
et as pruneSelection,
|
|
911
|
+
tr as resolveBrandMarkVisual,
|
|
912
|
+
Mr as scalePointToPanel,
|
|
913
|
+
er as stampAxisEditTarget,
|
|
914
|
+
Cr as stampGridEditTarget,
|
|
915
|
+
dr as stampLegendEditTarget,
|
|
916
|
+
mr as useElementScreenRect,
|
|
917
|
+
sr as useGeomHitTest,
|
|
918
|
+
Br as useGeomHover,
|
|
919
|
+
Gr as useGeomReaderTree,
|
|
920
|
+
Hr as useGeomStyleReader,
|
|
921
|
+
qr as useGraphCommands,
|
|
922
|
+
Nr as useGraphHandle,
|
|
923
|
+
an as useGraphHistory,
|
|
924
|
+
cn as useGraphHistoryShortcuts,
|
|
925
|
+
Lr as useGraphLocale,
|
|
926
|
+
Rr as useGraphSelection,
|
|
927
|
+
Ar as useGuidesTakePress,
|
|
928
|
+
kr as useHandleScene,
|
|
929
|
+
wr as useHoverState,
|
|
930
|
+
xr as usePaintDefs,
|
|
931
|
+
ir as useResolvedStyle,
|
|
932
|
+
_r as useSceneSelector,
|
|
933
|
+
br as useStyleReaderTree,
|
|
934
|
+
Tr as useStyleResolver,
|
|
935
|
+
ln as useTargetBoundary,
|
|
936
|
+
gr as useTextMeasurer,
|
|
937
|
+
Ur as vars
|
|
882
938
|
};
|