@marimo-team/islands 0.25.3-dev402 → 0.25.3-dev409
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/{ConnectedDataExplorerComponent-1DGGwl88.js → ConnectedDataExplorerComponent-DCW4bXq-.js} +1 -1
- package/dist/{ErrorBoundary-DfbzIKA3.js → ErrorBoundary-DvqXHbNZ.js} +1 -1
- package/dist/{chat-ui-r3PPIMn0.js → chat-ui-BGEXB6V4.js} +1354 -1320
- package/dist/{code-visibility-CXijswY7.js → code-visibility-U0UkDKVw.js} +1 -1
- package/dist/{common-Cm5ENbUw.js → common-DIbea_dy.js} +1 -1
- package/dist/{data-grid-overlay-editor-Dv0TkGKt.js → data-grid-overlay-editor-DfXNDUyH.js} +1 -1
- package/dist/{feedback-button-Xk-mOev4.js → feedback-button-MbaK_7gC.js} +2 -2
- package/dist/{glide-data-editor-DdxBDWAj.js → glide-data-editor-BFIyRGll.js} +3 -3
- package/dist/{globals-DR3VVkF6.js → globals-B19LJT4z.js} +1 -1
- package/dist/main.js +6160 -6141
- package/dist/{number-overlay-editor-Cc5gJryh.js → number-overlay-editor-VHIfift0.js} +1 -1
- package/dist/{process-output-39KkAXSF.js → process-output-BvCDoG-m.js} +14 -25
- package/dist/{reveal-component-Dm5K9KPi.js → reveal-component-2v0Bn3oO.js} +2 -2
- package/dist/{spec-Ww0JjShW.js → spec-DV8oNpRR.js} +46 -49
- package/dist/{semaphore-8KhQouXt.js → useDeepCompareMemoize-C90a6_io.js} +15 -5
- package/dist/{vega-component-DQZhTzVQ.js → vega-component-ArEoBGzQ.js} +197 -198
- package/package.json +1 -1
- package/src/components/chat/__tests__/chat-utils.test.ts +48 -0
- package/src/components/chat/__tests__/message-queue.test.tsx +94 -1
- package/src/components/chat/__tests__/pending-chat-prompt.test.tsx +568 -0
- package/src/components/chat/__tests__/useFileState.test.tsx +176 -15
- package/src/components/chat/chat-components.tsx +3 -2
- package/src/components/chat/chat-panel.tsx +199 -74
- package/src/components/chat/chat-utils.ts +148 -34
- package/src/components/chat/user-message.tsx +15 -6
- package/src/components/data-table/charts/__tests__/altair-generator.test.ts +42 -27
- package/src/components/data-table/charts/chart-spec/altair-generator.ts +2 -6
- package/src/core/ai/__tests__/attachments.test.ts +153 -0
- package/src/core/ai/attachments.ts +80 -0
- package/src/utils/python-poet/poet.ts +12 -2
- package/dist/useDeepCompareMemoize-Bvrue1iy.js +0 -11
|
@@ -13,20 +13,19 @@ import { t as te } from "./useEvent-BoN7U38T.js";
|
|
|
13
13
|
import { a as ne, i as re, n as ie, t as m } from "./formats-BDqe9cfr.js";
|
|
14
14
|
import { a as h, t as g } from "./arrays-DoQ-AILx.js";
|
|
15
15
|
import { t as ae } from "./useAsyncData-P5-Oovhq.js";
|
|
16
|
-
import {
|
|
17
|
-
import { W as
|
|
18
|
-
import { t as
|
|
19
|
-
import { a as
|
|
20
|
-
import { t as
|
|
21
|
-
import { t as de } from "./use-vega-container-remeasure-BrUpWQfF.js";
|
|
16
|
+
import { n as _, t as oe } from "./useDeepCompareMemoize-C90a6_io.js";
|
|
17
|
+
import { W as se, n as ce } from "./vega-loader.browser-Co9gYE8Z.js";
|
|
18
|
+
import { t as le } from "./react-vega-CGgQEf0O.js";
|
|
19
|
+
import { a as ue, n as de } from "./loader-Bin_dutt.js";
|
|
20
|
+
import { t as fe } from "./use-vega-container-remeasure-BrUpWQfF.js";
|
|
22
21
|
//#region src/plugins/impl/vega/fix-relative-url.ts
|
|
23
|
-
var
|
|
24
|
-
function
|
|
22
|
+
var pe = /* @__PURE__ */ e(a(), 1), me = o();
|
|
23
|
+
function he(e) {
|
|
25
24
|
return e.data && "url" in e.data && (e.data.url = l(e.data.url).href), e;
|
|
26
25
|
}
|
|
27
26
|
//#endregion
|
|
28
27
|
//#region src/plugins/impl/vega/types.ts
|
|
29
|
-
var
|
|
28
|
+
var v = {
|
|
30
29
|
arc: "arc",
|
|
31
30
|
area: "area",
|
|
32
31
|
bar: "bar",
|
|
@@ -41,23 +40,23 @@ var y = {
|
|
|
41
40
|
circle: "circle",
|
|
42
41
|
square: "square",
|
|
43
42
|
geoshape: "geoshape"
|
|
44
|
-
},
|
|
43
|
+
}, y = /* @__PURE__ */ new Set([
|
|
45
44
|
"boxplot",
|
|
46
45
|
"errorband",
|
|
47
46
|
"errorbar"
|
|
48
|
-
]),
|
|
47
|
+
]), b = {
|
|
49
48
|
getMarkType(e) {
|
|
50
49
|
let t = typeof e == "string" ? e : e.type;
|
|
51
|
-
if (
|
|
50
|
+
if (y.has(t)) throw Error("Not supported");
|
|
52
51
|
return t;
|
|
53
52
|
},
|
|
54
53
|
isInteractive(e) {
|
|
55
54
|
let t = typeof e == "string" ? e : e.type;
|
|
56
|
-
return !
|
|
55
|
+
return !y.has(t);
|
|
57
56
|
},
|
|
58
57
|
makeClickable(e) {
|
|
59
58
|
let t = typeof e == "string" ? e : e.type;
|
|
60
|
-
return t in
|
|
59
|
+
return t in v ? typeof e == "string" ? {
|
|
61
60
|
type: e,
|
|
62
61
|
cursor: "pointer",
|
|
63
62
|
tooltip: !0
|
|
@@ -71,7 +70,7 @@ var y = {
|
|
|
71
70
|
getOpacity(e) {
|
|
72
71
|
return typeof e == "string" ? null : "opacity" in e && typeof e.opacity == "number" ? e.opacity : null;
|
|
73
72
|
}
|
|
74
|
-
},
|
|
73
|
+
}, x = {
|
|
75
74
|
point(e) {
|
|
76
75
|
return e == null ? "select_point" : `select_point_${e}`;
|
|
77
76
|
},
|
|
@@ -102,13 +101,13 @@ var y = {
|
|
|
102
101
|
return e.startsWith("bin_coloring");
|
|
103
102
|
}
|
|
104
103
|
};
|
|
105
|
-
function
|
|
104
|
+
function S() {
|
|
106
105
|
return i() ? "metaKey" : "ctrlKey";
|
|
107
106
|
}
|
|
108
|
-
var
|
|
107
|
+
var C = {
|
|
109
108
|
highlight() {
|
|
110
109
|
return {
|
|
111
|
-
name:
|
|
110
|
+
name: x.HIGHLIGHT,
|
|
112
111
|
select: {
|
|
113
112
|
type: "point",
|
|
114
113
|
on: "mouseover"
|
|
@@ -116,12 +115,12 @@ var w = {
|
|
|
116
115
|
};
|
|
117
116
|
},
|
|
118
117
|
interval(e, t) {
|
|
119
|
-
let n =
|
|
118
|
+
let n = S();
|
|
120
119
|
return {
|
|
121
|
-
name:
|
|
120
|
+
name: x.interval(t),
|
|
122
121
|
select: {
|
|
123
122
|
type: "interval",
|
|
124
|
-
encodings:
|
|
123
|
+
encodings: w(e),
|
|
125
124
|
mark: {
|
|
126
125
|
fill: "#669EFF",
|
|
127
126
|
fillOpacity: .07,
|
|
@@ -135,26 +134,26 @@ var w = {
|
|
|
135
134
|
},
|
|
136
135
|
point(e, t) {
|
|
137
136
|
return {
|
|
138
|
-
name:
|
|
137
|
+
name: x.point(t),
|
|
139
138
|
select: {
|
|
140
139
|
type: "point",
|
|
141
|
-
encodings:
|
|
142
|
-
on: `click[!event.${
|
|
140
|
+
encodings: w(e),
|
|
141
|
+
on: `click[!event.${S()}]`
|
|
143
142
|
}
|
|
144
143
|
};
|
|
145
144
|
},
|
|
146
145
|
binColoring(e) {
|
|
147
146
|
return {
|
|
148
|
-
name:
|
|
147
|
+
name: x.binColoring(e),
|
|
149
148
|
select: {
|
|
150
149
|
type: "point",
|
|
151
|
-
on: `click[!event.${
|
|
150
|
+
on: `click[!event.${S()}]`
|
|
152
151
|
}
|
|
153
152
|
};
|
|
154
153
|
},
|
|
155
154
|
legend(e) {
|
|
156
155
|
return {
|
|
157
|
-
name:
|
|
156
|
+
name: x.legendSelection(e),
|
|
158
157
|
select: {
|
|
159
158
|
type: "point",
|
|
160
159
|
fields: [e]
|
|
@@ -163,9 +162,9 @@ var w = {
|
|
|
163
162
|
};
|
|
164
163
|
},
|
|
165
164
|
panZoom() {
|
|
166
|
-
let e =
|
|
165
|
+
let e = S();
|
|
167
166
|
return {
|
|
168
|
-
name:
|
|
167
|
+
name: x.PAN_ZOOM,
|
|
169
168
|
bind: "scales",
|
|
170
169
|
select: {
|
|
171
170
|
type: "interval",
|
|
@@ -176,42 +175,42 @@ var w = {
|
|
|
176
175
|
};
|
|
177
176
|
}
|
|
178
177
|
};
|
|
179
|
-
function
|
|
180
|
-
switch (
|
|
181
|
-
case
|
|
182
|
-
case
|
|
183
|
-
case
|
|
184
|
-
case
|
|
185
|
-
case
|
|
186
|
-
let t =
|
|
178
|
+
function w(e) {
|
|
179
|
+
switch (b.getMarkType(e.mark)) {
|
|
180
|
+
case v.image:
|
|
181
|
+
case v.trail: return;
|
|
182
|
+
case v.area:
|
|
183
|
+
case v.arc: return ["color"];
|
|
184
|
+
case v.bar: {
|
|
185
|
+
let t = E(e);
|
|
187
186
|
return t === "horizontal" ? ["y"] : t === "vertical" ? ["x"] : void 0;
|
|
188
187
|
}
|
|
189
|
-
case
|
|
190
|
-
case
|
|
191
|
-
case
|
|
192
|
-
case
|
|
193
|
-
case
|
|
194
|
-
case
|
|
195
|
-
case
|
|
196
|
-
case
|
|
197
|
-
case
|
|
188
|
+
case v.circle:
|
|
189
|
+
case v.geoshape:
|
|
190
|
+
case v.line:
|
|
191
|
+
case v.point:
|
|
192
|
+
case v.rect:
|
|
193
|
+
case v.rule:
|
|
194
|
+
case v.square:
|
|
195
|
+
case v.text:
|
|
196
|
+
case v.tick: return ["x", "y"];
|
|
198
197
|
}
|
|
199
198
|
}
|
|
200
|
-
function
|
|
199
|
+
function T(e) {
|
|
201
200
|
if ("params" in e && e.params && e.params.length > 0) {
|
|
202
201
|
let t = e.params.filter((e) => e != null && "select" in e && e.select !== void 0).map((e) => e.name);
|
|
203
202
|
return h(t);
|
|
204
203
|
}
|
|
205
|
-
return "layer" in e ? h(e.layer.flatMap(
|
|
204
|
+
return "layer" in e ? h(e.layer.flatMap(T)) : "vconcat" in e ? h(e.vconcat.flatMap(T)) : "hconcat" in e ? h(e.hconcat.flatMap(T)) : [];
|
|
206
205
|
}
|
|
207
|
-
function
|
|
206
|
+
function E(e) {
|
|
208
207
|
if (!e || !("mark" in e)) return;
|
|
209
208
|
let t = e.encoding?.x, n = e.encoding?.y;
|
|
210
209
|
if (t && "type" in t && t.type === "nominal") return "vertical";
|
|
211
210
|
if (n && "type" in n && n.type === "nominal" || t && "aggregate" in t) return "horizontal";
|
|
212
211
|
if (n && "aggregate" in n) return "vertical";
|
|
213
212
|
}
|
|
214
|
-
function
|
|
213
|
+
function D(e) {
|
|
215
214
|
if (!e.encoding) return [];
|
|
216
215
|
let t = [];
|
|
217
216
|
for (let n of Object.values(e.encoding)) n && typeof n == "object" && "bin" in n && n.bin && "field" in n && typeof n.field == "string" && t.push(n.field);
|
|
@@ -219,15 +218,15 @@ function O(e) {
|
|
|
219
218
|
}
|
|
220
219
|
//#endregion
|
|
221
220
|
//#region src/plugins/impl/vega/encodings.ts
|
|
222
|
-
function
|
|
221
|
+
function O(e) {
|
|
223
222
|
if (!e || !("encoding" in e)) return [];
|
|
224
223
|
let { encoding: t } = e;
|
|
225
224
|
return t ? Object.entries(t).flatMap((e) => {
|
|
226
225
|
let [t, n] = e;
|
|
227
|
-
return !n || !
|
|
226
|
+
return !n || !k.has(t) ? [] : "field" in n && typeof n.field == "string" ? [n.field] : "condition" in n && n.condition && typeof n.condition == "object" && "field" in n.condition && n.condition.field && typeof n.condition.field == "string" ? [n.condition.field] : [];
|
|
228
227
|
}) : [];
|
|
229
228
|
}
|
|
230
|
-
var
|
|
229
|
+
var k = /* @__PURE__ */ new Set([
|
|
231
230
|
"color",
|
|
232
231
|
"fill",
|
|
233
232
|
"fillOpacity",
|
|
@@ -235,11 +234,11 @@ var A = /* @__PURE__ */ new Set([
|
|
|
235
234
|
"shape",
|
|
236
235
|
"size"
|
|
237
236
|
]);
|
|
238
|
-
function
|
|
239
|
-
let i = n.filter((e) =>
|
|
237
|
+
function A(e, t, n, r) {
|
|
238
|
+
let i = n.filter((e) => x.isBinColoring(e)), a = { and: (i.length > 0 ? i : n).map((e) => ({ param: e })) };
|
|
240
239
|
switch (e) {
|
|
241
240
|
case "opacity": {
|
|
242
|
-
let e =
|
|
241
|
+
let e = b.getOpacity(r) || 1;
|
|
243
242
|
return {
|
|
244
243
|
...t,
|
|
245
244
|
opacity: {
|
|
@@ -256,7 +255,7 @@ function j(e, t, n, r) {
|
|
|
256
255
|
}
|
|
257
256
|
//#endregion
|
|
258
257
|
//#region src/plugins/impl/vega/make-selectable.ts
|
|
259
|
-
function
|
|
258
|
+
function j(e) {
|
|
260
259
|
if (!("select" in e) || !e.select) return JSON.stringify(e);
|
|
261
260
|
let t = e.select;
|
|
262
261
|
if (typeof t == "string") return JSON.stringify({
|
|
@@ -271,30 +270,30 @@ function M(e) {
|
|
|
271
270
|
};
|
|
272
271
|
return JSON.stringify(n);
|
|
273
272
|
}
|
|
274
|
-
function
|
|
275
|
-
let t =
|
|
273
|
+
function M(e) {
|
|
274
|
+
let t = N(e);
|
|
276
275
|
if (t.length === 0) return e;
|
|
277
|
-
let n =
|
|
276
|
+
let n = P(t);
|
|
278
277
|
return n.length === 0 ? e : {
|
|
279
|
-
...
|
|
278
|
+
...I(F(e, new Set(n.map((e) => e.name))), n.map((e) => e.name)),
|
|
280
279
|
params: [...e.params || [], ...n]
|
|
281
280
|
};
|
|
282
281
|
}
|
|
283
|
-
function
|
|
282
|
+
function N(e) {
|
|
284
283
|
let t = [];
|
|
285
|
-
if ("vconcat" in e && Array.isArray(e.vconcat)) for (let n of e.vconcat) t.push(...
|
|
286
|
-
else if ("hconcat" in e && Array.isArray(e.hconcat)) for (let n of e.hconcat) t.push(...
|
|
284
|
+
if ("vconcat" in e && Array.isArray(e.vconcat)) for (let n of e.vconcat) t.push(...N(n));
|
|
285
|
+
else if ("hconcat" in e && Array.isArray(e.hconcat)) for (let n of e.hconcat) t.push(...N(n));
|
|
287
286
|
else if ("layer" in e) return [];
|
|
288
287
|
else "mark" in e && "params" in e && e.params && e.params.length > 0 && t.push({ params: e.params });
|
|
289
288
|
return t;
|
|
290
289
|
}
|
|
291
|
-
function
|
|
290
|
+
function P(e) {
|
|
292
291
|
if (e.length === 0) return [];
|
|
293
292
|
let t = /* @__PURE__ */ new Map(), n = e.length;
|
|
294
293
|
for (let { params: n } of e) {
|
|
295
294
|
let e = /* @__PURE__ */ new Set();
|
|
296
295
|
for (let r of n) {
|
|
297
|
-
let n =
|
|
296
|
+
let n = j(r);
|
|
298
297
|
e.has(n) || (e.add(n), t.has(n) || t.set(n, {
|
|
299
298
|
count: 0,
|
|
300
299
|
param: r
|
|
@@ -305,14 +304,14 @@ function F(e) {
|
|
|
305
304
|
for (let [, { count: e, param: i }] of t) e === n && r.push(i);
|
|
306
305
|
return r;
|
|
307
306
|
}
|
|
308
|
-
function
|
|
307
|
+
function F(e, t) {
|
|
309
308
|
if ("vconcat" in e && Array.isArray(e.vconcat)) return {
|
|
310
309
|
...e,
|
|
311
|
-
vconcat: e.vconcat.map((e) =>
|
|
310
|
+
vconcat: e.vconcat.map((e) => F(e, t))
|
|
312
311
|
};
|
|
313
312
|
if ("hconcat" in e && Array.isArray(e.hconcat)) return {
|
|
314
313
|
...e,
|
|
315
|
-
hconcat: e.hconcat.map((e) =>
|
|
314
|
+
hconcat: e.hconcat.map((e) => F(e, t))
|
|
316
315
|
};
|
|
317
316
|
if ("mark" in e && "params" in e && e.params) {
|
|
318
317
|
let n = e.params, r = [];
|
|
@@ -328,20 +327,20 @@ function I(e, t) {
|
|
|
328
327
|
}
|
|
329
328
|
return e;
|
|
330
329
|
}
|
|
331
|
-
function
|
|
330
|
+
function I(e, t) {
|
|
332
331
|
return "vconcat" in e && Array.isArray(e.vconcat) ? {
|
|
333
332
|
...e,
|
|
334
|
-
vconcat: e.vconcat.map((e) =>
|
|
333
|
+
vconcat: e.vconcat.map((e) => I(e, t))
|
|
335
334
|
} : "hconcat" in e && Array.isArray(e.hconcat) ? {
|
|
336
335
|
...e,
|
|
337
|
-
hconcat: e.hconcat.map((e) =>
|
|
338
|
-
} : "layer" in e ? e : "mark" in e &&
|
|
336
|
+
hconcat: e.hconcat.map((e) => I(e, t))
|
|
337
|
+
} : "layer" in e ? e : "mark" in e && b.isInteractive(e.mark) ? {
|
|
339
338
|
...e,
|
|
340
|
-
mark:
|
|
341
|
-
encoding:
|
|
339
|
+
mark: b.makeClickable(e.mark),
|
|
340
|
+
encoding: A("opacity", e.encoding || {}, t, e.mark)
|
|
342
341
|
} : e;
|
|
343
342
|
}
|
|
344
|
-
function
|
|
343
|
+
function ge(e, t) {
|
|
345
344
|
let { chartSelection: n = !0, fieldSelection: r = !0 } = t;
|
|
346
345
|
if (!n && !r) return e;
|
|
347
346
|
e.params?.some((e) => e.bind === "legend") && (r = !1);
|
|
@@ -350,21 +349,21 @@ function he(e, t) {
|
|
|
350
349
|
let a = "vconcat" in e || "hconcat" in e;
|
|
351
350
|
if (i && a) return e;
|
|
352
351
|
if ("vconcat" in e) {
|
|
353
|
-
let t = e.vconcat.map((e) => "mark" in e ?
|
|
352
|
+
let t = e.vconcat.map((e) => "mark" in e ? ge(e, {
|
|
354
353
|
chartSelection: n,
|
|
355
354
|
fieldSelection: r
|
|
356
355
|
}) : e);
|
|
357
|
-
return
|
|
356
|
+
return M({
|
|
358
357
|
...e,
|
|
359
358
|
vconcat: t
|
|
360
359
|
});
|
|
361
360
|
}
|
|
362
361
|
if ("hconcat" in e) {
|
|
363
|
-
let t = e.hconcat.map((e) => "mark" in e ?
|
|
362
|
+
let t = e.hconcat.map((e) => "mark" in e ? ge(e, {
|
|
364
363
|
chartSelection: n,
|
|
365
364
|
fieldSelection: r
|
|
366
365
|
}) : e);
|
|
367
|
-
return
|
|
366
|
+
return M({
|
|
368
367
|
...e,
|
|
369
368
|
hconcat: t
|
|
370
369
|
});
|
|
@@ -372,78 +371,78 @@ function he(e, t) {
|
|
|
372
371
|
if ("layer" in e) {
|
|
373
372
|
let t = e.params && e.params.length > 0, i = r !== !1 && !t, a = [];
|
|
374
373
|
if (i) {
|
|
375
|
-
let t = e.layer.flatMap((e) => "mark" in e ?
|
|
374
|
+
let t = e.layer.flatMap((e) => "mark" in e ? O(e) : []);
|
|
376
375
|
a = [...new Set(t)], Array.isArray(r) && (a = g.intersection(a, r));
|
|
377
376
|
}
|
|
378
377
|
let o = e.layer.map((e, t) => {
|
|
379
378
|
if (!("mark" in e)) return e;
|
|
380
379
|
let r = e;
|
|
381
380
|
if (t === 0 && a.length > 0) {
|
|
382
|
-
let e = a.map((e) =>
|
|
381
|
+
let e = a.map((e) => C.legend(e));
|
|
383
382
|
r = {
|
|
384
383
|
...r,
|
|
385
384
|
params: [...r.params || [], ...e]
|
|
386
385
|
};
|
|
387
386
|
}
|
|
388
|
-
return r =
|
|
387
|
+
return r = R(r, n, t), r = B(r), t === 0 && (r = z(r)), r;
|
|
389
388
|
});
|
|
390
389
|
return {
|
|
391
390
|
...e,
|
|
392
391
|
layer: o
|
|
393
392
|
};
|
|
394
393
|
}
|
|
395
|
-
if (!("mark" in e) || !
|
|
394
|
+
if (!("mark" in e) || !b.isInteractive(e.mark)) return e;
|
|
396
395
|
let o = e;
|
|
397
|
-
return o =
|
|
396
|
+
return o = L(o, r), o = R(o, n, void 0), o = B(o), o = z(o), o;
|
|
398
397
|
}
|
|
399
|
-
function
|
|
398
|
+
function L(e, t) {
|
|
400
399
|
if (t === !1) return e;
|
|
401
|
-
let n =
|
|
400
|
+
let n = O(e);
|
|
402
401
|
Array.isArray(t) && (n = g.intersection(n, t));
|
|
403
|
-
let r = n.map((e) =>
|
|
402
|
+
let r = n.map((e) => C.legend(e)), i = [...e.params || [], ...r];
|
|
404
403
|
return {
|
|
405
404
|
...e,
|
|
406
405
|
params: i
|
|
407
406
|
};
|
|
408
407
|
}
|
|
409
|
-
function
|
|
408
|
+
function R(e, t, n) {
|
|
410
409
|
if (t === !1) return e;
|
|
411
410
|
let r;
|
|
412
411
|
try {
|
|
413
|
-
r =
|
|
412
|
+
r = b.getMarkType(e.mark);
|
|
414
413
|
} catch {
|
|
415
414
|
return e;
|
|
416
415
|
}
|
|
417
416
|
if (r === "geoshape") return e;
|
|
418
|
-
let i =
|
|
417
|
+
let i = D(e), a = t === !0 ? i.length > 0 ? ["point"] : V(r) : [t];
|
|
419
418
|
if (!a || a.length === 0) return e;
|
|
420
|
-
let o = a.map((t) => t === "interval" ?
|
|
421
|
-
return i.length > 0 && a.includes("point") && s.push(
|
|
419
|
+
let o = a.map((t) => t === "interval" ? C.interval(e, n) : C.point(e, n)), s = [...e.params || [], ...o];
|
|
420
|
+
return i.length > 0 && a.includes("point") && s.push(C.binColoring(n)), {
|
|
422
421
|
...e,
|
|
423
422
|
params: s
|
|
424
423
|
};
|
|
425
424
|
}
|
|
426
|
-
function
|
|
425
|
+
function z(e) {
|
|
427
426
|
let t;
|
|
428
427
|
try {
|
|
429
|
-
t =
|
|
428
|
+
t = b.getMarkType(e.mark);
|
|
430
429
|
} catch {}
|
|
431
430
|
if (t === "geoshape") return e;
|
|
432
431
|
let n = e.params || [];
|
|
433
432
|
return n.some((e) => e.bind === "scales") ? e : {
|
|
434
433
|
...e,
|
|
435
|
-
params: [...n,
|
|
434
|
+
params: [...n, C.panZoom()]
|
|
436
435
|
};
|
|
437
436
|
}
|
|
438
|
-
function
|
|
437
|
+
function B(e) {
|
|
439
438
|
let t = "encoding" in e ? e.encoding : void 0, n = e.params || [], r = n.map((e) => e.name);
|
|
440
|
-
return n.length === 0 || !
|
|
439
|
+
return n.length === 0 || !b.isInteractive(e.mark) ? e : {
|
|
441
440
|
...e,
|
|
442
|
-
mark:
|
|
443
|
-
encoding:
|
|
441
|
+
mark: b.makeClickable(e.mark),
|
|
442
|
+
encoding: A("opacity", t || {}, r, e.mark)
|
|
444
443
|
};
|
|
445
444
|
}
|
|
446
|
-
function
|
|
445
|
+
function V(e) {
|
|
447
446
|
switch (e) {
|
|
448
447
|
case "arc":
|
|
449
448
|
case "area": return ["point"];
|
|
@@ -455,10 +454,10 @@ function H(e) {
|
|
|
455
454
|
}
|
|
456
455
|
//#endregion
|
|
457
456
|
//#region src/plugins/impl/vega/resolve-data.ts
|
|
458
|
-
var
|
|
459
|
-
async function
|
|
457
|
+
var H = 5;
|
|
458
|
+
async function U(e) {
|
|
460
459
|
if (!e) return e;
|
|
461
|
-
let t = "datasets" in e ? { ...e.datasets } : {}, n = new _(
|
|
460
|
+
let t = "datasets" in e ? { ...e.datasets } : {}, n = new _(H), r = async (e) => {
|
|
462
461
|
if (!e) return e;
|
|
463
462
|
if ("layer" in e) {
|
|
464
463
|
let t = await Promise.all(e.layer.map(r));
|
|
@@ -491,7 +490,7 @@ async function W(e) {
|
|
|
491
490
|
} catch {
|
|
492
491
|
return e;
|
|
493
492
|
}
|
|
494
|
-
let a = e.data.format, o = await n.run(() =>
|
|
493
|
+
let a = e.data.format, o = await n.run(() => de(i.href, a));
|
|
495
494
|
return t[i.pathname] = o, {
|
|
496
495
|
...e,
|
|
497
496
|
data: { name: i.pathname }
|
|
@@ -504,19 +503,19 @@ async function W(e) {
|
|
|
504
503
|
}
|
|
505
504
|
//#endregion
|
|
506
505
|
//#region src/plugins/impl/vega/vega-component.tsx
|
|
507
|
-
var
|
|
508
|
-
|
|
509
|
-
var
|
|
510
|
-
let t = (0,
|
|
511
|
-
t[0] === o ? (c = t[1], l = t[2]) : (c = async () =>
|
|
506
|
+
var W = u();
|
|
507
|
+
ce("arrow", m);
|
|
508
|
+
var G = (e) => {
|
|
509
|
+
let t = (0, me.c)(12), { value: n, setValue: r, chartSelection: i, fieldSelection: a, spec: o, embedOptions: s } = e, c, l;
|
|
510
|
+
t[0] === o ? (c = t[1], l = t[2]) : (c = async () => U(o), l = [o], t[0] = o, t[1] = c, t[2] = l);
|
|
512
511
|
let { data: u, error: d } = ae(c, l);
|
|
513
512
|
if (d) {
|
|
514
513
|
let e;
|
|
515
|
-
return t[3] === d ? e = t[4] : (e = /* @__PURE__ */ (0,
|
|
514
|
+
return t[3] === d ? e = t[4] : (e = /* @__PURE__ */ (0, W.jsx)(f, { error: d }), t[3] = d, t[4] = e), e;
|
|
516
515
|
}
|
|
517
516
|
if (!u) return null;
|
|
518
517
|
let p;
|
|
519
|
-
return t[5] !== i || t[6] !== s || t[7] !== a || t[8] !== u || t[9] !== r || t[10] !== n ? (p = /* @__PURE__ */ (0,
|
|
518
|
+
return t[5] !== i || t[6] !== s || t[7] !== a || t[8] !== u || t[9] !== r || t[10] !== n ? (p = /* @__PURE__ */ (0, W.jsx)(K, {
|
|
520
519
|
value: n,
|
|
521
520
|
setValue: r,
|
|
522
521
|
chartSelection: i,
|
|
@@ -524,147 +523,147 @@ var K = (e) => {
|
|
|
524
523
|
spec: u,
|
|
525
524
|
embedOptions: s
|
|
526
525
|
}), t[5] = i, t[6] = s, t[7] = a, t[8] = u, t[9] = r, t[10] = n, t[11] = p) : p = t[11], p;
|
|
527
|
-
},
|
|
528
|
-
let a = (0,
|
|
526
|
+
}, K = (e) => {
|
|
527
|
+
let a = (0, me.c)(50), { value: o, setValue: l, chartSelection: u, fieldSelection: f, spec: ne, embedOptions: m } = e, { theme: h } = d(), g = (0, pe.useRef)(null), ae = (0, pe.useRef)(void 0), [_, ce] = (0, pe.useState)(), de;
|
|
529
528
|
bb0: {
|
|
530
529
|
if (m && "actions" in m) {
|
|
531
|
-
|
|
530
|
+
de = m.actions;
|
|
532
531
|
break bb0;
|
|
533
532
|
}
|
|
534
533
|
let e;
|
|
535
534
|
a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
|
|
536
535
|
source: !1,
|
|
537
536
|
compiled: !1
|
|
538
|
-
}, a[0] = e) : e = a[0],
|
|
537
|
+
}, a[0] = e) : e = a[0], de = e;
|
|
539
538
|
}
|
|
540
|
-
let
|
|
541
|
-
a[1] !== u || a[2] !== f || a[3] !==
|
|
539
|
+
let v = de, y = oe(ne), b;
|
|
540
|
+
a[1] !== u || a[2] !== f || a[3] !== y ? (b = ge(he(y), {
|
|
542
541
|
chartSelection: u,
|
|
543
542
|
fieldSelection: f
|
|
544
|
-
}), a[1] = u, a[2] = f, a[3] =
|
|
545
|
-
let
|
|
546
|
-
a[5] ===
|
|
547
|
-
let
|
|
548
|
-
a[7] !== l || a[8] !== o ? (
|
|
543
|
+
}), a[1] = u, a[2] = f, a[3] = y, a[4] = b) : b = a[4];
|
|
544
|
+
let S = b, C;
|
|
545
|
+
a[5] === S ? C = a[6] : (C = T(S), a[5] = S, a[6] = C);
|
|
546
|
+
let w = C, E;
|
|
547
|
+
a[7] !== l || a[8] !== o ? (E = (e) => {
|
|
549
548
|
l({
|
|
550
549
|
...o,
|
|
551
550
|
...e
|
|
552
551
|
});
|
|
553
|
-
}, a[7] = l, a[8] = o, a[9] =
|
|
554
|
-
let
|
|
555
|
-
a[10] ===
|
|
552
|
+
}, a[7] = l, a[8] = o, a[9] = E) : E = a[9];
|
|
553
|
+
let D = te(E), O;
|
|
554
|
+
a[10] === D ? O = a[11] : (O = p((e, n) => {
|
|
556
555
|
t.debug("[Vega signal]", e, n);
|
|
557
|
-
let r = ee.mapValues(n,
|
|
558
|
-
r = ee.mapValues(r,
|
|
559
|
-
}, 100), a[10] =
|
|
560
|
-
let
|
|
561
|
-
if (a[12] !==
|
|
556
|
+
let r = ee.mapValues(n, ve);
|
|
557
|
+
r = ee.mapValues(r, _e), D({ [e]: r });
|
|
558
|
+
}, 100), a[10] = D, a[11] = O);
|
|
559
|
+
let k = O, A = oe(w), j;
|
|
560
|
+
if (a[12] !== k || a[13] !== A) {
|
|
562
561
|
let e;
|
|
563
|
-
a[15] ===
|
|
562
|
+
a[15] === k ? e = a[16] : (e = (e, t) => (x.PAN_ZOOM === t || x.isBinColoring(t) || e.push({
|
|
564
563
|
signalName: t,
|
|
565
|
-
handler: (e, t) =>
|
|
566
|
-
}), e), a[15] =
|
|
567
|
-
} else
|
|
568
|
-
let
|
|
569
|
-
a[17] ===
|
|
570
|
-
t.error(e), t.debug(
|
|
571
|
-
}, a[17] =
|
|
572
|
-
let
|
|
573
|
-
a[19] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
574
|
-
t.debug("[Vega view] created", e), ae.current = e,
|
|
575
|
-
}, a[19] =
|
|
576
|
-
let
|
|
577
|
-
a[20] ===
|
|
564
|
+
handler: (e, t) => k(e, t)
|
|
565
|
+
}), e), a[15] = k, a[16] = e), j = A.reduce(e, []), a[12] = k, a[13] = A, a[14] = j;
|
|
566
|
+
} else j = a[14];
|
|
567
|
+
let M = j, N;
|
|
568
|
+
a[17] === S ? N = a[18] : (N = (e) => {
|
|
569
|
+
t.error(e), t.debug(S), ce(e);
|
|
570
|
+
}, a[17] = S, a[18] = N);
|
|
571
|
+
let P = te(N), F;
|
|
572
|
+
a[19] === Symbol.for("react.memo_cache_sentinel") ? (F = (e) => {
|
|
573
|
+
t.debug("[Vega view] created", e), ae.current = e, ce(void 0);
|
|
574
|
+
}, a[19] = F) : F = a[19];
|
|
575
|
+
let I = te(F), L;
|
|
576
|
+
a[20] === w ? L = a[21] : (L = () => {
|
|
578
577
|
let e = [];
|
|
579
|
-
if (
|
|
578
|
+
if (x.hasPoint(w) && e.push(["Point selection", "click to select a point; hold shift for multi-select"]), x.hasInterval(w) && e.push(["Interval selection", "click and drag to select an interval"]), x.hasLegend(w) && e.push(["Legend selection", "click to select a legend item; hold shift for multi-select"]), x.hasPanZoom(w)) {
|
|
580
579
|
let t = i() ? "⌘" : "ctrl";
|
|
581
580
|
e.push(["Pan", `hold the ${t} key and drag`], ["Zoom", `hold the ${t} key and scroll`]);
|
|
582
581
|
}
|
|
583
|
-
return e.length === 0 ? null : /* @__PURE__ */ (0,
|
|
582
|
+
return e.length === 0 ? null : /* @__PURE__ */ (0, W.jsx)(s, {
|
|
584
583
|
delayDuration: 300,
|
|
585
584
|
side: "left",
|
|
586
|
-
content: /* @__PURE__ */ (0,
|
|
585
|
+
content: /* @__PURE__ */ (0, W.jsx)("div", {
|
|
587
586
|
className: "text-xs flex flex-col",
|
|
588
|
-
children: e.map(
|
|
587
|
+
children: e.map(ye)
|
|
589
588
|
}),
|
|
590
|
-
children: /* @__PURE__ */ (0,
|
|
589
|
+
children: /* @__PURE__ */ (0, W.jsx)(c, { className: "absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground" })
|
|
591
590
|
});
|
|
592
|
-
}, a[20] =
|
|
593
|
-
let
|
|
594
|
-
a[22] !==
|
|
595
|
-
theme:
|
|
596
|
-
actions:
|
|
591
|
+
}, a[20] = w, a[21] = L);
|
|
592
|
+
let R = L, z = h === "dark" ? "dark" : void 0, B;
|
|
593
|
+
a[22] !== v || a[23] !== z ? (B = {
|
|
594
|
+
theme: z,
|
|
595
|
+
actions: v,
|
|
597
596
|
mode: "vega-lite",
|
|
598
|
-
tooltip:
|
|
597
|
+
tooltip: ue.call,
|
|
599
598
|
renderer: "canvas"
|
|
600
|
-
}, a[22] =
|
|
601
|
-
let
|
|
602
|
-
a[25] !==
|
|
599
|
+
}, a[22] = v, a[23] = z, a[24] = B) : B = a[24];
|
|
600
|
+
let V;
|
|
601
|
+
a[25] !== P || a[26] !== I || a[27] !== S || a[28] !== B ? (V = {
|
|
603
602
|
ref: g,
|
|
604
|
-
spec:
|
|
605
|
-
options:
|
|
606
|
-
onError:
|
|
607
|
-
onEmbed:
|
|
608
|
-
}, a[25] =
|
|
609
|
-
let
|
|
610
|
-
a[30] ===
|
|
611
|
-
let
|
|
612
|
-
|
|
613
|
-
let
|
|
614
|
-
a[32] !==
|
|
603
|
+
spec: S,
|
|
604
|
+
options: B,
|
|
605
|
+
onError: P,
|
|
606
|
+
onEmbed: I
|
|
607
|
+
}, a[25] = P, a[26] = I, a[27] = S, a[28] = B, a[29] = V) : V = a[29];
|
|
608
|
+
let H = le(V), U;
|
|
609
|
+
a[30] === S ? U = a[31] : (U = se(S), a[30] = S, a[31] = U);
|
|
610
|
+
let G = U;
|
|
611
|
+
fe(g, G === "container");
|
|
612
|
+
let K, q;
|
|
613
|
+
a[32] !== H || a[33] !== M ? (K = () => (M.forEach((e) => {
|
|
615
614
|
let { signalName: n, handler: r } = e;
|
|
616
615
|
try {
|
|
617
|
-
|
|
616
|
+
H?.view.addSignalListener(n, r);
|
|
618
617
|
} catch (e) {
|
|
619
618
|
let n = e;
|
|
620
619
|
t.error(n);
|
|
621
620
|
}
|
|
622
621
|
}), () => {
|
|
623
|
-
|
|
622
|
+
M.forEach((e) => {
|
|
624
623
|
let { signalName: n, handler: r } = e;
|
|
625
624
|
try {
|
|
626
|
-
|
|
625
|
+
H?.view.removeSignalListener(n, r);
|
|
627
626
|
} catch (e) {
|
|
628
627
|
let n = e;
|
|
629
628
|
t.error(n);
|
|
630
629
|
}
|
|
631
630
|
});
|
|
632
|
-
}),
|
|
633
|
-
let
|
|
634
|
-
a[36] === _ ?
|
|
631
|
+
}), q = [H, M], a[32] = H, a[33] = M, a[34] = K, a[35] = q) : (K = a[34], q = a[35]), (0, pe.useEffect)(K, q);
|
|
632
|
+
let J;
|
|
633
|
+
a[36] === _ ? J = a[37] : (J = _ && /* @__PURE__ */ (0, W.jsxs)(ie, {
|
|
635
634
|
variant: "destructive",
|
|
636
|
-
children: [/* @__PURE__ */ (0,
|
|
635
|
+
children: [/* @__PURE__ */ (0, W.jsx)(re, { children: _.message }), /* @__PURE__ */ (0, W.jsx)("div", {
|
|
637
636
|
className: "text-md",
|
|
638
637
|
children: _.stack
|
|
639
638
|
})]
|
|
640
|
-
}), a[36] = _, a[37] =
|
|
641
|
-
let
|
|
642
|
-
a[38] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
643
|
-
let
|
|
644
|
-
a[40] ===
|
|
639
|
+
}), a[36] = _, a[37] = J);
|
|
640
|
+
let Y, be;
|
|
641
|
+
a[38] === Symbol.for("react.memo_cache_sentinel") ? (Y = n("relative"), be = r.stopPropagation(), a[38] = Y, a[39] = be) : (Y = a[38], be = a[39]);
|
|
642
|
+
let X;
|
|
643
|
+
a[40] === G ? X = a[41] : (X = /* @__PURE__ */ (0, W.jsx)("div", {
|
|
645
644
|
ref: g,
|
|
646
|
-
"data-container-width":
|
|
647
|
-
}), a[40] =
|
|
645
|
+
"data-container-width": G
|
|
646
|
+
}), a[40] = G, a[41] = X);
|
|
647
|
+
let Z;
|
|
648
|
+
a[42] === R ? Z = a[43] : (Z = R(), a[42] = R, a[43] = Z);
|
|
648
649
|
let Q;
|
|
649
|
-
a[
|
|
650
|
+
a[44] !== X || a[45] !== Z ? (Q = /* @__PURE__ */ (0, W.jsxs)("div", {
|
|
651
|
+
className: Y,
|
|
652
|
+
onPointerDown: be,
|
|
653
|
+
children: [X, Z]
|
|
654
|
+
}), a[44] = X, a[45] = Z, a[46] = Q) : Q = a[46];
|
|
650
655
|
let $;
|
|
651
|
-
a[
|
|
652
|
-
className: X,
|
|
653
|
-
onPointerDown: ye,
|
|
654
|
-
children: [Z, Q]
|
|
655
|
-
}), a[44] = Z, a[45] = Q, a[46] = $) : $ = a[46];
|
|
656
|
-
let be;
|
|
657
|
-
return a[47] !== Y || a[48] !== $ ? (be = /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [Y, $] }), a[47] = Y, a[48] = $, a[49] = be) : be = a[49], be;
|
|
656
|
+
return a[47] !== J || a[48] !== Q ? ($ = /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [J, Q] }), a[47] = J, a[48] = Q, a[49] = $) : $ = a[49], $;
|
|
658
657
|
};
|
|
659
|
-
function
|
|
658
|
+
function _e(e) {
|
|
660
659
|
return e instanceof Set ? [...e] : e;
|
|
661
660
|
}
|
|
662
|
-
function
|
|
661
|
+
function ve(e) {
|
|
663
662
|
return Array.isArray(e) ? e.map((e) => e instanceof Date && ne(e) ? new Date(e).getTime() : e) : e;
|
|
664
663
|
}
|
|
665
|
-
function
|
|
666
|
-
return /* @__PURE__ */ (0,
|
|
667
|
-
/* @__PURE__ */ (0,
|
|
664
|
+
function ye(e, t) {
|
|
665
|
+
return /* @__PURE__ */ (0, W.jsxs)("div", { children: [
|
|
666
|
+
/* @__PURE__ */ (0, W.jsxs)("span", {
|
|
668
667
|
className: "font-bold tracking-wide",
|
|
669
668
|
children: [e[0], ":"]
|
|
670
669
|
}),
|
|
@@ -673,4 +672,4 @@ function ve(e, t) {
|
|
|
673
672
|
] }, t);
|
|
674
673
|
}
|
|
675
674
|
//#endregion
|
|
676
|
-
export {
|
|
675
|
+
export { G as default };
|