precision-dashwidgets 0.3.3 → 0.3.5
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/precision-dashwidgets.es.js +740 -738
- package/dist/precision-dashwidgets.umd.js +31 -3888
- package/dist/style.css +1 -1
- package/package.json +4 -5
- package/dist/plotly.min-C6i-CQY9-Buq8XTFA.mjs +0 -108795
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as _e, createElementBlock as O, openBlock as
|
|
1
|
+
import { defineComponent as _e, createElementBlock as O, openBlock as B, createElementVNode as N, ref as T, computed as j, watch as Q, onMounted as Ve, onBeforeUnmount as Tt, withDirectives as Re, vModelText as un, Fragment as re, renderList as de, toDisplayString as G, vModelSelect as _t, createCommentVNode as Ee, createBlock as sn, createVNode as oe, vShow as Vn, normalizeStyle as Wn, onUnmounted as jn, resolveComponent as bt, normalizeClass as Hn, withCtx as Pe, createTextVNode as At, inject as Xn, unref as we, watchEffect as Gn, renderSlot as Nt } from "vue";
|
|
2
2
|
import { ElTooltip as Qn } from "element-plus";
|
|
3
3
|
import { defineStore as Kn } from "pinia";
|
|
4
4
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
@@ -6,7 +6,7 @@ var Jn = /* @__PURE__ */ _e({
|
|
|
6
6
|
name: "InfoFilled",
|
|
7
7
|
__name: "info-filled",
|
|
8
8
|
setup(e) {
|
|
9
|
-
return (t, n) => (
|
|
9
|
+
return (t, n) => (B(), O("svg", {
|
|
10
10
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
11
|
viewBox: "0 0 1024 1024"
|
|
12
12
|
}, [
|
|
@@ -20,24 +20,24 @@ var Jn = /* @__PURE__ */ _e({
|
|
|
20
20
|
function W(e) {
|
|
21
21
|
return e != null && typeof e == "object" && e["@@functional/placeholder"] === !0;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Ce(e) {
|
|
24
24
|
return function t(n) {
|
|
25
25
|
return arguments.length === 0 || W(n) ? t : e.apply(this, arguments);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Me(e) {
|
|
29
29
|
return function t(n, r) {
|
|
30
30
|
switch (arguments.length) {
|
|
31
31
|
case 0:
|
|
32
32
|
return t;
|
|
33
33
|
case 1:
|
|
34
|
-
return W(n) ? t :
|
|
34
|
+
return W(n) ? t : Ce(function(a) {
|
|
35
35
|
return e(n, a);
|
|
36
36
|
});
|
|
37
37
|
default:
|
|
38
|
-
return W(n) && W(r) ? t : W(n) ?
|
|
38
|
+
return W(n) && W(r) ? t : W(n) ? Ce(function(a) {
|
|
39
39
|
return e(a, r);
|
|
40
|
-
}) : W(r) ?
|
|
40
|
+
}) : W(r) ? Ce(function(a) {
|
|
41
41
|
return e(n, a);
|
|
42
42
|
}) : e(n, r);
|
|
43
43
|
}
|
|
@@ -49,29 +49,29 @@ function er(e) {
|
|
|
49
49
|
case 0:
|
|
50
50
|
return t;
|
|
51
51
|
case 1:
|
|
52
|
-
return W(n) ? t :
|
|
52
|
+
return W(n) ? t : Me(function(i, l) {
|
|
53
53
|
return e(n, i, l);
|
|
54
54
|
});
|
|
55
55
|
case 2:
|
|
56
|
-
return W(n) && W(r) ? t : W(n) ?
|
|
56
|
+
return W(n) && W(r) ? t : W(n) ? Me(function(i, l) {
|
|
57
57
|
return e(i, r, l);
|
|
58
|
-
}) : W(r) ?
|
|
58
|
+
}) : W(r) ? Me(function(i, l) {
|
|
59
59
|
return e(n, i, l);
|
|
60
|
-
}) :
|
|
60
|
+
}) : Ce(function(i) {
|
|
61
61
|
return e(n, r, i);
|
|
62
62
|
});
|
|
63
63
|
default:
|
|
64
|
-
return W(n) && W(r) && W(a) ? t : W(n) && W(r) ?
|
|
64
|
+
return W(n) && W(r) && W(a) ? t : W(n) && W(r) ? Me(function(i, l) {
|
|
65
65
|
return e(i, l, a);
|
|
66
|
-
}) : W(n) && W(a) ?
|
|
66
|
+
}) : W(n) && W(a) ? Me(function(i, l) {
|
|
67
67
|
return e(i, r, l);
|
|
68
|
-
}) : W(r) && W(a) ?
|
|
68
|
+
}) : W(r) && W(a) ? Me(function(i, l) {
|
|
69
69
|
return e(n, i, l);
|
|
70
|
-
}) : W(n) ?
|
|
70
|
+
}) : W(n) ? Ce(function(i) {
|
|
71
71
|
return e(i, r, a);
|
|
72
|
-
}) : W(r) ?
|
|
72
|
+
}) : W(r) ? Ce(function(i) {
|
|
73
73
|
return e(n, i, a);
|
|
74
|
-
}) : W(a) ?
|
|
74
|
+
}) : W(a) ? Ce(function(i) {
|
|
75
75
|
return e(n, r, i);
|
|
76
76
|
}) : e(n, r, a);
|
|
77
77
|
}
|
|
@@ -84,7 +84,7 @@ function nr(e, t) {
|
|
|
84
84
|
var n = e < 0 ? t.length + e : e;
|
|
85
85
|
return t[n];
|
|
86
86
|
}
|
|
87
|
-
var rr = /* @__PURE__ */
|
|
87
|
+
var rr = /* @__PURE__ */ Me(function(e, t) {
|
|
88
88
|
return t == null || t !== t ? e : t;
|
|
89
89
|
});
|
|
90
90
|
function ar(e, t) {
|
|
@@ -99,12 +99,12 @@ function ar(e, t) {
|
|
|
99
99
|
var or = /* @__PURE__ */ er(function(e, t, n) {
|
|
100
100
|
return rr(e, ar(t, n));
|
|
101
101
|
});
|
|
102
|
-
const
|
|
103
|
-
const e =
|
|
102
|
+
const It = Kn("duckdb", () => {
|
|
103
|
+
const e = T(null), t = T(!1), n = T(!1), r = T(""), a = T(/* @__PURE__ */ new Map()), i = T(/* @__PURE__ */ new Map()), l = T(/* @__PURE__ */ new Map());
|
|
104
104
|
let u = null;
|
|
105
|
-
const f = j(() => t.value && !r.value), c = j(() => (_) =>
|
|
106
|
-
const
|
|
107
|
-
return
|
|
105
|
+
const f = j(() => t.value && !r.value), c = j(() => (_) => a.value.get(_)), p = j(() => (_) => {
|
|
106
|
+
const M = a.value.get(_);
|
|
107
|
+
return M && !M.isLoading && !M.error;
|
|
108
108
|
}), y = j(() => i.value.size), w = j(() => i.value.size > 0), A = async () => {
|
|
109
109
|
if (typeof window > "u" || typeof Worker > "u") {
|
|
110
110
|
const _ = "DuckDB can only be initialized in the browser.";
|
|
@@ -112,7 +112,7 @@ const Lt = Kn("duckdb", () => {
|
|
|
112
112
|
}
|
|
113
113
|
return e.value ? e.value : u ? (await u, e.value) : (n.value = !0, r.value = "", u = (async () => {
|
|
114
114
|
try {
|
|
115
|
-
const _ = await import("./duckdb-browser-CI2dpY-v-CoCsU0kJ.mjs"),
|
|
115
|
+
const _ = await import("./duckdb-browser-CI2dpY-v-CoCsU0kJ.mjs"), M = {
|
|
116
116
|
mvp: {
|
|
117
117
|
mainModule: "/static/duckdb/duckdb-mvp.wasm",
|
|
118
118
|
mainWorker: "/static/duckdb/duckdb-browser-mvp.worker.js"
|
|
@@ -121,47 +121,47 @@ const Lt = Kn("duckdb", () => {
|
|
|
121
121
|
mainModule: "/static/duckdb/duckdb-eh.wasm",
|
|
122
122
|
mainWorker: "/static/duckdb/duckdb-browser-eh.worker.js"
|
|
123
123
|
}
|
|
124
|
-
}, s = await _.selectBundle(
|
|
125
|
-
return e.value = new _.AsyncDuckDB(o,
|
|
124
|
+
}, s = await _.selectBundle(M), v = new Worker(s.mainWorker), o = new _.ConsoleLogger(_.LogLevel.WARNING);
|
|
125
|
+
return e.value = new _.AsyncDuckDB(o, v), await e.value.instantiate(s.mainModule), t.value = !0, e.value;
|
|
126
126
|
} catch (_) {
|
|
127
127
|
throw r.value = `Failed to initialize DuckDB: ${(_ == null ? void 0 : _.message) || _}`, e.value = null, _;
|
|
128
128
|
} finally {
|
|
129
129
|
n.value = !1, u = null;
|
|
130
130
|
}
|
|
131
131
|
})(), await u, e.value);
|
|
132
|
-
},
|
|
132
|
+
}, C = async (_) => {
|
|
133
133
|
e.value || await A();
|
|
134
|
-
const
|
|
134
|
+
const M = await e.value.connect(), s = _ || `conn_${Date.now()}_${Math.random().toString(36).slice(2, 11)}`;
|
|
135
135
|
return i.value.set(s, {
|
|
136
|
-
connection:
|
|
136
|
+
connection: M,
|
|
137
137
|
viewerId: s,
|
|
138
138
|
createdAt: /* @__PURE__ */ new Date()
|
|
139
|
-
}), { connection:
|
|
139
|
+
}), { connection: M, connectionId: s };
|
|
140
140
|
}, S = async (_) => {
|
|
141
|
-
const
|
|
142
|
-
|
|
141
|
+
const M = i.value.get(_);
|
|
142
|
+
M && (await M.connection.close(), i.value.delete(_), $(_), i.value.size === 0 && console.log("No active connections remaining. Keeping DuckDB instance for potential reuse."));
|
|
143
143
|
}, $ = (_) => {
|
|
144
|
-
for (const [
|
|
145
|
-
s.delete(_), s.size === 0 && console.log(`File ${
|
|
146
|
-
}, k = (_,
|
|
147
|
-
l.value.has(_) || l.value.set(_, /* @__PURE__ */ new Set()), l.value.get(_).add(
|
|
148
|
-
},
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
144
|
+
for (const [M, s] of l.value)
|
|
145
|
+
s.delete(_), s.size === 0 && console.log(`File ${M} is no longer used by any viewers`);
|
|
146
|
+
}, k = (_, M) => {
|
|
147
|
+
l.value.has(_) || l.value.set(_, /* @__PURE__ */ new Set()), l.value.get(_).add(M);
|
|
148
|
+
}, F = async (_) => {
|
|
149
|
+
const M = a.value.get(_);
|
|
150
|
+
if (M && M.tableName)
|
|
151
151
|
try {
|
|
152
152
|
const s = await e.value.connect();
|
|
153
|
-
await s.query(`DROP TABLE IF EXISTS ${
|
|
153
|
+
await s.query(`DROP TABLE IF EXISTS ${M.tableName};`), await s.close();
|
|
154
154
|
} catch (s) {
|
|
155
|
-
console.warn(`Failed to drop table ${
|
|
155
|
+
console.warn(`Failed to drop table ${M.tableName}:`, s);
|
|
156
156
|
}
|
|
157
157
|
a.value.delete(_), l.value.delete(_);
|
|
158
|
-
}, D = async (_,
|
|
159
|
-
const g =
|
|
160
|
-
if (
|
|
161
|
-
return
|
|
158
|
+
}, D = async (_, M, s = "my_data", v = {}, o = null, d = null) => {
|
|
159
|
+
const g = d || _, h = a.value.get(g);
|
|
160
|
+
if (h && !h.isLoading && !h.error)
|
|
161
|
+
return o && k(g, o), h.tableName;
|
|
162
162
|
f.value || await A(), a.value.set(g, {
|
|
163
163
|
tableName: s,
|
|
164
|
-
fileType:
|
|
164
|
+
fileType: M,
|
|
165
165
|
fileUrl: _,
|
|
166
166
|
// Store the current URL for reference
|
|
167
167
|
isLoading: !0,
|
|
@@ -172,73 +172,73 @@ const Lt = Kn("duckdb", () => {
|
|
|
172
172
|
if (!m.ok)
|
|
173
173
|
throw new Error(`Failed to fetch file: ${m.status} ${m.statusText}`);
|
|
174
174
|
let x;
|
|
175
|
-
if (
|
|
176
|
-
const b = await m.text(),
|
|
177
|
-
x = new Uint8Array(
|
|
175
|
+
if (M === "csv") {
|
|
176
|
+
const b = await m.text(), I = await new Blob([b], { type: "text/csv" }).arrayBuffer();
|
|
177
|
+
x = new Uint8Array(I);
|
|
178
178
|
} else {
|
|
179
179
|
const b = await m.arrayBuffer();
|
|
180
180
|
x = new Uint8Array(b);
|
|
181
181
|
}
|
|
182
|
-
const
|
|
183
|
-
await e.value.registerFileBuffer(
|
|
184
|
-
const
|
|
182
|
+
const R = `${d || s}.${M}`;
|
|
183
|
+
await e.value.registerFileBuffer(R, x);
|
|
184
|
+
const E = await e.value.connect();
|
|
185
185
|
try {
|
|
186
186
|
let b;
|
|
187
|
-
if (
|
|
188
|
-
const
|
|
187
|
+
if (M === "csv") {
|
|
188
|
+
const L = {
|
|
189
189
|
header: !0,
|
|
190
190
|
delimiter: ",",
|
|
191
|
-
...
|
|
191
|
+
...v
|
|
192
192
|
};
|
|
193
193
|
b = `
|
|
194
194
|
CREATE OR REPLACE TABLE ${s} AS
|
|
195
|
-
SELECT * FROM read_csv('${
|
|
195
|
+
SELECT * FROM read_csv('${R}', header=${L.header}, delim='${L.delimiter}');
|
|
196
196
|
`;
|
|
197
|
-
} else if (
|
|
197
|
+
} else if (M === "parquet")
|
|
198
198
|
b = `
|
|
199
199
|
CREATE OR REPLACE TABLE ${s} AS
|
|
200
|
-
SELECT * FROM read_parquet('${
|
|
200
|
+
SELECT * FROM read_parquet('${R}');
|
|
201
201
|
`;
|
|
202
202
|
else
|
|
203
|
-
throw new Error(`Unsupported file type: ${
|
|
204
|
-
await
|
|
205
|
-
const
|
|
203
|
+
throw new Error(`Unsupported file type: ${M}`);
|
|
204
|
+
await E.query(b);
|
|
205
|
+
const I = (await E.query(`SELECT COUNT(*) as count FROM ${s};`)).toArray()[0].count;
|
|
206
206
|
return a.value.set(g, {
|
|
207
207
|
tableName: s,
|
|
208
|
-
fileType:
|
|
208
|
+
fileType: M,
|
|
209
209
|
fileUrl: _,
|
|
210
210
|
// Store current URL for reference
|
|
211
211
|
isLoading: !1,
|
|
212
212
|
error: null,
|
|
213
|
-
rowCount:
|
|
213
|
+
rowCount: I,
|
|
214
214
|
loadedAt: /* @__PURE__ */ new Date()
|
|
215
215
|
}), o && k(g, o), s;
|
|
216
216
|
} finally {
|
|
217
|
-
await
|
|
217
|
+
await E.close();
|
|
218
218
|
}
|
|
219
219
|
} catch (m) {
|
|
220
220
|
throw a.value.set(g, {
|
|
221
221
|
tableName: s,
|
|
222
|
-
fileType:
|
|
222
|
+
fileType: M,
|
|
223
223
|
fileUrl: _,
|
|
224
224
|
isLoading: !1,
|
|
225
225
|
error: m.message
|
|
226
226
|
}), m;
|
|
227
227
|
}
|
|
228
|
-
}, z = async (_,
|
|
229
|
-
const s = i.value.get(
|
|
228
|
+
}, z = async (_, M) => {
|
|
229
|
+
const s = i.value.get(M);
|
|
230
230
|
if (!s)
|
|
231
|
-
throw new Error(`Connection not found: ${
|
|
232
|
-
return (await s.connection.query(_)).toArray().map((
|
|
231
|
+
throw new Error(`Connection not found: ${M}`);
|
|
232
|
+
return (await s.connection.query(_)).toArray().map((v) => {
|
|
233
233
|
const o = {};
|
|
234
|
-
for (const [
|
|
235
|
-
o[
|
|
234
|
+
for (const [d, g] of Object.entries(v))
|
|
235
|
+
o[d] = g;
|
|
236
236
|
return o;
|
|
237
237
|
});
|
|
238
238
|
}, q = async () => {
|
|
239
|
-
for (const [_,
|
|
239
|
+
for (const [_, M] of i.value)
|
|
240
240
|
try {
|
|
241
|
-
await
|
|
241
|
+
await M.connection.close(), console.log(`Closed connection: ${_}`);
|
|
242
242
|
} catch (s) {
|
|
243
243
|
console.warn(`Error closing connection ${_}:`, s);
|
|
244
244
|
}
|
|
@@ -255,29 +255,29 @@ const Lt = Kn("duckdb", () => {
|
|
|
255
255
|
_ || i.value.size === 0 ? await q() : console.log(`Skipping global cleanup. ${i.value.size} active connections remaining.`);
|
|
256
256
|
}, V = () => {
|
|
257
257
|
const _ = [];
|
|
258
|
-
for (const [
|
|
258
|
+
for (const [M, s] of i.value)
|
|
259
259
|
_.push({
|
|
260
|
-
connectionId:
|
|
260
|
+
connectionId: M,
|
|
261
261
|
viewerId: s.viewerId,
|
|
262
262
|
createdAt: s.createdAt
|
|
263
263
|
});
|
|
264
264
|
return _;
|
|
265
265
|
}, K = () => {
|
|
266
266
|
const _ = [];
|
|
267
|
-
for (const [
|
|
268
|
-
const
|
|
267
|
+
for (const [M, s] of l.value) {
|
|
268
|
+
const v = a.value.get(M);
|
|
269
269
|
_.push({
|
|
270
|
-
fileId:
|
|
271
|
-
tableName:
|
|
272
|
-
fileType:
|
|
273
|
-
fileUrl:
|
|
274
|
-
rowCount:
|
|
275
|
-
loadedAt:
|
|
270
|
+
fileId: M,
|
|
271
|
+
tableName: v == null ? void 0 : v.tableName,
|
|
272
|
+
fileType: v == null ? void 0 : v.fileType,
|
|
273
|
+
fileUrl: v == null ? void 0 : v.fileUrl,
|
|
274
|
+
rowCount: v == null ? void 0 : v.rowCount,
|
|
275
|
+
loadedAt: v == null ? void 0 : v.loadedAt,
|
|
276
276
|
usedByViewers: Array.from(s)
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
279
|
return _;
|
|
280
|
-
}, X =
|
|
280
|
+
}, X = T(null), P = T(0);
|
|
281
281
|
function ne(_) {
|
|
282
282
|
return `"${String(_).replace(/"/g, '""')}"`;
|
|
283
283
|
}
|
|
@@ -295,37 +295,37 @@ const Lt = Kn("duckdb", () => {
|
|
|
295
295
|
// Getters
|
|
296
296
|
isReady: f,
|
|
297
297
|
getLoadedFile: c,
|
|
298
|
-
isFileLoaded:
|
|
298
|
+
isFileLoaded: p,
|
|
299
299
|
activeConnectionCount: y,
|
|
300
300
|
hasActiveConnections: w,
|
|
301
301
|
// Actions
|
|
302
302
|
initDuckDB: A,
|
|
303
|
-
createConnection:
|
|
303
|
+
createConnection: C,
|
|
304
304
|
closeConnection: S,
|
|
305
305
|
cleanupViewerFileUsage: $,
|
|
306
306
|
trackFileUsage: k,
|
|
307
|
-
unloadFile:
|
|
307
|
+
unloadFile: F,
|
|
308
308
|
loadFile: D,
|
|
309
309
|
executeQuery: z,
|
|
310
310
|
cleanup: H,
|
|
311
311
|
performGlobalCleanup: q,
|
|
312
312
|
getConnectionInfo: V,
|
|
313
313
|
getFileUsageInfo: K,
|
|
314
|
-
publishViewFromQuery: async (_,
|
|
315
|
-
var
|
|
316
|
-
const o = (
|
|
314
|
+
publishViewFromQuery: async (_, M, s) => {
|
|
315
|
+
var v;
|
|
316
|
+
const o = (v = i.value.get(s)) == null ? void 0 : v.connection;
|
|
317
317
|
if (!o) throw new Error(`Connection not found: ${s}`);
|
|
318
|
-
await o.query(`CREATE OR REPLACE VIEW ${ne(_)} AS ${
|
|
318
|
+
await o.query(`CREATE OR REPLACE VIEW ${ne(_)} AS ${M}`), X.value = _, P.value++;
|
|
319
319
|
},
|
|
320
|
-
publishTableFromQuery: async (_,
|
|
321
|
-
var
|
|
322
|
-
const o = (
|
|
320
|
+
publishTableFromQuery: async (_, M, s) => {
|
|
321
|
+
var v;
|
|
322
|
+
const o = (v = i.value.get(s)) == null ? void 0 : v.connection;
|
|
323
323
|
if (!o) throw new Error(`Connection not found: ${s}`);
|
|
324
|
-
await o.query(`CREATE OR REPLACE TABLE ${ne(_)} AS ${
|
|
324
|
+
await o.query(`CREATE OR REPLACE TABLE ${ne(_)} AS ${M}`), X.value = _, P.value++;
|
|
325
325
|
},
|
|
326
|
-
formatIdFromUrl: (_) =>
|
|
326
|
+
formatIdFromUrl: (_) => "url_" + btoa(_).replace(/=+$/, "").replace(/[+/]/g, "_")
|
|
327
327
|
};
|
|
328
|
-
}),
|
|
328
|
+
}), Le = (e, t) => {
|
|
329
329
|
const n = e.__vccOpts || e;
|
|
330
330
|
for (const [r, a] of t)
|
|
331
331
|
n[r] = a;
|
|
@@ -336,7 +336,7 @@ const Lt = Kn("duckdb", () => {
|
|
|
336
336
|
}, cr = { class: "query-examples" }, fr = ["onClick"], hr = {
|
|
337
337
|
key: 1,
|
|
338
338
|
class: "results-panel"
|
|
339
|
-
},
|
|
339
|
+
}, pr = { class: "results-controls" }, vr = { class: "left-controls" }, dr = { class: "right-controls" }, mr = {
|
|
340
340
|
key: 0,
|
|
341
341
|
class: "table-container"
|
|
342
342
|
}, gr = { class: "results-table" }, yr = {
|
|
@@ -372,11 +372,11 @@ const Lt = Kn("duckdb", () => {
|
|
|
372
372
|
},
|
|
373
373
|
emits: ["query-results"],
|
|
374
374
|
setup(e, { emit: t }) {
|
|
375
|
-
const n = e, r = t, a =
|
|
375
|
+
const n = e, r = t, a = It(), i = T({
|
|
376
376
|
header: !0,
|
|
377
377
|
dynamicTyping: !0,
|
|
378
378
|
delimiter: ","
|
|
379
|
-
}), l =
|
|
379
|
+
}), l = T(!1), u = T(!1), f = T(n.url), c = T("my_data"), p = T(""), y = T(null), w = T(""), A = T("table"), C = T(1), S = T(50), $ = T(null);
|
|
380
380
|
Q(
|
|
381
381
|
() => n.url,
|
|
382
382
|
async (h) => {
|
|
@@ -389,12 +389,12 @@ const Lt = Kn("duckdb", () => {
|
|
|
389
389
|
},
|
|
390
390
|
{ immediate: !0 }
|
|
391
391
|
);
|
|
392
|
-
const k = j(() => a.isReady && $.value && !l.value),
|
|
392
|
+
const k = j(() => a.isReady && $.value && !l.value), F = j(() => a.formatIdFromUrl(n.url)), D = j(() => l.value ? "Loading..." : a.isInitializing ? "Initializing..." : a.isReady ? k.value ? "Connected" : "Not Connected" : "Not Ready"), z = j(() => !y.value || !Array.isArray(y.value) || y.value.length === 0 ? [] : Object.keys(y.value[0] || {})), q = j(() => !y.value || !Array.isArray(y.value) ? 0 : Math.ceil(y.value.length / S.value)), H = j(() => {
|
|
393
393
|
if (!y.value || !Array.isArray(y.value)) return [];
|
|
394
|
-
const h = (
|
|
394
|
+
const h = (C.value - 1) * S.value, m = h + S.value;
|
|
395
395
|
return y.value.slice(h, m);
|
|
396
396
|
}), V = j(() => [
|
|
397
|
-
{ name: "Show All", query: "SELECT * FROM data
|
|
397
|
+
{ name: "Show All", query: "SELECT * FROM data;" },
|
|
398
398
|
{ name: "Count Rows", query: "SELECT COUNT(*) as row_count FROM data;" },
|
|
399
399
|
{
|
|
400
400
|
name: "Group By",
|
|
@@ -445,9 +445,9 @@ const Lt = Kn("duckdb", () => {
|
|
|
445
445
|
i.value,
|
|
446
446
|
n.viewerId,
|
|
447
447
|
// Pass viewer ID for tracking
|
|
448
|
-
|
|
448
|
+
F.value
|
|
449
449
|
);
|
|
450
|
-
c.value = m,
|
|
450
|
+
c.value = m, v("SELECT * FROM data;");
|
|
451
451
|
} catch {
|
|
452
452
|
} finally {
|
|
453
453
|
l.value = !1;
|
|
@@ -456,7 +456,7 @@ const Lt = Kn("duckdb", () => {
|
|
|
456
456
|
/\bPRAGMA\s+table_info\(\s*data\s*\)/gi,
|
|
457
457
|
`PRAGMA table_info(${c.value})`
|
|
458
458
|
), _ = async () => {
|
|
459
|
-
if (!
|
|
459
|
+
if (!p.value || !$.value) {
|
|
460
460
|
w.value = "Please provide a valid SQL query";
|
|
461
461
|
return;
|
|
462
462
|
}
|
|
@@ -464,9 +464,9 @@ const Lt = Kn("duckdb", () => {
|
|
|
464
464
|
w.value = "No data table loaded";
|
|
465
465
|
return;
|
|
466
466
|
}
|
|
467
|
-
u.value = !0, w.value = "",
|
|
467
|
+
u.value = !0, w.value = "", C.value = 1;
|
|
468
468
|
try {
|
|
469
|
-
const h = ne(
|
|
469
|
+
const h = ne(p.value.trim());
|
|
470
470
|
y.value = await a.executeQuery(
|
|
471
471
|
h,
|
|
472
472
|
$.value
|
|
@@ -479,25 +479,25 @@ const Lt = Kn("duckdb", () => {
|
|
|
479
479
|
} finally {
|
|
480
480
|
u.value = !1;
|
|
481
481
|
}
|
|
482
|
-
},
|
|
483
|
-
|
|
482
|
+
}, M = (h) => {
|
|
483
|
+
C.value = h;
|
|
484
484
|
}, s = (h) => {
|
|
485
|
-
S.value = h,
|
|
486
|
-
},
|
|
487
|
-
|
|
488
|
-
}, o = (h) => h == null ? "NULL" : typeof h == "number" ? Number.isInteger(h) ? h.toString() : h.toFixed(4) : typeof h == "string" && h.length > 100 ? h.substring(0, 100) + "..." : h.toString(),
|
|
485
|
+
S.value = h, C.value = 1;
|
|
486
|
+
}, v = (h) => {
|
|
487
|
+
p.value = h;
|
|
488
|
+
}, o = (h) => h == null ? "NULL" : typeof h == "number" ? Number.isInteger(h) ? h.toString() : h.toFixed(4) : typeof h == "string" && h.length > 100 ? h.substring(0, 100) + "..." : h.toString(), d = () => {
|
|
489
489
|
if (!y.value || y.value.length === 0) return;
|
|
490
490
|
const h = Object.keys(y.value[0]), m = [
|
|
491
491
|
h.join(","),
|
|
492
492
|
...y.value.map(
|
|
493
|
-
(b) => h.map((
|
|
494
|
-
const
|
|
493
|
+
(b) => h.map((I) => {
|
|
494
|
+
const L = b[I], U = L == null ? "" : L.toString();
|
|
495
495
|
return U.includes(",") ? `"${U}"` : U;
|
|
496
496
|
}).join(",")
|
|
497
497
|
)
|
|
498
498
|
].join(`
|
|
499
|
-
`), x = new Blob([m], { type: "text/csv" }),
|
|
500
|
-
|
|
499
|
+
`), x = new Blob([m], { type: "text/csv" }), R = URL.createObjectURL(x), E = document.createElement("a");
|
|
500
|
+
E.href = R, E.download = "query-results.csv", E.click(), URL.revokeObjectURL(R);
|
|
501
501
|
}, g = () => {
|
|
502
502
|
w.value = "";
|
|
503
503
|
};
|
|
@@ -506,8 +506,8 @@ const Lt = Kn("duckdb", () => {
|
|
|
506
506
|
}), jn(async () => {
|
|
507
507
|
$.value && (a.activeConnectionCount, a.loadedFiles.size, await a.closeConnection($.value), a.activeConnectionCount, a.loadedFiles.size);
|
|
508
508
|
}), (h, m) => {
|
|
509
|
-
const x = bt("bf-button"),
|
|
510
|
-
return
|
|
509
|
+
const x = bt("bf-button"), R = bt("el-pagination");
|
|
510
|
+
return B(), O("div", ir, [
|
|
511
511
|
N("header", lr, [
|
|
512
512
|
m[3] || (m[3] = N("h1", null, "Data Explorer", -1)),
|
|
513
513
|
N("div", {
|
|
@@ -515,42 +515,42 @@ const Lt = Kn("duckdb", () => {
|
|
|
515
515
|
}, G(D.value), 3)
|
|
516
516
|
]),
|
|
517
517
|
N("div", ur, [
|
|
518
|
-
k.value ? (
|
|
518
|
+
k.value ? (B(), O("div", sr, [
|
|
519
519
|
m[5] || (m[5] = N("h3", null, "SQL Query", -1)),
|
|
520
520
|
N("div", cr, [
|
|
521
521
|
m[4] || (m[4] = N("span", null, "Quick queries:", -1)),
|
|
522
|
-
(
|
|
523
|
-
key:
|
|
524
|
-
onClick: (b) =>
|
|
522
|
+
(B(!0), O(re, null, de(V.value, (E) => (B(), O("button", {
|
|
523
|
+
key: E.name,
|
|
524
|
+
onClick: (b) => v(E.query),
|
|
525
525
|
class: "example-btn"
|
|
526
|
-
}, G(
|
|
526
|
+
}, G(E.name), 9, fr))), 128))
|
|
527
527
|
]),
|
|
528
|
-
|
|
529
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
530
|
-
placeholder: "SELECT * FROM data
|
|
528
|
+
Re(N("textarea", {
|
|
529
|
+
"onUpdate:modelValue": m[0] || (m[0] = (E) => p.value = E),
|
|
530
|
+
placeholder: "SELECT * FROM data;",
|
|
531
531
|
class: "query-textarea",
|
|
532
532
|
rows: "4"
|
|
533
533
|
}, null, 512), [
|
|
534
|
-
[un,
|
|
534
|
+
[un, p.value]
|
|
535
535
|
]),
|
|
536
536
|
oe(x, {
|
|
537
537
|
class: "execute-query-button",
|
|
538
538
|
onClick: _,
|
|
539
|
-
disabled: u.value || !
|
|
539
|
+
disabled: u.value || !p.value
|
|
540
540
|
}, {
|
|
541
541
|
default: Pe(() => [
|
|
542
542
|
At(G(u.value ? "Running..." : "Execute Query"), 1)
|
|
543
543
|
]),
|
|
544
544
|
_: 1
|
|
545
545
|
}, 8, ["disabled"])
|
|
546
|
-
])) :
|
|
547
|
-
y.value ? (
|
|
546
|
+
])) : Ee("", !0),
|
|
547
|
+
y.value ? (B(), O("div", hr, [
|
|
548
548
|
N("h3", null, "Results (" + G(y.value.length) + " rows)", 1),
|
|
549
|
-
N("div",
|
|
550
|
-
N("div",
|
|
549
|
+
N("div", pr, [
|
|
550
|
+
N("div", vr, [
|
|
551
551
|
oe(x, {
|
|
552
552
|
class: "secondary",
|
|
553
|
-
onClick:
|
|
553
|
+
onClick: d
|
|
554
554
|
}, {
|
|
555
555
|
default: Pe(() => [...m[6] || (m[6] = [
|
|
556
556
|
At("Export to CSV", -1)
|
|
@@ -558,62 +558,62 @@ const Lt = Kn("duckdb", () => {
|
|
|
558
558
|
_: 1
|
|
559
559
|
})
|
|
560
560
|
]),
|
|
561
|
-
N("div",
|
|
562
|
-
A.value === "table" && q.value > 1 ? (
|
|
561
|
+
N("div", dr, [
|
|
562
|
+
A.value === "table" && q.value > 1 ? (B(), sn(R, {
|
|
563
563
|
key: 0,
|
|
564
|
-
"current-page":
|
|
565
|
-
"onUpdate:currentPage": m[1] || (m[1] = (
|
|
564
|
+
"current-page": C.value,
|
|
565
|
+
"onUpdate:currentPage": m[1] || (m[1] = (E) => C.value = E),
|
|
566
566
|
"page-size": S.value,
|
|
567
567
|
total: y.value.length,
|
|
568
568
|
layout: "prev, pager, next",
|
|
569
|
-
onCurrentChange:
|
|
569
|
+
onCurrentChange: M,
|
|
570
570
|
class: "results-pagination"
|
|
571
|
-
}, null, 8, ["current-page", "page-size", "total"])) :
|
|
571
|
+
}, null, 8, ["current-page", "page-size", "total"])) : Ee("", !0)
|
|
572
572
|
])
|
|
573
573
|
]),
|
|
574
574
|
m[7] || (m[7] = N("div", { class: "pagination-wrapper" }, null, -1)),
|
|
575
|
-
A.value === "table" ? (
|
|
575
|
+
A.value === "table" ? (B(), O("div", mr, [
|
|
576
576
|
N("table", gr, [
|
|
577
577
|
N("thead", null, [
|
|
578
578
|
N("tr", null, [
|
|
579
|
-
(
|
|
579
|
+
(B(!0), O(re, null, de(z.value, (E) => (B(), O("th", { key: E }, G(E), 1))), 128))
|
|
580
580
|
])
|
|
581
581
|
]),
|
|
582
582
|
N("tbody", null, [
|
|
583
|
-
(
|
|
584
|
-
(
|
|
583
|
+
(B(!0), O(re, null, de(H.value, (E, b) => (B(), O("tr", { key: b }, [
|
|
584
|
+
(B(!0), O(re, null, de(z.value, (I) => (B(), O("td", { key: I }, G(o(E[I])), 1))), 128))
|
|
585
585
|
]))), 128))
|
|
586
586
|
])
|
|
587
587
|
]),
|
|
588
|
-
q.value > 1 ? (
|
|
589
|
-
oe(
|
|
590
|
-
"current-page":
|
|
591
|
-
"onUpdate:currentPage": m[2] || (m[2] = (
|
|
588
|
+
q.value > 1 ? (B(), O("div", yr, [
|
|
589
|
+
oe(R, {
|
|
590
|
+
"current-page": C.value,
|
|
591
|
+
"onUpdate:currentPage": m[2] || (m[2] = (E) => C.value = E),
|
|
592
592
|
"page-size": S.value,
|
|
593
593
|
total: y.value.length,
|
|
594
594
|
layout: " prev, pager, next",
|
|
595
595
|
"page-sizes": [25, 50, 100, 200, 500],
|
|
596
|
-
onCurrentChange:
|
|
596
|
+
onCurrentChange: M,
|
|
597
597
|
onSizeChange: s
|
|
598
598
|
}, null, 8, ["current-page", "page-size", "total"])
|
|
599
|
-
])) :
|
|
600
|
-
])) : (
|
|
599
|
+
])) : Ee("", !0)
|
|
600
|
+
])) : (B(), O("div", wr, [
|
|
601
601
|
N("pre", null, G(JSON.stringify(y.value.slice(0, 100), null, 2)), 1)
|
|
602
602
|
]))
|
|
603
|
-
])) :
|
|
604
|
-
w.value ? (
|
|
603
|
+
])) : Ee("", !0),
|
|
604
|
+
w.value ? (B(), O("div", _r, [
|
|
605
605
|
m[8] || (m[8] = N("h3", null, "Error", -1)),
|
|
606
606
|
N("p", null, G(w.value), 1),
|
|
607
607
|
N("button", {
|
|
608
608
|
onClick: g,
|
|
609
609
|
class: "clear-error-btn"
|
|
610
610
|
}, "Clear")
|
|
611
|
-
])) :
|
|
611
|
+
])) : Ee("", !0)
|
|
612
612
|
])
|
|
613
613
|
]);
|
|
614
614
|
};
|
|
615
615
|
}
|
|
616
|
-
}, Ar = /* @__PURE__ */
|
|
616
|
+
}, Ar = /* @__PURE__ */ Le(br, [["__scopeId", "data-v-b5de149e"]]), xr = { class: "app-container" }, Mr = /* @__PURE__ */ _e({
|
|
617
617
|
__name: "DataExplorerWrap",
|
|
618
618
|
props: {
|
|
619
619
|
pkg: {},
|
|
@@ -624,9 +624,9 @@ const Lt = Kn("duckdb", () => {
|
|
|
624
624
|
},
|
|
625
625
|
emits: ["queryResults"],
|
|
626
626
|
setup(e, { emit: t }) {
|
|
627
|
-
const n = e, r = t, a =
|
|
627
|
+
const n = e, r = t, a = T([]), i = T(""), l = T("parquet"), u = T("");
|
|
628
628
|
Ve(async () => {
|
|
629
|
-
var w, A,
|
|
629
|
+
var w, A, C, S, $;
|
|
630
630
|
if (n.srcUrl) {
|
|
631
631
|
i.value = n.srcUrl, l.value = n.srcFileType ?? (n.srcUrl.toLowerCase().endsWith(".csv") ? "csv" : "parquet");
|
|
632
632
|
return;
|
|
@@ -637,17 +637,17 @@ const Lt = Kn("duckdb", () => {
|
|
|
637
637
|
return;
|
|
638
638
|
}
|
|
639
639
|
try {
|
|
640
|
-
await
|
|
641
|
-
const
|
|
642
|
-
if (!
|
|
640
|
+
await p(k);
|
|
641
|
+
const F = (C = (A = (w = a.value) == null ? void 0 : w[0]) == null ? void 0 : A.content) == null ? void 0 : C.id;
|
|
642
|
+
if (!F) {
|
|
643
643
|
console.error("[DuckDBViewerWrapper] No files found in /view response.");
|
|
644
644
|
return;
|
|
645
645
|
}
|
|
646
|
-
u.value =
|
|
646
|
+
u.value = F, i.value = await y(k, F);
|
|
647
647
|
const D = ($ = (S = n.pkg) == null ? void 0 : S.content) == null ? void 0 : $.packageType;
|
|
648
648
|
l.value = D === "CSV" ? "csv" : "parquet";
|
|
649
|
-
} catch (
|
|
650
|
-
console.error(
|
|
649
|
+
} catch (F) {
|
|
650
|
+
console.error(F);
|
|
651
651
|
}
|
|
652
652
|
});
|
|
653
653
|
function f(w) {
|
|
@@ -657,29 +657,29 @@ const Lt = Kn("duckdb", () => {
|
|
|
657
657
|
const { useGetToken: w } = await import("./useGetToken-DaxIvkvl-BZdrKpSJ.mjs");
|
|
658
658
|
return w();
|
|
659
659
|
}
|
|
660
|
-
async function
|
|
661
|
-
const A = await c(),
|
|
660
|
+
async function p(w) {
|
|
661
|
+
const A = await c(), C = `${n.apiUrl}/packages/${w}/view?api_key=${A}`, S = await fetch(C);
|
|
662
662
|
if (!S.ok) throw new Error(`view failed: ${S.status}`);
|
|
663
663
|
a.value = await S.json();
|
|
664
664
|
}
|
|
665
665
|
async function y(w, A) {
|
|
666
|
-
const
|
|
666
|
+
const C = await c(), S = `${n.apiUrl}/packages/${w}/files/${A}?api_key=${C}`, $ = await fetch(S);
|
|
667
667
|
if (!$.ok) throw new Error(`file url failed: ${$.status}`);
|
|
668
668
|
return (await $.json()).url;
|
|
669
669
|
}
|
|
670
|
-
return (w, A) => (
|
|
670
|
+
return (w, A) => (B(), O("div", xr, [
|
|
671
671
|
oe(Ar, {
|
|
672
672
|
url: i.value,
|
|
673
673
|
"file-type": l.value,
|
|
674
674
|
"file-id": u.value,
|
|
675
|
-
onQueryResults: A[0] || (A[0] = (
|
|
675
|
+
onQueryResults: A[0] || (A[0] = (C) => f(C))
|
|
676
676
|
}, null, 8, ["url", "file-type", "file-id"])
|
|
677
677
|
]));
|
|
678
678
|
}
|
|
679
|
-
}),
|
|
680
|
-
var
|
|
679
|
+
}), Er = /* @__PURE__ */ Le(Mr, [["__scopeId", "data-v-7298e5bf"]]);
|
|
680
|
+
var Cr = { value: () => {
|
|
681
681
|
} };
|
|
682
|
-
function
|
|
682
|
+
function Lt() {
|
|
683
683
|
for (var e = 0, t = arguments.length, n = {}, r; e < t; ++e) {
|
|
684
684
|
if (!(r = arguments[e] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r);
|
|
685
685
|
n[r] = [];
|
|
@@ -696,7 +696,7 @@ function Sr(e, t) {
|
|
|
696
696
|
return { type: n, name: r };
|
|
697
697
|
});
|
|
698
698
|
}
|
|
699
|
-
Ke.prototype =
|
|
699
|
+
Ke.prototype = Lt.prototype = {
|
|
700
700
|
constructor: Ke,
|
|
701
701
|
on: function(e, t) {
|
|
702
702
|
var n = this._, r = Sr(e + "", n), a, i = -1, l = r.length;
|
|
@@ -733,7 +733,7 @@ function kr(e, t) {
|
|
|
733
733
|
function Yt(e, t, n) {
|
|
734
734
|
for (var r = 0, a = e.length; r < a; ++r)
|
|
735
735
|
if (e[r].name === t) {
|
|
736
|
-
e[r] =
|
|
736
|
+
e[r] = Cr, e = e.slice(0, r).concat(e.slice(r + 1));
|
|
737
737
|
break;
|
|
738
738
|
}
|
|
739
739
|
return n != null && e.push({ name: t, value: n }), e;
|
|
@@ -756,46 +756,46 @@ function $r(e) {
|
|
|
756
756
|
return n === xt && t.documentElement.namespaceURI === xt ? t.createElement(e) : t.createElementNS(n, e);
|
|
757
757
|
};
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function Rr(e) {
|
|
760
760
|
return function() {
|
|
761
761
|
return this.ownerDocument.createElementNS(e.space, e.local);
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
764
|
function cn(e) {
|
|
765
765
|
var t = ut(e);
|
|
766
|
-
return (t.local ?
|
|
766
|
+
return (t.local ? Rr : $r)(t);
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function Tr() {
|
|
769
769
|
}
|
|
770
770
|
function Ut(e) {
|
|
771
|
-
return e == null ?
|
|
771
|
+
return e == null ? Tr : function() {
|
|
772
772
|
return this.querySelector(e);
|
|
773
773
|
};
|
|
774
774
|
}
|
|
775
775
|
function Nr(e) {
|
|
776
776
|
typeof e != "function" && (e = Ut(e));
|
|
777
777
|
for (var t = this._groups, n = t.length, r = new Array(n), a = 0; a < n; ++a)
|
|
778
|
-
for (var i = t[a], l = i.length, u = r[a] = new Array(l), f, c,
|
|
779
|
-
(f = i[
|
|
778
|
+
for (var i = t[a], l = i.length, u = r[a] = new Array(l), f, c, p = 0; p < l; ++p)
|
|
779
|
+
(f = i[p]) && (c = e.call(f, f.__data__, p, i)) && ("__data__" in f && (c.__data__ = f.__data__), u[p] = c);
|
|
780
780
|
return new te(r, this._parents);
|
|
781
781
|
}
|
|
782
|
-
function
|
|
782
|
+
function Ir(e) {
|
|
783
783
|
return e == null ? [] : Array.isArray(e) ? e : Array.from(e);
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function Lr() {
|
|
786
786
|
return [];
|
|
787
787
|
}
|
|
788
788
|
function fn(e) {
|
|
789
|
-
return e == null ?
|
|
789
|
+
return e == null ? Lr : function() {
|
|
790
790
|
return this.querySelectorAll(e);
|
|
791
791
|
};
|
|
792
792
|
}
|
|
793
793
|
function Ur(e) {
|
|
794
794
|
return function() {
|
|
795
|
-
return
|
|
795
|
+
return Ir(e.apply(this, arguments));
|
|
796
796
|
};
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function Br(e) {
|
|
799
799
|
typeof e == "function" ? e = Ur(e) : e = fn(e);
|
|
800
800
|
for (var t = this._groups, n = t.length, r = [], a = [], i = 0; i < n; ++i)
|
|
801
801
|
for (var l = t[i], u = l.length, f, c = 0; c < u; ++c)
|
|
@@ -807,22 +807,22 @@ function hn(e) {
|
|
|
807
807
|
return this.matches(e);
|
|
808
808
|
};
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function pn(e) {
|
|
811
811
|
return function(t) {
|
|
812
812
|
return t.matches(e);
|
|
813
813
|
};
|
|
814
814
|
}
|
|
815
|
-
var
|
|
815
|
+
var Fr = Array.prototype.find;
|
|
816
816
|
function Or(e) {
|
|
817
817
|
return function() {
|
|
818
|
-
return
|
|
818
|
+
return Fr.call(this.children, e);
|
|
819
819
|
};
|
|
820
820
|
}
|
|
821
821
|
function Pr() {
|
|
822
822
|
return this.firstElementChild;
|
|
823
823
|
}
|
|
824
824
|
function Dr(e) {
|
|
825
|
-
return this.select(e == null ? Pr : Or(typeof e == "function" ? e :
|
|
825
|
+
return this.select(e == null ? Pr : Or(typeof e == "function" ? e : pn(e)));
|
|
826
826
|
}
|
|
827
827
|
var zr = Array.prototype.filter;
|
|
828
828
|
function qr() {
|
|
@@ -834,7 +834,7 @@ function Yr(e) {
|
|
|
834
834
|
};
|
|
835
835
|
}
|
|
836
836
|
function Vr(e) {
|
|
837
|
-
return this.selectAll(e == null ? qr : Yr(typeof e == "function" ? e :
|
|
837
|
+
return this.selectAll(e == null ? qr : Yr(typeof e == "function" ? e : pn(e)));
|
|
838
838
|
}
|
|
839
839
|
function Wr(e) {
|
|
840
840
|
typeof e != "function" && (e = hn(e));
|
|
@@ -843,11 +843,11 @@ function Wr(e) {
|
|
|
843
843
|
(f = i[c]) && e.call(f, f.__data__, c, i) && u.push(f);
|
|
844
844
|
return new te(r, this._parents);
|
|
845
845
|
}
|
|
846
|
-
function
|
|
846
|
+
function vn(e) {
|
|
847
847
|
return new Array(e.length);
|
|
848
848
|
}
|
|
849
849
|
function jr() {
|
|
850
|
-
return new te(this._enter || this._groups.map(
|
|
850
|
+
return new te(this._enter || this._groups.map(vn), this._parents);
|
|
851
851
|
}
|
|
852
852
|
function tt(e, t) {
|
|
853
853
|
this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t;
|
|
@@ -879,12 +879,12 @@ function Xr(e, t, n, r, a, i) {
|
|
|
879
879
|
(u = t[l]) && (a[l] = u);
|
|
880
880
|
}
|
|
881
881
|
function Gr(e, t, n, r, a, i, l) {
|
|
882
|
-
var u, f, c = /* @__PURE__ */ new Map(),
|
|
883
|
-
for (u = 0; u <
|
|
882
|
+
var u, f, c = /* @__PURE__ */ new Map(), p = t.length, y = i.length, w = new Array(p), A;
|
|
883
|
+
for (u = 0; u < p; ++u)
|
|
884
884
|
(f = t[u]) && (w[u] = A = l.call(f, f.__data__, u, t) + "", c.has(A) ? a[u] = f : c.set(A, f));
|
|
885
885
|
for (u = 0; u < y; ++u)
|
|
886
886
|
A = l.call(e, i[u], u, i) + "", (f = c.get(A)) ? (r[u] = f, f.__data__ = i[u], c.delete(A)) : n[u] = new tt(e, i[u]);
|
|
887
|
-
for (u = 0; u <
|
|
887
|
+
for (u = 0; u < p; ++u)
|
|
888
888
|
(f = t[u]) && c.get(w[u]) === f && (a[u] = f);
|
|
889
889
|
}
|
|
890
890
|
function Qr(e) {
|
|
@@ -895,11 +895,11 @@ function Kr(e, t) {
|
|
|
895
895
|
var n = t ? Gr : Xr, r = this._parents, a = this._groups;
|
|
896
896
|
typeof e != "function" && (e = Hr(e));
|
|
897
897
|
for (var i = a.length, l = new Array(i), u = new Array(i), f = new Array(i), c = 0; c < i; ++c) {
|
|
898
|
-
var
|
|
899
|
-
n(
|
|
900
|
-
for (var
|
|
901
|
-
if (z = S[
|
|
902
|
-
for (
|
|
898
|
+
var p = r[c], y = a[c], w = y.length, A = Jr(e.call(p, p && p.__data__, c, r)), C = A.length, S = u[c] = new Array(C), $ = l[c] = new Array(C), k = f[c] = new Array(w);
|
|
899
|
+
n(p, y, S, $, k, A, t);
|
|
900
|
+
for (var F = 0, D = 0, z, q; F < C; ++F)
|
|
901
|
+
if (z = S[F]) {
|
|
902
|
+
for (F >= D && (D = F + 1); !(q = $[D]) && ++D < C; ) ;
|
|
903
903
|
z._next = q || null;
|
|
904
904
|
}
|
|
905
905
|
}
|
|
@@ -909,7 +909,7 @@ function Jr(e) {
|
|
|
909
909
|
return typeof e == "object" && "length" in e ? e : Array.from(e);
|
|
910
910
|
}
|
|
911
911
|
function Zr() {
|
|
912
|
-
return new te(this._exit || this._groups.map(
|
|
912
|
+
return new te(this._exit || this._groups.map(vn), this._parents);
|
|
913
913
|
}
|
|
914
914
|
function ea(e, t, n) {
|
|
915
915
|
var r = this.enter(), a = this, i = this.exit();
|
|
@@ -917,8 +917,8 @@ function ea(e, t, n) {
|
|
|
917
917
|
}
|
|
918
918
|
function ta(e) {
|
|
919
919
|
for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, a = n.length, i = r.length, l = Math.min(a, i), u = new Array(a), f = 0; f < l; ++f)
|
|
920
|
-
for (var c = n[f],
|
|
921
|
-
(A = c[
|
|
920
|
+
for (var c = n[f], p = r[f], y = c.length, w = u[f] = new Array(y), A, C = 0; C < y; ++C)
|
|
921
|
+
(A = c[C] || p[C]) && (w[C] = A);
|
|
922
922
|
for (; f < a; ++f)
|
|
923
923
|
u[f] = n[f];
|
|
924
924
|
return new te(u, this._parents);
|
|
@@ -935,8 +935,8 @@ function ra(e) {
|
|
|
935
935
|
return y && w ? e(y.__data__, w.__data__) : !y - !w;
|
|
936
936
|
}
|
|
937
937
|
for (var n = this._groups, r = n.length, a = new Array(r), i = 0; i < r; ++i) {
|
|
938
|
-
for (var l = n[i], u = l.length, f = a[i] = new Array(u), c,
|
|
939
|
-
(c = l[
|
|
938
|
+
for (var l = n[i], u = l.length, f = a[i] = new Array(u), c, p = 0; p < u; ++p)
|
|
939
|
+
(c = l[p]) && (f[p] = c);
|
|
940
940
|
f.sort(t);
|
|
941
941
|
}
|
|
942
942
|
return new te(a, this._parents).order();
|
|
@@ -983,17 +983,17 @@ function ha(e) {
|
|
|
983
983
|
this.removeAttributeNS(e.space, e.local);
|
|
984
984
|
};
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function pa(e, t) {
|
|
987
987
|
return function() {
|
|
988
988
|
this.setAttribute(e, t);
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function va(e, t) {
|
|
992
992
|
return function() {
|
|
993
993
|
this.setAttributeNS(e.space, e.local, t);
|
|
994
994
|
};
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function da(e, t) {
|
|
997
997
|
return function() {
|
|
998
998
|
var n = t.apply(this, arguments);
|
|
999
999
|
n == null ? this.removeAttribute(e) : this.setAttribute(e, n);
|
|
@@ -1011,9 +1011,9 @@ function ga(e, t) {
|
|
|
1011
1011
|
var r = this.node();
|
|
1012
1012
|
return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n);
|
|
1013
1013
|
}
|
|
1014
|
-
return this.each((t == null ? n.local ? ha : fa : typeof t == "function" ? n.local ? ma :
|
|
1014
|
+
return this.each((t == null ? n.local ? ha : fa : typeof t == "function" ? n.local ? ma : da : n.local ? va : pa)(n, t));
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1016
|
+
function dn(e) {
|
|
1017
1017
|
return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView;
|
|
1018
1018
|
}
|
|
1019
1019
|
function ya(e) {
|
|
@@ -1036,7 +1036,7 @@ function ba(e, t, n) {
|
|
|
1036
1036
|
return arguments.length > 1 ? this.each((t == null ? ya : typeof t == "function" ? _a : wa)(e, t, n ?? "")) : Ne(this.node(), e);
|
|
1037
1037
|
}
|
|
1038
1038
|
function Ne(e, t) {
|
|
1039
|
-
return e.style.getPropertyValue(t) ||
|
|
1039
|
+
return e.style.getPropertyValue(t) || dn(e).getComputedStyle(e, null).getPropertyValue(t);
|
|
1040
1040
|
}
|
|
1041
1041
|
function Aa(e) {
|
|
1042
1042
|
return function() {
|
|
@@ -1048,19 +1048,19 @@ function xa(e, t) {
|
|
|
1048
1048
|
this[e] = t;
|
|
1049
1049
|
};
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function Ma(e, t) {
|
|
1052
1052
|
return function() {
|
|
1053
1053
|
var n = t.apply(this, arguments);
|
|
1054
1054
|
n == null ? delete this[e] : this[e] = n;
|
|
1055
1055
|
};
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1058
|
-
return arguments.length > 1 ? this.each((t == null ? Aa : typeof t == "function" ?
|
|
1057
|
+
function Ea(e, t) {
|
|
1058
|
+
return arguments.length > 1 ? this.each((t == null ? Aa : typeof t == "function" ? Ma : xa)(e, t)) : this.node()[e];
|
|
1059
1059
|
}
|
|
1060
1060
|
function mn(e) {
|
|
1061
1061
|
return e.trim().split(/^|\s+/);
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function Bt(e) {
|
|
1064
1064
|
return e.classList || new gn(e);
|
|
1065
1065
|
}
|
|
1066
1066
|
function gn(e) {
|
|
@@ -1080,12 +1080,12 @@ gn.prototype = {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
};
|
|
1082
1082
|
function yn(e, t) {
|
|
1083
|
-
for (var n =
|
|
1083
|
+
for (var n = Bt(e), r = -1, a = t.length; ++r < a; ) n.add(t[r]);
|
|
1084
1084
|
}
|
|
1085
1085
|
function wn(e, t) {
|
|
1086
|
-
for (var n =
|
|
1086
|
+
for (var n = Bt(e), r = -1, a = t.length; ++r < a; ) n.remove(t[r]);
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
1088
|
+
function Ca(e) {
|
|
1089
1089
|
return function() {
|
|
1090
1090
|
yn(this, e);
|
|
1091
1091
|
};
|
|
@@ -1103,15 +1103,15 @@ function ka(e, t) {
|
|
|
1103
1103
|
function $a(e, t) {
|
|
1104
1104
|
var n = mn(e + "");
|
|
1105
1105
|
if (arguments.length < 2) {
|
|
1106
|
-
for (var r =
|
|
1106
|
+
for (var r = Bt(this.node()), a = -1, i = n.length; ++a < i; ) if (!r.contains(n[a])) return !1;
|
|
1107
1107
|
return !0;
|
|
1108
1108
|
}
|
|
1109
|
-
return this.each((typeof t == "function" ? ka : t ?
|
|
1109
|
+
return this.each((typeof t == "function" ? ka : t ? Ca : Sa)(n, t));
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function Ra() {
|
|
1112
1112
|
this.textContent = "";
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1114
|
+
function Ta(e) {
|
|
1115
1115
|
return function() {
|
|
1116
1116
|
this.textContent = e;
|
|
1117
1117
|
};
|
|
@@ -1122,10 +1122,10 @@ function Na(e) {
|
|
|
1122
1122
|
this.textContent = t ?? "";
|
|
1123
1123
|
};
|
|
1124
1124
|
}
|
|
1125
|
-
function
|
|
1126
|
-
return arguments.length ? this.each(e == null ?
|
|
1125
|
+
function Ia(e) {
|
|
1126
|
+
return arguments.length ? this.each(e == null ? Ra : (typeof e == "function" ? Na : Ta)(e)) : this.node().textContent;
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function La() {
|
|
1129
1129
|
this.innerHTML = "";
|
|
1130
1130
|
}
|
|
1131
1131
|
function Ua(e) {
|
|
@@ -1133,14 +1133,14 @@ function Ua(e) {
|
|
|
1133
1133
|
this.innerHTML = e;
|
|
1134
1134
|
};
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function Ba(e) {
|
|
1137
1137
|
return function() {
|
|
1138
1138
|
var t = e.apply(this, arguments);
|
|
1139
1139
|
this.innerHTML = t ?? "";
|
|
1140
1140
|
};
|
|
1141
1141
|
}
|
|
1142
|
-
function
|
|
1143
|
-
return arguments.length ? this.each(e == null ?
|
|
1142
|
+
function Fa(e) {
|
|
1143
|
+
return arguments.length ? this.each(e == null ? La : (typeof e == "function" ? Ba : Ua)(e)) : this.node().innerHTML;
|
|
1144
1144
|
}
|
|
1145
1145
|
function Oa() {
|
|
1146
1146
|
this.nextSibling && this.parentNode.appendChild(this);
|
|
@@ -1229,10 +1229,10 @@ function to(e, t, n) {
|
|
|
1229
1229
|
if (arguments.length < 2) {
|
|
1230
1230
|
var u = this.node().__on;
|
|
1231
1231
|
if (u) {
|
|
1232
|
-
for (var f = 0, c = u.length,
|
|
1233
|
-
for (a = 0,
|
|
1234
|
-
if ((l = r[a]).type ===
|
|
1235
|
-
return
|
|
1232
|
+
for (var f = 0, c = u.length, p; f < c; ++f)
|
|
1233
|
+
for (a = 0, p = u[f]; a < i; ++a)
|
|
1234
|
+
if ((l = r[a]).type === p.type && l.name === p.name)
|
|
1235
|
+
return p.value;
|
|
1236
1236
|
}
|
|
1237
1237
|
return;
|
|
1238
1238
|
}
|
|
@@ -1240,7 +1240,7 @@ function to(e, t, n) {
|
|
|
1240
1240
|
return this;
|
|
1241
1241
|
}
|
|
1242
1242
|
function _n(e, t, n) {
|
|
1243
|
-
var r =
|
|
1243
|
+
var r = dn(e), a = r.CustomEvent;
|
|
1244
1244
|
typeof a == "function" ? a = new a(t, n) : (a = r.document.createEvent("Event"), n ? (a.initEvent(t, n.bubbles, n.cancelable), a.detail = n.detail) : a.initEvent(t, !1, !1)), e.dispatchEvent(a);
|
|
1245
1245
|
}
|
|
1246
1246
|
function no(e, t) {
|
|
@@ -1274,7 +1274,7 @@ function io() {
|
|
|
1274
1274
|
te.prototype = We.prototype = {
|
|
1275
1275
|
constructor: te,
|
|
1276
1276
|
select: Nr,
|
|
1277
|
-
selectAll:
|
|
1277
|
+
selectAll: Br,
|
|
1278
1278
|
selectChild: Dr,
|
|
1279
1279
|
selectChildren: Vr,
|
|
1280
1280
|
filter: Wr,
|
|
@@ -1294,10 +1294,10 @@ te.prototype = We.prototype = {
|
|
|
1294
1294
|
each: ca,
|
|
1295
1295
|
attr: ga,
|
|
1296
1296
|
style: ba,
|
|
1297
|
-
property:
|
|
1297
|
+
property: Ea,
|
|
1298
1298
|
classed: $a,
|
|
1299
|
-
text:
|
|
1300
|
-
html:
|
|
1299
|
+
text: Ia,
|
|
1300
|
+
html: Fa,
|
|
1301
1301
|
raise: Pa,
|
|
1302
1302
|
lower: za,
|
|
1303
1303
|
append: qa,
|
|
@@ -1309,7 +1309,7 @@ te.prototype = We.prototype = {
|
|
|
1309
1309
|
dispatch: ao,
|
|
1310
1310
|
[Symbol.iterator]: oo
|
|
1311
1311
|
};
|
|
1312
|
-
function
|
|
1312
|
+
function ve(e) {
|
|
1313
1313
|
return typeof e == "string" ? new te([[document.querySelector(e)]], [document.documentElement]) : new te([[e]], bn);
|
|
1314
1314
|
}
|
|
1315
1315
|
function lo(e) {
|
|
@@ -1331,21 +1331,21 @@ function xe(e, t) {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
return [e.pageX, e.pageY];
|
|
1333
1333
|
}
|
|
1334
|
-
const
|
|
1335
|
-
function
|
|
1334
|
+
const Mt = { capture: !0, passive: !1 };
|
|
1335
|
+
function Et(e) {
|
|
1336
1336
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
1337
1337
|
}
|
|
1338
1338
|
function uo(e) {
|
|
1339
|
-
var t = e.document.documentElement, n =
|
|
1340
|
-
"onselectstart" in t ? n.on("selectstart.drag",
|
|
1339
|
+
var t = e.document.documentElement, n = ve(e).on("dragstart.drag", Et, Mt);
|
|
1340
|
+
"onselectstart" in t ? n.on("selectstart.drag", Et, Mt) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none");
|
|
1341
1341
|
}
|
|
1342
1342
|
function so(e, t) {
|
|
1343
|
-
var n = e.document.documentElement, r =
|
|
1344
|
-
t && (r.on("click.drag",
|
|
1343
|
+
var n = e.document.documentElement, r = ve(e).on("dragstart.drag", null);
|
|
1344
|
+
t && (r.on("click.drag", Et, Mt), setTimeout(function() {
|
|
1345
1345
|
r.on("click.drag", null);
|
|
1346
1346
|
}, 0)), "onselectstart" in n ? r.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
|
|
1347
1347
|
}
|
|
1348
|
-
function
|
|
1348
|
+
function Ft(e, t, n) {
|
|
1349
1349
|
e.prototype = t.prototype = n, n.constructor = e;
|
|
1350
1350
|
}
|
|
1351
1351
|
function An(e, t) {
|
|
@@ -1355,7 +1355,7 @@ function An(e, t) {
|
|
|
1355
1355
|
}
|
|
1356
1356
|
function je() {
|
|
1357
1357
|
}
|
|
1358
|
-
var De = 0.7, nt = 1 / De,
|
|
1358
|
+
var De = 0.7, nt = 1 / De, Te = "\\s*([+-]?\\d+)\\s*", ze = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", se = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", co = /^#([0-9a-f]{3,8})$/, fo = new RegExp(`^rgb\\(${Te},${Te},${Te}\\)$`), ho = new RegExp(`^rgb\\(${se},${se},${se}\\)$`), po = new RegExp(`^rgba\\(${Te},${Te},${Te},${ze}\\)$`), vo = new RegExp(`^rgba\\(${se},${se},${se},${ze}\\)$`), mo = new RegExp(`^hsl\\(${ze},${se},${se}\\)$`), go = new RegExp(`^hsla\\(${ze},${se},${se},${ze}\\)$`), Wt = {
|
|
1359
1359
|
aliceblue: 15792383,
|
|
1360
1360
|
antiquewhite: 16444375,
|
|
1361
1361
|
aqua: 65535,
|
|
@@ -1505,7 +1505,7 @@ var De = 0.7, nt = 1 / De, Re = "\\s*([+-]?\\d+)\\s*", ze = "\\s*([+-]?(?:\\d*\\
|
|
|
1505
1505
|
yellow: 16776960,
|
|
1506
1506
|
yellowgreen: 10145074
|
|
1507
1507
|
};
|
|
1508
|
-
|
|
1508
|
+
Ft(je, qe, {
|
|
1509
1509
|
copy(e) {
|
|
1510
1510
|
return Object.assign(new this.constructor(), this, e);
|
|
1511
1511
|
},
|
|
@@ -1545,13 +1545,13 @@ function He(e, t, n, r) {
|
|
|
1545
1545
|
function _o(e) {
|
|
1546
1546
|
return e instanceof je || (e = qe(e)), e ? (e = e.rgb(), new ee(e.r, e.g, e.b, e.opacity)) : new ee();
|
|
1547
1547
|
}
|
|
1548
|
-
function
|
|
1548
|
+
function Ct(e, t, n, r) {
|
|
1549
1549
|
return arguments.length === 1 ? _o(e) : new ee(e, t, n, r ?? 1);
|
|
1550
1550
|
}
|
|
1551
1551
|
function ee(e, t, n, r) {
|
|
1552
1552
|
this.r = +e, this.g = +t, this.b = +n, this.opacity = +r;
|
|
1553
1553
|
}
|
|
1554
|
-
|
|
1554
|
+
Ft(ee, Ct, An(je, {
|
|
1555
1555
|
brighter(e) {
|
|
1556
1556
|
return e = e == null ? nt : Math.pow(nt, e), new ee(this.r * e, this.g * e, this.b * e, this.opacity);
|
|
1557
1557
|
},
|
|
@@ -1610,7 +1610,7 @@ function Ao(e, t, n, r) {
|
|
|
1610
1610
|
function ae(e, t, n, r) {
|
|
1611
1611
|
this.h = +e, this.s = +t, this.l = +n, this.opacity = +r;
|
|
1612
1612
|
}
|
|
1613
|
-
|
|
1613
|
+
Ft(ae, Ao, An(je, {
|
|
1614
1614
|
brighter(e) {
|
|
1615
1615
|
return e = e == null ? nt : Math.pow(nt, e), new ae(this.h, this.s, this.l * e, this.opacity);
|
|
1616
1616
|
},
|
|
@@ -1646,32 +1646,32 @@ function Xe(e) {
|
|
|
1646
1646
|
function ht(e, t, n) {
|
|
1647
1647
|
return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255;
|
|
1648
1648
|
}
|
|
1649
|
-
const
|
|
1649
|
+
const Mn = (e) => () => e;
|
|
1650
1650
|
function xo(e, t) {
|
|
1651
1651
|
return function(n) {
|
|
1652
1652
|
return e + n * t;
|
|
1653
1653
|
};
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1655
|
+
function Mo(e, t, n) {
|
|
1656
1656
|
return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) {
|
|
1657
1657
|
return Math.pow(e + r * t, n);
|
|
1658
1658
|
};
|
|
1659
1659
|
}
|
|
1660
|
-
function
|
|
1661
|
-
return (e = +e) == 1 ?
|
|
1662
|
-
return n - t ?
|
|
1660
|
+
function Eo(e) {
|
|
1661
|
+
return (e = +e) == 1 ? En : function(t, n) {
|
|
1662
|
+
return n - t ? Mo(t, n, e) : Mn(isNaN(t) ? n : t);
|
|
1663
1663
|
};
|
|
1664
1664
|
}
|
|
1665
|
-
function
|
|
1665
|
+
function En(e, t) {
|
|
1666
1666
|
var n = t - e;
|
|
1667
|
-
return n ? xo(e, n) :
|
|
1667
|
+
return n ? xo(e, n) : Mn(isNaN(e) ? t : e);
|
|
1668
1668
|
}
|
|
1669
1669
|
const Zt = (function e(t) {
|
|
1670
|
-
var n =
|
|
1670
|
+
var n = Eo(t);
|
|
1671
1671
|
function r(a, i) {
|
|
1672
|
-
var l = n((a =
|
|
1673
|
-
return function(
|
|
1674
|
-
return a.r = l(
|
|
1672
|
+
var l = n((a = Ct(a)).r, (i = Ct(i)).r), u = n(a.g, i.g), f = n(a.b, i.b), c = En(a.opacity, i.opacity);
|
|
1673
|
+
return function(p) {
|
|
1674
|
+
return a.r = l(p), a.g = u(p), a.b = f(p), a.opacity = c(p), a + "";
|
|
1675
1675
|
};
|
|
1676
1676
|
}
|
|
1677
1677
|
return r.gamma = e, r;
|
|
@@ -1681,8 +1681,8 @@ function ye(e, t) {
|
|
|
1681
1681
|
return e * (1 - n) + t * n;
|
|
1682
1682
|
};
|
|
1683
1683
|
}
|
|
1684
|
-
var St = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
|
|
1685
|
-
function
|
|
1684
|
+
var St = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, pt = new RegExp(St.source, "g");
|
|
1685
|
+
function Co(e) {
|
|
1686
1686
|
return function() {
|
|
1687
1687
|
return e;
|
|
1688
1688
|
};
|
|
@@ -1693,15 +1693,15 @@ function So(e) {
|
|
|
1693
1693
|
};
|
|
1694
1694
|
}
|
|
1695
1695
|
function ko(e, t) {
|
|
1696
|
-
var n = St.lastIndex =
|
|
1697
|
-
for (e = e + "", t = t + ""; (r = St.exec(e)) && (a =
|
|
1698
|
-
(i = a.index) > n && (i = t.slice(n, i), u[l] ? u[l] += i : u[++l] = i), (r = r[0]) === (a = a[0]) ? u[l] ? u[l] += a : u[++l] = a : (u[++l] = null, f.push({ i: l, x: ye(r, a) })), n =
|
|
1699
|
-
return n < t.length && (i = t.slice(n), u[l] ? u[l] += i : u[++l] = i), u.length < 2 ? f[0] ? So(f[0].x) :
|
|
1700
|
-
for (var
|
|
1696
|
+
var n = St.lastIndex = pt.lastIndex = 0, r, a, i, l = -1, u = [], f = [];
|
|
1697
|
+
for (e = e + "", t = t + ""; (r = St.exec(e)) && (a = pt.exec(t)); )
|
|
1698
|
+
(i = a.index) > n && (i = t.slice(n, i), u[l] ? u[l] += i : u[++l] = i), (r = r[0]) === (a = a[0]) ? u[l] ? u[l] += a : u[++l] = a : (u[++l] = null, f.push({ i: l, x: ye(r, a) })), n = pt.lastIndex;
|
|
1699
|
+
return n < t.length && (i = t.slice(n), u[l] ? u[l] += i : u[++l] = i), u.length < 2 ? f[0] ? So(f[0].x) : Co(t) : (t = f.length, function(c) {
|
|
1700
|
+
for (var p = 0, y; p < t; ++p) u[(y = f[p]).i] = y.x(c);
|
|
1701
1701
|
return u.join("");
|
|
1702
1702
|
});
|
|
1703
1703
|
}
|
|
1704
|
-
var en = 180 / Math.PI,
|
|
1704
|
+
var en = 180 / Math.PI, Cn = {
|
|
1705
1705
|
translateX: 0,
|
|
1706
1706
|
translateY: 0,
|
|
1707
1707
|
rotate: 0,
|
|
@@ -1723,69 +1723,69 @@ function Sn(e, t, n, r, a, i) {
|
|
|
1723
1723
|
var Ge;
|
|
1724
1724
|
function $o(e) {
|
|
1725
1725
|
const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + "");
|
|
1726
|
-
return t.isIdentity ?
|
|
1726
|
+
return t.isIdentity ? Cn : Sn(t.a, t.b, t.c, t.d, t.e, t.f);
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1729
|
-
return e == null || (Ge || (Ge = document.createElementNS("http://www.w3.org/2000/svg", "g")), Ge.setAttribute("transform", e), !(e = Ge.transform.baseVal.consolidate())) ?
|
|
1728
|
+
function Ro(e) {
|
|
1729
|
+
return e == null || (Ge || (Ge = document.createElementNS("http://www.w3.org/2000/svg", "g")), Ge.setAttribute("transform", e), !(e = Ge.transform.baseVal.consolidate())) ? Cn : (e = e.matrix, Sn(e.a, e.b, e.c, e.d, e.e, e.f));
|
|
1730
1730
|
}
|
|
1731
1731
|
function kn(e, t, n, r) {
|
|
1732
1732
|
function a(c) {
|
|
1733
1733
|
return c.length ? c.pop() + " " : "";
|
|
1734
1734
|
}
|
|
1735
|
-
function i(c,
|
|
1736
|
-
if (c !== y ||
|
|
1735
|
+
function i(c, p, y, w, A, C) {
|
|
1736
|
+
if (c !== y || p !== w) {
|
|
1737
1737
|
var S = A.push("translate(", null, t, null, n);
|
|
1738
|
-
|
|
1738
|
+
C.push({ i: S - 4, x: ye(c, y) }, { i: S - 2, x: ye(p, w) });
|
|
1739
1739
|
} else (y || w) && A.push("translate(" + y + t + w + n);
|
|
1740
1740
|
}
|
|
1741
|
-
function l(c,
|
|
1742
|
-
c !==
|
|
1741
|
+
function l(c, p, y, w) {
|
|
1742
|
+
c !== p ? (c - p > 180 ? p += 360 : p - c > 180 && (c += 360), w.push({ i: y.push(a(y) + "rotate(", null, r) - 2, x: ye(c, p) })) : p && y.push(a(y) + "rotate(" + p + r);
|
|
1743
1743
|
}
|
|
1744
|
-
function u(c,
|
|
1745
|
-
c !==
|
|
1744
|
+
function u(c, p, y, w) {
|
|
1745
|
+
c !== p ? w.push({ i: y.push(a(y) + "skewX(", null, r) - 2, x: ye(c, p) }) : p && y.push(a(y) + "skewX(" + p + r);
|
|
1746
1746
|
}
|
|
1747
|
-
function f(c,
|
|
1748
|
-
if (c !== y ||
|
|
1747
|
+
function f(c, p, y, w, A, C) {
|
|
1748
|
+
if (c !== y || p !== w) {
|
|
1749
1749
|
var S = A.push(a(A) + "scale(", null, ",", null, ")");
|
|
1750
|
-
|
|
1750
|
+
C.push({ i: S - 4, x: ye(c, y) }, { i: S - 2, x: ye(p, w) });
|
|
1751
1751
|
} else (y !== 1 || w !== 1) && A.push(a(A) + "scale(" + y + "," + w + ")");
|
|
1752
1752
|
}
|
|
1753
|
-
return function(c,
|
|
1753
|
+
return function(c, p) {
|
|
1754
1754
|
var y = [], w = [];
|
|
1755
|
-
return c = e(c),
|
|
1756
|
-
for (var
|
|
1755
|
+
return c = e(c), p = e(p), i(c.translateX, c.translateY, p.translateX, p.translateY, y, w), l(c.rotate, p.rotate, y, w), u(c.skewX, p.skewX, y, w), f(c.scaleX, c.scaleY, p.scaleX, p.scaleY, y, w), c = p = null, function(A) {
|
|
1756
|
+
for (var C = -1, S = w.length, $; ++C < S; ) y[($ = w[C]).i] = $.x(A);
|
|
1757
1757
|
return y.join("");
|
|
1758
1758
|
};
|
|
1759
1759
|
};
|
|
1760
1760
|
}
|
|
1761
|
-
var
|
|
1761
|
+
var To = kn($o, "px, ", "px)", "deg)"), No = kn(Ro, ", ", ")", ")"), Io = 1e-12;
|
|
1762
1762
|
function tn(e) {
|
|
1763
1763
|
return ((e = Math.exp(e)) + 1 / e) / 2;
|
|
1764
1764
|
}
|
|
1765
|
-
function
|
|
1765
|
+
function Lo(e) {
|
|
1766
1766
|
return ((e = Math.exp(e)) - 1 / e) / 2;
|
|
1767
1767
|
}
|
|
1768
1768
|
function Uo(e) {
|
|
1769
1769
|
return ((e = Math.exp(2 * e)) - 1) / (e + 1);
|
|
1770
1770
|
}
|
|
1771
|
-
const
|
|
1771
|
+
const Bo = (function e(t, n, r) {
|
|
1772
1772
|
function a(i, l) {
|
|
1773
|
-
var u = i[0], f = i[1], c = i[2],
|
|
1774
|
-
if (S <
|
|
1773
|
+
var u = i[0], f = i[1], c = i[2], p = l[0], y = l[1], w = l[2], A = p - u, C = y - f, S = A * A + C * C, $, k;
|
|
1774
|
+
if (S < Io)
|
|
1775
1775
|
k = Math.log(w / c) / t, $ = function(V) {
|
|
1776
1776
|
return [
|
|
1777
1777
|
u + V * A,
|
|
1778
|
-
f + V *
|
|
1778
|
+
f + V * C,
|
|
1779
1779
|
c * Math.exp(t * V * k)
|
|
1780
1780
|
];
|
|
1781
1781
|
};
|
|
1782
1782
|
else {
|
|
1783
|
-
var
|
|
1783
|
+
var F = Math.sqrt(S), D = (w * w - c * c + r * S) / (2 * c * n * F), z = (w * w - c * c - r * S) / (2 * w * n * F), q = Math.log(Math.sqrt(D * D + 1) - D), H = Math.log(Math.sqrt(z * z + 1) - z);
|
|
1784
1784
|
k = (H - q) / t, $ = function(V) {
|
|
1785
|
-
var K = V * k, X = tn(q), P = c / (n *
|
|
1785
|
+
var K = V * k, X = tn(q), P = c / (n * F) * (X * Uo(t * K + q) - Lo(q));
|
|
1786
1786
|
return [
|
|
1787
1787
|
u + P * A,
|
|
1788
|
-
f + P *
|
|
1788
|
+
f + P * C,
|
|
1789
1789
|
c * X / tn(t * K + q)
|
|
1790
1790
|
];
|
|
1791
1791
|
};
|
|
@@ -1797,19 +1797,19 @@ const Fo = (function e(t, n, r) {
|
|
|
1797
1797
|
return e(l, u, f);
|
|
1798
1798
|
}, a;
|
|
1799
1799
|
})(Math.SQRT2, 2, 4);
|
|
1800
|
-
var
|
|
1800
|
+
var Ie = 0, Fe = 0, Ue = 0, $n = 1e3, at, Oe, ot = 0, $e = 0, st = 0, Ye = typeof performance == "object" && performance.now ? performance : Date, Rn = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) {
|
|
1801
1801
|
setTimeout(e, 17);
|
|
1802
1802
|
};
|
|
1803
1803
|
function Ot() {
|
|
1804
|
-
return $e || (
|
|
1804
|
+
return $e || (Rn(Fo), $e = Ye.now() + st);
|
|
1805
1805
|
}
|
|
1806
|
-
function
|
|
1806
|
+
function Fo() {
|
|
1807
1807
|
$e = 0;
|
|
1808
1808
|
}
|
|
1809
1809
|
function it() {
|
|
1810
1810
|
this._call = this._time = this._next = null;
|
|
1811
1811
|
}
|
|
1812
|
-
it.prototype =
|
|
1812
|
+
it.prototype = Tn.prototype = {
|
|
1813
1813
|
constructor: it,
|
|
1814
1814
|
restart: function(e, t, n) {
|
|
1815
1815
|
if (typeof e != "function") throw new TypeError("callback is not a function");
|
|
@@ -1819,22 +1819,22 @@ it.prototype = Rn.prototype = {
|
|
|
1819
1819
|
this._call && (this._call = null, this._time = 1 / 0, kt());
|
|
1820
1820
|
}
|
|
1821
1821
|
};
|
|
1822
|
-
function
|
|
1822
|
+
function Tn(e, t, n) {
|
|
1823
1823
|
var r = new it();
|
|
1824
1824
|
return r.restart(e, t, n), r;
|
|
1825
1825
|
}
|
|
1826
1826
|
function Oo() {
|
|
1827
|
-
Ot(), ++
|
|
1827
|
+
Ot(), ++Ie;
|
|
1828
1828
|
for (var e = at, t; e; )
|
|
1829
1829
|
(t = $e - e._time) >= 0 && e._call.call(void 0, t), e = e._next;
|
|
1830
|
-
--
|
|
1830
|
+
--Ie;
|
|
1831
1831
|
}
|
|
1832
1832
|
function nn() {
|
|
1833
|
-
$e = (ot = Ye.now()) + st,
|
|
1833
|
+
$e = (ot = Ye.now()) + st, Ie = Fe = 0;
|
|
1834
1834
|
try {
|
|
1835
1835
|
Oo();
|
|
1836
1836
|
} finally {
|
|
1837
|
-
|
|
1837
|
+
Ie = 0, Do(), $e = 0;
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
1840
1840
|
function Po() {
|
|
@@ -1847,10 +1847,10 @@ function Do() {
|
|
|
1847
1847
|
Oe = e, kt(r);
|
|
1848
1848
|
}
|
|
1849
1849
|
function kt(e) {
|
|
1850
|
-
if (!
|
|
1851
|
-
|
|
1850
|
+
if (!Ie) {
|
|
1851
|
+
Fe && (Fe = clearTimeout(Fe));
|
|
1852
1852
|
var t = e - $e;
|
|
1853
|
-
t > 24 ? (e < 1 / 0 && (
|
|
1853
|
+
t > 24 ? (e < 1 / 0 && (Fe = setTimeout(nn, e - Ye.now() - st)), Ue && (Ue = clearInterval(Ue))) : (Ue || (ot = Ye.now(), Ue = setInterval(Po, $n)), Ie = 1, Rn(nn));
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
1856
|
function rn(e, t, n) {
|
|
@@ -1859,7 +1859,7 @@ function rn(e, t, n) {
|
|
|
1859
1859
|
r.stop(), e(a + t);
|
|
1860
1860
|
}, t, n), r;
|
|
1861
1861
|
}
|
|
1862
|
-
var zo =
|
|
1862
|
+
var zo = Lt("start", "end", "cancel", "interrupt"), qo = [], Nn = 0, an = 1, $t = 2, Je = 3, on = 4, Rt = 5, Ze = 6;
|
|
1863
1863
|
function ct(e, t, n, r, a, i) {
|
|
1864
1864
|
var l = e.__transition;
|
|
1865
1865
|
if (!l) e.__transition = {};
|
|
@@ -1897,30 +1897,30 @@ function ie(e, t) {
|
|
|
1897
1897
|
}
|
|
1898
1898
|
function Yo(e, t, n) {
|
|
1899
1899
|
var r = e.__transition, a;
|
|
1900
|
-
r[t] = n, n.timer =
|
|
1900
|
+
r[t] = n, n.timer = Tn(i, 0, n.time);
|
|
1901
1901
|
function i(c) {
|
|
1902
1902
|
n.state = an, n.timer.restart(l, n.delay, n.time), n.delay <= c && l(c - n.delay);
|
|
1903
1903
|
}
|
|
1904
1904
|
function l(c) {
|
|
1905
|
-
var
|
|
1905
|
+
var p, y, w, A;
|
|
1906
1906
|
if (n.state !== an) return f();
|
|
1907
|
-
for (
|
|
1908
|
-
if (A = r[
|
|
1907
|
+
for (p in r)
|
|
1908
|
+
if (A = r[p], A.name === n.name) {
|
|
1909
1909
|
if (A.state === Je) return rn(l);
|
|
1910
|
-
A.state === on ? (A.state = Ze, A.timer.stop(), A.on.call("interrupt", e, e.__data__, A.index, A.group), delete r[
|
|
1910
|
+
A.state === on ? (A.state = Ze, A.timer.stop(), A.on.call("interrupt", e, e.__data__, A.index, A.group), delete r[p]) : +p < t && (A.state = Ze, A.timer.stop(), A.on.call("cancel", e, e.__data__, A.index, A.group), delete r[p]);
|
|
1911
1911
|
}
|
|
1912
1912
|
if (rn(function() {
|
|
1913
1913
|
n.state === Je && (n.state = on, n.timer.restart(u, n.delay, n.time), u(c));
|
|
1914
1914
|
}), n.state = $t, n.on.call("start", e, e.__data__, n.index, n.group), n.state === $t) {
|
|
1915
|
-
for (n.state = Je, a = new Array(w = n.tween.length),
|
|
1916
|
-
(A = n.tween[
|
|
1915
|
+
for (n.state = Je, a = new Array(w = n.tween.length), p = 0, y = -1; p < w; ++p)
|
|
1916
|
+
(A = n.tween[p].value.call(e, e.__data__, n.index, n.group)) && (a[++y] = A);
|
|
1917
1917
|
a.length = y + 1;
|
|
1918
1918
|
}
|
|
1919
1919
|
}
|
|
1920
1920
|
function u(c) {
|
|
1921
|
-
for (var
|
|
1922
|
-
a[y].call(e,
|
|
1923
|
-
n.state ===
|
|
1921
|
+
for (var p = c < n.duration ? n.ease.call(null, c / n.duration) : (n.timer.restart(f), n.state = Rt, 1), y = -1, w = a.length; ++y < w; )
|
|
1922
|
+
a[y].call(e, p);
|
|
1923
|
+
n.state === Rt && (n.on.call("end", e, e.__data__, n.index, n.group), f());
|
|
1924
1924
|
}
|
|
1925
1925
|
function f() {
|
|
1926
1926
|
n.state = Ze, n.timer.stop(), delete r[t];
|
|
@@ -1937,7 +1937,7 @@ function et(e, t) {
|
|
|
1937
1937
|
i = !1;
|
|
1938
1938
|
continue;
|
|
1939
1939
|
}
|
|
1940
|
-
a = r.state > $t && r.state <
|
|
1940
|
+
a = r.state > $t && r.state < Rt, r.state = Ze, r.timer.stop(), r.on.call(a ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[l];
|
|
1941
1941
|
}
|
|
1942
1942
|
i && delete e.__transition;
|
|
1943
1943
|
}
|
|
@@ -1998,7 +1998,7 @@ function Dt(e, t, n) {
|
|
|
1998
1998
|
return ie(a, r).value[t];
|
|
1999
1999
|
};
|
|
2000
2000
|
}
|
|
2001
|
-
function
|
|
2001
|
+
function In(e, t) {
|
|
2002
2002
|
var n;
|
|
2003
2003
|
return (typeof t == "number" ? ye : t instanceof qe ? Zt : (n = qe(t)) ? (t = n, Zt) : ko)(e, t);
|
|
2004
2004
|
}
|
|
@@ -2041,7 +2041,7 @@ function Zo(e, t, n) {
|
|
|
2041
2041
|
};
|
|
2042
2042
|
}
|
|
2043
2043
|
function ei(e, t) {
|
|
2044
|
-
var n = ut(e), r = n === "transform" ? No :
|
|
2044
|
+
var n = ut(e), r = n === "transform" ? No : In;
|
|
2045
2045
|
return this.attrTween(e, typeof t == "function" ? (n.local ? Zo : Jo)(n, r, Dt(this, "attr." + e, t)) : t == null ? (n.local ? Go : Xo)(n) : (n.local ? Ko : Qo)(n, r, t));
|
|
2046
2046
|
}
|
|
2047
2047
|
function ti(e, t) {
|
|
@@ -2112,20 +2112,20 @@ function hi(e, t) {
|
|
|
2112
2112
|
ce(this, e).ease = t;
|
|
2113
2113
|
};
|
|
2114
2114
|
}
|
|
2115
|
-
function
|
|
2115
|
+
function pi(e) {
|
|
2116
2116
|
var t = this._id;
|
|
2117
2117
|
return arguments.length ? this.each(hi(t, e)) : ie(this.node(), t).ease;
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2119
|
+
function vi(e, t) {
|
|
2120
2120
|
return function() {
|
|
2121
2121
|
var n = t.apply(this, arguments);
|
|
2122
2122
|
if (typeof n != "function") throw new Error();
|
|
2123
2123
|
ce(this, e).ease = n;
|
|
2124
2124
|
};
|
|
2125
2125
|
}
|
|
2126
|
-
function
|
|
2126
|
+
function di(e) {
|
|
2127
2127
|
if (typeof e != "function") throw new Error();
|
|
2128
|
-
return this.each(
|
|
2128
|
+
return this.each(vi(this._id, e));
|
|
2129
2129
|
}
|
|
2130
2130
|
function mi(e) {
|
|
2131
2131
|
typeof e != "function" && (e = hn(e));
|
|
@@ -2137,7 +2137,7 @@ function mi(e) {
|
|
|
2137
2137
|
function gi(e) {
|
|
2138
2138
|
if (e._id !== this._id) throw new Error();
|
|
2139
2139
|
for (var t = this._groups, n = e._groups, r = t.length, a = n.length, i = Math.min(r, a), l = new Array(r), u = 0; u < i; ++u)
|
|
2140
|
-
for (var f = t[u], c = n[u],
|
|
2140
|
+
for (var f = t[u], c = n[u], p = f.length, y = l[u] = new Array(p), w, A = 0; A < p; ++A)
|
|
2141
2141
|
(w = f[A] || c[A]) && (y[A] = w);
|
|
2142
2142
|
for (; u < r; ++u)
|
|
2143
2143
|
l[u] = t[u];
|
|
@@ -2174,25 +2174,25 @@ function xi(e) {
|
|
|
2174
2174
|
var t = this._name, n = this._id;
|
|
2175
2175
|
typeof e != "function" && (e = Ut(e));
|
|
2176
2176
|
for (var r = this._groups, a = r.length, i = new Array(a), l = 0; l < a; ++l)
|
|
2177
|
-
for (var u = r[l], f = u.length, c = i[l] = new Array(f),
|
|
2178
|
-
(
|
|
2177
|
+
for (var u = r[l], f = u.length, c = i[l] = new Array(f), p, y, w = 0; w < f; ++w)
|
|
2178
|
+
(p = u[w]) && (y = e.call(p, p.__data__, w, u)) && ("__data__" in p && (y.__data__ = p.__data__), c[w] = y, ct(c[w], t, n, w, c, ie(p, n)));
|
|
2179
2179
|
return new ge(i, this._parents, t, n);
|
|
2180
2180
|
}
|
|
2181
|
-
function
|
|
2181
|
+
function Mi(e) {
|
|
2182
2182
|
var t = this._name, n = this._id;
|
|
2183
2183
|
typeof e != "function" && (e = fn(e));
|
|
2184
2184
|
for (var r = this._groups, a = r.length, i = [], l = [], u = 0; u < a; ++u)
|
|
2185
|
-
for (var f = r[u], c = f.length,
|
|
2186
|
-
if (
|
|
2187
|
-
for (var w = e.call(
|
|
2188
|
-
(A = w[S]) && ct(A, t, n, S, w,
|
|
2189
|
-
i.push(w), l.push(
|
|
2185
|
+
for (var f = r[u], c = f.length, p, y = 0; y < c; ++y)
|
|
2186
|
+
if (p = f[y]) {
|
|
2187
|
+
for (var w = e.call(p, p.__data__, y, f), A, C = ie(p, n), S = 0, $ = w.length; S < $; ++S)
|
|
2188
|
+
(A = w[S]) && ct(A, t, n, S, w, C);
|
|
2189
|
+
i.push(w), l.push(p);
|
|
2190
2190
|
}
|
|
2191
2191
|
return new ge(i, l, t, n);
|
|
2192
2192
|
}
|
|
2193
|
-
var
|
|
2194
|
-
function
|
|
2195
|
-
return new
|
|
2193
|
+
var Ei = We.prototype.constructor;
|
|
2194
|
+
function Ci() {
|
|
2195
|
+
return new Ei(this._groups, this._parents);
|
|
2196
2196
|
}
|
|
2197
2197
|
function Si(e, t) {
|
|
2198
2198
|
var n, r, a;
|
|
@@ -2201,7 +2201,7 @@ function Si(e, t) {
|
|
|
2201
2201
|
return i === l ? null : i === n && l === r ? a : a = t(n = i, r = l);
|
|
2202
2202
|
};
|
|
2203
2203
|
}
|
|
2204
|
-
function
|
|
2204
|
+
function Ln(e) {
|
|
2205
2205
|
return function() {
|
|
2206
2206
|
this.style.removeProperty(e);
|
|
2207
2207
|
};
|
|
@@ -2220,23 +2220,23 @@ function $i(e, t, n) {
|
|
|
2220
2220
|
return u == null && (f = u = (this.style.removeProperty(e), Ne(this, e))), l === f ? null : l === r && f === a ? i : (a = f, i = t(r = l, u));
|
|
2221
2221
|
};
|
|
2222
2222
|
}
|
|
2223
|
-
function
|
|
2223
|
+
function Ri(e, t) {
|
|
2224
2224
|
var n, r, a, i = "style." + t, l = "end." + i, u;
|
|
2225
2225
|
return function() {
|
|
2226
|
-
var f = ce(this, e), c = f.on,
|
|
2227
|
-
(c !== n || a !==
|
|
2226
|
+
var f = ce(this, e), c = f.on, p = f.value[i] == null ? u || (u = Ln(t)) : void 0;
|
|
2227
|
+
(c !== n || a !== p) && (r = (n = c).copy()).on(l, a = p), f.on = r;
|
|
2228
2228
|
};
|
|
2229
2229
|
}
|
|
2230
|
-
function
|
|
2231
|
-
var r = (e += "") == "transform" ?
|
|
2232
|
-
return t == null ? this.styleTween(e, Si(e, r)).on("end.style." + e,
|
|
2230
|
+
function Ti(e, t, n) {
|
|
2231
|
+
var r = (e += "") == "transform" ? To : In;
|
|
2232
|
+
return t == null ? this.styleTween(e, Si(e, r)).on("end.style." + e, Ln(e)) : typeof t == "function" ? this.styleTween(e, $i(e, r, Dt(this, "style." + e, t))).each(Ri(this._id, e)) : this.styleTween(e, ki(e, r, t), n).on("end.style." + e, null);
|
|
2233
2233
|
}
|
|
2234
2234
|
function Ni(e, t, n) {
|
|
2235
2235
|
return function(r) {
|
|
2236
2236
|
this.style.setProperty(e, t.call(this, r), n);
|
|
2237
2237
|
};
|
|
2238
2238
|
}
|
|
2239
|
-
function
|
|
2239
|
+
function Ii(e, t, n) {
|
|
2240
2240
|
var r, a;
|
|
2241
2241
|
function i() {
|
|
2242
2242
|
var l = t.apply(this, arguments);
|
|
@@ -2244,26 +2244,26 @@ function Li(e, t, n) {
|
|
|
2244
2244
|
}
|
|
2245
2245
|
return i._value = t, i;
|
|
2246
2246
|
}
|
|
2247
|
-
function
|
|
2247
|
+
function Li(e, t, n) {
|
|
2248
2248
|
var r = "style." + (e += "");
|
|
2249
2249
|
if (arguments.length < 2) return (r = this.tween(r)) && r._value;
|
|
2250
2250
|
if (t == null) return this.tween(r, null);
|
|
2251
2251
|
if (typeof t != "function") throw new Error();
|
|
2252
|
-
return this.tween(r,
|
|
2252
|
+
return this.tween(r, Ii(e, t, n ?? ""));
|
|
2253
2253
|
}
|
|
2254
2254
|
function Ui(e) {
|
|
2255
2255
|
return function() {
|
|
2256
2256
|
this.textContent = e;
|
|
2257
2257
|
};
|
|
2258
2258
|
}
|
|
2259
|
-
function
|
|
2259
|
+
function Bi(e) {
|
|
2260
2260
|
return function() {
|
|
2261
2261
|
var t = e(this);
|
|
2262
2262
|
this.textContent = t ?? "";
|
|
2263
2263
|
};
|
|
2264
2264
|
}
|
|
2265
|
-
function
|
|
2266
|
-
return this.tween("text", typeof e == "function" ?
|
|
2265
|
+
function Fi(e) {
|
|
2266
|
+
return this.tween("text", typeof e == "function" ? Bi(Dt(this, "text", e)) : Ui(e == null ? "" : e + ""));
|
|
2267
2267
|
}
|
|
2268
2268
|
function Oi(e) {
|
|
2269
2269
|
return function(t) {
|
|
@@ -2289,12 +2289,12 @@ function zi() {
|
|
|
2289
2289
|
for (var e = this._name, t = this._id, n = Un(), r = this._groups, a = r.length, i = 0; i < a; ++i)
|
|
2290
2290
|
for (var l = r[i], u = l.length, f, c = 0; c < u; ++c)
|
|
2291
2291
|
if (f = l[c]) {
|
|
2292
|
-
var
|
|
2292
|
+
var p = ie(f, t);
|
|
2293
2293
|
ct(f, e, n, c, l, {
|
|
2294
|
-
time:
|
|
2294
|
+
time: p.time + p.delay + p.duration,
|
|
2295
2295
|
delay: 0,
|
|
2296
|
-
duration:
|
|
2297
|
-
ease:
|
|
2296
|
+
duration: p.duration,
|
|
2297
|
+
ease: p.ease
|
|
2298
2298
|
});
|
|
2299
2299
|
}
|
|
2300
2300
|
return new ge(r, this._parents, e, n);
|
|
@@ -2306,8 +2306,8 @@ function qi() {
|
|
|
2306
2306
|
--a === 0 && i();
|
|
2307
2307
|
} };
|
|
2308
2308
|
n.each(function() {
|
|
2309
|
-
var c = ce(this, r),
|
|
2310
|
-
|
|
2309
|
+
var c = ce(this, r), p = c.on;
|
|
2310
|
+
p !== e && (t = (e = p).copy(), t._.cancel.push(u), t._.interrupt.push(u), t._.end.push(f)), c.on = t;
|
|
2311
2311
|
}), a === 0 && i();
|
|
2312
2312
|
});
|
|
2313
2313
|
}
|
|
@@ -2318,38 +2318,38 @@ function ge(e, t, n, r) {
|
|
|
2318
2318
|
function Un() {
|
|
2319
2319
|
return ++Yi;
|
|
2320
2320
|
}
|
|
2321
|
-
var
|
|
2321
|
+
var pe = We.prototype;
|
|
2322
2322
|
ge.prototype = {
|
|
2323
2323
|
constructor: ge,
|
|
2324
2324
|
select: xi,
|
|
2325
|
-
selectAll:
|
|
2326
|
-
selectChild:
|
|
2327
|
-
selectChildren:
|
|
2325
|
+
selectAll: Mi,
|
|
2326
|
+
selectChild: pe.selectChild,
|
|
2327
|
+
selectChildren: pe.selectChildren,
|
|
2328
2328
|
filter: mi,
|
|
2329
2329
|
merge: gi,
|
|
2330
|
-
selection:
|
|
2330
|
+
selection: Ci,
|
|
2331
2331
|
transition: zi,
|
|
2332
|
-
call:
|
|
2333
|
-
nodes:
|
|
2334
|
-
node:
|
|
2335
|
-
size:
|
|
2336
|
-
empty:
|
|
2337
|
-
each:
|
|
2332
|
+
call: pe.call,
|
|
2333
|
+
nodes: pe.nodes,
|
|
2334
|
+
node: pe.node,
|
|
2335
|
+
size: pe.size,
|
|
2336
|
+
empty: pe.empty,
|
|
2337
|
+
each: pe.each,
|
|
2338
2338
|
on: _i,
|
|
2339
2339
|
attr: ei,
|
|
2340
2340
|
attrTween: oi,
|
|
2341
|
-
style:
|
|
2342
|
-
styleTween:
|
|
2343
|
-
text:
|
|
2341
|
+
style: Ti,
|
|
2342
|
+
styleTween: Li,
|
|
2343
|
+
text: Fi,
|
|
2344
2344
|
textTween: Di,
|
|
2345
2345
|
remove: Ai,
|
|
2346
2346
|
tween: Ho,
|
|
2347
2347
|
delay: ui,
|
|
2348
2348
|
duration: fi,
|
|
2349
|
-
ease:
|
|
2350
|
-
easeVarying:
|
|
2349
|
+
ease: pi,
|
|
2350
|
+
easeVarying: di,
|
|
2351
2351
|
end: qi,
|
|
2352
|
-
[Symbol.iterator]:
|
|
2352
|
+
[Symbol.iterator]: pe[Symbol.iterator]
|
|
2353
2353
|
};
|
|
2354
2354
|
function Vi(e) {
|
|
2355
2355
|
return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2;
|
|
@@ -2433,10 +2433,10 @@ me.prototype = {
|
|
|
2433
2433
|
};
|
|
2434
2434
|
var lt = new me(1, 0, 0);
|
|
2435
2435
|
me.prototype;
|
|
2436
|
-
function
|
|
2436
|
+
function vt(e) {
|
|
2437
2437
|
e.stopImmediatePropagation();
|
|
2438
2438
|
}
|
|
2439
|
-
function
|
|
2439
|
+
function Be(e) {
|
|
2440
2440
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
2441
2441
|
}
|
|
2442
2442
|
function Gi(e) {
|
|
@@ -2463,73 +2463,73 @@ function Zi(e, t, n) {
|
|
|
2463
2463
|
);
|
|
2464
2464
|
}
|
|
2465
2465
|
function el() {
|
|
2466
|
-
var e = Gi, t = Qi, n = Zi, r = Ki, a = Ji, i = [0, 1 / 0], l = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], u = 250, f =
|
|
2466
|
+
var e = Gi, t = Qi, n = Zi, r = Ki, a = Ji, i = [0, 1 / 0], l = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], u = 250, f = Bo, c = Lt("start", "zoom", "end"), p, y, w, A = 500, C = 150, S = 0, $ = 10;
|
|
2467
2467
|
function k(s) {
|
|
2468
|
-
s.property("__zoom", ln).on("wheel.zoom", K, { passive: !1 }).on("mousedown.zoom", X).on("dblclick.zoom", P).filter(a).on("touchstart.zoom", ne).on("touchmove.zoom", _).on("touchend.zoom touchcancel.zoom",
|
|
2468
|
+
s.property("__zoom", ln).on("wheel.zoom", K, { passive: !1 }).on("mousedown.zoom", X).on("dblclick.zoom", P).filter(a).on("touchstart.zoom", ne).on("touchmove.zoom", _).on("touchend.zoom touchcancel.zoom", M).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
2469
2469
|
}
|
|
2470
|
-
k.transform = function(s,
|
|
2470
|
+
k.transform = function(s, v, o, d) {
|
|
2471
2471
|
var g = s.selection ? s.selection() : s;
|
|
2472
|
-
g.property("__zoom", ln), s !== g ? q(s,
|
|
2473
|
-
H(this, arguments).event(
|
|
2472
|
+
g.property("__zoom", ln), s !== g ? q(s, v, o, d) : g.interrupt().each(function() {
|
|
2473
|
+
H(this, arguments).event(d).start().zoom(null, typeof v == "function" ? v.apply(this, arguments) : v).end();
|
|
2474
2474
|
});
|
|
2475
|
-
}, k.scaleBy = function(s,
|
|
2475
|
+
}, k.scaleBy = function(s, v, o, d) {
|
|
2476
2476
|
k.scaleTo(s, function() {
|
|
2477
|
-
var g = this.__zoom.k, h = typeof
|
|
2477
|
+
var g = this.__zoom.k, h = typeof v == "function" ? v.apply(this, arguments) : v;
|
|
2478
2478
|
return g * h;
|
|
2479
|
-
}, o,
|
|
2480
|
-
}, k.scaleTo = function(s,
|
|
2479
|
+
}, o, d);
|
|
2480
|
+
}, k.scaleTo = function(s, v, o, d) {
|
|
2481
2481
|
k.transform(s, function() {
|
|
2482
|
-
var g = t.apply(this, arguments), h = this.__zoom, m = o == null ? z(g) : typeof o == "function" ? o.apply(this, arguments) : o, x = h.invert(m),
|
|
2483
|
-
return n(D(
|
|
2484
|
-
}, o,
|
|
2485
|
-
}, k.translateBy = function(s,
|
|
2482
|
+
var g = t.apply(this, arguments), h = this.__zoom, m = o == null ? z(g) : typeof o == "function" ? o.apply(this, arguments) : o, x = h.invert(m), R = typeof v == "function" ? v.apply(this, arguments) : v;
|
|
2483
|
+
return n(D(F(h, R), m, x), g, l);
|
|
2484
|
+
}, o, d);
|
|
2485
|
+
}, k.translateBy = function(s, v, o, d) {
|
|
2486
2486
|
k.transform(s, function() {
|
|
2487
2487
|
return n(this.__zoom.translate(
|
|
2488
|
-
typeof
|
|
2488
|
+
typeof v == "function" ? v.apply(this, arguments) : v,
|
|
2489
2489
|
typeof o == "function" ? o.apply(this, arguments) : o
|
|
2490
2490
|
), t.apply(this, arguments), l);
|
|
2491
|
-
}, null,
|
|
2492
|
-
}, k.translateTo = function(s,
|
|
2491
|
+
}, null, d);
|
|
2492
|
+
}, k.translateTo = function(s, v, o, d, g) {
|
|
2493
2493
|
k.transform(s, function() {
|
|
2494
|
-
var h = t.apply(this, arguments), m = this.__zoom, x =
|
|
2494
|
+
var h = t.apply(this, arguments), m = this.__zoom, x = d == null ? z(h) : typeof d == "function" ? d.apply(this, arguments) : d;
|
|
2495
2495
|
return n(lt.translate(x[0], x[1]).scale(m.k).translate(
|
|
2496
|
-
typeof
|
|
2496
|
+
typeof v == "function" ? -v.apply(this, arguments) : -v,
|
|
2497
2497
|
typeof o == "function" ? -o.apply(this, arguments) : -o
|
|
2498
2498
|
), h, l);
|
|
2499
|
-
},
|
|
2499
|
+
}, d, g);
|
|
2500
2500
|
};
|
|
2501
|
-
function
|
|
2502
|
-
return
|
|
2501
|
+
function F(s, v) {
|
|
2502
|
+
return v = Math.max(i[0], Math.min(i[1], v)), v === s.k ? s : new me(v, s.x, s.y);
|
|
2503
2503
|
}
|
|
2504
|
-
function D(s,
|
|
2505
|
-
var
|
|
2506
|
-
return
|
|
2504
|
+
function D(s, v, o) {
|
|
2505
|
+
var d = v[0] - o[0] * s.k, g = v[1] - o[1] * s.k;
|
|
2506
|
+
return d === s.x && g === s.y ? s : new me(s.k, d, g);
|
|
2507
2507
|
}
|
|
2508
2508
|
function z(s) {
|
|
2509
2509
|
return [(+s[0][0] + +s[1][0]) / 2, (+s[0][1] + +s[1][1]) / 2];
|
|
2510
2510
|
}
|
|
2511
|
-
function q(s,
|
|
2511
|
+
function q(s, v, o, d) {
|
|
2512
2512
|
s.on("start.zoom", function() {
|
|
2513
|
-
H(this, arguments).event(
|
|
2513
|
+
H(this, arguments).event(d).start();
|
|
2514
2514
|
}).on("interrupt.zoom end.zoom", function() {
|
|
2515
|
-
H(this, arguments).event(
|
|
2515
|
+
H(this, arguments).event(d).end();
|
|
2516
2516
|
}).tween("zoom", function() {
|
|
2517
|
-
var g = this, h = arguments, m = H(g, h).event(
|
|
2517
|
+
var g = this, h = arguments, m = H(g, h).event(d), x = t.apply(g, h), R = o == null ? z(x) : typeof o == "function" ? o.apply(g, h) : o, E = Math.max(x[1][0] - x[0][0], x[1][1] - x[0][1]), b = g.__zoom, I = typeof v == "function" ? v.apply(g, h) : v, L = f(b.invert(R).concat(E / b.k), I.invert(R).concat(E / I.k));
|
|
2518
2518
|
return function(U) {
|
|
2519
|
-
if (U === 1) U =
|
|
2519
|
+
if (U === 1) U = I;
|
|
2520
2520
|
else {
|
|
2521
|
-
var Y =
|
|
2522
|
-
U = new me(le,
|
|
2521
|
+
var Y = L(U), le = E / Y[2];
|
|
2522
|
+
U = new me(le, R[0] - Y[0] * le, R[1] - Y[1] * le);
|
|
2523
2523
|
}
|
|
2524
2524
|
m.zoom(null, U);
|
|
2525
2525
|
};
|
|
2526
2526
|
});
|
|
2527
2527
|
}
|
|
2528
|
-
function H(s,
|
|
2529
|
-
return !o && s.__zooming || new V(s,
|
|
2528
|
+
function H(s, v, o) {
|
|
2529
|
+
return !o && s.__zooming || new V(s, v);
|
|
2530
2530
|
}
|
|
2531
|
-
function V(s,
|
|
2532
|
-
this.that = s, this.args =
|
|
2531
|
+
function V(s, v) {
|
|
2532
|
+
this.that = s, this.args = v, this.active = 0, this.sourceEvent = null, this.extent = t.apply(s, v), this.taps = 0;
|
|
2533
2533
|
}
|
|
2534
2534
|
V.prototype = {
|
|
2535
2535
|
event: function(s) {
|
|
@@ -2538,14 +2538,14 @@ function el() {
|
|
|
2538
2538
|
start: function() {
|
|
2539
2539
|
return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this;
|
|
2540
2540
|
},
|
|
2541
|
-
zoom: function(s,
|
|
2542
|
-
return this.mouse && s !== "mouse" && (this.mouse[1] =
|
|
2541
|
+
zoom: function(s, v) {
|
|
2542
|
+
return this.mouse && s !== "mouse" && (this.mouse[1] = v.invert(this.mouse[0])), this.touch0 && s !== "touch" && (this.touch0[1] = v.invert(this.touch0[0])), this.touch1 && s !== "touch" && (this.touch1[1] = v.invert(this.touch1[0])), this.that.__zoom = v, this.emit("zoom"), this;
|
|
2543
2543
|
},
|
|
2544
2544
|
end: function() {
|
|
2545
2545
|
return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
|
|
2546
2546
|
},
|
|
2547
2547
|
emit: function(s) {
|
|
2548
|
-
var
|
|
2548
|
+
var v = ve(this.that).datum();
|
|
2549
2549
|
c.call(
|
|
2550
2550
|
s,
|
|
2551
2551
|
this.that,
|
|
@@ -2555,78 +2555,78 @@ function el() {
|
|
|
2555
2555
|
transform: this.that.__zoom,
|
|
2556
2556
|
dispatch: c
|
|
2557
2557
|
}),
|
|
2558
|
-
|
|
2558
|
+
v
|
|
2559
2559
|
);
|
|
2560
2560
|
}
|
|
2561
2561
|
};
|
|
2562
|
-
function K(s, ...
|
|
2562
|
+
function K(s, ...v) {
|
|
2563
2563
|
if (!e.apply(this, arguments)) return;
|
|
2564
|
-
var o = H(this,
|
|
2564
|
+
var o = H(this, v).event(s), d = this.__zoom, g = Math.max(i[0], Math.min(i[1], d.k * Math.pow(2, r.apply(this, arguments)))), h = xe(s);
|
|
2565
2565
|
if (o.wheel)
|
|
2566
|
-
(o.mouse[0][0] !== h[0] || o.mouse[0][1] !== h[1]) && (o.mouse[1] =
|
|
2566
|
+
(o.mouse[0][0] !== h[0] || o.mouse[0][1] !== h[1]) && (o.mouse[1] = d.invert(o.mouse[0] = h)), clearTimeout(o.wheel);
|
|
2567
2567
|
else {
|
|
2568
|
-
if (
|
|
2569
|
-
o.mouse = [h,
|
|
2568
|
+
if (d.k === g) return;
|
|
2569
|
+
o.mouse = [h, d.invert(h)], et(this), o.start();
|
|
2570
2570
|
}
|
|
2571
|
-
|
|
2571
|
+
Be(s), o.wheel = setTimeout(m, C), o.zoom("mouse", n(D(F(d, g), o.mouse[0], o.mouse[1]), o.extent, l));
|
|
2572
2572
|
function m() {
|
|
2573
2573
|
o.wheel = null, o.end();
|
|
2574
2574
|
}
|
|
2575
2575
|
}
|
|
2576
|
-
function X(s, ...
|
|
2576
|
+
function X(s, ...v) {
|
|
2577
2577
|
if (w || !e.apply(this, arguments)) return;
|
|
2578
|
-
var o = s.currentTarget,
|
|
2579
|
-
uo(s.view),
|
|
2580
|
-
function
|
|
2581
|
-
if (
|
|
2582
|
-
var
|
|
2583
|
-
|
|
2578
|
+
var o = s.currentTarget, d = H(this, v, !0).event(s), g = ve(s.view).on("mousemove.zoom", R, !0).on("mouseup.zoom", E, !0), h = xe(s, o), m = s.clientX, x = s.clientY;
|
|
2579
|
+
uo(s.view), vt(s), d.mouse = [h, this.__zoom.invert(h)], et(this), d.start();
|
|
2580
|
+
function R(b) {
|
|
2581
|
+
if (Be(b), !d.moved) {
|
|
2582
|
+
var I = b.clientX - m, L = b.clientY - x;
|
|
2583
|
+
d.moved = I * I + L * L > S;
|
|
2584
2584
|
}
|
|
2585
|
-
|
|
2585
|
+
d.event(b).zoom("mouse", n(D(d.that.__zoom, d.mouse[0] = xe(b, o), d.mouse[1]), d.extent, l));
|
|
2586
2586
|
}
|
|
2587
|
-
function
|
|
2588
|
-
g.on("mousemove.zoom mouseup.zoom", null), so(b.view,
|
|
2587
|
+
function E(b) {
|
|
2588
|
+
g.on("mousemove.zoom mouseup.zoom", null), so(b.view, d.moved), Be(b), d.event(b).end();
|
|
2589
2589
|
}
|
|
2590
2590
|
}
|
|
2591
|
-
function P(s, ...
|
|
2591
|
+
function P(s, ...v) {
|
|
2592
2592
|
if (e.apply(this, arguments)) {
|
|
2593
|
-
var o = this.__zoom,
|
|
2594
|
-
|
|
2593
|
+
var o = this.__zoom, d = xe(s.changedTouches ? s.changedTouches[0] : s, this), g = o.invert(d), h = o.k * (s.shiftKey ? 0.5 : 2), m = n(D(F(o, h), d, g), t.apply(this, v), l);
|
|
2594
|
+
Be(s), u > 0 ? ve(this).transition().duration(u).call(q, m, d, s) : ve(this).call(k.transform, m, d, s);
|
|
2595
2595
|
}
|
|
2596
2596
|
}
|
|
2597
|
-
function ne(s, ...
|
|
2597
|
+
function ne(s, ...v) {
|
|
2598
2598
|
if (e.apply(this, arguments)) {
|
|
2599
|
-
var o = s.touches,
|
|
2600
|
-
for (
|
|
2601
|
-
x = o[m],
|
|
2602
|
-
|
|
2603
|
-
|
|
2599
|
+
var o = s.touches, d = o.length, g = H(this, v, s.changedTouches.length === d).event(s), h, m, x, R;
|
|
2600
|
+
for (vt(s), m = 0; m < d; ++m)
|
|
2601
|
+
x = o[m], R = xe(x, this), R = [R, this.__zoom.invert(R), x.identifier], g.touch0 ? !g.touch1 && g.touch0[2] !== R[2] && (g.touch1 = R, g.taps = 0) : (g.touch0 = R, h = !0, g.taps = 1 + !!p);
|
|
2602
|
+
p && (p = clearTimeout(p)), h && (g.taps < 2 && (y = R[0], p = setTimeout(function() {
|
|
2603
|
+
p = null;
|
|
2604
2604
|
}, A)), et(this), g.start());
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
2607
|
-
function _(s, ...
|
|
2607
|
+
function _(s, ...v) {
|
|
2608
2608
|
if (this.__zooming) {
|
|
2609
|
-
var o = H(this,
|
|
2610
|
-
for (
|
|
2611
|
-
m =
|
|
2609
|
+
var o = H(this, v).event(s), d = s.changedTouches, g = d.length, h, m, x, R;
|
|
2610
|
+
for (Be(s), h = 0; h < g; ++h)
|
|
2611
|
+
m = d[h], x = xe(m, this), o.touch0 && o.touch0[2] === m.identifier ? o.touch0[0] = x : o.touch1 && o.touch1[2] === m.identifier && (o.touch1[0] = x);
|
|
2612
2612
|
if (m = o.that.__zoom, o.touch1) {
|
|
2613
|
-
var
|
|
2614
|
-
m =
|
|
2615
|
-
} else if (o.touch0) x = o.touch0[0],
|
|
2613
|
+
var E = o.touch0[0], b = o.touch0[1], I = o.touch1[0], L = o.touch1[1], U = (U = I[0] - E[0]) * U + (U = I[1] - E[1]) * U, Y = (Y = L[0] - b[0]) * Y + (Y = L[1] - b[1]) * Y;
|
|
2614
|
+
m = F(m, Math.sqrt(U / Y)), x = [(E[0] + I[0]) / 2, (E[1] + I[1]) / 2], R = [(b[0] + L[0]) / 2, (b[1] + L[1]) / 2];
|
|
2615
|
+
} else if (o.touch0) x = o.touch0[0], R = o.touch0[1];
|
|
2616
2616
|
else return;
|
|
2617
|
-
o.zoom("touch", n(D(m, x,
|
|
2617
|
+
o.zoom("touch", n(D(m, x, R), o.extent, l));
|
|
2618
2618
|
}
|
|
2619
2619
|
}
|
|
2620
|
-
function
|
|
2620
|
+
function M(s, ...v) {
|
|
2621
2621
|
if (this.__zooming) {
|
|
2622
|
-
var o = H(this,
|
|
2623
|
-
for (
|
|
2622
|
+
var o = H(this, v).event(s), d = s.changedTouches, g = d.length, h, m;
|
|
2623
|
+
for (vt(s), w && clearTimeout(w), w = setTimeout(function() {
|
|
2624
2624
|
w = null;
|
|
2625
2625
|
}, A), h = 0; h < g; ++h)
|
|
2626
|
-
m =
|
|
2626
|
+
m = d[h], o.touch0 && o.touch0[2] === m.identifier ? delete o.touch0 : o.touch1 && o.touch1[2] === m.identifier && delete o.touch1;
|
|
2627
2627
|
if (o.touch1 && !o.touch0 && (o.touch0 = o.touch1, delete o.touch1), o.touch0) o.touch0[1] = this.__zoom.invert(o.touch0[0]);
|
|
2628
2628
|
else if (o.end(), o.taps === 2 && (m = xe(m, this), Math.hypot(y[0] - m[0], y[1] - m[1]) < $)) {
|
|
2629
|
-
var x =
|
|
2629
|
+
var x = ve(this).on("dblclick.zoom");
|
|
2630
2630
|
x && x.apply(this, arguments);
|
|
2631
2631
|
}
|
|
2632
2632
|
}
|
|
@@ -2674,62 +2674,62 @@ const tl = /* @__PURE__ */ _e({
|
|
|
2674
2674
|
},
|
|
2675
2675
|
emits: ["updateColorMap"],
|
|
2676
2676
|
setup(e, { emit: t }) {
|
|
2677
|
-
const n = e, r =
|
|
2678
|
-
let u = null, f = null, c = null,
|
|
2679
|
-
Q(() => n.colorMap,
|
|
2677
|
+
const n = e, r = T(null), a = T(null), i = T(null), l = T(null);
|
|
2678
|
+
let u = null, f = null, c = null, p = [], y = null, w = null, A = null, C = 0, S = 0, $ = 1;
|
|
2679
|
+
Q(() => n.colorMap, v, { deep: !0 });
|
|
2680
2680
|
function k(o) {
|
|
2681
2681
|
if (!o || o.length < 7) return [1, 0, 0];
|
|
2682
|
-
const
|
|
2683
|
-
return [
|
|
2682
|
+
const d = parseInt(o.slice(1, 3), 16) / 255, g = parseInt(o.slice(3, 5), 16) / 255, h = parseInt(o.slice(5, 7), 16) / 255;
|
|
2683
|
+
return [d, g, h].some(Number.isNaN) ? [1, 0, 0] : [d, g, h];
|
|
2684
2684
|
}
|
|
2685
|
-
const
|
|
2686
|
-
function D(o,
|
|
2685
|
+
const F = (o, d, g) => o + (d - o) * g;
|
|
2686
|
+
function D(o, d) {
|
|
2687
2687
|
const g = o.parentElement;
|
|
2688
|
-
g && ($ = window.devicePixelRatio || 1,
|
|
2688
|
+
g && ($ = window.devicePixelRatio || 1, C = g.clientWidth || 800, S = g.clientHeight || 400, o.style.width = `${C}px`, o.style.height = `${S}px`, o.width = Math.round(C * $), o.height = Math.round(S * $), d.viewport(0, 0, o.width, o.height));
|
|
2689
2689
|
}
|
|
2690
|
-
function z(o,
|
|
2691
|
-
var g, h, m, x,
|
|
2692
|
-
const J = (
|
|
2690
|
+
function z(o, d) {
|
|
2691
|
+
var g, h, m, x, R, E, b, I, L, U, Y, le;
|
|
2692
|
+
const J = (E = (R = (x = (m = (h = (g = n.metaData) == null ? void 0 : g.row_groups) == null ? void 0 : h[0]) == null ? void 0 : m.columns) == null ? void 0 : x[0]) == null ? void 0 : R.meta_data) == null ? void 0 : E.statistics, ue = (le = (Y = (U = (L = (I = (b = n.metaData) == null ? void 0 : b.row_groups) == null ? void 0 : I[0]) == null ? void 0 : L.columns) == null ? void 0 : U[1]) == null ? void 0 : Y.meta_data) == null ? void 0 : le.statistics, fe = Number((J == null ? void 0 : J.min_value) ?? -1), be = Number((J == null ? void 0 : J.max_value) ?? 1), Z = Number((ue == null ? void 0 : ue.min_value) ?? -1), he = Number((ue == null ? void 0 : ue.max_value) ?? 1), Ae = (fe + be) / 2, Bn = (Z + he) / 2, Fn = Math.max(1e-9, be - fe), On = Math.max(1e-9, he - Z), Pn = 2 / Math.max(Fn, On), Dn = y.x / o * 2 - 1, zn = -y.y / d * 2 + 1, ft = y.k * Pn, qn = Dn - ft * Ae, Yn = zn - ft * Bn;
|
|
2693
2693
|
return { s: ft, tx: qn, ty: Yn };
|
|
2694
2694
|
}
|
|
2695
|
-
function q(o,
|
|
2696
|
-
const { s: m, tx: x, ty:
|
|
2697
|
-
return { x:
|
|
2695
|
+
function q(o, d, g, h) {
|
|
2696
|
+
const { s: m, tx: x, ty: R } = z(g, h), E = o / g * 2 - 1, b = -(d / h * 2 - 1), I = (E - x) / m, L = (b - R) / m;
|
|
2697
|
+
return { x: I, y: L };
|
|
2698
2698
|
}
|
|
2699
|
-
function H(o,
|
|
2699
|
+
function H(o, d, g, h, m) {
|
|
2700
2700
|
if (!o.length || !y) return null;
|
|
2701
|
-
const x = q(
|
|
2702
|
-
let
|
|
2701
|
+
const x = q(d, g, h, m);
|
|
2702
|
+
let R = 1 / 0, E = null;
|
|
2703
2703
|
for (const b of o) {
|
|
2704
|
-
const
|
|
2705
|
-
U <
|
|
2704
|
+
const I = b.x - x.x, L = b.y - x.y, U = Math.hypot(I, L), Y = 3 / (y.k / 2);
|
|
2705
|
+
U < R && U < Y && (R = U, E = b);
|
|
2706
2706
|
}
|
|
2707
|
-
return
|
|
2707
|
+
return E;
|
|
2708
2708
|
}
|
|
2709
2709
|
function V() {
|
|
2710
|
-
var o,
|
|
2710
|
+
var o, d;
|
|
2711
2711
|
const g = [], h = ((o = n.metaData) == null ? void 0 : o.schema) || [], m = n.data;
|
|
2712
2712
|
for (let x = 0; x < m.length; x++) {
|
|
2713
|
-
const
|
|
2714
|
-
for (let
|
|
2715
|
-
const U = ((
|
|
2716
|
-
|
|
2713
|
+
const R = m[x], E = Number(R[0]), b = Number(R[1]), I = {};
|
|
2714
|
+
for (let L = 0; L < h.length; L++) {
|
|
2715
|
+
const U = ((d = h[L]) == null ? void 0 : d.name) ?? `col_${L}`;
|
|
2716
|
+
I[U] = R[L];
|
|
2717
2717
|
}
|
|
2718
2718
|
g.push({
|
|
2719
|
-
x:
|
|
2719
|
+
x: E,
|
|
2720
2720
|
y: b,
|
|
2721
|
-
rawX:
|
|
2721
|
+
rawX: E,
|
|
2722
2722
|
rawY: b,
|
|
2723
2723
|
color: [0.5, 0.5, 0.5],
|
|
2724
2724
|
id: x,
|
|
2725
|
-
attrs:
|
|
2725
|
+
attrs: I
|
|
2726
2726
|
});
|
|
2727
2727
|
}
|
|
2728
2728
|
return g;
|
|
2729
2729
|
}
|
|
2730
|
-
function K(o,
|
|
2730
|
+
function K(o, d, g) {
|
|
2731
2731
|
const h = o.createShader(o.VERTEX_SHADER);
|
|
2732
|
-
if (o.shaderSource(h,
|
|
2732
|
+
if (o.shaderSource(h, d), o.compileShader(h), !o.getShaderParameter(h, o.COMPILE_STATUS))
|
|
2733
2733
|
return console.error("Vertex shader error:", o.getShaderInfoLog(h)), null;
|
|
2734
2734
|
const m = o.createShader(o.FRAGMENT_SHADER);
|
|
2735
2735
|
if (o.shaderSource(m, g), o.compileShader(m), !o.getShaderParameter(m, o.COMPILE_STATUS))
|
|
@@ -2737,7 +2737,7 @@ const tl = /* @__PURE__ */ _e({
|
|
|
2737
2737
|
const x = o.createProgram();
|
|
2738
2738
|
return o.attachShader(x, h), o.attachShader(x, m), o.linkProgram(x), o.getProgramParameter(x, o.LINK_STATUS) ? (o.validateProgram(x), o.getProgramParameter(x, o.VALIDATE_STATUS) ? x : (console.error("Program validate error:", o.getProgramInfoLog(x)), null)) : (console.error("Program link error:", o.getProgramInfoLog(x)), null);
|
|
2739
2739
|
}
|
|
2740
|
-
function X(o,
|
|
2740
|
+
function X(o, d, g) {
|
|
2741
2741
|
if (!g.length) return null;
|
|
2742
2742
|
const h = o.createBuffer();
|
|
2743
2743
|
o.bindBuffer(o.ARRAY_BUFFER, h);
|
|
@@ -2745,33 +2745,33 @@ const tl = /* @__PURE__ */ _e({
|
|
|
2745
2745
|
o.bufferData(o.ARRAY_BUFFER, m, o.STATIC_DRAW);
|
|
2746
2746
|
const x = o.createBuffer();
|
|
2747
2747
|
o.bindBuffer(o.ARRAY_BUFFER, x);
|
|
2748
|
-
const
|
|
2749
|
-
o.bufferData(o.ARRAY_BUFFER,
|
|
2750
|
-
const
|
|
2748
|
+
const R = new Float32Array(g.flatMap((U) => U.color));
|
|
2749
|
+
o.bufferData(o.ARRAY_BUFFER, R, o.STATIC_DRAW);
|
|
2750
|
+
const E = o.getAttribLocation(d, "a_position"), b = o.getAttribLocation(d, "a_color"), I = o.getUniformLocation(d, "u_viewMatrix"), L = o.getUniformLocation(d, "u_pointSize");
|
|
2751
2751
|
return {
|
|
2752
|
-
program:
|
|
2752
|
+
program: d,
|
|
2753
2753
|
positionBuffer: h,
|
|
2754
2754
|
colorBuffer: x,
|
|
2755
|
-
positionAttributeLocation:
|
|
2755
|
+
positionAttributeLocation: E,
|
|
2756
2756
|
colorAttributeLocation: b,
|
|
2757
|
-
viewMatrixLocation:
|
|
2758
|
-
pointSizeLocation:
|
|
2757
|
+
viewMatrixLocation: I,
|
|
2758
|
+
pointSizeLocation: L,
|
|
2759
2759
|
count: g.length
|
|
2760
2760
|
};
|
|
2761
2761
|
}
|
|
2762
|
-
function P(o,
|
|
2763
|
-
if (!o || !
|
|
2762
|
+
function P(o, d, g, h = null) {
|
|
2763
|
+
if (!o || !d || !y) return;
|
|
2764
2764
|
const {
|
|
2765
2765
|
program: m,
|
|
2766
2766
|
positionBuffer: x,
|
|
2767
|
-
colorBuffer:
|
|
2768
|
-
positionAttributeLocation:
|
|
2767
|
+
colorBuffer: R,
|
|
2768
|
+
positionAttributeLocation: E,
|
|
2769
2769
|
colorAttributeLocation: b,
|
|
2770
|
-
viewMatrixLocation:
|
|
2771
|
-
pointSizeLocation:
|
|
2770
|
+
viewMatrixLocation: I,
|
|
2771
|
+
pointSizeLocation: L,
|
|
2772
2772
|
count: U
|
|
2773
|
-
} =
|
|
2774
|
-
o.clearColor(0, 0, 0, 1), o.clear(o.COLOR_BUFFER_BIT), o.useProgram(m), o.enableVertexAttribArray(
|
|
2773
|
+
} = d;
|
|
2774
|
+
o.clearColor(0, 0, 0, 1), o.clear(o.COLOR_BUFFER_BIT), o.useProgram(m), o.enableVertexAttribArray(E), o.bindBuffer(o.ARRAY_BUFFER, x), o.vertexAttribPointer(E, 2, o.FLOAT, !1, 0, 0), o.enableVertexAttribArray(b), o.bindBuffer(o.ARRAY_BUFFER, R), o.vertexAttribPointer(b, 3, o.FLOAT, !1, 0, 0);
|
|
2775
2775
|
const Y = o.canvas.clientWidth, le = o.canvas.clientHeight, { s: J, tx: ue, ty: fe } = z(Y, le), be = new Float32Array([
|
|
2776
2776
|
J,
|
|
2777
2777
|
0,
|
|
@@ -2790,13 +2790,13 @@ const tl = /* @__PURE__ */ _e({
|
|
|
2790
2790
|
0,
|
|
2791
2791
|
1
|
|
2792
2792
|
]);
|
|
2793
|
-
if (o.uniformMatrix4fv(
|
|
2793
|
+
if (o.uniformMatrix4fv(I, !1, be), o.uniform1f(L, Math.max(1.5, g * Math.sqrt(y.k) * $)), o.enable(o.BLEND), o.blendFunc(o.SRC_ALPHA, o.ONE_MINUS_SRC_ALPHA), o.drawArrays(o.POINTS, 0, U), h) {
|
|
2794
2794
|
const Z = o.createBuffer();
|
|
2795
|
-
o.bindBuffer(o.ARRAY_BUFFER, Z), o.bufferData(o.ARRAY_BUFFER, new Float32Array([h.x, h.y]), o.STATIC_DRAW), o.vertexAttribPointer(
|
|
2795
|
+
o.bindBuffer(o.ARRAY_BUFFER, Z), o.bufferData(o.ARRAY_BUFFER, new Float32Array([h.x, h.y]), o.STATIC_DRAW), o.vertexAttribPointer(E, 2, o.FLOAT, !1, 0, 0);
|
|
2796
2796
|
const he = o.createBuffer();
|
|
2797
|
-
o.bindBuffer(o.ARRAY_BUFFER, he), o.bufferData(o.ARRAY_BUFFER, new Float32Array([1, 1, 0.5]), o.STATIC_DRAW), o.vertexAttribPointer(b, 3, o.FLOAT, !1, 0, 0), o.uniform1f(
|
|
2797
|
+
o.bindBuffer(o.ARRAY_BUFFER, he), o.bufferData(o.ARRAY_BUFFER, new Float32Array([1, 1, 0.5]), o.STATIC_DRAW), o.vertexAttribPointer(b, 3, o.FLOAT, !1, 0, 0), o.uniform1f(L, Math.max(2.5, g * Math.sqrt(y.k) * 2.5 * $)), o.drawArrays(o.POINTS, 0, 1);
|
|
2798
2798
|
const Ae = o.createBuffer();
|
|
2799
|
-
o.bindBuffer(o.ARRAY_BUFFER, Ae), o.bufferData(o.ARRAY_BUFFER, new Float32Array([1, 0.8, 0.2]), o.STATIC_DRAW), o.vertexAttribPointer(b, 3, o.FLOAT, !1, 0, 0), o.uniform1f(
|
|
2799
|
+
o.bindBuffer(o.ARRAY_BUFFER, Ae), o.bufferData(o.ARRAY_BUFFER, new Float32Array([1, 0.8, 0.2]), o.STATIC_DRAW), o.vertexAttribPointer(b, 3, o.FLOAT, !1, 0, 0), o.uniform1f(L, Math.max(3, g * Math.sqrt(y.k) * 3 * $)), o.drawArrays(o.POINTS, 0, 1), o.deleteBuffer(Z), o.deleteBuffer(he), o.deleteBuffer(Ae);
|
|
2800
2800
|
}
|
|
2801
2801
|
}
|
|
2802
2802
|
function ne() {
|
|
@@ -2830,19 +2830,19 @@ const tl = /* @__PURE__ */ _e({
|
|
|
2830
2830
|
if (dist > 0.4) { alpha = 1.0 - (dist - 0.4) * 2.0; }
|
|
2831
2831
|
gl_FragColor = vec4(v_color, alpha);
|
|
2832
2832
|
}
|
|
2833
|
-
`), f && (u.useProgram(f),
|
|
2833
|
+
`), f && (u.useProgram(f), p = V(), c = X(u, f, p), y = lt.translate(C / 2, S / 2).scale(1), w = el().scaleExtent([0.1, 100]).on("zoom", (o) => {
|
|
2834
2834
|
y = o.transform, P(u, c, 2, A);
|
|
2835
|
-
}),
|
|
2835
|
+
}), ve(a.value).call(w), requestAnimationFrame(() => P(u, c, 2, null)), a.value.addEventListener("mousemove", _), a.value.addEventListener("mouseleave", M));
|
|
2836
2836
|
}
|
|
2837
2837
|
}
|
|
2838
2838
|
function _(o) {
|
|
2839
|
-
var
|
|
2839
|
+
var d, g, h, m, x;
|
|
2840
2840
|
if (!a.value) return;
|
|
2841
|
-
const
|
|
2842
|
-
if (
|
|
2843
|
-
const
|
|
2844
|
-
|
|
2845
|
-
const U = ((
|
|
2841
|
+
const R = a.value.getBoundingClientRect(), E = o.clientX - R.left, b = o.clientY - R.top, I = H(p, E, b, C, S);
|
|
2842
|
+
if (I) {
|
|
2843
|
+
const L = i.value;
|
|
2844
|
+
L.style.left = `${o.clientX + 15}px`, L.style.top = `${o.clientY - 15}px`, L.style.opacity = "1";
|
|
2845
|
+
const U = ((d = n.metaData) == null ? void 0 : d.schema) || [], Y = U.findIndex((Z) => (Z == null ? void 0 : Z.name) === n.colorMode), le = n.colorMode, J = Y >= 0 ? (h = I.attrs) == null ? void 0 : h[((g = U[Y]) == null ? void 0 : g.name) || ""] : void 0;
|
|
2846
2846
|
let ue = "";
|
|
2847
2847
|
const fe = n.selectedMapEntries;
|
|
2848
2848
|
J !== void 0 && (fe instanceof Map ? ue = fe.has(J) ? String(J) : "" : Array.isArray(fe) && (ue = fe.some(([Z]) => Z === J) ? String(J) : ""));
|
|
@@ -2850,63 +2850,63 @@ const tl = /* @__PURE__ */ _e({
|
|
|
2850
2850
|
for (let Z = 2; Z < Math.min(U.length, 7); Z++) {
|
|
2851
2851
|
const he = (m = U[Z]) == null ? void 0 : m.name;
|
|
2852
2852
|
if (!he) continue;
|
|
2853
|
-
const Ae = (x =
|
|
2853
|
+
const Ae = (x = I.attrs) == null ? void 0 : x[he];
|
|
2854
2854
|
be.push(`<div><em>${he}</em>: ${Ae === void 0 ? "—" : String(Ae)}</div>`);
|
|
2855
2855
|
}
|
|
2856
|
-
|
|
2857
|
-
<strong>(${
|
|
2856
|
+
L.innerHTML = `
|
|
2857
|
+
<strong>(${I.rawX.toFixed(2)}, ${I.rawY.toFixed(2)})</strong>
|
|
2858
2858
|
${Y >= 0 ? `<div><b>${le}</b>: ${ue || String(J)}</div>` : ""}
|
|
2859
2859
|
${be.join("")}
|
|
2860
|
-
`, A =
|
|
2860
|
+
`, A = I, P(u, c, 2, A);
|
|
2861
2861
|
} else
|
|
2862
2862
|
i.value && (i.value.style.opacity = "0"), A !== null && (A = null, P(u, c, 2, null));
|
|
2863
2863
|
}
|
|
2864
|
-
function
|
|
2864
|
+
function M() {
|
|
2865
2865
|
i.value && (i.value.style.opacity = "0"), A !== null && (A = null, P(u, c, 2, null));
|
|
2866
2866
|
}
|
|
2867
2867
|
function s() {
|
|
2868
2868
|
!a.value || !u || (D(a.value, u), P(u, c, 2, A));
|
|
2869
2869
|
}
|
|
2870
|
-
function
|
|
2870
|
+
function v() {
|
|
2871
2871
|
var o;
|
|
2872
2872
|
if (!u || !c || !n.data.length) return;
|
|
2873
|
-
const
|
|
2873
|
+
const d = (((o = n.metaData) == null ? void 0 : o.schema) || []).findIndex((E) => (E == null ? void 0 : E.name) === n.colorMode), g = d >= 0 ? d : -1, h = k(n.startColor), m = k(n.endColor);
|
|
2874
2874
|
let x = [];
|
|
2875
2875
|
if (n.colorMap && n.colorMap.size > 0 && g >= 0)
|
|
2876
|
-
x = n.data.flatMap((
|
|
2876
|
+
x = n.data.flatMap((E) => n.colorMap.get(E[g]) || [0.6, 0.6, 0.6]);
|
|
2877
2877
|
else if (g >= 0) {
|
|
2878
|
-
const
|
|
2879
|
-
x = n.data.flatMap((
|
|
2880
|
-
const U = Number(
|
|
2878
|
+
const E = n.data.map((L) => Number(L[g])).filter(Number.isFinite), b = Math.min(...E), I = Math.max(...E) - b || 1;
|
|
2879
|
+
x = n.data.flatMap((L) => {
|
|
2880
|
+
const U = Number(L[g]), Y = Math.max(0, Math.min(1, (U - b) / I));
|
|
2881
2881
|
return [
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2882
|
+
F(h[0], m[0], Y),
|
|
2883
|
+
F(h[1], m[1], Y),
|
|
2884
|
+
F(h[2], m[2], Y)
|
|
2885
2885
|
];
|
|
2886
2886
|
});
|
|
2887
2887
|
} else {
|
|
2888
|
-
const
|
|
2889
|
-
x = n.data.flatMap(() =>
|
|
2888
|
+
const E = k(n.singleColor);
|
|
2889
|
+
x = n.data.flatMap(() => E);
|
|
2890
2890
|
}
|
|
2891
2891
|
u.deleteBuffer(c.colorBuffer);
|
|
2892
|
-
const
|
|
2893
|
-
u.bindBuffer(u.ARRAY_BUFFER,
|
|
2892
|
+
const R = u.createBuffer();
|
|
2893
|
+
u.bindBuffer(u.ARRAY_BUFFER, R), u.bufferData(u.ARRAY_BUFFER, new Float32Array(x), u.STATIC_DRAW), c.colorBuffer = R, P(u, c, 2, A);
|
|
2894
2894
|
}
|
|
2895
2895
|
return Q(() => n.forceRegenerate, () => {
|
|
2896
|
-
!u || !f || (
|
|
2896
|
+
!u || !f || (p = V(), c && (u.deleteBuffer(c.positionBuffer), u.deleteBuffer(c.colorBuffer)), c = X(u, f, p), y = lt, a.value && w && ve(a.value).call(w.transform, y), v(), P(u, c, 2, null));
|
|
2897
2897
|
}), Q(() => n.data, () => {
|
|
2898
2898
|
if (!u || !f) {
|
|
2899
2899
|
ne();
|
|
2900
2900
|
return;
|
|
2901
2901
|
}
|
|
2902
|
-
|
|
2903
|
-
}), Q(() => n.colorMode,
|
|
2904
|
-
!u || !f || (
|
|
2902
|
+
p = V(), c && (u.deleteBuffer(c.positionBuffer), u.deleteBuffer(c.colorBuffer)), c = X(u, f, p), v(), P(u, c, 2, null);
|
|
2903
|
+
}), Q(() => n.colorMode, v), Q([() => n.startColor, () => n.endColor, () => n.singleColor], v), Q(() => n.pointCount, (o) => {
|
|
2904
|
+
!u || !f || (p = V(), c && (u.deleteBuffer(c.positionBuffer), u.deleteBuffer(c.colorBuffer)), c = X(u, f, p), v(), P(u, c, 2, null));
|
|
2905
2905
|
}), Ve(() => {
|
|
2906
2906
|
window.addEventListener("resize", s);
|
|
2907
|
-
}),
|
|
2908
|
-
a.value && (a.value.removeEventListener("mousemove", _), a.value.removeEventListener("mouseleave",
|
|
2909
|
-
}), (o,
|
|
2907
|
+
}), Tt(() => {
|
|
2908
|
+
a.value && (a.value.removeEventListener("mousemove", _), a.value.removeEventListener("mouseleave", M)), window.removeEventListener("resize", s), u && c && (u.deleteBuffer(c.positionBuffer), u.deleteBuffer(c.colorBuffer), f && u.deleteProgram(f));
|
|
2909
|
+
}), (o, d) => (B(), O("div", {
|
|
2910
2910
|
class: "scatterplot-container",
|
|
2911
2911
|
ref_key: "containerRef",
|
|
2912
2912
|
ref: r
|
|
@@ -2920,7 +2920,7 @@ const tl = /* @__PURE__ */ _e({
|
|
|
2920
2920
|
ref_key: "tooltipRef",
|
|
2921
2921
|
ref: i
|
|
2922
2922
|
}, null, 512),
|
|
2923
|
-
|
|
2923
|
+
Re(N("div", {
|
|
2924
2924
|
id: "debug",
|
|
2925
2925
|
ref_key: "debugRef",
|
|
2926
2926
|
ref: l
|
|
@@ -2929,7 +2929,7 @@ const tl = /* @__PURE__ */ _e({
|
|
|
2929
2929
|
])
|
|
2930
2930
|
], 512));
|
|
2931
2931
|
}
|
|
2932
|
-
}), nl = /* @__PURE__ */
|
|
2932
|
+
}), nl = /* @__PURE__ */ Le(tl, [["__scopeId", "data-v-aa7d57bd"]]), rl = { class: "control-panel" }, al = { class: "color-option" }, ol = ["value"], il = {
|
|
2933
2933
|
key: 0,
|
|
2934
2934
|
class: "color-option"
|
|
2935
2935
|
}, ll = { class: "legend" }, ul = { class: "legend-label" }, sl = /* @__PURE__ */ _e({
|
|
@@ -2954,31 +2954,31 @@ const tl = /* @__PURE__ */ _e({
|
|
|
2954
2954
|
"updateColorMap"
|
|
2955
2955
|
],
|
|
2956
2956
|
setup(e, { emit: t }) {
|
|
2957
|
-
const n = e, r = t, a =
|
|
2957
|
+
const n = e, r = t, a = T(n.pointCount), i = T(n.colorMode), l = T(n.startColor), u = T(n.endColor), f = T(n.singleColor), c = j(
|
|
2958
2958
|
() => n.colorMapMap instanceof Map ? Array.from(n.colorMapMap.keys()) : []
|
|
2959
|
-
),
|
|
2959
|
+
), p = j(
|
|
2960
2960
|
() => n.colorMapMap instanceof Map ? n.colorMapMap.get(i.value) : void 0
|
|
2961
|
-
), y = j(() =>
|
|
2962
|
-
function w(
|
|
2963
|
-
if (!
|
|
2964
|
-
const [S, $, k] =
|
|
2961
|
+
), y = j(() => p.value ? Array.from(p.value.entries()) : []);
|
|
2962
|
+
function w(C) {
|
|
2963
|
+
if (!C) return "rgb(150,150,150)";
|
|
2964
|
+
const [S, $, k] = C;
|
|
2965
2965
|
return `rgb(${Math.round(S * 255)}, ${Math.round($ * 255)}, ${Math.round(k * 255)})`;
|
|
2966
2966
|
}
|
|
2967
2967
|
function A() {
|
|
2968
|
-
r("update:colorMode", i.value), r("updateColorMap", [i.value,
|
|
2968
|
+
r("update:colorMode", i.value), r("updateColorMap", [i.value, p.value ?? /* @__PURE__ */ new Map()]), r("update:startColor", l.value), r("update:endColor", u.value), r("update:singleColor", f.value);
|
|
2969
2969
|
}
|
|
2970
|
-
return Q(() => n.pointCount, (
|
|
2970
|
+
return Q(() => n.pointCount, (C) => a.value = C), Q(() => n.colorMode, (C) => i.value = C), Q(() => n.startColor, (C) => l.value = C), Q(() => n.endColor, (C) => u.value = C), Q(() => n.singleColor, (C) => f.value = C), Q(i, A), Q(() => n.colorMapMap, () => {
|
|
2971
2971
|
n.colorMapMap instanceof Map && (i.value !== "random" && !n.colorMapMap.has(i.value) && (i.value = "random"), A());
|
|
2972
|
-
}), (
|
|
2972
|
+
}), (C, S) => (B(), O("div", rl, [
|
|
2973
2973
|
S[4] || (S[4] = N("h3", null, "Color Controls", -1)),
|
|
2974
2974
|
N("div", al, [
|
|
2975
2975
|
S[2] || (S[2] = N("label", { for: "colorMode" }, "Color Mode:", -1)),
|
|
2976
|
-
|
|
2976
|
+
Re(N("select", {
|
|
2977
2977
|
id: "colorMode",
|
|
2978
2978
|
"onUpdate:modelValue": S[0] || (S[0] = ($) => i.value = $)
|
|
2979
2979
|
}, [
|
|
2980
2980
|
S[1] || (S[1] = N("option", { value: "random" }, "all", -1)),
|
|
2981
|
-
(
|
|
2981
|
+
(B(!0), O(re, null, de(c.value, ($) => (B(), O("option", {
|
|
2982
2982
|
key: $,
|
|
2983
2983
|
value: $
|
|
2984
2984
|
}, G($), 9, ol))), 128))
|
|
@@ -2986,12 +2986,12 @@ const tl = /* @__PURE__ */ _e({
|
|
|
2986
2986
|
[_t, i.value]
|
|
2987
2987
|
])
|
|
2988
2988
|
]),
|
|
2989
|
-
y.value.length ? (
|
|
2989
|
+
y.value.length ? (B(), O("div", il, [
|
|
2990
2990
|
N("div", ll, [
|
|
2991
2991
|
S[3] || (S[3] = N("h4", null, "Legend", -1)),
|
|
2992
|
-
(
|
|
2992
|
+
(B(!0), O(re, null, de(y.value, ([$, k], F) => (B(), O("div", {
|
|
2993
2993
|
class: "legend-item",
|
|
2994
|
-
key: `${$}-${
|
|
2994
|
+
key: `${$}-${F}`
|
|
2995
2995
|
}, [
|
|
2996
2996
|
N("div", {
|
|
2997
2997
|
class: "legend-color",
|
|
@@ -3000,10 +3000,10 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3000
3000
|
N("div", ul, G($), 1)
|
|
3001
3001
|
]))), 128))
|
|
3002
3002
|
])
|
|
3003
|
-
])) :
|
|
3003
|
+
])) : Ee("", !0)
|
|
3004
3004
|
]));
|
|
3005
3005
|
}
|
|
3006
|
-
}), cl = /* @__PURE__ */
|
|
3006
|
+
}), cl = /* @__PURE__ */ Le(sl, [["__scopeId", "data-v-832c88a6"]]), fl = { class: "app-container" }, dt = "UMAP_1", mt = "UMAP_2", hl = /* @__PURE__ */ _e({
|
|
3007
3007
|
__name: "wrapper",
|
|
3008
3008
|
props: {
|
|
3009
3009
|
apiUrl: {},
|
|
@@ -3013,33 +3013,33 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3013
3013
|
srcFileId: {}
|
|
3014
3014
|
},
|
|
3015
3015
|
setup(e) {
|
|
3016
|
-
const t = e, n =
|
|
3016
|
+
const t = e, n = T(5e3), r = T("random"), a = T("#ff0000"), i = T("#0000ff"), l = T("#4285f4"), u = T(!1), f = T(0), c = T([]), p = T(null), y = T(/* @__PURE__ */ new Map()), w = T(/* @__PURE__ */ new Map()), A = T([]), C = It(), S = T(null), $ = T(null), k = j(() => C.formatIdFromUrl(t.srcUrl));
|
|
3017
3017
|
Q(
|
|
3018
3018
|
() => {
|
|
3019
|
-
var
|
|
3019
|
+
var v, o, d, g;
|
|
3020
3020
|
return {
|
|
3021
3021
|
srcUrl: t.srcUrl,
|
|
3022
3022
|
srcFileType: t.srcFileType,
|
|
3023
3023
|
srcFileId: t.srcFileId,
|
|
3024
|
-
pkgId: ((o = (
|
|
3025
|
-
pkgType: ((g = (
|
|
3024
|
+
pkgId: ((o = (v = t.pkg) == null ? void 0 : v.content) == null ? void 0 : o.id) || "",
|
|
3025
|
+
pkgType: ((g = (d = t.pkg) == null ? void 0 : d.content) == null ? void 0 : g.packageType) || "",
|
|
3026
3026
|
apiUrl: t.apiUrl || ""
|
|
3027
3027
|
};
|
|
3028
3028
|
},
|
|
3029
|
-
async ({ srcUrl:
|
|
3030
|
-
var x,
|
|
3029
|
+
async ({ srcUrl: v, srcFileType: o, srcFileId: d, pkgId: g, pkgType: h, apiUrl: m }) => {
|
|
3030
|
+
var x, R, E;
|
|
3031
3031
|
try {
|
|
3032
|
-
if (c.value = [],
|
|
3033
|
-
const b = o ?? (
|
|
3034
|
-
await D(
|
|
3032
|
+
if (c.value = [], p.value = null, await F(), v) {
|
|
3033
|
+
const b = o ?? (v.toLowerCase().endsWith(".csv") ? "csv" : "parquet");
|
|
3034
|
+
await D(v, b, k.value), await z();
|
|
3035
3035
|
return;
|
|
3036
3036
|
}
|
|
3037
3037
|
if (g && m) {
|
|
3038
3038
|
await K(g, m);
|
|
3039
|
-
const b = (
|
|
3039
|
+
const b = (E = (R = (x = A.value) == null ? void 0 : x[0]) == null ? void 0 : R.content) == null ? void 0 : E.id;
|
|
3040
3040
|
if (!b) return;
|
|
3041
|
-
const
|
|
3042
|
-
await D(
|
|
3041
|
+
const I = await X(g, b, m);
|
|
3042
|
+
await D(I, h === "CSV" ? "csv" : "parquet", b), await z();
|
|
3043
3043
|
}
|
|
3044
3044
|
} catch (b) {
|
|
3045
3045
|
console.error("[UMAP Wrapper] Load failed:", (b == null ? void 0 : b.message) || b);
|
|
@@ -3048,66 +3048,66 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3048
3048
|
{ immediate: !0 }
|
|
3049
3049
|
), Q(n, async () => {
|
|
3050
3050
|
$.value && S.value && await q();
|
|
3051
|
-
}), Q([() =>
|
|
3052
|
-
|
|
3051
|
+
}), Q([() => C.sharedVersion, () => C.sharedResultName], async () => {
|
|
3052
|
+
C.sharedResultName && (await F(), $.value = C.sharedResultName, await z());
|
|
3053
3053
|
});
|
|
3054
|
-
async function
|
|
3054
|
+
async function F() {
|
|
3055
3055
|
if (S.value) return;
|
|
3056
|
-
const { connectionId:
|
|
3057
|
-
S.value =
|
|
3056
|
+
const { connectionId: v } = await C.createConnection(`umap_${Date.now()}`);
|
|
3057
|
+
S.value = v;
|
|
3058
3058
|
}
|
|
3059
|
-
async function D(
|
|
3060
|
-
const g = `umap_${
|
|
3061
|
-
$.value = await
|
|
3059
|
+
async function D(v, o, d) {
|
|
3060
|
+
const g = `umap_${d.replace(/[^a-zA-Z0-9_]/g, "_")}`;
|
|
3061
|
+
$.value = await C.loadFile(v, o, g, {}, S.value, d);
|
|
3062
3062
|
}
|
|
3063
3063
|
async function z() {
|
|
3064
|
-
var
|
|
3064
|
+
var v, o, d, g;
|
|
3065
3065
|
if (!$.value || !S.value) return;
|
|
3066
|
-
const h = await s($.value), m = h.filter((
|
|
3067
|
-
await q(x,
|
|
3066
|
+
const h = await s($.value), m = h.filter((E) => /DOUBLE|HUGEINT|BIGINT|INTEGER|DECIMAL|FLOAT|REAL/i.test(E.type)), x = h.some((E) => E.name === dt) ? dt : ((v = m[0]) == null ? void 0 : v.name) || ((o = h[0]) == null ? void 0 : o.name), R = h.some((E) => E.name === mt) ? mt : ((d = m[1]) == null ? void 0 : d.name) || ((g = h[1]) == null ? void 0 : g.name) || x;
|
|
3067
|
+
await q(x, R, h.map((E) => E.name)), await H(h, x, R);
|
|
3068
3068
|
}
|
|
3069
|
-
async function q(
|
|
3069
|
+
async function q(v = dt, o = mt, d) {
|
|
3070
3070
|
var g;
|
|
3071
3071
|
if (!$.value || !S.value) return;
|
|
3072
|
-
const h = (
|
|
3073
|
-
`CAST(${P(
|
|
3072
|
+
const h = (d || (await s($.value)).map((b) => b.name)).filter((b) => b !== v && b !== o), m = `SELECT ${[
|
|
3073
|
+
`CAST(${P(v)} AS DOUBLE) AS __x`,
|
|
3074
3074
|
`CAST(${P(o)} AS DOUBLE) AS __y`,
|
|
3075
3075
|
...h.map((b) => P(b))
|
|
3076
|
-
].join(", ")} FROM ${$.value} LIMIT ${n.value}`, x = await
|
|
3077
|
-
c.value = x.map((b) => [b.__x, b.__y, ...h.map((
|
|
3078
|
-
const
|
|
3079
|
-
SELECT min(${P(
|
|
3076
|
+
].join(", ")} FROM ${$.value} LIMIT ${n.value}`, x = await C.executeQuery(m, S.value);
|
|
3077
|
+
c.value = x.map((b) => [b.__x, b.__y, ...h.map((I) => b[I])]);
|
|
3078
|
+
const R = `
|
|
3079
|
+
SELECT min(${P(v)}) AS xmin, max(${P(v)}) AS xmax,
|
|
3080
3080
|
min(${P(o)}) AS ymin, max(${P(o)}) AS ymax
|
|
3081
3081
|
FROM ${$.value}
|
|
3082
|
-
`,
|
|
3083
|
-
|
|
3084
|
-
schema: [{ name:
|
|
3082
|
+
`, E = ((g = await C.executeQuery(R, S.value)) == null ? void 0 : g[0]) || { xmin: -1, xmax: 1, ymin: -1, ymax: 1 };
|
|
3083
|
+
p.value = {
|
|
3084
|
+
schema: [{ name: v }, { name: o }, ...h.map((b) => ({ name: b }))],
|
|
3085
3085
|
row_groups: [
|
|
3086
3086
|
{
|
|
3087
3087
|
columns: [
|
|
3088
|
-
{ meta_data: { statistics: { min_value:
|
|
3089
|
-
{ meta_data: { statistics: { min_value:
|
|
3088
|
+
{ meta_data: { statistics: { min_value: E.xmin, max_value: E.xmax } } },
|
|
3089
|
+
{ meta_data: { statistics: { min_value: E.ymin, max_value: E.ymax } } }
|
|
3090
3090
|
]
|
|
3091
3091
|
}
|
|
3092
3092
|
]
|
|
3093
3093
|
};
|
|
3094
3094
|
}
|
|
3095
|
-
async function H(
|
|
3095
|
+
async function H(v, o, d) {
|
|
3096
3096
|
w.value = /* @__PURE__ */ new Map();
|
|
3097
3097
|
const g = ["#4269d0", "#efb118", "#ff725c", "#6cc5b0", "#3ca951", "#ff8ab7", "#a463f2", "#97bbf5", "#9c6b4e", "#9498a0"], h = (m) => /DOUBLE|HUGEINT|BIGINT|INTEGER|DECIMAL|FLOAT|REAL/i.test(m);
|
|
3098
|
-
for (const m of
|
|
3099
|
-
if (m.name === o || m.name ===
|
|
3098
|
+
for (const m of v) {
|
|
3099
|
+
if (m.name === o || m.name === d) {
|
|
3100
3100
|
w.value.set(m.name, /* @__PURE__ */ new Map());
|
|
3101
3101
|
continue;
|
|
3102
3102
|
}
|
|
3103
3103
|
if (h(m.type))
|
|
3104
3104
|
w.value.set(m.name, /* @__PURE__ */ new Map());
|
|
3105
3105
|
else {
|
|
3106
|
-
const x = `SELECT DISTINCT ${P(m.name)} AS v FROM ${$.value} LIMIT 10000`,
|
|
3107
|
-
|
|
3106
|
+
const x = `SELECT DISTINCT ${P(m.name)} AS v FROM ${$.value} LIMIT 10000`, R = (await C.executeQuery(x, S.value)).map((b) => b.v).filter((b) => b != null), E = /* @__PURE__ */ new Map();
|
|
3107
|
+
R.forEach((b, I) => E.set(b, _(g[I % g.length]))), w.value.set(m.name, E);
|
|
3108
3108
|
}
|
|
3109
3109
|
}
|
|
3110
|
-
(
|
|
3110
|
+
(p.value || (p.value = {})).key_value_metadata = Array.from(w.value.keys()).map((m) => {
|
|
3111
3111
|
var x;
|
|
3112
3112
|
return {
|
|
3113
3113
|
key: m,
|
|
@@ -3116,48 +3116,48 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3116
3116
|
}), r.value !== "random" && !w.value.has(r.value) && (r.value = "random");
|
|
3117
3117
|
}
|
|
3118
3118
|
async function V() {
|
|
3119
|
-
const { useGetToken:
|
|
3120
|
-
return
|
|
3119
|
+
const { useGetToken: v } = await import("./useGetToken-DaxIvkvl-BZdrKpSJ.mjs");
|
|
3120
|
+
return v();
|
|
3121
3121
|
}
|
|
3122
|
-
async function K(
|
|
3123
|
-
const
|
|
3122
|
+
async function K(v, o) {
|
|
3123
|
+
const d = await V(), g = `${o}/packages/${v}/view?api_key=${d}`, h = await fetch(g);
|
|
3124
3124
|
if (!h.ok) throw new Error(`view failed: ${h.status}`);
|
|
3125
3125
|
A.value = await h.json();
|
|
3126
3126
|
}
|
|
3127
|
-
async function X(
|
|
3128
|
-
const g = await V(), h = `${
|
|
3127
|
+
async function X(v, o, d) {
|
|
3128
|
+
const g = await V(), h = `${d}/packages/${v}/files/${o}?api_key=${g}`, m = await fetch(h);
|
|
3129
3129
|
if (!m.ok) throw new Error(`file url failed: ${m.status}`);
|
|
3130
3130
|
return (await m.json()).url;
|
|
3131
3131
|
}
|
|
3132
|
-
function P(
|
|
3133
|
-
return `"${
|
|
3132
|
+
function P(v) {
|
|
3133
|
+
return `"${v.replace(/"/g, '""')}"`;
|
|
3134
3134
|
}
|
|
3135
3135
|
function ne() {
|
|
3136
3136
|
u.value = !u.value, f.value++;
|
|
3137
3137
|
}
|
|
3138
|
-
function _(
|
|
3138
|
+
function _(v) {
|
|
3139
3139
|
try {
|
|
3140
|
-
if (!
|
|
3141
|
-
const o = parseInt(
|
|
3142
|
-
return Number.isNaN(o) || Number.isNaN(
|
|
3140
|
+
if (!v || v.length < 7) return [1, 0, 0];
|
|
3141
|
+
const o = parseInt(v.slice(1, 3), 16) / 255, d = parseInt(v.slice(3, 5), 16) / 255, g = parseInt(v.slice(5, 7), 16) / 255;
|
|
3142
|
+
return Number.isNaN(o) || Number.isNaN(d) || Number.isNaN(g) ? [1, 0, 0] : [o, d, g];
|
|
3143
3143
|
} catch {
|
|
3144
3144
|
return [1, 0, 0];
|
|
3145
3145
|
}
|
|
3146
3146
|
}
|
|
3147
|
-
function
|
|
3148
|
-
y.value =
|
|
3147
|
+
function M(v) {
|
|
3148
|
+
y.value = v[1];
|
|
3149
3149
|
}
|
|
3150
|
-
async function s(
|
|
3151
|
-
return (await
|
|
3150
|
+
async function s(v) {
|
|
3151
|
+
return (await C.executeQuery(`PRAGMA table_info(${v});`, S.value)).map((o) => ({ name: o.name, type: o.type }));
|
|
3152
3152
|
}
|
|
3153
3153
|
return Ve(async () => {
|
|
3154
|
-
await
|
|
3155
|
-
}),
|
|
3156
|
-
S.value && await
|
|
3157
|
-
}), (
|
|
3158
|
-
(
|
|
3154
|
+
await F();
|
|
3155
|
+
}), Tt(async () => {
|
|
3156
|
+
S.value && await C.closeConnection(S.value);
|
|
3157
|
+
}), (v, o) => (B(), O("div", fl, [
|
|
3158
|
+
(B(), sn(nl, {
|
|
3159
3159
|
data: c.value,
|
|
3160
|
-
metaData:
|
|
3160
|
+
metaData: p.value,
|
|
3161
3161
|
pointCount: n.value,
|
|
3162
3162
|
"color-map": y.value,
|
|
3163
3163
|
colorMode: r.value,
|
|
@@ -3170,26 +3170,26 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3170
3170
|
}, null, 8, ["data", "metaData", "pointCount", "color-map", "colorMode", "startColor", "endColor", "singleColor", "selectedMapEntries", "forceRegenerate"])),
|
|
3171
3171
|
oe(cl, {
|
|
3172
3172
|
pointCount: n.value,
|
|
3173
|
-
"onUpdate:pointCount": o[0] || (o[0] = (
|
|
3173
|
+
"onUpdate:pointCount": o[0] || (o[0] = (d) => n.value = d),
|
|
3174
3174
|
colorMode: r.value,
|
|
3175
|
-
"onUpdate:colorMode": o[1] || (o[1] = (
|
|
3175
|
+
"onUpdate:colorMode": o[1] || (o[1] = (d) => r.value = d),
|
|
3176
3176
|
startColor: a.value,
|
|
3177
|
-
"onUpdate:startColor": o[2] || (o[2] = (
|
|
3177
|
+
"onUpdate:startColor": o[2] || (o[2] = (d) => a.value = d),
|
|
3178
3178
|
endColor: i.value,
|
|
3179
|
-
"onUpdate:endColor": o[3] || (o[3] = (
|
|
3179
|
+
"onUpdate:endColor": o[3] || (o[3] = (d) => i.value = d),
|
|
3180
3180
|
singleColor: l.value,
|
|
3181
|
-
"onUpdate:singleColor": o[4] || (o[4] = (
|
|
3181
|
+
"onUpdate:singleColor": o[4] || (o[4] = (d) => l.value = d),
|
|
3182
3182
|
"color-scheme": y.value,
|
|
3183
3183
|
"color-map-map": w.value,
|
|
3184
3184
|
onRegenerate: ne,
|
|
3185
|
-
onUpdateColorMap:
|
|
3185
|
+
onUpdateColorMap: M
|
|
3186
3186
|
}, null, 8, ["pointCount", "colorMode", "startColor", "endColor", "singleColor", "color-scheme", "color-map-map"])
|
|
3187
3187
|
]));
|
|
3188
3188
|
}
|
|
3189
|
-
}),
|
|
3189
|
+
}), pl = /* @__PURE__ */ Le(hl, [["__scopeId", "data-v-1515ae28"]]), vl = { class: "pp-container" }, dl = { class: "pp-header" }, ml = { class: "pp-controls" }, gl = { class: "pp-field" }, yl = ["disabled"], wl = { class: "pp-field" }, _l = ["disabled"], bl = ["value"], Al = ["value"], xl = ["disabled"], Ml = ["value"], El = { class: "pp-field" }, Cl = ["disabled"], Sl = {
|
|
3190
3190
|
key: 0,
|
|
3191
3191
|
class: "pp-message"
|
|
3192
|
-
}, gt = 100, yt = 12, wt = "(other)",
|
|
3192
|
+
}, gt = 100, yt = 12, wt = "(other)", kl = /* @__PURE__ */ _e({
|
|
3193
3193
|
__name: "proportionPlot",
|
|
3194
3194
|
props: {
|
|
3195
3195
|
apiUrl: {},
|
|
@@ -3202,25 +3202,25 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3202
3202
|
setup(e) {
|
|
3203
3203
|
const t = e;
|
|
3204
3204
|
let n;
|
|
3205
|
-
const r =
|
|
3205
|
+
const r = It(), a = T(null), i = T(null), l = T(
|
|
3206
3206
|
t.srcUrl || "https://temp-precision-dashboard-data.s3.us-east-1.amazonaws.com/precision_human_drg_data.parquet"
|
|
3207
|
-
), u = j(() => r.formatIdFromUrl(l.value)), f =
|
|
3207
|
+
), u = j(() => r.formatIdFromUrl(l.value)), f = T(!1), c = T(""), p = T([]), y = T(""), w = T(""), A = `proportion-plot-${Math.random().toString(36).slice(2)}`;
|
|
3208
3208
|
Q(
|
|
3209
3209
|
() => ({ srcUrl: t.srcUrl, srcFileType: t.srcFileType, srcFileId: t.srcFileId, pkg: t.pkg, apiUrl: t.apiUrl }),
|
|
3210
|
-
async ({ srcUrl: _, srcFileType:
|
|
3211
|
-
var
|
|
3210
|
+
async ({ srcUrl: _, srcFileType: M, srcFileId: s, pkg: v, apiUrl: o }) => {
|
|
3211
|
+
var d, g;
|
|
3212
3212
|
try {
|
|
3213
3213
|
if (_ && (l.value = _), await k(), l.value) {
|
|
3214
|
-
const x =
|
|
3214
|
+
const x = M ?? (l.value.toLowerCase().endsWith(".csv") ? "csv" : "parquet");
|
|
3215
3215
|
await D(x, u.value);
|
|
3216
3216
|
return;
|
|
3217
3217
|
}
|
|
3218
|
-
const h = (
|
|
3218
|
+
const h = (d = v == null ? void 0 : v.content) == null ? void 0 : d.id, m = (g = v == null ? void 0 : v.content) == null ? void 0 : g.packageType;
|
|
3219
3219
|
if (h && o) {
|
|
3220
3220
|
const x = await K(h, o);
|
|
3221
3221
|
if (!x) return;
|
|
3222
|
-
const
|
|
3223
|
-
l.value =
|
|
3222
|
+
const R = await X(h, x, o), E = m === "CSV" ? "csv" : "parquet", b = x.replace(/[^a-zA-Z0-9_.-]/g, "_");
|
|
3223
|
+
l.value = R, await D(E, b);
|
|
3224
3224
|
}
|
|
3225
3225
|
} catch (h) {
|
|
3226
3226
|
console.error("[ProportionPlot] Load failed:", (h == null ? void 0 : h.message) || h), c.value = `Load failed: ${(h == null ? void 0 : h.message) || h}`;
|
|
@@ -3228,30 +3228,30 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3228
3228
|
},
|
|
3229
3229
|
{ immediate: !0 }
|
|
3230
3230
|
);
|
|
3231
|
-
const
|
|
3231
|
+
const C = /* @__PURE__ */ new Set(["VARCHAR", "STRING", "TEXT", "BOOL", "BOOLEAN", "DATE", "TIMESTAMP"]), S = j(() => p.value.filter((_) => C.has(_.type) || _.type.startsWith("VARCHAR"))), $ = j(() => p.value.filter((_) => !C.has(_.type)));
|
|
3232
3232
|
async function k() {
|
|
3233
3233
|
if (a.value) return;
|
|
3234
3234
|
const { connectionId: _ } = await r.createConnection(`prop_${Date.now()}`);
|
|
3235
3235
|
a.value = _;
|
|
3236
3236
|
}
|
|
3237
|
-
function
|
|
3238
|
-
const
|
|
3239
|
-
return (/^[A-Za-z_]/.test(
|
|
3237
|
+
function F(_) {
|
|
3238
|
+
const M = String(_).replace(/[^A-Za-z0-9_]/g, "_");
|
|
3239
|
+
return (/^[A-Za-z_]/.test(M) ? M : `t_${M}`).slice(0, 63);
|
|
3240
3240
|
}
|
|
3241
|
-
async function D(_,
|
|
3241
|
+
async function D(_, M) {
|
|
3242
3242
|
a.value || await k();
|
|
3243
|
-
const s = (
|
|
3243
|
+
const s = (M || t.srcFileId || l.value || "file").replace(/[^A-Za-z0-9]/g, "_");
|
|
3244
3244
|
f.value = !0, c.value = "Loading file into DuckDB…";
|
|
3245
3245
|
try {
|
|
3246
|
-
const
|
|
3246
|
+
const v = _ ?? (l.value.toLowerCase().endsWith(".csv") ? "csv" : "parquet"), o = t.tableNameOverride || F(`file_${s.slice(0, 48)}`), d = await r.loadFile(
|
|
3247
3247
|
l.value,
|
|
3248
|
-
|
|
3248
|
+
v,
|
|
3249
3249
|
o,
|
|
3250
3250
|
{},
|
|
3251
3251
|
a.value,
|
|
3252
3252
|
s
|
|
3253
3253
|
);
|
|
3254
|
-
i.value =
|
|
3254
|
+
i.value = d, await q(!0);
|
|
3255
3255
|
} finally {
|
|
3256
3256
|
f.value = !1;
|
|
3257
3257
|
}
|
|
@@ -3260,14 +3260,14 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3260
3260
|
return '"' + String(_).replace(/"/g, '""') + '"';
|
|
3261
3261
|
}
|
|
3262
3262
|
async function q(_ = !1) {
|
|
3263
|
-
var
|
|
3263
|
+
var M, s, v, o;
|
|
3264
3264
|
if (!i.value || !a.value) return;
|
|
3265
|
-
const
|
|
3266
|
-
if (
|
|
3267
|
-
const h =
|
|
3268
|
-
y.value = ((
|
|
3265
|
+
const d = `PRAGMA table_info(${z(i.value)})`, g = await r.executeQuery(d, a.value);
|
|
3266
|
+
if (p.value = g.map((h) => ({ name: String(h.name), type: String(h.type).toUpperCase() })), _ || !y.value || !w.value) {
|
|
3267
|
+
const h = p.value.filter((m) => C.has(m.type) || m.type.startsWith("VARCHAR"));
|
|
3268
|
+
y.value = ((M = h[0]) == null ? void 0 : M.name) || ((s = p.value[0]) == null ? void 0 : s.name) || "", w.value = ((v = h[1]) == null ? void 0 : v.name) || ((o = h[0]) == null ? void 0 : o.name) || "";
|
|
3269
3269
|
}
|
|
3270
|
-
c.value = `Columns: ${
|
|
3270
|
+
c.value = `Columns: ${p.value.length}.`;
|
|
3271
3271
|
}
|
|
3272
3272
|
async function H() {
|
|
3273
3273
|
if (!(!i.value || !a.value)) {
|
|
@@ -3277,9 +3277,9 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3277
3277
|
}
|
|
3278
3278
|
f.value = !0, c.value = "Computing proportions…";
|
|
3279
3279
|
try {
|
|
3280
|
-
const _ = z(i.value),
|
|
3280
|
+
const _ = z(i.value), M = z(y.value), s = z(w.value), v = `
|
|
3281
3281
|
WITH xf AS (
|
|
3282
|
-
SELECT ${
|
|
3282
|
+
SELECT ${M} AS x, COUNT(*) AS c
|
|
3283
3283
|
FROM ${_}
|
|
3284
3284
|
GROUP BY 1
|
|
3285
3285
|
ORDER BY c DESC
|
|
@@ -3295,11 +3295,11 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3295
3295
|
filtered AS (
|
|
3296
3296
|
SELECT src.*
|
|
3297
3297
|
FROM ${_} AS src
|
|
3298
|
-
JOIN xf ON src.${
|
|
3298
|
+
JOIN xf ON src.${M} = xf.x -- <-- src."org.ident"
|
|
3299
3299
|
),
|
|
3300
3300
|
labeled AS (
|
|
3301
3301
|
SELECT
|
|
3302
|
-
${
|
|
3302
|
+
${M} AS x,
|
|
3303
3303
|
CASE
|
|
3304
3304
|
WHEN ${s} IN (SELECT y FROM yf) THEN COALESCE(${s}, '(missing)')
|
|
3305
3305
|
ELSE '${wt}'
|
|
@@ -3322,20 +3322,20 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3322
3322
|
JOIN denom d USING (x)
|
|
3323
3323
|
)
|
|
3324
3324
|
SELECT * FROM props ORDER BY x, y;
|
|
3325
|
-
`, o = await r.executeQuery(
|
|
3325
|
+
`, o = await r.executeQuery(v, a.value);
|
|
3326
3326
|
if (!o.length) {
|
|
3327
3327
|
c.value = "No rows returned. Try different columns.", n.purge(A);
|
|
3328
3328
|
return;
|
|
3329
3329
|
}
|
|
3330
|
-
const
|
|
3330
|
+
const d = Array.from(new Set(o.map((b) => String(b.x)))), g = Array.from(new Set(o.map((b) => String(b.y)))), h = (b, I) => `${b}\0${I}`, m = /* @__PURE__ */ new Map();
|
|
3331
3331
|
for (const b of o) m.set(h(String(b.x), String(b.y)), Number(b.p ?? 0));
|
|
3332
3332
|
const x = g.map((b) => ({
|
|
3333
3333
|
type: "bar",
|
|
3334
3334
|
name: b,
|
|
3335
|
-
x:
|
|
3336
|
-
y:
|
|
3335
|
+
x: d,
|
|
3336
|
+
y: d.map((I) => m.get(h(I, b)) ?? 0),
|
|
3337
3337
|
hovertemplate: `${w.value}=%{fullData.name}<br>${y.value}=%{x}<br>Proportion=%{y:.1%}<extra></extra>`
|
|
3338
|
-
})),
|
|
3338
|
+
})), R = {
|
|
3339
3339
|
title: `${w.value} proportions within ${y.value}`,
|
|
3340
3340
|
barmode: "stack",
|
|
3341
3341
|
yaxis: { range: [0, 1], tickformat: ".0%", title: "Proportion" },
|
|
@@ -3343,9 +3343,9 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3343
3343
|
legend: { orientation: "h", y: -0.2 },
|
|
3344
3344
|
margin: { t: 48, r: 16, b: 96, l: 56 }
|
|
3345
3345
|
};
|
|
3346
|
-
await n.newPlot(A, x,
|
|
3347
|
-
const
|
|
3348
|
-
c.value = `Plotted ${g.length} categories across ${
|
|
3346
|
+
await n.newPlot(A, x, R, { responsive: !0 });
|
|
3347
|
+
const E = (d.length >= gt ? ` Limited to top ${gt} ${y.value}.` : "") + (g.length >= yt || g.includes(wt) ? ` Limited to top ${yt} ${w.value} (+ ${wt}).` : "");
|
|
3348
|
+
c.value = `Plotted ${g.length} categories across ${d.length} groups.${E}`;
|
|
3349
3349
|
} catch (_) {
|
|
3350
3350
|
console.error(_), c.value = `Error: ${(_ == null ? void 0 : _.message) || _}`;
|
|
3351
3351
|
} finally {
|
|
@@ -3355,38 +3355,38 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3355
3355
|
}
|
|
3356
3356
|
async function V() {
|
|
3357
3357
|
}
|
|
3358
|
-
async function K(_,
|
|
3359
|
-
var s,
|
|
3360
|
-
const o = await V(),
|
|
3358
|
+
async function K(_, M) {
|
|
3359
|
+
var s, v;
|
|
3360
|
+
const o = await V(), d = `${M}/packages/${_}/view?api_key=${o}`, g = await fetch(d);
|
|
3361
3361
|
if (!g.ok) return null;
|
|
3362
3362
|
const h = await g.json();
|
|
3363
|
-
return (
|
|
3363
|
+
return (v = (s = h == null ? void 0 : h[0]) == null ? void 0 : s.content) == null ? void 0 : v.id;
|
|
3364
3364
|
}
|
|
3365
|
-
async function X(_,
|
|
3366
|
-
const
|
|
3367
|
-
if (!
|
|
3368
|
-
return (await
|
|
3365
|
+
async function X(_, M, s) {
|
|
3366
|
+
const v = await V(), o = `${s}/packages/${_}/files/${M}?api_key=${v}`, d = await fetch(o);
|
|
3367
|
+
if (!d.ok) throw new Error(`file url failed: ${d.status}`);
|
|
3368
|
+
return (await d.json()).url;
|
|
3369
3369
|
}
|
|
3370
3370
|
function P() {
|
|
3371
3371
|
return typeof window < "u" && typeof document < "u";
|
|
3372
3372
|
}
|
|
3373
3373
|
async function ne() {
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3374
|
+
return P() ? n || (await new Promise((_, M) => {
|
|
3375
|
+
const s = document.createElement("script");
|
|
3376
|
+
s.src = "https://cdn.plot.ly/plotly-2.35.3.min.js", s.onload = () => _(), s.onerror = () => M(new Error("Failed to load Plotly CDN")), document.head.appendChild(s);
|
|
3377
|
+
}), n = window.Plotly, console.log(n), n) : null;
|
|
3378
3378
|
}
|
|
3379
3379
|
return Ve(async () => {
|
|
3380
3380
|
await k(), await ne();
|
|
3381
|
-
}),
|
|
3381
|
+
}), Tt(async () => {
|
|
3382
3382
|
a.value && await r.closeConnection(a.value);
|
|
3383
|
-
}), (_,
|
|
3384
|
-
N("div",
|
|
3383
|
+
}), (_, M) => (B(), O("div", vl, [
|
|
3384
|
+
N("div", dl, [
|
|
3385
3385
|
N("div", ml, [
|
|
3386
3386
|
N("div", gl, [
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
"onUpdate:modelValue":
|
|
3387
|
+
M[3] || (M[3] = N("label", null, "Data URL", -1)),
|
|
3388
|
+
Re(N("input", {
|
|
3389
|
+
"onUpdate:modelValue": M[0] || (M[0] = (s) => l.value = s),
|
|
3390
3390
|
type: "text",
|
|
3391
3391
|
class: "pp-input pp-input--url",
|
|
3392
3392
|
disabled: f.value,
|
|
@@ -3396,56 +3396,58 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3396
3396
|
])
|
|
3397
3397
|
]),
|
|
3398
3398
|
N("div", wl, [
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
"
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
"
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3399
|
+
N("div", null, [
|
|
3400
|
+
M[5] || (M[5] = N("label", null, "X (group) column", -1)),
|
|
3401
|
+
Re(N("select", {
|
|
3402
|
+
"onUpdate:modelValue": M[1] || (M[1] = (s) => y.value = s),
|
|
3403
|
+
class: "pp-select",
|
|
3404
|
+
disabled: f.value || p.value.length === 0
|
|
3405
|
+
}, [
|
|
3406
|
+
M[4] || (M[4] = N("option", {
|
|
3407
|
+
disabled: "",
|
|
3408
|
+
value: ""
|
|
3409
|
+
}, "— choose —", -1)),
|
|
3410
|
+
(B(!0), O(re, null, de(S.value, (s) => (B(), O("option", {
|
|
3411
|
+
key: s.name,
|
|
3412
|
+
value: s.name
|
|
3413
|
+
}, G(s.name) + " (" + G(s.type) + ")", 9, bl))), 128)),
|
|
3414
|
+
(B(!0), O(re, null, de($.value, (s) => (B(), O("option", {
|
|
3415
|
+
key: s.name + "-num",
|
|
3416
|
+
value: s.name
|
|
3417
|
+
}, G(s.name) + " (" + G(s.type) + ")", 9, Al))), 128))
|
|
3418
|
+
], 8, _l), [
|
|
3419
|
+
[_t, y.value]
|
|
3420
|
+
])
|
|
3421
|
+
]),
|
|
3422
|
+
N("div", null, [
|
|
3423
|
+
M[7] || (M[7] = N("label", null, "Y (category) column", -1)),
|
|
3424
|
+
Re(N("select", {
|
|
3425
|
+
"onUpdate:modelValue": M[2] || (M[2] = (s) => w.value = s),
|
|
3426
|
+
class: "pp-select",
|
|
3427
|
+
disabled: f.value || p.value.length === 0
|
|
3428
|
+
}, [
|
|
3429
|
+
M[6] || (M[6] = N("option", {
|
|
3430
|
+
disabled: "",
|
|
3431
|
+
value: ""
|
|
3432
|
+
}, "— choose —", -1)),
|
|
3433
|
+
(B(!0), O(re, null, de(S.value, (s) => (B(), O("option", {
|
|
3434
|
+
key: s.name + "-y",
|
|
3435
|
+
value: s.name
|
|
3436
|
+
}, G(s.name) + " (" + G(s.type) + ")", 9, Ml))), 128))
|
|
3437
|
+
], 8, xl), [
|
|
3438
|
+
[_t, w.value]
|
|
3439
|
+
])
|
|
3438
3440
|
])
|
|
3439
3441
|
]),
|
|
3440
|
-
N("div",
|
|
3442
|
+
N("div", El, [
|
|
3441
3443
|
N("button", {
|
|
3442
3444
|
class: "pp-btn pp-btn--primary",
|
|
3443
3445
|
disabled: !y.value || !w.value || f.value || !a.value || !i.value,
|
|
3444
3446
|
onClick: H
|
|
3445
|
-
}, G(f.value ? "Working…" : "Plot"), 9,
|
|
3447
|
+
}, G(f.value ? "Working…" : "Plot"), 9, Cl),
|
|
3448
|
+
c.value ? (B(), O("div", Sl, G(c.value), 1)) : Ee("", !0)
|
|
3446
3449
|
])
|
|
3447
|
-
])
|
|
3448
|
-
c.value ? (F(), O("div", kl, G(c.value), 1)) : Ce("", !0)
|
|
3450
|
+
])
|
|
3449
3451
|
]),
|
|
3450
3452
|
N("div", {
|
|
3451
3453
|
id: A,
|
|
@@ -3453,23 +3455,23 @@ const tl = /* @__PURE__ */ _e({
|
|
|
3453
3455
|
})
|
|
3454
3456
|
]));
|
|
3455
3457
|
}
|
|
3456
|
-
}),
|
|
3458
|
+
}), $l = /* @__PURE__ */ Le(kl, [["__scopeId", "data-v-1e3cf8a1"]]), Rl = "dashboard:globalVars";
|
|
3457
3459
|
function zt(e = !1) {
|
|
3458
3460
|
const t = Xn(Rl, null);
|
|
3459
3461
|
return !t && e && console.warn("[Widget] dashboard:globalVars not provided."), t;
|
|
3460
3462
|
}
|
|
3461
|
-
const
|
|
3463
|
+
const Tl = { class: "data-explorer-wrap" }, Nl = { class: "data-explorer-info" }, Il = /* @__PURE__ */ _e({
|
|
3462
3464
|
inheritAttrs: !1,
|
|
3463
3465
|
__name: "DataExplorer",
|
|
3464
3466
|
setup(e) {
|
|
3465
|
-
const t = zt(), n =
|
|
3467
|
+
const t = zt(), n = T("Data Explorer"), r = j(() => we(t.s3Url));
|
|
3466
3468
|
return Gn(() => {
|
|
3467
3469
|
}), (a, i) => {
|
|
3468
3470
|
const l = bt("el-icon");
|
|
3469
|
-
return
|
|
3471
|
+
return B(), O(re, null, [
|
|
3470
3472
|
Nt(a.$slots, "default", { widgetName: n.value }, void 0, !0),
|
|
3471
|
-
N("div",
|
|
3472
|
-
N("div",
|
|
3473
|
+
N("div", Tl, [
|
|
3474
|
+
N("div", Nl, [
|
|
3473
3475
|
oe(we(Qn), { placement: "top-start" }, {
|
|
3474
3476
|
content: Pe(() => [...i[0] || (i[0] = [
|
|
3475
3477
|
At("Type in a query or use the suggested query buttons to run on your csv file", -1)
|
|
@@ -3485,7 +3487,7 @@ const Nl = { class: "data-explorer-wrap" }, Ll = { class: "data-explorer-info" }
|
|
|
3485
3487
|
_: 1
|
|
3486
3488
|
})
|
|
3487
3489
|
]),
|
|
3488
|
-
oe(we(
|
|
3490
|
+
oe(we(Er), { srcUrl: r.value }, null, 8, ["srcUrl"])
|
|
3489
3491
|
])
|
|
3490
3492
|
], 64);
|
|
3491
3493
|
};
|
|
@@ -3495,34 +3497,34 @@ const Nl = { class: "data-explorer-wrap" }, Ll = { class: "data-explorer-info" }
|
|
|
3495
3497
|
for (const [r, a] of t)
|
|
3496
3498
|
n[r] = a;
|
|
3497
3499
|
return n;
|
|
3498
|
-
},
|
|
3500
|
+
}, zl = /* @__PURE__ */ qt(Il, [["__scopeId", "data-v-e47a9f7d"]]), Ll = { class: "umap-wrap" }, Ul = /* @__PURE__ */ Object.assign({
|
|
3499
3501
|
inheritAttrs: !1
|
|
3500
3502
|
}, {
|
|
3501
3503
|
__name: "Umap",
|
|
3502
3504
|
setup(e) {
|
|
3503
|
-
const t = zt(), n =
|
|
3504
|
-
return (a, i) => (
|
|
3505
|
+
const t = zt(), n = T("Data Explorer"), r = j(() => we(t == null ? void 0 : t.s3Url));
|
|
3506
|
+
return (a, i) => (B(), O(re, null, [
|
|
3505
3507
|
Nt(a.$slots, "default", { widgetName: n.value }, void 0, !0),
|
|
3506
|
-
N("div",
|
|
3507
|
-
oe(we(
|
|
3508
|
+
N("div", Ll, [
|
|
3509
|
+
oe(we(pl), { srcUrl: r.value }, null, 8, ["srcUrl"])
|
|
3508
3510
|
])
|
|
3509
3511
|
], 64));
|
|
3510
3512
|
}
|
|
3511
|
-
}),
|
|
3513
|
+
}), ql = /* @__PURE__ */ qt(Ul, [["__scopeId", "data-v-d8a1dc37"]]), Bl = { class: "proportion-plot-wrap" }, Fl = /* @__PURE__ */ _e({
|
|
3512
3514
|
inheritAttrs: !1,
|
|
3513
3515
|
__name: "Proportion",
|
|
3514
3516
|
setup(e) {
|
|
3515
3517
|
const t = zt(), n = j(() => we(t.s3Url));
|
|
3516
|
-
return (r, a) => (
|
|
3518
|
+
return (r, a) => (B(), O(re, null, [
|
|
3517
3519
|
Nt(r.$slots, "default", {}, void 0, !0),
|
|
3518
3520
|
N("div", Bl, [
|
|
3519
|
-
oe(we(
|
|
3521
|
+
oe(we($l), { srcUrl: n.value }, null, 8, ["srcUrl"])
|
|
3520
3522
|
])
|
|
3521
3523
|
], 64));
|
|
3522
3524
|
}
|
|
3523
|
-
}),
|
|
3525
|
+
}), Yl = /* @__PURE__ */ qt(Fl, [["__scopeId", "data-v-96c1c44d"]]);
|
|
3524
3526
|
export {
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3527
|
+
zl as DataExplorer,
|
|
3528
|
+
Yl as ProportionPlot,
|
|
3529
|
+
ql as UMAP
|
|
3528
3530
|
};
|