@nice2dev/ui-science 1.1.7 โ 1.1.10
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/index.cjs +12 -9
- package/dist/index.mjs +252 -223
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var st = Object.defineProperty;
|
|
2
2
|
var at = (e, t, n) => t in e ? st(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var ve = (e, t, n) => at(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { jsx as o, jsxs as u, Fragment as
|
|
5
|
-
import { createContext as Ue, useContext as Ze, useState as j, useCallback as
|
|
4
|
+
import { jsx as o, jsxs as u, Fragment as Ae } from "react/jsx-runtime";
|
|
5
|
+
import { createContext as Ue, useContext as Ze, useState as j, useCallback as q, useMemo as K, useRef as ze, useEffect as Xe } from "react";
|
|
6
6
|
class lt {
|
|
7
7
|
constructor(t) {
|
|
8
8
|
ve(this, "config");
|
|
@@ -156,6 +156,9 @@ class lt {
|
|
|
156
156
|
<meta charset="utf-8">
|
|
157
157
|
<title>${t.title}</title>
|
|
158
158
|
<style>
|
|
159
|
+
/* audit-allow: token-role +5 โ this stylesheet ships inside a STANDALONE exported
|
|
160
|
+
document, where no --nice-* property is declared, so every reference here renders
|
|
161
|
+
its fallback and nothing else. The ink colours are intentional. */
|
|
159
162
|
body { font-family: 'Times New Roman', serif; max-width: 800px; margin: 0 auto; padding: var(--nice-space-5, 20px); }
|
|
160
163
|
h1 { border-bottom: 2px solid var(--nice-text, #333); }
|
|
161
164
|
.meta { color: var(--nice-text-secondary, #666); font-size: 0.9em; }
|
|
@@ -213,7 +216,7 @@ function ct({
|
|
|
213
216
|
service: e,
|
|
214
217
|
children: t
|
|
215
218
|
}) {
|
|
216
|
-
const [n, r] = j([]), [i, s] = j(null), [a, l] = j(null), c =
|
|
219
|
+
const [n, r] = j([]), [i, s] = j(null), [a, l] = j(null), c = q(async () => {
|
|
217
220
|
const $ = await e.listNotebooks();
|
|
218
221
|
r($);
|
|
219
222
|
}, [e]), h = K(
|
|
@@ -222,7 +225,7 @@ function ct({
|
|
|
222
225
|
), p = K(
|
|
223
226
|
() => (h == null ? void 0 : h.entries.find(($) => $.id === a)) || null,
|
|
224
227
|
[h, a]
|
|
225
|
-
), y =
|
|
228
|
+
), y = q(($) => {
|
|
226
229
|
s($), l(null);
|
|
227
230
|
}, []), m = {
|
|
228
231
|
service: e,
|
|
@@ -235,7 +238,7 @@ function ct({
|
|
|
235
238
|
};
|
|
236
239
|
return /* @__PURE__ */ o(Ke.Provider, { value: m, children: t });
|
|
237
240
|
}
|
|
238
|
-
const
|
|
241
|
+
const P = {
|
|
239
242
|
container: {
|
|
240
243
|
display: "flex",
|
|
241
244
|
height: "100%",
|
|
@@ -298,7 +301,7 @@ const q = {
|
|
|
298
301
|
button: {
|
|
299
302
|
padding: "8px 16px",
|
|
300
303
|
backgroundColor: "var(--nice-primary-hover, #1976d2)",
|
|
301
|
-
color: "var(--nice-
|
|
304
|
+
color: "var(--nice-text-on-primary, #fff)",
|
|
302
305
|
border: "none",
|
|
303
306
|
borderRadius: "4px",
|
|
304
307
|
cursor: "pointer",
|
|
@@ -312,20 +315,20 @@ const q = {
|
|
|
312
315
|
signed: "var(--nice-accent, #9c27b0)",
|
|
313
316
|
locked: "var(--nice-danger, #f44336)"
|
|
314
317
|
}, Je = {
|
|
315
|
-
experiment: "
|
|
316
|
-
protocol: "
|
|
317
|
-
observation: "
|
|
318
|
-
calculation: "
|
|
319
|
-
meeting: "
|
|
320
|
-
report: "
|
|
321
|
-
note: "
|
|
318
|
+
experiment: "EXP",
|
|
319
|
+
protocol: "PRO",
|
|
320
|
+
observation: "OBS",
|
|
321
|
+
calculation: "CALC",
|
|
322
|
+
meeting: "MEET",
|
|
323
|
+
report: "REP",
|
|
324
|
+
note: "NOTE"
|
|
322
325
|
};
|
|
323
326
|
function Jt({
|
|
324
327
|
service: e,
|
|
325
328
|
className: t,
|
|
326
329
|
style: n
|
|
327
330
|
}) {
|
|
328
|
-
return /* @__PURE__ */ o(ct, { service: e, children: /* @__PURE__ */ u("div", { className: t, style: { ...
|
|
331
|
+
return /* @__PURE__ */ o(ct, { service: e, children: /* @__PURE__ */ u("div", { className: t, style: { ...P.container, ...n }, children: [
|
|
329
332
|
/* @__PURE__ */ o(dt, {}),
|
|
330
333
|
/* @__PURE__ */ o(ut, {})
|
|
331
334
|
] }) });
|
|
@@ -334,14 +337,14 @@ function dt() {
|
|
|
334
337
|
const { notebooks: e, currentNotebook: t, setCurrentNotebook: n, service: r, refresh: i } = Te(), [s, a] = j(!1), [l, c] = j(""), h = async () => {
|
|
335
338
|
l.trim() && (await r.createNotebook({ name: l.trim() }), await i(), c(""), a(!1));
|
|
336
339
|
};
|
|
337
|
-
return /* @__PURE__ */ u("div", { style:
|
|
338
|
-
/* @__PURE__ */ o("div", { style: { padding: "16px", borderBottom: "1px solid var(--nice-border, #e0e0e0)" }, children: /* @__PURE__ */ o("h2", { style: { margin: 0, fontSize: "18px" }, children: "
|
|
340
|
+
return /* @__PURE__ */ u("div", { style: P.sidebar, children: [
|
|
341
|
+
/* @__PURE__ */ o("div", { style: { padding: "16px", borderBottom: "1px solid var(--nice-border, #e0e0e0)" }, children: /* @__PURE__ */ o("h2", { style: { margin: 0, fontSize: "18px" }, children: "Lab Notebooks" }) }),
|
|
339
342
|
/* @__PURE__ */ o("div", { style: { flex: 1, overflow: "auto" }, children: e.map((p) => /* @__PURE__ */ u(
|
|
340
343
|
"div",
|
|
341
344
|
{
|
|
342
345
|
onClick: () => n(p.id),
|
|
343
346
|
style: {
|
|
344
|
-
...
|
|
347
|
+
...P.entryCard,
|
|
345
348
|
backgroundColor: (t == null ? void 0 : t.id) === p.id ? "var(--nice-primary-bg, #e3f2fd)" : "transparent"
|
|
346
349
|
},
|
|
347
350
|
children: [
|
|
@@ -372,39 +375,36 @@ function dt() {
|
|
|
372
375
|
value: l,
|
|
373
376
|
onChange: (p) => c(p.target.value),
|
|
374
377
|
placeholder: "Notebook name",
|
|
375
|
-
style:
|
|
378
|
+
style: P.input,
|
|
376
379
|
autoFocus: !0
|
|
377
380
|
}
|
|
378
381
|
),
|
|
379
382
|
/* @__PURE__ */ u("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
380
|
-
/* @__PURE__ */ o("button", { onClick: h, style:
|
|
383
|
+
/* @__PURE__ */ o("button", { onClick: h, style: P.button, children: "Create" }),
|
|
381
384
|
/* @__PURE__ */ o(
|
|
382
385
|
"button",
|
|
383
386
|
{
|
|
384
387
|
onClick: () => a(!1),
|
|
385
|
-
style: { ...
|
|
388
|
+
style: { ...P.button, backgroundColor: "var(--nice-bg-tertiary, #9e9e9e)" },
|
|
386
389
|
children: "Cancel"
|
|
387
390
|
}
|
|
388
391
|
)
|
|
389
392
|
] })
|
|
390
|
-
] }) : /* @__PURE__ */ o("button", { onClick: () => a(!0), style: { ...
|
|
393
|
+
] }) : /* @__PURE__ */ o("button", { onClick: () => a(!0), style: { ...P.button, width: "100%" }, children: "+ New Notebook" }) })
|
|
391
394
|
] });
|
|
392
395
|
}
|
|
393
396
|
function ut() {
|
|
394
397
|
const { currentNotebook: e, currentEntry: t, setCurrentEntry: n, service: r, refresh: i } = Te(), [s, a] = j(!1);
|
|
395
398
|
if (!e)
|
|
396
|
-
return /* @__PURE__ */ o("div", { style: { ...
|
|
397
|
-
/* @__PURE__ */ o("div", { style: { fontSize: "48px", marginBottom: "16px" }, children: "๐" }),
|
|
398
|
-
/* @__PURE__ */ o("div", { style: { fontSize: "18px" }, children: "Select a notebook to get started" })
|
|
399
|
-
] }) });
|
|
399
|
+
return /* @__PURE__ */ o("div", { style: { ...P.main, justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ o("div", { style: { textAlign: "center", color: "var(--nice-text-secondary, #666)" }, children: /* @__PURE__ */ o("div", { style: { fontSize: "18px" }, children: "Select a notebook to get started" }) }) });
|
|
400
400
|
const l = async (c) => {
|
|
401
401
|
const h = await r.createEntry(e.id, c);
|
|
402
402
|
await i(), n(h.id), a(!1);
|
|
403
403
|
};
|
|
404
|
-
return /* @__PURE__ */ u("div", { style:
|
|
405
|
-
/* @__PURE__ */ o("div", { style:
|
|
404
|
+
return /* @__PURE__ */ u("div", { style: P.main, children: [
|
|
405
|
+
/* @__PURE__ */ o("div", { style: P.header, children: /* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
406
406
|
/* @__PURE__ */ o("h1", { style: { margin: 0, fontSize: "20px" }, children: e.name }),
|
|
407
|
-
/* @__PURE__ */ o("button", { onClick: () => a(!0), style:
|
|
407
|
+
/* @__PURE__ */ o("button", { onClick: () => a(!0), style: P.button, children: "+ New Entry" })
|
|
408
408
|
] }) }),
|
|
409
409
|
/* @__PURE__ */ u("div", { style: { display: "flex", flex: 1, overflow: "hidden" }, children: [
|
|
410
410
|
/* @__PURE__ */ o(
|
|
@@ -420,12 +420,22 @@ function ut() {
|
|
|
420
420
|
{
|
|
421
421
|
onClick: () => n(c.id),
|
|
422
422
|
style: {
|
|
423
|
-
...
|
|
423
|
+
...P.entryCard,
|
|
424
424
|
backgroundColor: (t == null ? void 0 : t.id) === c.id ? "var(--nice-primary-bg, #e3f2fd)" : "transparent"
|
|
425
425
|
},
|
|
426
426
|
children: [
|
|
427
427
|
/* @__PURE__ */ u("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
|
|
428
|
-
/* @__PURE__ */ o(
|
|
428
|
+
/* @__PURE__ */ o(
|
|
429
|
+
"span",
|
|
430
|
+
{
|
|
431
|
+
style: {
|
|
432
|
+
fontSize: "10px",
|
|
433
|
+
fontWeight: 600,
|
|
434
|
+
color: "var(--nice-text-secondary, #666)"
|
|
435
|
+
},
|
|
436
|
+
children: Je[c.type]
|
|
437
|
+
}
|
|
438
|
+
),
|
|
429
439
|
/* @__PURE__ */ o("span", { style: { fontWeight: 500 }, children: c.title })
|
|
430
440
|
] }),
|
|
431
441
|
/* @__PURE__ */ u("div", { style: { display: "flex", gap: "8px", marginTop: "8px" }, children: [
|
|
@@ -433,7 +443,7 @@ function ut() {
|
|
|
433
443
|
"span",
|
|
434
444
|
{
|
|
435
445
|
style: {
|
|
436
|
-
...
|
|
446
|
+
...P.badge,
|
|
437
447
|
backgroundColor: `${Be[c.status]}20`,
|
|
438
448
|
color: Be[c.status]
|
|
439
449
|
},
|
|
@@ -448,7 +458,7 @@ function ut() {
|
|
|
448
458
|
))
|
|
449
459
|
}
|
|
450
460
|
),
|
|
451
|
-
/* @__PURE__ */ o("div", { style:
|
|
461
|
+
/* @__PURE__ */ o("div", { style: P.content, children: t ? /* @__PURE__ */ o(ht, { entry: t }) : s ? /* @__PURE__ */ o(pt, { onSubmit: l, onCancel: () => a(!1) }) : /* @__PURE__ */ o(
|
|
452
462
|
"div",
|
|
453
463
|
{
|
|
454
464
|
style: {
|
|
@@ -490,7 +500,7 @@ function ht({ entry: e }) {
|
|
|
490
500
|
"span",
|
|
491
501
|
{
|
|
492
502
|
style: {
|
|
493
|
-
...
|
|
503
|
+
...P.badge,
|
|
494
504
|
backgroundColor: `${Be[e.status]}20`,
|
|
495
505
|
color: Be[e.status]
|
|
496
506
|
},
|
|
@@ -503,8 +513,8 @@ function ht({ entry: e }) {
|
|
|
503
513
|
] })
|
|
504
514
|
] })
|
|
505
515
|
] }),
|
|
506
|
-
!c && /* @__PURE__ */ o("div", { style: { display: "flex", gap: "8px" }, children: i ? /* @__PURE__ */ u(
|
|
507
|
-
/* @__PURE__ */ o("button", { onClick: h, style:
|
|
516
|
+
!c && /* @__PURE__ */ o("div", { style: { display: "flex", gap: "8px" }, children: i ? /* @__PURE__ */ u(Ae, { children: [
|
|
517
|
+
/* @__PURE__ */ o("button", { onClick: h, style: P.button, children: "Save" }),
|
|
508
518
|
/* @__PURE__ */ o(
|
|
509
519
|
"button",
|
|
510
520
|
{
|
|
@@ -512,19 +522,19 @@ function ht({ entry: e }) {
|
|
|
512
522
|
s(!1), l(e);
|
|
513
523
|
},
|
|
514
524
|
style: {
|
|
515
|
-
...
|
|
516
|
-
backgroundColor: "var(--nice-
|
|
525
|
+
...P.button,
|
|
526
|
+
backgroundColor: "var(--nice-bg-tertiary, #9e9e9e)"
|
|
517
527
|
},
|
|
518
528
|
children: "Cancel"
|
|
519
529
|
}
|
|
520
530
|
)
|
|
521
|
-
] }) : /* @__PURE__ */ u(
|
|
522
|
-
/* @__PURE__ */ o("button", { onClick: () => s(!0), style:
|
|
531
|
+
] }) : /* @__PURE__ */ u(Ae, { children: [
|
|
532
|
+
/* @__PURE__ */ o("button", { onClick: () => s(!0), style: P.button, children: "Edit" }),
|
|
523
533
|
/* @__PURE__ */ o(
|
|
524
534
|
"button",
|
|
525
535
|
{
|
|
526
536
|
onClick: p,
|
|
527
|
-
style: { ...
|
|
537
|
+
style: { ...P.button, backgroundColor: "var(--nice-accent, #9c27b0)" },
|
|
528
538
|
children: "Sign"
|
|
529
539
|
}
|
|
530
540
|
)
|
|
@@ -541,7 +551,7 @@ function ht({ entry: e }) {
|
|
|
541
551
|
type: "text",
|
|
542
552
|
value: a.title,
|
|
543
553
|
onChange: (y) => l({ ...a, title: y.target.value }),
|
|
544
|
-
style:
|
|
554
|
+
style: P.input
|
|
545
555
|
}
|
|
546
556
|
)
|
|
547
557
|
] }),
|
|
@@ -552,7 +562,7 @@ function ht({ entry: e }) {
|
|
|
552
562
|
{
|
|
553
563
|
value: a.objective || "",
|
|
554
564
|
onChange: (y) => l({ ...a, objective: y.target.value }),
|
|
555
|
-
style:
|
|
565
|
+
style: P.textarea
|
|
556
566
|
}
|
|
557
567
|
)
|
|
558
568
|
] }),
|
|
@@ -563,7 +573,7 @@ function ht({ entry: e }) {
|
|
|
563
573
|
{
|
|
564
574
|
value: a.methods || "",
|
|
565
575
|
onChange: (y) => l({ ...a, methods: y.target.value }),
|
|
566
|
-
style:
|
|
576
|
+
style: P.textarea
|
|
567
577
|
}
|
|
568
578
|
)
|
|
569
579
|
] }),
|
|
@@ -574,7 +584,7 @@ function ht({ entry: e }) {
|
|
|
574
584
|
{
|
|
575
585
|
value: a.results || "",
|
|
576
586
|
onChange: (y) => l({ ...a, results: y.target.value }),
|
|
577
|
-
style:
|
|
587
|
+
style: P.textarea
|
|
578
588
|
}
|
|
579
589
|
)
|
|
580
590
|
] }),
|
|
@@ -585,7 +595,7 @@ function ht({ entry: e }) {
|
|
|
585
595
|
{
|
|
586
596
|
value: a.conclusions || "",
|
|
587
597
|
onChange: (y) => l({ ...a, conclusions: y.target.value }),
|
|
588
|
-
style:
|
|
598
|
+
style: P.textarea
|
|
589
599
|
}
|
|
590
600
|
)
|
|
591
601
|
] })
|
|
@@ -646,7 +656,6 @@ function ht({ entry: e }) {
|
|
|
646
656
|
textDecoration: "none"
|
|
647
657
|
},
|
|
648
658
|
children: [
|
|
649
|
-
"๐ ",
|
|
650
659
|
y.name,
|
|
651
660
|
" (",
|
|
652
661
|
(y.size / 1024).toFixed(1),
|
|
@@ -680,7 +689,7 @@ function pt({
|
|
|
680
689
|
{
|
|
681
690
|
value: n.type,
|
|
682
691
|
onChange: (s) => r({ ...n, type: s.target.value }),
|
|
683
|
-
style:
|
|
692
|
+
style: P.input,
|
|
684
693
|
children: Object.entries(Je).map(([s, a]) => /* @__PURE__ */ u("option", { value: s, children: [
|
|
685
694
|
a,
|
|
686
695
|
" ",
|
|
@@ -698,7 +707,7 @@ function pt({
|
|
|
698
707
|
value: n.title,
|
|
699
708
|
onChange: (s) => r({ ...n, title: s.target.value }),
|
|
700
709
|
placeholder: "Enter entry title",
|
|
701
|
-
style:
|
|
710
|
+
style: P.input,
|
|
702
711
|
required: !0
|
|
703
712
|
}
|
|
704
713
|
)
|
|
@@ -711,18 +720,18 @@ function pt({
|
|
|
711
720
|
value: n.objective,
|
|
712
721
|
onChange: (s) => r({ ...n, objective: s.target.value }),
|
|
713
722
|
placeholder: "What is the goal of this entry?",
|
|
714
|
-
style:
|
|
723
|
+
style: P.textarea
|
|
715
724
|
}
|
|
716
725
|
)
|
|
717
726
|
] }),
|
|
718
727
|
/* @__PURE__ */ u("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
719
|
-
/* @__PURE__ */ o("button", { type: "submit", style:
|
|
728
|
+
/* @__PURE__ */ o("button", { type: "submit", style: P.button, children: "Create Entry" }),
|
|
720
729
|
/* @__PURE__ */ o(
|
|
721
730
|
"button",
|
|
722
731
|
{
|
|
723
732
|
type: "button",
|
|
724
733
|
onClick: t,
|
|
725
|
-
style: { ...
|
|
734
|
+
style: { ...P.button, backgroundColor: "var(--nice-bg-tertiary, #9e9e9e)" },
|
|
726
735
|
children: "Cancel"
|
|
727
736
|
}
|
|
728
737
|
)
|
|
@@ -1204,7 +1213,7 @@ function Qt({
|
|
|
1204
1213
|
className: t,
|
|
1205
1214
|
style: n
|
|
1206
1215
|
}) {
|
|
1207
|
-
const [r, i] = j([]), [s, a] = j(null), [l, c] = j("data"), h =
|
|
1216
|
+
const [r, i] = j([]), [s, a] = j(null), [l, c] = j("data"), h = q(() => {
|
|
1208
1217
|
i(e.listDatasets());
|
|
1209
1218
|
}, [e]), p = K(
|
|
1210
1219
|
() => r.find((m) => m.id === s),
|
|
@@ -1305,7 +1314,7 @@ function Qt({
|
|
|
1305
1314
|
]
|
|
1306
1315
|
}
|
|
1307
1316
|
),
|
|
1308
|
-
/* @__PURE__ */ o("div", { style: { flex: 1, overflow: "auto", padding: "16px" }, children: p ? l === "data" ? /* @__PURE__ */ o(yt, { dataset: p }) : l === "stats" ? /* @__PURE__ */ o(mt, { dataset: p }) : /* @__PURE__ */ o(gt, { dataset: p, service: e }) : /* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ o("div", { style: { flex: 1, overflow: "auto", padding: "16px" }, children: p ? l === "data" ? /* @__PURE__ */ o(yt, { dataset: p }) : l === "stats" ? /* @__PURE__ */ o(mt, { dataset: p }) : /* @__PURE__ */ o(gt, { dataset: p, service: e }) : /* @__PURE__ */ o(
|
|
1309
1318
|
"div",
|
|
1310
1319
|
{
|
|
1311
1320
|
style: {
|
|
@@ -1313,10 +1322,7 @@ function Qt({
|
|
|
1313
1322
|
color: "var(--nice-text-secondary, #666)",
|
|
1314
1323
|
padding: "48px"
|
|
1315
1324
|
},
|
|
1316
|
-
children:
|
|
1317
|
-
/* @__PURE__ */ o("div", { style: { fontSize: "48px", marginBottom: "16px" }, children: "๐" }),
|
|
1318
|
-
/* @__PURE__ */ o("div", { style: { fontSize: "18px" }, children: "Import a dataset or select an existing one to begin" })
|
|
1319
|
-
]
|
|
1325
|
+
children: /* @__PURE__ */ o("div", { style: { fontSize: "18px" }, children: "Import a dataset or select an existing one to begin" })
|
|
1320
1326
|
}
|
|
1321
1327
|
) })
|
|
1322
1328
|
]
|
|
@@ -1381,7 +1387,7 @@ function yt({ dataset: e }) {
|
|
|
1381
1387
|
"td",
|
|
1382
1388
|
{
|
|
1383
1389
|
style: { padding: "8px 12px", border: "1px solid var(--nice-border, #ddd)" },
|
|
1384
|
-
children: a[c.name] != null ? String(a[c.name]) : /* @__PURE__ */ o("span", { style: { color: "var(--nice-
|
|
1390
|
+
children: a[c.name] != null ? String(a[c.name]) : /* @__PURE__ */ o("span", { style: { color: "var(--nice-text-secondary, #ccc)" }, children: "null" })
|
|
1385
1391
|
},
|
|
1386
1392
|
c.name
|
|
1387
1393
|
))
|
|
@@ -1984,7 +1990,7 @@ const he = {
|
|
|
1984
1990
|
}
|
|
1985
1991
|
};
|
|
1986
1992
|
function en({ service: e, className: t, style: n }) {
|
|
1987
|
-
const [r, i] = j([]), [s, a] = j([]), [l, c] = j("all"), [h, p] = j(null), [y, m] = j(""), [$, w] = j("apa"), F =
|
|
1993
|
+
const [r, i] = j([]), [s, a] = j([]), [l, c] = j("all"), [h, p] = j(null), [y, m] = j(""), [$, w] = j("apa"), F = q(() => {
|
|
1988
1994
|
i(e.listCitations(l)), a(e.listCollections());
|
|
1989
1995
|
}, [e, l]), J = K(() => y ? e.searchCitations(y, { collection: l }) : r, [r, y, l, e]), te = K(
|
|
1990
1996
|
() => r.find((L) => L.id === h),
|
|
@@ -2117,7 +2123,7 @@ function kt() {
|
|
|
2117
2123
|
}
|
|
2118
2124
|
}
|
|
2119
2125
|
};
|
|
2120
|
-
return /* @__PURE__ */ u(
|
|
2126
|
+
return /* @__PURE__ */ u(Ae, { children: [
|
|
2121
2127
|
/* @__PURE__ */ o("button", { onClick: () => r(!0), style: he.button, children: "+ Add Reference" }),
|
|
2122
2128
|
n && /* @__PURE__ */ o(
|
|
2123
2129
|
"div",
|
|
@@ -2159,7 +2165,7 @@ function kt() {
|
|
|
2159
2165
|
"button",
|
|
2160
2166
|
{
|
|
2161
2167
|
onClick: () => r(!1),
|
|
2162
|
-
style: { ...he.button, backgroundColor: "var(--nice-
|
|
2168
|
+
style: { ...he.button, backgroundColor: "var(--nice-bg-tertiary, #9e9e9e)" },
|
|
2163
2169
|
children: "Cancel"
|
|
2164
2170
|
}
|
|
2165
2171
|
),
|
|
@@ -2272,7 +2278,7 @@ function Dt({ citation: e }) {
|
|
|
2272
2278
|
] })
|
|
2273
2279
|
] });
|
|
2274
2280
|
}
|
|
2275
|
-
const
|
|
2281
|
+
const At = {
|
|
2276
2282
|
series: [],
|
|
2277
2283
|
xAxes: [],
|
|
2278
2284
|
yAxes: [],
|
|
@@ -2285,7 +2291,7 @@ const zt = {
|
|
|
2285
2291
|
function Ie(e) {
|
|
2286
2292
|
return e.reduce((t, n) => t + n, 0) / e.length;
|
|
2287
2293
|
}
|
|
2288
|
-
function
|
|
2294
|
+
function zt(e) {
|
|
2289
2295
|
const t = [...e].sort((r, i) => r - i), n = Math.floor(t.length / 2);
|
|
2290
2296
|
return t.length % 2 ? t[n] : (t[n - 1] + t[n]) / 2;
|
|
2291
2297
|
}
|
|
@@ -2312,7 +2318,7 @@ function Ye(e, t, n, r = 5) {
|
|
|
2312
2318
|
const s = (t - e) / (r - 1);
|
|
2313
2319
|
return Array.from({ length: r }, (a, l) => e + l * s);
|
|
2314
2320
|
}
|
|
2315
|
-
function
|
|
2321
|
+
function Pe(e, t) {
|
|
2316
2322
|
return Math.abs(e) >= 1e6 ? (e / 1e6).toFixed(1) + "M" : Math.abs(e) >= 1e3 ? (e / 1e3).toFixed(1) + "K" : Math.abs(e) < 0.01 ? e.toExponential(2) : e.toFixed(2).replace(/\.?0+$/, "");
|
|
2317
2323
|
}
|
|
2318
2324
|
function tn({
|
|
@@ -2342,10 +2348,10 @@ function tn({
|
|
|
2342
2348
|
className: de,
|
|
2343
2349
|
style: pe
|
|
2344
2350
|
}) {
|
|
2345
|
-
const se =
|
|
2346
|
-
|
|
2351
|
+
const se = ze(null);
|
|
2352
|
+
ze(null);
|
|
2347
2353
|
const [ne, Y] = j({
|
|
2348
|
-
...
|
|
2354
|
+
...At,
|
|
2349
2355
|
series: e,
|
|
2350
2356
|
annotations: h
|
|
2351
2357
|
}), [ce, ue] = j({ width: 0, height: 0 }), [me, xe] = j({ x: null, y: null }), [X, Z] = j(
|
|
@@ -2358,11 +2364,11 @@ function tn({
|
|
|
2358
2364
|
return { xMin: 0, xMax: 1, yMin: 0, yMax: 1 };
|
|
2359
2365
|
let x = 1 / 0, S = -1 / 0, E = 1 / 0, N = -1 / 0;
|
|
2360
2366
|
for (const M of d)
|
|
2361
|
-
for (const
|
|
2362
|
-
const W = typeof
|
|
2363
|
-
if (x = Math.min(x, W), S = Math.max(S, W), E = Math.min(E,
|
|
2364
|
-
const [T, le] = Array.isArray(
|
|
2365
|
-
E = Math.min(E,
|
|
2367
|
+
for (const A of M.data) {
|
|
2368
|
+
const W = typeof A.x == "number" ? A.x : 0;
|
|
2369
|
+
if (x = Math.min(x, W), S = Math.max(S, W), E = Math.min(E, A.y), N = Math.max(N, A.y), A.error) {
|
|
2370
|
+
const [T, le] = Array.isArray(A.error) ? A.error : [-A.error, A.error];
|
|
2371
|
+
E = Math.min(E, A.y + T), N = Math.max(N, A.y + le);
|
|
2366
2372
|
}
|
|
2367
2373
|
}
|
|
2368
2374
|
const _ = (S - x) * 0.05 || 0.5, g = (N - E) * 0.05 || 0.5;
|
|
@@ -2378,7 +2384,7 @@ function tn({
|
|
|
2378
2384
|
if (!ae.has(x.id))
|
|
2379
2385
|
continue;
|
|
2380
2386
|
const S = x.data.map((E) => E.y);
|
|
2381
|
-
c.includes("mean") && (d[`${x.id}_mean`] = Ie(S)), c.includes("median") && (d[`${x.id}_median`] =
|
|
2387
|
+
c.includes("mean") && (d[`${x.id}_mean`] = Ie(S)), c.includes("median") && (d[`${x.id}_median`] = zt(S)), c.includes("std-dev") && (d[`${x.id}_std`] = Re(S)), c.includes("regression") && (d[`${x.id}_regression`] = Et(x.data)), c.includes("confidence-interval") && (d[`${x.id}_ci95`] = Nt(S));
|
|
2382
2388
|
}
|
|
2383
2389
|
return d;
|
|
2384
2390
|
}, [e, ae, c]), ee = K(() => w.map((d) => {
|
|
@@ -2401,19 +2407,19 @@ function tn({
|
|
|
2401
2407
|
}
|
|
2402
2408
|
}
|
|
2403
2409
|
return d;
|
|
2404
|
-
}), [w, e]), re =
|
|
2410
|
+
}), [w, e]), re = q((d) => {
|
|
2405
2411
|
G((x) => {
|
|
2406
2412
|
const S = new Set(x);
|
|
2407
2413
|
return S.has(d) ? S.delete(d) : S.add(d), S;
|
|
2408
2414
|
});
|
|
2409
|
-
}, []), ie =
|
|
2415
|
+
}, []), ie = q(() => {
|
|
2410
2416
|
xe({ x: null, y: null }), oe == null || oe(null, null);
|
|
2411
|
-
}, [oe]),
|
|
2417
|
+
}, [oe]), z = K(() => {
|
|
2412
2418
|
switch (V) {
|
|
2413
2419
|
case "dark":
|
|
2414
2420
|
return [
|
|
2415
2421
|
"var(--nice-primary-light, #60a5fa)",
|
|
2416
|
-
"var(--nice-accent-pink, #f472b6)",
|
|
2422
|
+
"var(--nice-color-accent-pink, #f472b6)",
|
|
2417
2423
|
"var(--nice-success-light, #34d399)",
|
|
2418
2424
|
"var(--nice-warning-light, #fbbf24)",
|
|
2419
2425
|
"var(--nice-accent, #a78bfa)",
|
|
@@ -2428,7 +2434,7 @@ function tn({
|
|
|
2428
2434
|
"var(--nice-success, #22c55e)",
|
|
2429
2435
|
"var(--nice-warning, #f59e0b)",
|
|
2430
2436
|
"var(--nice-accent, #8b5cf6)",
|
|
2431
|
-
"var(--nice-accent-pink, #ec4899)"
|
|
2437
|
+
"var(--nice-color-accent-pink, #ec4899)"
|
|
2432
2438
|
];
|
|
2433
2439
|
default:
|
|
2434
2440
|
return [
|
|
@@ -2437,15 +2443,15 @@ function tn({
|
|
|
2437
2443
|
"var(--nice-success-dark, #16a34a)",
|
|
2438
2444
|
"#ca8a04",
|
|
2439
2445
|
"var(--nice-accent, #7c3aed)",
|
|
2440
|
-
"var(--nice-accent-pink, #db2777)"
|
|
2446
|
+
"var(--nice-color-accent-pink, #db2777)"
|
|
2441
2447
|
];
|
|
2442
2448
|
}
|
|
2443
2449
|
}, [V]), k = K(() => {
|
|
2444
2450
|
switch (V) {
|
|
2445
2451
|
case "dark":
|
|
2446
2452
|
return {
|
|
2447
|
-
bg: "var(--nice-
|
|
2448
|
-
text: "var(--nice-
|
|
2453
|
+
bg: "var(--nice-bg-secondary, #1f2937)",
|
|
2454
|
+
text: "var(--nice-text-primary, #f3f4f6)",
|
|
2449
2455
|
grid: "var(--nice-text, #374151)",
|
|
2450
2456
|
axis: "var(--nice-text-muted, #9ca3af)",
|
|
2451
2457
|
tooltip: "var(--nice-text, #374151)"
|
|
@@ -2534,7 +2540,7 @@ function tn({
|
|
|
2534
2540
|
width: 12,
|
|
2535
2541
|
height: 12,
|
|
2536
2542
|
borderRadius: 2,
|
|
2537
|
-
backgroundColor: d.color ||
|
|
2543
|
+
backgroundColor: d.color || z[x % z.length]
|
|
2538
2544
|
}
|
|
2539
2545
|
}
|
|
2540
2546
|
),
|
|
@@ -2578,24 +2584,41 @@ function tn({
|
|
|
2578
2584
|
] }),
|
|
2579
2585
|
e.filter((d) => ae.has(d.id) && d.visible !== !1).map((d, x) => {
|
|
2580
2586
|
var N, _, g;
|
|
2581
|
-
const S = d.color ||
|
|
2582
|
-
return /* @__PURE__ */ o("g", { className: "nice-scientific-chart__series", children: E === "scatter" || E === "line" ? /* @__PURE__ */ u(
|
|
2583
|
-
E === "line" && d.data.length > 1 &&
|
|
2584
|
-
|
|
2587
|
+
const S = d.color || z[x % z.length], E = d.type || s;
|
|
2588
|
+
return /* @__PURE__ */ o("g", { className: "nice-scientific-chart__series", children: E === "scatter" || E === "line" ? /* @__PURE__ */ u(Ae, { children: [
|
|
2589
|
+
E === "line" && d.data.length > 1 && // `points` takes plain numbers โ percentages are invalid there (the
|
|
2590
|
+
// line series never rendered; the browser rejected every point). The
|
|
2591
|
+
// same 0โ100 coordinates go into a stretched 100ร100 viewBox instead,
|
|
2592
|
+
// with a non-scaling stroke so the width stays in pixels.
|
|
2593
|
+
/* @__PURE__ */ o(
|
|
2594
|
+
"svg",
|
|
2585
2595
|
{
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2596
|
+
x: "0",
|
|
2597
|
+
y: "0",
|
|
2598
|
+
width: "100%",
|
|
2599
|
+
height: "100%",
|
|
2600
|
+
viewBox: "0 0 100 100",
|
|
2601
|
+
preserveAspectRatio: "none",
|
|
2602
|
+
style: { overflow: "visible" },
|
|
2603
|
+
children: /* @__PURE__ */ o(
|
|
2604
|
+
"polyline",
|
|
2605
|
+
{
|
|
2606
|
+
fill: "none",
|
|
2607
|
+
stroke: S,
|
|
2608
|
+
strokeWidth: ((N = d.line) == null ? void 0 : N.width) || 2,
|
|
2609
|
+
vectorEffect: "non-scaling-stroke",
|
|
2610
|
+
strokeDasharray: ((_ = d.line) == null ? void 0 : _.style) === "dashed" ? "5,5" : ((g = d.line) == null ? void 0 : g.style) === "dotted" ? "2,2" : void 0,
|
|
2611
|
+
points: d.data.map((M, A) => {
|
|
2612
|
+
const W = 10 + ((typeof M.x == "number" ? M.x : A) - C.xMin) / (C.xMax - C.xMin) * 85, T = 90 - (M.y - C.yMin) / (C.yMax - C.yMin) * 85;
|
|
2613
|
+
return `${W},${T}`;
|
|
2614
|
+
}).join(" ")
|
|
2615
|
+
}
|
|
2616
|
+
)
|
|
2594
2617
|
}
|
|
2595
2618
|
),
|
|
2596
|
-
d.data.map((M,
|
|
2619
|
+
d.data.map((M, A) => {
|
|
2597
2620
|
var fe, be, ge, ye, we;
|
|
2598
|
-
const W = 10 + ((typeof M.x == "number" ? M.x :
|
|
2621
|
+
const W = 10 + ((typeof M.x == "number" ? M.x : A) - C.xMin) / (C.xMax - C.xMin) * 85, T = 90 - (M.y - C.yMin) / (C.yMax - C.yMin) * 85, le = M.size || ((fe = d.marker) == null ? void 0 : fe.size) || 6;
|
|
2599
2622
|
return /* @__PURE__ */ u("g", { className: "nice-scientific-chart__point", children: [
|
|
2600
2623
|
M.error && /* @__PURE__ */ o(
|
|
2601
2624
|
"line",
|
|
@@ -2620,7 +2643,7 @@ function tn({
|
|
|
2620
2643
|
opacity: ((we = d.marker) == null ? void 0 : we.opacity) ?? 1,
|
|
2621
2644
|
style: { cursor: L ? "pointer" : void 0 },
|
|
2622
2645
|
onMouseEnter: () => {
|
|
2623
|
-
Z({ seriesId: d.id, pointIndex:
|
|
2646
|
+
Z({ seriesId: d.id, pointIndex: A }), H == null || H(M, d);
|
|
2624
2647
|
},
|
|
2625
2648
|
onMouseLeave: () => {
|
|
2626
2649
|
Z(null), H == null || H(null, null);
|
|
@@ -2628,7 +2651,7 @@ function tn({
|
|
|
2628
2651
|
onClick: (Se) => L == null ? void 0 : L(M, d, Se)
|
|
2629
2652
|
}
|
|
2630
2653
|
)
|
|
2631
|
-
] },
|
|
2654
|
+
] }, A);
|
|
2632
2655
|
}),
|
|
2633
2656
|
Q[`${d.id}_regression`] && /* @__PURE__ */ o(
|
|
2634
2657
|
"line",
|
|
@@ -2671,7 +2694,7 @@ function tn({
|
|
|
2671
2694
|
textAnchor: "middle",
|
|
2672
2695
|
fill: k.axis,
|
|
2673
2696
|
fontSize: "0.75rem",
|
|
2674
|
-
children:
|
|
2697
|
+
children: Pe(d)
|
|
2675
2698
|
}
|
|
2676
2699
|
)
|
|
2677
2700
|
] }, `x-${x}`)),
|
|
@@ -2686,7 +2709,7 @@ function tn({
|
|
|
2686
2709
|
dominantBaseline: "middle",
|
|
2687
2710
|
fill: k.axis,
|
|
2688
2711
|
fontSize: "0.75rem",
|
|
2689
|
-
children:
|
|
2712
|
+
children: Pe(d)
|
|
2690
2713
|
}
|
|
2691
2714
|
)
|
|
2692
2715
|
] }, `y-${x}`))
|
|
@@ -2736,7 +2759,7 @@ function tn({
|
|
|
2736
2759
|
},
|
|
2737
2760
|
children: (() => {
|
|
2738
2761
|
const d = e.find((S) => S.id === X.seriesId), x = d == null ? void 0 : d.data[X.pointIndex];
|
|
2739
|
-
return !d || !x ? null : y.format ? y.format(x, d) : /* @__PURE__ */ u(
|
|
2762
|
+
return !d || !x ? null : y.format ? y.format(x, d) : /* @__PURE__ */ u(Ae, { children: [
|
|
2740
2763
|
/* @__PURE__ */ o("div", { style: { fontWeight: "bold" }, children: d.name }),
|
|
2741
2764
|
/* @__PURE__ */ u("div", { children: [
|
|
2742
2765
|
"X: ",
|
|
@@ -2824,7 +2847,7 @@ function tn({
|
|
|
2824
2847
|
}
|
|
2825
2848
|
);
|
|
2826
2849
|
}
|
|
2827
|
-
const
|
|
2850
|
+
const qe = {
|
|
2828
2851
|
rotationX: 25,
|
|
2829
2852
|
rotationY: -45,
|
|
2830
2853
|
rotationZ: 0,
|
|
@@ -2987,49 +3010,49 @@ function nn({
|
|
|
2987
3010
|
className: L,
|
|
2988
3011
|
style: H
|
|
2989
3012
|
}) {
|
|
2990
|
-
const oe =
|
|
3013
|
+
const oe = ze(null), [U, de] = j(qe), [pe, se] = j(!1), [ne, Y] = j(
|
|
2991
3014
|
null
|
|
2992
3015
|
), [ce, ue] = j(
|
|
2993
3016
|
null
|
|
2994
3017
|
), [me, xe] = j(0), X = K(() => {
|
|
2995
|
-
let
|
|
3018
|
+
let z = 1 / 0, k = -1 / 0, d = 1 / 0, x = -1 / 0, S = 1 / 0, E = -1 / 0, N = 1 / 0, _ = -1 / 0;
|
|
2996
3019
|
for (const M of e)
|
|
2997
3020
|
if (M.type === "scatter3d")
|
|
2998
|
-
for (const
|
|
2999
|
-
|
|
3021
|
+
for (const A of M.points)
|
|
3022
|
+
z = Math.min(z, A.x), k = Math.max(k, A.x), d = Math.min(d, A.y), x = Math.max(x, A.y), S = Math.min(S, A.z), E = Math.max(E, A.z), typeof A.color == "number" && (N = Math.min(N, A.color), _ = Math.max(_, A.color));
|
|
3000
3023
|
else if (M.type === "surface" || M.type === "wireframe") {
|
|
3001
|
-
const
|
|
3002
|
-
for (const W of
|
|
3003
|
-
|
|
3004
|
-
for (const W of
|
|
3024
|
+
const A = M;
|
|
3025
|
+
for (const W of A.xData)
|
|
3026
|
+
z = Math.min(z, W), k = Math.max(k, W);
|
|
3027
|
+
for (const W of A.yData)
|
|
3005
3028
|
d = Math.min(d, W), x = Math.max(x, W);
|
|
3006
|
-
for (const W of
|
|
3029
|
+
for (const W of A.zData)
|
|
3007
3030
|
for (const T of W)
|
|
3008
3031
|
S = Math.min(S, T), E = Math.max(E, T), N = Math.min(N, T), _ = Math.max(_, T);
|
|
3009
3032
|
}
|
|
3010
|
-
const g = Math.max(k -
|
|
3011
|
-
return { xMin:
|
|
3012
|
-
}, [e]), Z =
|
|
3013
|
-
(
|
|
3033
|
+
const g = Math.max(k - z, x - d, E - S) || 1;
|
|
3034
|
+
return { xMin: z, xMax: k, yMin: d, yMax: x, zMin: S, zMax: E, colorMin: N, colorMax: _, maxRange: g };
|
|
3035
|
+
}, [e]), Z = q(
|
|
3036
|
+
(z) => {
|
|
3014
3037
|
const k = 2 / X.maxRange;
|
|
3015
3038
|
return {
|
|
3016
|
-
x: (
|
|
3017
|
-
y: (
|
|
3018
|
-
z: (
|
|
3039
|
+
x: (z.x - (X.xMin + X.xMax) / 2) * k,
|
|
3040
|
+
y: (z.y - (X.yMin + X.yMax) / 2) * k,
|
|
3041
|
+
z: (z.z - (X.zMin + X.zMax) / 2) * k
|
|
3019
3042
|
};
|
|
3020
3043
|
},
|
|
3021
3044
|
[X]
|
|
3022
|
-
), ae =
|
|
3023
|
-
(
|
|
3024
|
-
!h && !y || (se(!0), Y({ x:
|
|
3045
|
+
), ae = q(
|
|
3046
|
+
(z) => {
|
|
3047
|
+
!h && !y || (se(!0), Y({ x: z.clientX, y: z.clientY, viewState: { ...U } }));
|
|
3025
3048
|
},
|
|
3026
3049
|
[h, y, U]
|
|
3027
|
-
), G =
|
|
3028
|
-
(
|
|
3050
|
+
), G = q(
|
|
3051
|
+
(z) => {
|
|
3029
3052
|
if (!pe || !ne)
|
|
3030
3053
|
return;
|
|
3031
|
-
const k =
|
|
3032
|
-
|
|
3054
|
+
const k = z.clientX - ne.x, d = z.clientY - ne.y;
|
|
3055
|
+
z.shiftKey && y ? de({
|
|
3033
3056
|
...ne.viewState,
|
|
3034
3057
|
panX: ne.viewState.panX + k * 2e-3,
|
|
3035
3058
|
panY: ne.viewState.panY + d * 2e-3
|
|
@@ -3040,14 +3063,14 @@ function nn({
|
|
|
3040
3063
|
});
|
|
3041
3064
|
},
|
|
3042
3065
|
[pe, ne, h, y]
|
|
3043
|
-
), C =
|
|
3066
|
+
), C = q(() => {
|
|
3044
3067
|
se(!1), Y(null);
|
|
3045
|
-
}, []), Q =
|
|
3046
|
-
(
|
|
3068
|
+
}, []), Q = q(
|
|
3069
|
+
(z) => {
|
|
3047
3070
|
if (!p)
|
|
3048
3071
|
return;
|
|
3049
|
-
|
|
3050
|
-
const k =
|
|
3072
|
+
z.preventDefault();
|
|
3073
|
+
const k = z.deltaY > 0 ? 0.9 : 1.1;
|
|
3051
3074
|
de((d) => ({
|
|
3052
3075
|
...d,
|
|
3053
3076
|
zoom: Math.max(0.1, Math.min(10, d.zoom * k))
|
|
@@ -3059,7 +3082,7 @@ function nn({
|
|
|
3059
3082
|
case "dark":
|
|
3060
3083
|
return {
|
|
3061
3084
|
bg: "var(--nice-bg, #1a1a2e)",
|
|
3062
|
-
text: "var(--nice-
|
|
3085
|
+
text: "var(--nice-text-secondary, #e0e0e0)",
|
|
3063
3086
|
axis: "var(--nice-text-secondary, #555)",
|
|
3064
3087
|
grid: "var(--nice-text, #333)"
|
|
3065
3088
|
};
|
|
@@ -3080,13 +3103,13 @@ function nn({
|
|
|
3080
3103
|
}
|
|
3081
3104
|
}, [F]), re = K(() => {
|
|
3082
3105
|
var k;
|
|
3083
|
-
const
|
|
3106
|
+
const z = [];
|
|
3084
3107
|
for (const d of e)
|
|
3085
3108
|
if (d.type === "scatter3d") {
|
|
3086
3109
|
const x = d, S = x.points.map((E) => {
|
|
3087
|
-
var
|
|
3110
|
+
var A, W, T, le, fe;
|
|
3088
3111
|
const N = Z(E), _ = Me(N, w, U);
|
|
3089
|
-
let g = (
|
|
3112
|
+
let g = (A = x.marker) == null ? void 0 : A.color;
|
|
3090
3113
|
if (Array.isArray((W = x.marker) == null ? void 0 : W.color)) {
|
|
3091
3114
|
const be = x.points.indexOf(E);
|
|
3092
3115
|
g = ke(
|
|
@@ -3109,7 +3132,7 @@ function nn({
|
|
|
3109
3132
|
original: E
|
|
3110
3133
|
};
|
|
3111
3134
|
});
|
|
3112
|
-
|
|
3135
|
+
z.push({ type: "scatter", points: S, data: d });
|
|
3113
3136
|
} else if (d.type === "surface" || d.type === "wireframe") {
|
|
3114
3137
|
const x = d, S = [];
|
|
3115
3138
|
for (let E = 0; E < x.xData.length; E++)
|
|
@@ -3118,35 +3141,35 @@ function nn({
|
|
|
3118
3141
|
x: x.xData[E],
|
|
3119
3142
|
y: x.yData[N],
|
|
3120
3143
|
z: x.zData[E][N]
|
|
3121
|
-
}, g = Z(_), M = Me(g, w, U),
|
|
3144
|
+
}, g = Z(_), M = Me(g, w, U), A = ke(
|
|
3122
3145
|
((k = x.colorData) == null ? void 0 : k[E][N]) ?? x.zData[E][N],
|
|
3123
3146
|
X.colorMin,
|
|
3124
3147
|
X.colorMax,
|
|
3125
3148
|
x.colorScale || "viridis"
|
|
3126
3149
|
);
|
|
3127
|
-
S.push({ ...M, color:
|
|
3150
|
+
S.push({ ...M, color: A, size: 3, original: _ });
|
|
3128
3151
|
}
|
|
3129
|
-
|
|
3152
|
+
z.push({ type: d.type, points: S, data: d });
|
|
3130
3153
|
}
|
|
3131
|
-
for (const d of
|
|
3154
|
+
for (const d of z)
|
|
3132
3155
|
d.points.sort((x, S) => x.depth - S.depth);
|
|
3133
|
-
return
|
|
3156
|
+
return z;
|
|
3134
3157
|
}, [e, U, w, Z, X]), ie = K(() => {
|
|
3135
3158
|
var d, x, S;
|
|
3136
3159
|
if (!m)
|
|
3137
3160
|
return null;
|
|
3138
|
-
const
|
|
3161
|
+
const z = 1.2, k = {
|
|
3139
3162
|
x: [
|
|
3140
|
-
Me({ x: -
|
|
3141
|
-
Me({ x:
|
|
3163
|
+
Me({ x: -z, y: 0, z: 0 }, w, U),
|
|
3164
|
+
Me({ x: z, y: 0, z: 0 }, w, U)
|
|
3142
3165
|
],
|
|
3143
3166
|
y: [
|
|
3144
|
-
Me({ x: 0, y: -
|
|
3145
|
-
Me({ x: 0, y:
|
|
3167
|
+
Me({ x: 0, y: -z, z: 0 }, w, U),
|
|
3168
|
+
Me({ x: 0, y: z, z: 0 }, w, U)
|
|
3146
3169
|
],
|
|
3147
3170
|
z: [
|
|
3148
|
-
Me({ x: 0, y: 0, z: -
|
|
3149
|
-
Me({ x: 0, y: 0, z
|
|
3171
|
+
Me({ x: 0, y: 0, z: -z }, w, U),
|
|
3172
|
+
Me({ x: 0, y: 0, z }, w, U)
|
|
3150
3173
|
]
|
|
3151
3174
|
};
|
|
3152
3175
|
return /* @__PURE__ */ u("g", { className: "nice-3d-plot__axes", children: [
|
|
@@ -3247,8 +3270,8 @@ function nn({
|
|
|
3247
3270
|
),
|
|
3248
3271
|
/* @__PURE__ */ u("svg", { width: "100%", height: "100%", style: { position: "absolute", top: 0, left: 0 }, children: [
|
|
3249
3272
|
ie,
|
|
3250
|
-
re.map((
|
|
3251
|
-
|
|
3273
|
+
re.map((z, k) => /* @__PURE__ */ u("g", { className: "nice-3d-plot__data", children: [
|
|
3274
|
+
z.type === "scatter" && z.points.map((d, x) => {
|
|
3252
3275
|
var S;
|
|
3253
3276
|
return /* @__PURE__ */ o(
|
|
3254
3277
|
"circle",
|
|
@@ -3257,7 +3280,7 @@ function nn({
|
|
|
3257
3280
|
cy: `${d.y}%`,
|
|
3258
3281
|
r: d.size || 4,
|
|
3259
3282
|
fill: d.color || "var(--nice-primary, #3498db)",
|
|
3260
|
-
opacity: ((S =
|
|
3283
|
+
opacity: ((S = z.data.marker) == null ? void 0 : S.opacity) ?? 0.8,
|
|
3261
3284
|
style: { cursor: te ? "pointer" : void 0 },
|
|
3262
3285
|
onMouseEnter: () => {
|
|
3263
3286
|
ue({ point: d.original, dataIndex: k }), V == null || V(d.original, k);
|
|
@@ -3270,7 +3293,7 @@ function nn({
|
|
|
3270
3293
|
x
|
|
3271
3294
|
);
|
|
3272
3295
|
}),
|
|
3273
|
-
(
|
|
3296
|
+
(z.type === "surface" || z.type === "wireframe") && z.points.map((d, x) => /* @__PURE__ */ o(
|
|
3274
3297
|
"rect",
|
|
3275
3298
|
{
|
|
3276
3299
|
x: `${d.x - 1}%`,
|
|
@@ -3278,11 +3301,11 @@ function nn({
|
|
|
3278
3301
|
width: "2%",
|
|
3279
3302
|
height: "2%",
|
|
3280
3303
|
fill: d.color || "var(--nice-primary, #3498db)",
|
|
3281
|
-
opacity:
|
|
3304
|
+
opacity: z.data.opacity ?? 0.7
|
|
3282
3305
|
},
|
|
3283
3306
|
x
|
|
3284
3307
|
))
|
|
3285
|
-
] },
|
|
3308
|
+
] }, z.data.id || k))
|
|
3286
3309
|
] }),
|
|
3287
3310
|
l && e.length > 1 && /* @__PURE__ */ o(
|
|
3288
3311
|
"div",
|
|
@@ -3298,7 +3321,7 @@ function nn({
|
|
|
3298
3321
|
...c === "bottom-right" && { bottom: 8, right: 8 },
|
|
3299
3322
|
...c === "bottom-left" && { bottom: 8, left: 8 }
|
|
3300
3323
|
},
|
|
3301
|
-
children: e.map((
|
|
3324
|
+
children: e.map((z, k) => /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
3302
3325
|
/* @__PURE__ */ o(
|
|
3303
3326
|
"span",
|
|
3304
3327
|
{
|
|
@@ -3310,8 +3333,8 @@ function nn({
|
|
|
3310
3333
|
}
|
|
3311
3334
|
}
|
|
3312
3335
|
),
|
|
3313
|
-
|
|
3314
|
-
] },
|
|
3336
|
+
z.name
|
|
3337
|
+
] }, z.id || k))
|
|
3315
3338
|
}
|
|
3316
3339
|
),
|
|
3317
3340
|
s && /* @__PURE__ */ u(
|
|
@@ -3342,7 +3365,7 @@ function nn({
|
|
|
3342
3365
|
bottom: 8,
|
|
3343
3366
|
left: 8,
|
|
3344
3367
|
background: "var(--nice-overlay-80, rgba(0, 0, 0, 0.8))",
|
|
3345
|
-
color: "var(--nice-
|
|
3368
|
+
color: "var(--nice-text-on-primary, #fff)",
|
|
3346
3369
|
padding: "4px 8px",
|
|
3347
3370
|
borderRadius: 4,
|
|
3348
3371
|
fontSize: "0.75rem"
|
|
@@ -3361,7 +3384,7 @@ function nn({
|
|
|
3361
3384
|
/* @__PURE__ */ o("div", { style: { position: "absolute", bottom: 8, right: 8, display: "flex", gap: 4 }, children: /* @__PURE__ */ o(
|
|
3362
3385
|
"button",
|
|
3363
3386
|
{
|
|
3364
|
-
onClick: () => de(
|
|
3387
|
+
onClick: () => de(qe),
|
|
3365
3388
|
style: { padding: "4px 8px", fontSize: "0.75rem", cursor: "pointer" },
|
|
3366
3389
|
children: "Reset View"
|
|
3367
3390
|
}
|
|
@@ -3569,7 +3592,9 @@ function rn({
|
|
|
3569
3592
|
labelType: l = "element",
|
|
3570
3593
|
width: c = "100%",
|
|
3571
3594
|
height: h = 500,
|
|
3572
|
-
|
|
3595
|
+
// A molecule viewport is a black stage in both themes; --nice-text turned it white
|
|
3596
|
+
// in the dark theme.
|
|
3597
|
+
backgroundColor: p = "#000000",
|
|
3573
3598
|
enableRotation: y = !0,
|
|
3574
3599
|
enableZoom: m = !0,
|
|
3575
3600
|
showControls: $ = !0,
|
|
@@ -3586,7 +3611,7 @@ function rn({
|
|
|
3586
3611
|
className: pe,
|
|
3587
3612
|
styleOverride: se
|
|
3588
3613
|
}) {
|
|
3589
|
-
const ne =
|
|
3614
|
+
const ne = ze(null), [Y, ce] = j(null), [ue, me] = j({
|
|
3590
3615
|
rotX: 0,
|
|
3591
3616
|
rotY: 0,
|
|
3592
3617
|
rotZ: 0,
|
|
@@ -3613,23 +3638,23 @@ function rn({
|
|
|
3613
3638
|
const { center: re, scale: ie } = K(() => {
|
|
3614
3639
|
if (!Y || Y.atoms.length === 0)
|
|
3615
3640
|
return { center: { x: 0, y: 0, z: 0 }, scale: 1 };
|
|
3616
|
-
let g = 1 / 0, M = -1 / 0,
|
|
3641
|
+
let g = 1 / 0, M = -1 / 0, A = 1 / 0, W = -1 / 0, T = 1 / 0, le = -1 / 0;
|
|
3617
3642
|
for (const ye of Y.atoms)
|
|
3618
|
-
g = Math.min(g, ye.x), M = Math.max(M, ye.x),
|
|
3643
|
+
g = Math.min(g, ye.x), M = Math.max(M, ye.x), A = Math.min(A, ye.y), W = Math.max(W, ye.y), T = Math.min(T, ye.z), le = Math.max(le, ye.z);
|
|
3619
3644
|
const fe = {
|
|
3620
3645
|
x: (g + M) / 2,
|
|
3621
|
-
y: (
|
|
3646
|
+
y: (A + W) / 2,
|
|
3622
3647
|
z: (T + le) / 2
|
|
3623
|
-
}, be = Math.max(M - g, W -
|
|
3648
|
+
}, be = Math.max(M - g, W - A, le - T), ge = be > 0 ? 35 / be : 1;
|
|
3624
3649
|
return { center: fe, scale: ge };
|
|
3625
|
-
}, [Y]),
|
|
3650
|
+
}, [Y]), z = K(() => Y ? Y.atoms.filter((g) => !i && g.element === "H" || !s && g.residueName === "HOH" ? !1 : g.visible !== !1).map((g) => ({
|
|
3626
3651
|
atom: g,
|
|
3627
3652
|
...je(g.x, g.y, g.z, ue, re, ie)
|
|
3628
3653
|
})).sort((g, M) => g.depth - M.depth) : [], [Y, ue, re, ie, i, s]), k = K(() => Y ? Y.bonds.filter((g) => g.visible !== !1).map((g) => {
|
|
3629
|
-
const M = Y.atoms[g.atom1],
|
|
3630
|
-
if (!M || !
|
|
3654
|
+
const M = Y.atoms[g.atom1], A = Y.atoms[g.atom2];
|
|
3655
|
+
if (!M || !A || !i && (M.element === "H" || A.element === "H"))
|
|
3631
3656
|
return null;
|
|
3632
|
-
const W = je(M.x, M.y, M.z, ue, re, ie), T = je(
|
|
3657
|
+
const W = je(M.x, M.y, M.z, ue, re, ie), T = je(A.x, A.y, A.z, ue, re, ie);
|
|
3633
3658
|
return {
|
|
3634
3659
|
bond: g,
|
|
3635
3660
|
x1: W.x,
|
|
@@ -3638,41 +3663,41 @@ function rn({
|
|
|
3638
3663
|
y2: T.y,
|
|
3639
3664
|
depth: (W.depth + T.depth) / 2,
|
|
3640
3665
|
color1: M.color,
|
|
3641
|
-
color2:
|
|
3666
|
+
color2: A.color
|
|
3642
3667
|
};
|
|
3643
|
-
}).filter(Boolean).sort((g, M) => g.depth - M.depth) : [], [Y, ue, re, ie, i]), d =
|
|
3668
|
+
}).filter(Boolean).sort((g, M) => g.depth - M.depth) : [], [Y, ue, re, ie, i]), d = q(
|
|
3644
3669
|
(g) => {
|
|
3645
3670
|
y && (X(!0), ae({ x: g.clientX, y: g.clientY, view: { ...ue } }));
|
|
3646
3671
|
},
|
|
3647
3672
|
[y, ue]
|
|
3648
|
-
), x =
|
|
3673
|
+
), x = q(
|
|
3649
3674
|
(g) => {
|
|
3650
3675
|
if (!xe || !Z)
|
|
3651
3676
|
return;
|
|
3652
|
-
const M = g.clientX - Z.x,
|
|
3677
|
+
const M = g.clientX - Z.x, A = g.clientY - Z.y;
|
|
3653
3678
|
g.shiftKey ? me({
|
|
3654
3679
|
...Z.view,
|
|
3655
3680
|
panX: Z.view.panX + M * 0.1,
|
|
3656
|
-
panY: Z.view.panY +
|
|
3681
|
+
panY: Z.view.panY + A * 0.1
|
|
3657
3682
|
}) : me({
|
|
3658
3683
|
...Z.view,
|
|
3659
3684
|
rotY: Z.view.rotY + M * 0.5,
|
|
3660
|
-
rotX: Z.view.rotX +
|
|
3685
|
+
rotX: Z.view.rotX + A * 0.5
|
|
3661
3686
|
});
|
|
3662
3687
|
},
|
|
3663
3688
|
[xe, Z]
|
|
3664
|
-
), S =
|
|
3689
|
+
), S = q(() => {
|
|
3665
3690
|
X(!1), ae(null);
|
|
3666
|
-
}, []), E =
|
|
3691
|
+
}, []), E = q(
|
|
3667
3692
|
(g) => {
|
|
3668
3693
|
if (!m)
|
|
3669
3694
|
return;
|
|
3670
3695
|
g.preventDefault();
|
|
3671
3696
|
const M = g.deltaY > 0 ? 0.9 : 1.1;
|
|
3672
|
-
me((
|
|
3697
|
+
me((A) => ({ ...A, zoom: Math.max(0.1, Math.min(10, A.zoom * M)) }));
|
|
3673
3698
|
},
|
|
3674
3699
|
[m]
|
|
3675
|
-
), N =
|
|
3700
|
+
), N = q(
|
|
3676
3701
|
(g) => {
|
|
3677
3702
|
switch (Q) {
|
|
3678
3703
|
case "space-filling":
|
|
@@ -3687,7 +3712,7 @@ function rn({
|
|
|
3687
3712
|
}
|
|
3688
3713
|
},
|
|
3689
3714
|
[Q]
|
|
3690
|
-
), _ =
|
|
3715
|
+
), _ = q(
|
|
3691
3716
|
(g) => (Q === "wireframe" ? 1 : Q === "stick" ? 3 : 2) * (g.order || 1),
|
|
3692
3717
|
[Q]
|
|
3693
3718
|
);
|
|
@@ -3725,7 +3750,7 @@ function rn({
|
|
|
3725
3750
|
},
|
|
3726
3751
|
`bond-${M}`
|
|
3727
3752
|
)),
|
|
3728
|
-
|
|
3753
|
+
z.map(({ atom: g, x: M, y: A }) => {
|
|
3729
3754
|
var fe;
|
|
3730
3755
|
const W = (fe = te == null ? void 0 : te.atoms) == null ? void 0 : fe.includes(g.id), T = (G == null ? void 0 : G.id) === g.id, le = N(g);
|
|
3731
3756
|
return /* @__PURE__ */ u("g", { children: [
|
|
@@ -3733,10 +3758,10 @@ function rn({
|
|
|
3733
3758
|
"circle",
|
|
3734
3759
|
{
|
|
3735
3760
|
cx: `${M}%`,
|
|
3736
|
-
cy: `${
|
|
3761
|
+
cy: `${A}%`,
|
|
3737
3762
|
r: le,
|
|
3738
|
-
fill: g.color || tt[g.element] || "
|
|
3739
|
-
stroke: W ? V : T ? "
|
|
3763
|
+
fill: g.color || tt[g.element] || "#808080",
|
|
3764
|
+
stroke: W ? V : T ? "#fff" : "none",
|
|
3740
3765
|
strokeWidth: W || T ? 2 : 0,
|
|
3741
3766
|
style: { cursor: "pointer" },
|
|
3742
3767
|
onMouseEnter: () => {
|
|
@@ -3752,8 +3777,8 @@ function rn({
|
|
|
3752
3777
|
"text",
|
|
3753
3778
|
{
|
|
3754
3779
|
x: `${M}%`,
|
|
3755
|
-
y: `${
|
|
3756
|
-
fill: "var(--nice-
|
|
3780
|
+
y: `${A - le * 0.15}%`,
|
|
3781
|
+
fill: "var(--nice-text-on-primary, #fff)",
|
|
3757
3782
|
fontSize: "10",
|
|
3758
3783
|
textAnchor: "middle",
|
|
3759
3784
|
dominantBaseline: "middle",
|
|
@@ -3766,10 +3791,10 @@ function rn({
|
|
|
3766
3791
|
w.map((g) => {
|
|
3767
3792
|
if (g.atoms.length < 2)
|
|
3768
3793
|
return null;
|
|
3769
|
-
const M = Y.atoms[g.atoms[0]],
|
|
3770
|
-
if (!M || !
|
|
3794
|
+
const M = Y.atoms[g.atoms[0]], A = Y.atoms[g.atoms[1]];
|
|
3795
|
+
if (!M || !A)
|
|
3771
3796
|
return null;
|
|
3772
|
-
const W = je(M.x, M.y, M.z, ue, re, ie), T = je(
|
|
3797
|
+
const W = je(M.x, M.y, M.z, ue, re, ie), T = je(A.x, A.y, A.z, ue, re, ie);
|
|
3773
3798
|
return /* @__PURE__ */ u("g", { children: [
|
|
3774
3799
|
/* @__PURE__ */ o(
|
|
3775
3800
|
"line",
|
|
@@ -3808,7 +3833,7 @@ function rn({
|
|
|
3808
3833
|
position: "absolute",
|
|
3809
3834
|
top: 8,
|
|
3810
3835
|
left: 8,
|
|
3811
|
-
color: "var(--nice-
|
|
3836
|
+
color: "var(--nice-text-primary, #fff)",
|
|
3812
3837
|
fontSize: "0.8rem"
|
|
3813
3838
|
},
|
|
3814
3839
|
children: [
|
|
@@ -3834,7 +3859,7 @@ function rn({
|
|
|
3834
3859
|
bottom: 8,
|
|
3835
3860
|
left: 8,
|
|
3836
3861
|
background: "var(--nice-overlay-80, rgba(0, 0, 0, 0.8))",
|
|
3837
|
-
color: "var(--nice-
|
|
3862
|
+
color: "var(--nice-text-on-primary, #fff)",
|
|
3838
3863
|
padding: "4px 8px",
|
|
3839
3864
|
borderRadius: 4,
|
|
3840
3865
|
fontSize: "0.75rem"
|
|
@@ -4027,7 +4052,7 @@ function on({
|
|
|
4027
4052
|
className: Y,
|
|
4028
4053
|
style: ce
|
|
4029
4054
|
}) {
|
|
4030
|
-
const ue =
|
|
4055
|
+
const ue = ze(null), [me, xe] = j(1), [X, Z] = j({ x: 0, y: 0 }), [ae, G] = j(!1), [C, Q] = j(null), [ee, re] = j(null), [ie, z] = j(t), [k, d] = j(/* @__PURE__ */ new Set()), x = K(() => e ? typeof e == "string" ? Wt(e) : e : null, [e]), S = K(() => {
|
|
4031
4056
|
if (!x)
|
|
4032
4057
|
return null;
|
|
4033
4058
|
const v = (D) => {
|
|
@@ -4046,21 +4071,21 @@ function on({
|
|
|
4046
4071
|
it(S, D, { value: 0 }), ot(S, v, 0);
|
|
4047
4072
|
const f = Math.max(...Array.from(v.values()));
|
|
4048
4073
|
return { positions: { x: v, y: D }, leafCount: B, maxX: f || 1 };
|
|
4049
|
-
}, [S]), g = K(() => S ? nt(S) : [], [S]), M = typeof V == "number" ? V : 800,
|
|
4074
|
+
}, [S]), g = K(() => S ? nt(S) : [], [S]), M = typeof V == "number" ? V : 800, A = typeof L == "number" ? L : 500, W = M - H * 2, T = A - H * 2, le = (v) => H + v / _ * W * 0.7, fe = (v) => H + v / (N - 1 || 1) * T, be = (v, D) => {
|
|
4050
4075
|
const B = D / (N - 1 || 1) * 2 * Math.PI - Math.PI / 2, f = v / _ * Math.min(W, T) * 0.4;
|
|
4051
4076
|
return {
|
|
4052
4077
|
x: M / 2 + f * Math.cos(B),
|
|
4053
|
-
y:
|
|
4078
|
+
y: A / 2 + f * Math.sin(B)
|
|
4054
4079
|
};
|
|
4055
4080
|
}, ge = (v) => {
|
|
4056
4081
|
const D = E.x.get(v) || 0, B = E.y.get(v) || 0;
|
|
4057
4082
|
return ie === "radial" || ie === "circular" ? be(D, B) : { x: le(D), y: fe(B) };
|
|
4058
|
-
}, ye =
|
|
4083
|
+
}, ye = q(
|
|
4059
4084
|
(v) => {
|
|
4060
4085
|
U && (G(!0), Q({ x: v.clientX, y: v.clientY, pan: { ...X } }));
|
|
4061
4086
|
},
|
|
4062
4087
|
[U, X]
|
|
4063
|
-
), we =
|
|
4088
|
+
), we = q(
|
|
4064
4089
|
(v) => {
|
|
4065
4090
|
if (!ae || !C)
|
|
4066
4091
|
return;
|
|
@@ -4068,9 +4093,9 @@ function on({
|
|
|
4068
4093
|
Z({ x: C.pan.x + D, y: C.pan.y + B });
|
|
4069
4094
|
},
|
|
4070
4095
|
[ae, C]
|
|
4071
|
-
), Se =
|
|
4096
|
+
), Se = q(() => {
|
|
4072
4097
|
G(!1), Q(null);
|
|
4073
|
-
}, []), Le =
|
|
4098
|
+
}, []), Le = q(
|
|
4074
4099
|
(v) => {
|
|
4075
4100
|
if (!oe)
|
|
4076
4101
|
return;
|
|
@@ -4079,7 +4104,7 @@ function on({
|
|
|
4079
4104
|
xe((B) => Math.max(0.1, Math.min(5, B * D)));
|
|
4080
4105
|
},
|
|
4081
4106
|
[oe]
|
|
4082
|
-
), _e =
|
|
4107
|
+
), _e = q((v) => {
|
|
4083
4108
|
d((D) => {
|
|
4084
4109
|
const B = new Set(D);
|
|
4085
4110
|
return B.has(v) ? B.delete(v) : B.add(v), B;
|
|
@@ -4232,7 +4257,7 @@ function on({
|
|
|
4232
4257
|
x: D.x,
|
|
4233
4258
|
y: D.y - i - 2,
|
|
4234
4259
|
fontSize: p * 0.8,
|
|
4235
|
-
fill: "var(--nice-accent-pink, #e91e63)",
|
|
4260
|
+
fill: "var(--nice-color-accent-pink, #e91e63)",
|
|
4236
4261
|
textAnchor: "middle",
|
|
4237
4262
|
children: v.bootstrap.toFixed(0)
|
|
4238
4263
|
}
|
|
@@ -4402,7 +4427,7 @@ function on({
|
|
|
4402
4427
|
"select",
|
|
4403
4428
|
{
|
|
4404
4429
|
value: ie,
|
|
4405
|
-
onChange: (v) =>
|
|
4430
|
+
onChange: (v) => z(v.target.value),
|
|
4406
4431
|
style: { padding: "2px 4px", fontSize: "0.75rem" },
|
|
4407
4432
|
children: [
|
|
4408
4433
|
/* @__PURE__ */ o("option", { value: "rectangular", children: "Rectangular" }),
|
|
@@ -4502,7 +4527,7 @@ function Yt(e, t, n, r) {
|
|
|
4502
4527
|
const c = n / (2 * Math.PI), h = n / 2 + c * De(t) * a, p = r / 2 - c * l * 1.3523 * Math.sign(e);
|
|
4503
4528
|
return { x: h, y: p };
|
|
4504
4529
|
}
|
|
4505
|
-
const
|
|
4530
|
+
const Pt = `
|
|
4506
4531
|
M 50,30 L 55,28 60,30 65,35 60,40 55,42 50,40 Z
|
|
4507
4532
|
M 70,25 L 80,23 85,28 87,35 85,45 78,50 72,48 68,40 70,32 Z
|
|
4508
4533
|
M 55,55 L 58,52 65,55 68,60 65,70 58,75 52,70 50,60 Z
|
|
@@ -4545,9 +4570,9 @@ function sn({
|
|
|
4545
4570
|
style: xe
|
|
4546
4571
|
}) {
|
|
4547
4572
|
var Ee, v, D, B;
|
|
4548
|
-
const X =
|
|
4573
|
+
const X = ze(null), [Z, ae] = j(l), [G, C] = j(c), [Q, ee] = j(!1), [re, ie] = j(null), [z, k] = j(null), [d, x] = j(e), [S, E] = j(
|
|
4549
4574
|
new Set(t.filter((f) => f.visible !== !1).map((f) => f.id))
|
|
4550
|
-
), N = typeof te == "number" ? te : 800, _ = typeof V == "number" ? V : 400, g =
|
|
4575
|
+
), N = typeof te == "number" ? te : 800, _ = typeof V == "number" ? V : 400, g = q(
|
|
4551
4576
|
(f, b) => {
|
|
4552
4577
|
switch (d) {
|
|
4553
4578
|
case "mercator":
|
|
@@ -4562,13 +4587,13 @@ function sn({
|
|
|
4562
4587
|
}
|
|
4563
4588
|
},
|
|
4564
4589
|
[d, N, _, Z]
|
|
4565
|
-
), M =
|
|
4590
|
+
), M = q(
|
|
4566
4591
|
(f, b) => {
|
|
4567
4592
|
const O = f / N * 360 - 180, I = 90 - b / _ * 180;
|
|
4568
4593
|
return { lat: Math.max(-90, Math.min(90, I)), lng: Math.max(-180, Math.min(180, O)) };
|
|
4569
4594
|
},
|
|
4570
4595
|
[N, _]
|
|
4571
|
-
),
|
|
4596
|
+
), A = K(() => {
|
|
4572
4597
|
const f = [];
|
|
4573
4598
|
for (let b = -90 + p; b < 90; b += p) {
|
|
4574
4599
|
let O = "";
|
|
@@ -4610,12 +4635,12 @@ function sn({
|
|
|
4610
4635
|
for (const b of t)
|
|
4611
4636
|
S.has(b.id) && b.polygons && f.push(...b.polygons);
|
|
4612
4637
|
return f;
|
|
4613
|
-
}, [i, t, S]), be =
|
|
4638
|
+
}, [i, t, S]), be = q(
|
|
4614
4639
|
(f) => {
|
|
4615
4640
|
L && (ee(!0), ie({ x: f.clientX, y: f.clientY, center: { ...Z } }));
|
|
4616
4641
|
},
|
|
4617
4642
|
[L, Z]
|
|
4618
|
-
), ge =
|
|
4643
|
+
), ge = q(
|
|
4619
4644
|
(f) => {
|
|
4620
4645
|
if (!Q || !re)
|
|
4621
4646
|
return;
|
|
@@ -4626,9 +4651,9 @@ function sn({
|
|
|
4626
4651
|
});
|
|
4627
4652
|
},
|
|
4628
4653
|
[Q, re, N, _, G]
|
|
4629
|
-
), ye =
|
|
4654
|
+
), ye = q(() => {
|
|
4630
4655
|
ee(!1), ie(null);
|
|
4631
|
-
}, []), we =
|
|
4656
|
+
}, []), we = q(
|
|
4632
4657
|
(f) => {
|
|
4633
4658
|
if (!H)
|
|
4634
4659
|
return;
|
|
@@ -4637,7 +4662,7 @@ function sn({
|
|
|
4637
4662
|
C((O) => Math.max(0.5, Math.min(20, O * b)));
|
|
4638
4663
|
},
|
|
4639
4664
|
[H]
|
|
4640
|
-
), Se =
|
|
4665
|
+
), Se = q(
|
|
4641
4666
|
(f) => {
|
|
4642
4667
|
var R;
|
|
4643
4668
|
if (!Y)
|
|
@@ -4653,7 +4678,7 @@ function sn({
|
|
|
4653
4678
|
const b = g(f.position.lat, f.position.lng);
|
|
4654
4679
|
if (b.visible === !1)
|
|
4655
4680
|
return null;
|
|
4656
|
-
const O = (
|
|
4681
|
+
const O = (z == null ? void 0 : z.id) === f.id, I = (f.size || 8) * (O ? 1.3 : 1), R = (() => {
|
|
4657
4682
|
switch (f.shape) {
|
|
4658
4683
|
case "square":
|
|
4659
4684
|
return /* @__PURE__ */ o("rect", { x: b.x - I / 2, y: b.y - I / 2, width: I, height: I });
|
|
@@ -4689,7 +4714,7 @@ function sn({
|
|
|
4689
4714
|
return /* @__PURE__ */ u(
|
|
4690
4715
|
"g",
|
|
4691
4716
|
{
|
|
4692
|
-
fill: f.color || "var(--nice-accent-pink, #e91e63)",
|
|
4717
|
+
fill: f.color || "var(--nice-color-accent-pink, #e91e63)",
|
|
4693
4718
|
stroke: O ? "var(--nice-text, #000)" : "var(--nice-bg, #fff)",
|
|
4694
4719
|
strokeWidth: O ? 2 : 1,
|
|
4695
4720
|
style: { cursor: "pointer" },
|
|
@@ -4792,7 +4817,7 @@ function sn({
|
|
|
4792
4817
|
children: [
|
|
4793
4818
|
/* @__PURE__ */ u("svg", { width: "100%", height: "100%", children: [
|
|
4794
4819
|
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ o("marker", { id: "arrow", markerWidth: "10", markerHeight: "10", refX: "9", refY: "3", orient: "auto", children: /* @__PURE__ */ o("path", { d: "M0,0 L0,6 L9,3 z", fill: "var(--nice-primary, #2196f3)" }) }) }),
|
|
4795
|
-
d === "orthographic" && W && /* @__PURE__ */ u(
|
|
4820
|
+
d === "orthographic" && W && /* @__PURE__ */ u(Ae, { children: [
|
|
4796
4821
|
/* @__PURE__ */ o(
|
|
4797
4822
|
"path",
|
|
4798
4823
|
{
|
|
@@ -4813,7 +4838,7 @@ function sn({
|
|
|
4813
4838
|
}
|
|
4814
4839
|
)
|
|
4815
4840
|
] }),
|
|
4816
|
-
h &&
|
|
4841
|
+
h && A.map((f, b) => /* @__PURE__ */ o(
|
|
4817
4842
|
"path",
|
|
4818
4843
|
{
|
|
4819
4844
|
d: f,
|
|
@@ -4827,7 +4852,7 @@ function sn({
|
|
|
4827
4852
|
y && d !== "orthographic" && /* @__PURE__ */ o("g", { transform: `scale(${N / 100}, ${_ / 100})`, children: /* @__PURE__ */ o(
|
|
4828
4853
|
"path",
|
|
4829
4854
|
{
|
|
4830
|
-
d:
|
|
4855
|
+
d: Pt,
|
|
4831
4856
|
fill: $,
|
|
4832
4857
|
stroke: F,
|
|
4833
4858
|
strokeWidth: 0.2
|
|
@@ -4844,7 +4869,9 @@ function sn({
|
|
|
4844
4869
|
position: "absolute",
|
|
4845
4870
|
[(Ee = U.position) != null && Ee.includes("bottom") ? "bottom" : "top"]: 8,
|
|
4846
4871
|
[(v = U.position) != null && v.includes("right") ? "right" : "left"]: 8,
|
|
4847
|
-
|
|
4872
|
+
// Theme surface + theme text: a fixed white box inherited white text in dark themes.
|
|
4873
|
+
background: "color-mix(in srgb, var(--nice-bg-elevated, #ffffff) 90%, transparent)",
|
|
4874
|
+
color: "var(--nice-text-primary, #333)",
|
|
4848
4875
|
padding: "4px 8px",
|
|
4849
4876
|
borderRadius: 4,
|
|
4850
4877
|
fontSize: "0.7rem"
|
|
@@ -4856,7 +4883,8 @@ function sn({
|
|
|
4856
4883
|
style: {
|
|
4857
4884
|
width: Ne.width,
|
|
4858
4885
|
height: 4,
|
|
4859
|
-
|
|
4886
|
+
// The bar is ink, drawn in the label's colour.
|
|
4887
|
+
background: "currentColor",
|
|
4860
4888
|
marginBottom: 2
|
|
4861
4889
|
}
|
|
4862
4890
|
}
|
|
@@ -4897,23 +4925,23 @@ function sn({
|
|
|
4897
4925
|
]
|
|
4898
4926
|
}
|
|
4899
4927
|
),
|
|
4900
|
-
(
|
|
4928
|
+
(z == null ? void 0 : z.tooltip) && /* @__PURE__ */ o(
|
|
4901
4929
|
"div",
|
|
4902
4930
|
{
|
|
4903
4931
|
style: {
|
|
4904
4932
|
position: "absolute",
|
|
4905
|
-
top: g(
|
|
4906
|
-
left: g(
|
|
4933
|
+
top: g(z.position.lat, z.position.lng).y - 30,
|
|
4934
|
+
left: g(z.position.lat, z.position.lng).x,
|
|
4907
4935
|
transform: "translateX(-50%)",
|
|
4908
4936
|
background: "var(--nice-overlay-80, rgba(0, 0, 0, 0.8))",
|
|
4909
|
-
color: "var(--nice-
|
|
4937
|
+
color: "var(--nice-text-on-primary, #fff)",
|
|
4910
4938
|
padding: "4px 8px",
|
|
4911
4939
|
borderRadius: 4,
|
|
4912
4940
|
fontSize: "0.75rem",
|
|
4913
4941
|
pointerEvents: "none",
|
|
4914
4942
|
whiteSpace: "nowrap"
|
|
4915
4943
|
},
|
|
4916
|
-
children:
|
|
4944
|
+
children: z.tooltip
|
|
4917
4945
|
}
|
|
4918
4946
|
),
|
|
4919
4947
|
/* @__PURE__ */ u(
|
|
@@ -4923,7 +4951,8 @@ function sn({
|
|
|
4923
4951
|
position: "absolute",
|
|
4924
4952
|
bottom: 8,
|
|
4925
4953
|
right: 8,
|
|
4926
|
-
|
|
4954
|
+
// Theme surface at 90 %, so the box flips with its theme-coloured text.
|
|
4955
|
+
background: "color-mix(in srgb, var(--nice-bg-elevated, #ffffff) 90%, transparent)",
|
|
4927
4956
|
padding: "2px 6px",
|
|
4928
4957
|
borderRadius: 4,
|
|
4929
4958
|
fontSize: "0.7rem",
|