@marimo-team/islands 0.25.2-dev56 → 0.25.2-dev61
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-DOJyF3tw.js → ConnectedDataExplorerComponent-BZmqc_F0.js} +2 -2
- package/dist/{ErrorBoundary-CVCDTnQn.js → ErrorBoundary-BL7bFtwp.js} +1 -1
- package/dist/{code-visibility-ChSJl-tu.js → code-visibility-_ihZ-SEb.js} +1 -1
- package/dist/{common-BBMXVTgG.js → common-ukM0sIeR.js} +5636 -5448
- package/dist/{data-grid-overlay-editor-DtZ07a7D.js → data-grid-overlay-editor-C1y0BPWs.js} +1 -1
- package/dist/{feedback-button-Dau56tFg.js → feedback-button-B-3hznXb.js} +2 -2
- package/dist/{glide-data-editor-BIEsSrta.js → glide-data-editor-CWMyztM6.js} +3 -3
- package/dist/{globals-Dp8BcGgy.js → globals-Iua0hQv2.js} +1 -1
- package/dist/main.js +2541 -2495
- package/dist/{number-overlay-editor-CHlrf9f-.js → number-overlay-editor--czk7lAt.js} +1 -1
- package/dist/{reveal-component-VEyGCQcx.js → reveal-component-DYQDbLdD.js} +2 -2
- package/dist/{spec-V5IXIHz1.js → spec-DVsoMvYT.js} +102 -123
- package/dist/style.css +1 -1
- package/dist/{useDateFormatter-DnT8h5fL.js → useDateFormatter-C-tz65rD.js} +48 -27
- package/package.json +1 -1
- package/src/components/data-table/TableTopBar.tsx +4 -0
- package/src/components/data-table/__tests__/export-actions.test.tsx +1111 -14
- package/src/components/data-table/__tests__/schemas.test.ts +57 -0
- package/src/components/data-table/data-table.tsx +3 -0
- package/src/components/data-table/export-actions.tsx +365 -81
- package/src/components/data-table/schemas.ts +90 -14
- package/src/plugins/impl/DataTablePlugin.tsx +23 -2
- package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +65 -8
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +15 -3
- package/src/stories/dataframe.stories.tsx +7 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
|
|
2
2
|
import { t } from "./react-ofJbxM4x.js";
|
|
3
|
-
import { a as n } from "./glide-data-editor-
|
|
3
|
+
import { a as n } from "./glide-data-editor-CWMyztM6.js";
|
|
4
4
|
//#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.8_b9e6aec46d952f631ce71b0585d2a8e5/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/private/number-overlay-editor-style.js
|
|
5
5
|
var r = /* @__PURE__ */ e(t()), i = /*#__PURE__*/ n("div")({
|
|
6
6
|
name: "NumberOverlayEditorStyle",
|
|
@@ -4,14 +4,14 @@ import { t as o } from "./react-ofJbxM4x.js";
|
|
|
4
4
|
import { t as s } from "./compiler-runtime-Cj8ZWiNS.js";
|
|
5
5
|
import { h as c, t as l } from "./tooltip-CuNWg2ay.js";
|
|
6
6
|
import { w as u } from "./cells-DzqPprAQ.js";
|
|
7
|
-
import { $ as d, Q as f, Z as p, an as m, i as h, l as g, ln as _, n as v, on as y, r as b, t as x, u as S } from "./common-
|
|
7
|
+
import { $ as d, Q as f, Z as p, an as m, i as h, l as g, ln as _, n as v, on as y, r as b, t as x, u as S } from "./common-ukM0sIeR.js";
|
|
8
8
|
import { M as C } from "./select-Bs-nmvm6.js";
|
|
9
9
|
import { q as ee } from "./dropdown-menu-Cz4TdOJh.js";
|
|
10
10
|
import { y as w } from "./toDate-vEi5kTfY.js";
|
|
11
11
|
import { t as T } from "./jsx-runtime-DgDPJV9S.js";
|
|
12
12
|
import { q as te } from "./use-restore-focus-kmgwrL8q.js";
|
|
13
13
|
import { A as E, C as D, b as O } from "./useTheme-BwSgeAFb.js";
|
|
14
|
-
import { a as k, n as ne, t as re } from "./code-visibility-
|
|
14
|
+
import { a as k, n as ne, t as re } from "./code-visibility-_ihZ-SEb.js";
|
|
15
15
|
/* empty css */
|
|
16
16
|
var A = c("sticky-note", [["path", {
|
|
17
17
|
d: "M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { h as e } from "./tooltip-CuNWg2ay.js";
|
|
2
2
|
import { s as t } from "./useLifecycle-B68iY077.js";
|
|
3
|
-
import {
|
|
4
|
-
import { C as
|
|
5
|
-
var
|
|
3
|
+
import { i as n, o as r } from "./useDateFormatter-C-tz65rD.js";
|
|
4
|
+
import { C as i } from "./select-Bs-nmvm6.js";
|
|
5
|
+
var a = e("align-center-vertical", [
|
|
6
6
|
["path", {
|
|
7
7
|
d: "M12 2v20",
|
|
8
8
|
key: "t6zp3m"
|
|
@@ -23,7 +23,7 @@ var i = e("align-center-vertical", [
|
|
|
23
23
|
d: "M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1",
|
|
24
24
|
key: "1euafb"
|
|
25
25
|
}]
|
|
26
|
-
]),
|
|
26
|
+
]), o = e("arrow-down-to-line", [
|
|
27
27
|
["path", {
|
|
28
28
|
d: "M12 17V3",
|
|
29
29
|
key: "1cwfxf"
|
|
@@ -36,7 +36,7 @@ var i = e("align-center-vertical", [
|
|
|
36
36
|
d: "M19 21H5",
|
|
37
37
|
key: "150jfl"
|
|
38
38
|
}]
|
|
39
|
-
]),
|
|
39
|
+
]), s = e("arrow-up-to-line", [
|
|
40
40
|
["path", {
|
|
41
41
|
d: "M5 3h14",
|
|
42
42
|
key: "7usisc"
|
|
@@ -49,7 +49,7 @@ var i = e("align-center-vertical", [
|
|
|
49
49
|
d: "M12 7v14",
|
|
50
50
|
key: "1akyts"
|
|
51
51
|
}]
|
|
52
|
-
]),
|
|
52
|
+
]), c = e("baseline", [
|
|
53
53
|
["path", {
|
|
54
54
|
d: "M4 20h16",
|
|
55
55
|
key: "14thso"
|
|
@@ -62,13 +62,13 @@ var i = e("align-center-vertical", [
|
|
|
62
62
|
d: "M8 12h8",
|
|
63
63
|
key: "1wcyev"
|
|
64
64
|
}]
|
|
65
|
-
]),
|
|
65
|
+
]), l = e("chart-area", [["path", {
|
|
66
66
|
d: "M3 3v16a2 2 0 0 0 2 2h16",
|
|
67
67
|
key: "c24i48"
|
|
68
68
|
}], ["path", {
|
|
69
69
|
d: "M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z",
|
|
70
70
|
key: "q0gr47"
|
|
71
|
-
}]]),
|
|
71
|
+
}]]), u = e("chart-column", [
|
|
72
72
|
["path", {
|
|
73
73
|
d: "M3 3v16a2 2 0 0 0 2 2h16",
|
|
74
74
|
key: "c24i48"
|
|
@@ -85,13 +85,13 @@ var i = e("align-center-vertical", [
|
|
|
85
85
|
d: "M8 17v-3",
|
|
86
86
|
key: "17ska0"
|
|
87
87
|
}]
|
|
88
|
-
]),
|
|
88
|
+
]), d = e("chart-line", [["path", {
|
|
89
89
|
d: "M3 3v16a2 2 0 0 0 2 2h16",
|
|
90
90
|
key: "c24i48"
|
|
91
91
|
}], ["path", {
|
|
92
92
|
d: "m19 9-5 5-4-4-3 3",
|
|
93
93
|
key: "2osh9i"
|
|
94
|
-
}]]),
|
|
94
|
+
}]]), f = e("chart-no-axes-column-increasing", [
|
|
95
95
|
["path", {
|
|
96
96
|
d: "M5 21v-6",
|
|
97
97
|
key: "1hz6c0"
|
|
@@ -104,7 +104,7 @@ var i = e("align-center-vertical", [
|
|
|
104
104
|
d: "M19 21V3",
|
|
105
105
|
key: "11j9sm"
|
|
106
106
|
}]
|
|
107
|
-
]),
|
|
107
|
+
]), p = e("chart-no-axes-column", [
|
|
108
108
|
["path", {
|
|
109
109
|
d: "M5 21v-6",
|
|
110
110
|
key: "1hz6c0"
|
|
@@ -117,7 +117,7 @@ var i = e("align-center-vertical", [
|
|
|
117
117
|
d: "M19 21V9",
|
|
118
118
|
key: "unv183"
|
|
119
119
|
}]
|
|
120
|
-
]),
|
|
120
|
+
]), m = e("chart-scatter", [
|
|
121
121
|
["circle", {
|
|
122
122
|
cx: "7.5",
|
|
123
123
|
cy: "7.5",
|
|
@@ -157,7 +157,7 @@ var i = e("align-center-vertical", [
|
|
|
157
157
|
d: "M3 3v16a2 2 0 0 0 2 2h16",
|
|
158
158
|
key: "c24i48"
|
|
159
159
|
}]
|
|
160
|
-
]),
|
|
160
|
+
]), h = e("ruler-dimension-line", [
|
|
161
161
|
["path", {
|
|
162
162
|
d: "M10 15v-3",
|
|
163
163
|
key: "1pjskw"
|
|
@@ -194,10 +194,10 @@ var i = e("align-center-vertical", [
|
|
|
194
194
|
rx: "2",
|
|
195
195
|
key: "1tqiko"
|
|
196
196
|
}]
|
|
197
|
-
]),
|
|
197
|
+
]), g = e("sigma", [["path", {
|
|
198
198
|
d: "M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",
|
|
199
199
|
key: "wuwx1p"
|
|
200
|
-
}]]),
|
|
200
|
+
}]]), _ = e("square-function", [
|
|
201
201
|
["rect", {
|
|
202
202
|
width: "18",
|
|
203
203
|
height: "18",
|
|
@@ -215,27 +215,6 @@ var i = e("align-center-vertical", [
|
|
|
215
215
|
d: "M9 11.2h5.7",
|
|
216
216
|
key: "3zgcl2"
|
|
217
217
|
}]
|
|
218
|
-
]), _ = e("table", [
|
|
219
|
-
["path", {
|
|
220
|
-
d: "M12 3v18",
|
|
221
|
-
key: "108xh3"
|
|
222
|
-
}],
|
|
223
|
-
["rect", {
|
|
224
|
-
width: "18",
|
|
225
|
-
height: "18",
|
|
226
|
-
x: "3",
|
|
227
|
-
y: "3",
|
|
228
|
-
rx: "2",
|
|
229
|
-
key: "afitv7"
|
|
230
|
-
}],
|
|
231
|
-
["path", {
|
|
232
|
-
d: "M3 9h18",
|
|
233
|
-
key: "1pudct"
|
|
234
|
-
}],
|
|
235
|
-
["path", {
|
|
236
|
-
d: "M3 15h18",
|
|
237
|
-
key: "5xshup"
|
|
238
|
-
}]
|
|
239
218
|
]);
|
|
240
219
|
//#endregion
|
|
241
220
|
//#region src/components/data-table/charts/chart-spec/utils.ts
|
|
@@ -244,29 +223,29 @@ function v(e) {
|
|
|
244
223
|
}
|
|
245
224
|
//#endregion
|
|
246
225
|
//#region src/components/data-table/charts/constants.ts
|
|
247
|
-
var y = "__count__", b = "default",
|
|
248
|
-
line:
|
|
249
|
-
bar:
|
|
250
|
-
pie:
|
|
251
|
-
scatter:
|
|
252
|
-
heatmap:
|
|
253
|
-
area:
|
|
254
|
-
}, S = "mean",
|
|
255
|
-
none:
|
|
226
|
+
var y = "__count__", b = "default", x = "yearmonthdate", ee = {
|
|
227
|
+
line: d,
|
|
228
|
+
bar: f,
|
|
229
|
+
pie: r,
|
|
230
|
+
scatter: m,
|
|
231
|
+
heatmap: n,
|
|
232
|
+
area: l
|
|
233
|
+
}, S = "mean", C = {
|
|
234
|
+
none: _,
|
|
256
235
|
count: t,
|
|
257
|
-
sum:
|
|
258
|
-
mean:
|
|
259
|
-
median:
|
|
260
|
-
min:
|
|
261
|
-
max:
|
|
236
|
+
sum: g,
|
|
237
|
+
mean: c,
|
|
238
|
+
median: a,
|
|
239
|
+
min: o,
|
|
240
|
+
max: s,
|
|
262
241
|
distinct: t,
|
|
263
242
|
valid: t,
|
|
264
|
-
stdev:
|
|
265
|
-
stdevp:
|
|
266
|
-
variance:
|
|
267
|
-
variancep:
|
|
268
|
-
bin:
|
|
269
|
-
},
|
|
243
|
+
stdev: p,
|
|
244
|
+
stdevp: p,
|
|
245
|
+
variance: u,
|
|
246
|
+
variancep: u,
|
|
247
|
+
bin: h
|
|
248
|
+
}, te = {
|
|
270
249
|
none: "No aggregation",
|
|
271
250
|
count: "Count of records",
|
|
272
251
|
sum: "Sum of values",
|
|
@@ -281,7 +260,7 @@ var y = "__count__", b = "default", ee = "yearmonthdate", x = {
|
|
|
281
260
|
variance: "Variance",
|
|
282
261
|
variancep: "Variance of population",
|
|
283
262
|
bin: "Group values into bins"
|
|
284
|
-
},
|
|
263
|
+
}, ne = [
|
|
285
264
|
b,
|
|
286
265
|
"accent",
|
|
287
266
|
"category10",
|
|
@@ -327,11 +306,11 @@ var y = "__count__", b = "default", ee = "yearmonthdate", x = {
|
|
|
327
306
|
"spectral",
|
|
328
307
|
"rainbow",
|
|
329
308
|
"sinebow"
|
|
330
|
-
],
|
|
309
|
+
], re = {
|
|
331
310
|
number: "Continuous numerical scale",
|
|
332
311
|
string: "Discrete categorical scale (inputs treated as strings)",
|
|
333
312
|
temporal: "Continuous temporal scale"
|
|
334
|
-
},
|
|
313
|
+
}, ie = {
|
|
335
314
|
year: ["Year", "2025"],
|
|
336
315
|
quarter: ["Quarter of year", "Q1"],
|
|
337
316
|
month: ["Month of year", "Jan"],
|
|
@@ -347,11 +326,11 @@ var y = "__count__", b = "default", ee = "yearmonthdate", x = {
|
|
|
347
326
|
yearmonthdate: ["Year Month Date", "Jan 01, 2025"],
|
|
348
327
|
yearmonthdatehours: ["Year Month Date Hours", "Jan 01, 2025 12:00"],
|
|
349
328
|
monthdate: ["Month Date", "Jan 01"]
|
|
350
|
-
},
|
|
329
|
+
}, w = [
|
|
351
330
|
"number",
|
|
352
331
|
"string",
|
|
353
332
|
"temporal"
|
|
354
|
-
],
|
|
333
|
+
], T = [
|
|
355
334
|
"year",
|
|
356
335
|
"quarter",
|
|
357
336
|
"month",
|
|
@@ -363,15 +342,15 @@ var y = "__count__", b = "default", ee = "yearmonthdate", x = {
|
|
|
363
342
|
"minutes",
|
|
364
343
|
"seconds",
|
|
365
344
|
"milliseconds"
|
|
366
|
-
],
|
|
345
|
+
], E = [
|
|
367
346
|
"yearmonth",
|
|
368
347
|
"yearmonthdate",
|
|
369
348
|
"yearmonthdatehours",
|
|
370
349
|
"monthdate"
|
|
371
|
-
],
|
|
372
|
-
[...
|
|
373
|
-
var
|
|
374
|
-
|
|
350
|
+
], D = [...T, ...E];
|
|
351
|
+
[...D];
|
|
352
|
+
var O = ["ascending", "descending"], k = "none", A = [
|
|
353
|
+
k,
|
|
375
354
|
"bin",
|
|
376
355
|
"count",
|
|
377
356
|
"sum",
|
|
@@ -385,27 +364,27 @@ var k = ["ascending", "descending"], A = "none", j = [
|
|
|
385
364
|
"stdevp",
|
|
386
365
|
"variance",
|
|
387
366
|
"variancep"
|
|
388
|
-
],
|
|
389
|
-
|
|
367
|
+
], j = [
|
|
368
|
+
k,
|
|
390
369
|
"count",
|
|
391
370
|
"distinct",
|
|
392
371
|
"valid"
|
|
393
|
-
],
|
|
372
|
+
], M = {
|
|
394
373
|
LINE: "line",
|
|
395
374
|
BAR: "bar",
|
|
396
375
|
PIE: "pie",
|
|
397
376
|
SCATTER: "scatter",
|
|
398
377
|
HEATMAP: "heatmap",
|
|
399
378
|
AREA: "area"
|
|
400
|
-
},
|
|
379
|
+
}, N = Object.values(M), ae = [
|
|
401
380
|
"X",
|
|
402
381
|
"Y",
|
|
403
382
|
"Color",
|
|
404
|
-
|
|
383
|
+
k
|
|
405
384
|
];
|
|
406
385
|
//#endregion
|
|
407
386
|
//#region src/components/data-table/charts/chart-spec/types.ts
|
|
408
|
-
function
|
|
387
|
+
function P(e) {
|
|
409
388
|
switch (e) {
|
|
410
389
|
case "number":
|
|
411
390
|
case "integer": return "quantitative";
|
|
@@ -417,10 +396,10 @@ function F(e) {
|
|
|
417
396
|
case "datetime":
|
|
418
397
|
case "time":
|
|
419
398
|
case "temporal": return "temporal";
|
|
420
|
-
default: return
|
|
399
|
+
default: return i(e), "nominal";
|
|
421
400
|
}
|
|
422
401
|
}
|
|
423
|
-
function
|
|
402
|
+
function F(e) {
|
|
424
403
|
switch (e) {
|
|
425
404
|
case "number":
|
|
426
405
|
case "integer": return "number";
|
|
@@ -431,34 +410,34 @@ function I(e) {
|
|
|
431
410
|
case "date":
|
|
432
411
|
case "datetime":
|
|
433
412
|
case "time": return "temporal";
|
|
434
|
-
default: return
|
|
413
|
+
default: return i(e), "string";
|
|
435
414
|
}
|
|
436
415
|
}
|
|
437
|
-
function
|
|
416
|
+
function I(e) {
|
|
438
417
|
switch (e) {
|
|
439
|
-
case
|
|
440
|
-
case
|
|
441
|
-
case
|
|
418
|
+
case M.PIE: return "arc";
|
|
419
|
+
case M.SCATTER: return "point";
|
|
420
|
+
case M.HEATMAP: return "rect";
|
|
442
421
|
default: return e;
|
|
443
422
|
}
|
|
444
423
|
}
|
|
445
424
|
//#endregion
|
|
446
425
|
//#region src/components/data-table/charts/chart-spec/encodings.ts
|
|
447
|
-
function
|
|
448
|
-
if (e ===
|
|
426
|
+
function L(e, t, n, r) {
|
|
427
|
+
if (e === M.HEATMAP) return n?.maxbins ? { maxbins: n?.maxbins } : void 0;
|
|
449
428
|
if (t !== "number") return;
|
|
450
429
|
if (!n?.binned) return r;
|
|
451
430
|
let i = {};
|
|
452
431
|
return n.step !== void 0 && (i.step = n.step), n.maxbins !== void 0 && (i.maxbins = n.maxbins), Object.keys(i).length === 0 || i;
|
|
453
432
|
}
|
|
454
|
-
function
|
|
433
|
+
function R(e) {
|
|
455
434
|
let t = e.color?.range;
|
|
456
435
|
if (t?.length) return { range: t };
|
|
457
436
|
let n = e.color?.scheme;
|
|
458
437
|
if (n && n !== "default") return { scheme: n };
|
|
459
438
|
}
|
|
460
|
-
function
|
|
461
|
-
if (e ===
|
|
439
|
+
function z(e, t) {
|
|
440
|
+
if (e === M.PIE) return;
|
|
462
441
|
let n;
|
|
463
442
|
if (Q(t.general?.colorByColumn?.field)) n = t.general?.colorByColumn;
|
|
464
443
|
else if (Q(t.color?.field)) switch (t.color?.field) {
|
|
@@ -482,28 +461,28 @@ function B(e, t) {
|
|
|
482
461
|
let r = t.color?.bin, i = n.selectedDataType || "string", a = n?.aggregate;
|
|
483
462
|
return {
|
|
484
463
|
field: v(n.field),
|
|
485
|
-
type:
|
|
486
|
-
scale:
|
|
487
|
-
aggregate:
|
|
488
|
-
bin:
|
|
464
|
+
type: P(i),
|
|
465
|
+
scale: R(t),
|
|
466
|
+
aggregate: V(a, i),
|
|
467
|
+
bin: L(e, i, r)
|
|
489
468
|
};
|
|
490
469
|
}
|
|
491
|
-
function
|
|
492
|
-
if (!(t.general?.stacking || !Q(t.general?.colorByColumn?.field) || e !==
|
|
470
|
+
function B(e, t) {
|
|
471
|
+
if (!(t.general?.stacking || !Q(t.general?.colorByColumn?.field) || e !== M.BAR)) return { field: v(t.general?.colorByColumn?.field) };
|
|
493
472
|
}
|
|
494
|
-
function
|
|
495
|
-
if (t !== "temporal" && e !== "none" && e !== "bin") return e ? t === "string" ?
|
|
473
|
+
function V(e, t, n) {
|
|
474
|
+
if (t !== "temporal" && e !== "none" && e !== "bin") return e ? t === "string" ? j.includes(e) ? e : void 0 : e : n || void 0;
|
|
496
475
|
}
|
|
497
476
|
//#endregion
|
|
498
477
|
//#region src/components/data-table/charts/chart-spec/tooltips.ts
|
|
499
|
-
function
|
|
478
|
+
function H(e) {
|
|
500
479
|
switch (e) {
|
|
501
480
|
case "integer": return ",.0f";
|
|
502
481
|
case "number": return ",.2f";
|
|
503
482
|
default: return;
|
|
504
483
|
}
|
|
505
484
|
}
|
|
506
|
-
function
|
|
485
|
+
function U(e) {
|
|
507
486
|
let { formValues: t, xEncoding: n, yEncoding: r, colorByEncoding: i } = e;
|
|
508
487
|
if (!t.tooltips) return;
|
|
509
488
|
function a(e, t, n) {
|
|
@@ -512,7 +491,7 @@ function W(e) {
|
|
|
512
491
|
field: e.field,
|
|
513
492
|
aggregate: e.aggregate,
|
|
514
493
|
timeUnit: e.timeUnit,
|
|
515
|
-
format:
|
|
494
|
+
format: H(t),
|
|
516
495
|
title: n,
|
|
517
496
|
bin: e.bin
|
|
518
497
|
};
|
|
@@ -549,20 +528,20 @@ function W(e) {
|
|
|
549
528
|
}
|
|
550
529
|
//#endregion
|
|
551
530
|
//#region src/components/data-table/charts/chart-spec/spec.ts
|
|
552
|
-
var
|
|
553
|
-
function
|
|
531
|
+
var W = "X-axis column is required", G = "Y-axis column is required";
|
|
532
|
+
function K(e, t, n, r, i) {
|
|
554
533
|
let { xColumn: a, yColumn: o, colorByColumn: s, horizontal: c, stacking: l, title: u, facet: d } = t.general ?? {};
|
|
555
|
-
if (e ===
|
|
556
|
-
if (!Q(a?.field)) return
|
|
557
|
-
if (!Q(o?.field)) return
|
|
558
|
-
let f =
|
|
534
|
+
if (e === M.PIE) return X(t, n, r, i);
|
|
535
|
+
if (!Q(a?.field)) return W;
|
|
536
|
+
if (!Q(o?.field)) return G;
|
|
537
|
+
let f = J(a, t.xAxis?.bin, $(t.xAxis?.label), s?.field && c ? l : void 0, e), p = S;
|
|
559
538
|
o?.selectedDataType === "string" && (p = "count");
|
|
560
|
-
let m =
|
|
539
|
+
let m = J(o, t.yAxis?.bin, $(t.yAxis?.label), s?.field && !c ? l : void 0, e, p), h = d?.row.field ? Y(d.row, e) : void 0, g = d?.column.field ? Y(d.column, e) : void 0, _ = z(e, t), v = Z(e, t, n, r, i, u), y = {
|
|
561
540
|
x: c ? m : f,
|
|
562
541
|
y: c ? f : m,
|
|
563
|
-
xOffset:
|
|
542
|
+
xOffset: B(e, t),
|
|
564
543
|
color: _,
|
|
565
|
-
tooltip:
|
|
544
|
+
tooltip: U({
|
|
566
545
|
formValues: t,
|
|
567
546
|
xEncoding: f,
|
|
568
547
|
yEncoding: m,
|
|
@@ -573,38 +552,38 @@ function q(e, t, n, r, i) {
|
|
|
573
552
|
}, b = ce(d?.column, d?.row);
|
|
574
553
|
return {
|
|
575
554
|
...v,
|
|
576
|
-
mark: { type:
|
|
555
|
+
mark: { type: I(e) },
|
|
577
556
|
encoding: y,
|
|
578
557
|
...b
|
|
579
558
|
};
|
|
580
559
|
}
|
|
581
|
-
function
|
|
560
|
+
function q(e, t) {
|
|
582
561
|
return {
|
|
583
562
|
...e,
|
|
584
563
|
data: { values: t }
|
|
585
564
|
};
|
|
586
565
|
}
|
|
587
|
-
function
|
|
566
|
+
function J(e, t, n, r, i, a) {
|
|
588
567
|
let o = e.selectedDataType || "string";
|
|
589
568
|
return e.field === "__count__" ? {
|
|
590
569
|
aggregate: "count",
|
|
591
570
|
type: "quantitative",
|
|
592
|
-
bin:
|
|
571
|
+
bin: L(i, o, t),
|
|
593
572
|
title: n === "__count__" ? void 0 : n,
|
|
594
573
|
stack: r
|
|
595
574
|
} : {
|
|
596
575
|
field: v(e.field),
|
|
597
|
-
type:
|
|
598
|
-
bin:
|
|
576
|
+
type: P(e.selectedDataType || "unknown"),
|
|
577
|
+
bin: L(i, o, t),
|
|
599
578
|
title: n,
|
|
600
579
|
stack: r,
|
|
601
|
-
aggregate:
|
|
580
|
+
aggregate: V(e.aggregate, o, a),
|
|
602
581
|
sort: e.sort,
|
|
603
582
|
timeUnit: oe(e)
|
|
604
583
|
};
|
|
605
584
|
}
|
|
606
|
-
function
|
|
607
|
-
let n =
|
|
585
|
+
function Y(e, t) {
|
|
586
|
+
let n = L(t, e.selectedDataType || "string", {
|
|
608
587
|
maxbins: e.maxbins,
|
|
609
588
|
binned: e.binned
|
|
610
589
|
}, { maxbins: 6 });
|
|
@@ -612,30 +591,30 @@ function X(e, t) {
|
|
|
612
591
|
field: v(e.field),
|
|
613
592
|
sort: e.sort,
|
|
614
593
|
timeUnit: se(e),
|
|
615
|
-
type:
|
|
594
|
+
type: P(e.selectedDataType || "unknown"),
|
|
616
595
|
bin: n
|
|
617
596
|
};
|
|
618
597
|
}
|
|
619
|
-
function
|
|
598
|
+
function X(e, t, n, r) {
|
|
620
599
|
let { yColumn: i, colorByColumn: a, title: o } = e.general ?? {};
|
|
621
600
|
if (!Q(a?.field)) return "Color by column is required";
|
|
622
601
|
if (!Q(i?.field)) return "Size by column is required";
|
|
623
|
-
let s =
|
|
602
|
+
let s = J(i, e.xAxis?.bin, $(e.xAxis?.label), void 0, M.PIE), c = {
|
|
624
603
|
field: v(a.field),
|
|
625
|
-
type:
|
|
626
|
-
scale:
|
|
604
|
+
type: P(a.selectedDataType || "unknown"),
|
|
605
|
+
scale: R(e),
|
|
627
606
|
title: $(e.yAxis?.label)
|
|
628
607
|
};
|
|
629
608
|
return {
|
|
630
|
-
...Z(
|
|
609
|
+
...Z(M.PIE, e, t, n, r, o),
|
|
631
610
|
mark: {
|
|
632
|
-
type:
|
|
611
|
+
type: I(M.PIE),
|
|
633
612
|
innerRadius: e.style?.innerRadius
|
|
634
613
|
},
|
|
635
614
|
encoding: {
|
|
636
615
|
theta: s,
|
|
637
616
|
color: c,
|
|
638
|
-
tooltip:
|
|
617
|
+
tooltip: U({
|
|
639
618
|
formValues: e,
|
|
640
619
|
xEncoding: s,
|
|
641
620
|
yEncoding: s,
|
|
@@ -646,7 +625,7 @@ function ae(e, t, n, r) {
|
|
|
646
625
|
}
|
|
647
626
|
function Z(e, t, n, r, i, a) {
|
|
648
627
|
let o = t.style?.gridLines ?? !1;
|
|
649
|
-
return e ===
|
|
628
|
+
return e === M.SCATTER && (o = !0), {
|
|
650
629
|
$schema: "https://vega.github.io/schema/vega-lite/v6.json",
|
|
651
630
|
background: n === "dark" ? "dark" : "white",
|
|
652
631
|
title: a,
|
|
@@ -674,4 +653,4 @@ function ce(e, t) {
|
|
|
674
653
|
return e?.linkXAxis === !1 && (n.x = "independent"), t?.linkYAxis === !1 && (n.y = "independent"), Object.keys(n).length > 0 ? { resolve: { axis: n } } : void 0;
|
|
675
654
|
}
|
|
676
655
|
//#endregion
|
|
677
|
-
export {
|
|
656
|
+
export { x as C, _ as D, v as E, u as O, b as S, ie as T, C as _, A as a, y as b, E as c, w as d, T as f, te as g, D as h, F as i, M as l, j as m, K as n, N as o, O as p, Q as r, ae as s, q as t, k as u, ee as v, re as w, S as x, ne as y };
|