hoodini-viz 0.1.0

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.
@@ -0,0 +1,107 @@
1
+ import * as r from "react";
2
+ import { createPortal as J } from "react-dom";
3
+ import { s as Q, i as I, a as U, b as Z, T as ee, C as te, m as re } from "./index-CLh4oIT4.js";
4
+ const ne = () => (t) => t.targetX, ie = () => (t) => t.targetY, se = () => (t) => t.targetWidth, ae = () => (t) => t.targetHeight, oe = () => (t) => t.targetY + 10, le = () => (t) => Math.max(0, (t.targetHeight - 28) / 2), de = /* @__PURE__ */ Q("div")({
5
+ name: "DataGridOverlayEditorStyle",
6
+ class: "gdg-d19meir1",
7
+ propsAsIs: !1,
8
+ vars: {
9
+ "d19meir1-0": [ie(), "px"],
10
+ "d19meir1-1": [ne(), "px"],
11
+ "d19meir1-2": [se(), "px"],
12
+ "d19meir1-3": [ae(), "px"],
13
+ "d19meir1-4": [oe(), "px"],
14
+ "d19meir1-5": [le(), "px"]
15
+ }
16
+ });
17
+ function ue() {
18
+ const [t, s] = r.useState();
19
+ return [t ?? void 0, s];
20
+ }
21
+ function ce() {
22
+ const [t, s] = ue(), [i, h] = r.useState(0), [f, b] = r.useState(!0);
23
+ r.useLayoutEffect(() => {
24
+ if (t === void 0 || !("IntersectionObserver" in window))
25
+ return;
26
+ const a = new IntersectionObserver((o) => {
27
+ o.length !== 0 && b(o[0].isIntersecting);
28
+ }, { threshold: 1 });
29
+ return a.observe(t), () => a.disconnect();
30
+ }, [t]), r.useEffect(() => {
31
+ if (f || t === void 0)
32
+ return;
33
+ let a;
34
+ const o = () => {
35
+ const { right: O } = t.getBoundingClientRect();
36
+ h((m) => Math.min(m + window.innerWidth - O - 10, 0)), a = requestAnimationFrame(o);
37
+ };
38
+ return a = requestAnimationFrame(o), () => {
39
+ a !== void 0 && cancelAnimationFrame(a);
40
+ };
41
+ }, [t, f]);
42
+ const C = r.useMemo(() => ({ transform: `translateX(${i}px)` }), [i]);
43
+ return {
44
+ ref: s,
45
+ style: C
46
+ };
47
+ }
48
+ const ge = (t) => {
49
+ const { target: s, content: i, onFinishEditing: h, forceEditMode: f, initialValue: b, imageEditorOverride: C, markdownDivCreateNode: a, highlight: o, className: O, theme: m, id: W, cell: g, bloom: w, portalElementRef: F, validateCell: p, getCellRenderer: P, provideEditor: T, isOutsideClick: X, customEventTarget: A, activation: x } = t, [l, K] = r.useState(f ? i : void 0), S = r.useRef(l ?? i);
50
+ S.current = l ?? i;
51
+ const [y, R] = r.useState(() => p === void 0 ? !0 : !(I(i) && p?.(g, i, S.current) === !1)), u = r.useCallback((e, n) => {
52
+ h(y ? e : void 0, n);
53
+ }, [y, h]), Y = r.useCallback((e) => {
54
+ if (p !== void 0 && e !== void 0 && I(e)) {
55
+ const n = p(g, e, S.current);
56
+ n === !1 ? R(!1) : (typeof n == "object" && (e = n), R(!0));
57
+ }
58
+ K(e);
59
+ }, [g, p]), E = r.useRef(!1), c = r.useRef(void 0), j = r.useCallback(() => {
60
+ u(l, [0, 0]), E.current = !0;
61
+ }, [l, u]), L = r.useCallback((e, n) => {
62
+ u(e, n ?? c.current ?? [0, 0]), E.current = !0;
63
+ }, [u]), q = r.useCallback(async (e) => {
64
+ let n = !1;
65
+ e.key === "Escape" ? (e.stopPropagation(), e.preventDefault(), c.current = [0, 0]) : e.key === "Enter" && // The shift key is reserved for multi-line editing
66
+ // to allow inserting new lines without closing the editor.
67
+ !e.shiftKey ? (e.stopPropagation(), e.preventDefault(), c.current = [0, 1], n = !0) : e.key === "Tab" && (e.stopPropagation(), e.preventDefault(), c.current = [e.shiftKey ? -1 : 1, 0], n = !0), window.setTimeout(() => {
68
+ !E.current && c.current !== void 0 && (u(n ? l : void 0, c.current), E.current = !0);
69
+ }, 0);
70
+ }, [u, l]), k = l ?? i, [d, B] = r.useMemo(() => {
71
+ if (U(i))
72
+ return [];
73
+ const e = { ...i, location: g, activation: x }, n = T?.(e);
74
+ return n !== void 0 ? [n, !1] : [P(i)?.provideEditor?.(e), !1];
75
+ }, [g, i, P, T, x]), { ref: $, style: z } = ce();
76
+ let M = !0, _, N = !0, v;
77
+ if (d !== void 0) {
78
+ M = d.disablePadding !== !0, N = d.disableStyling !== !0;
79
+ const e = Z(d);
80
+ e && (v = d.styleOverride);
81
+ const n = e ? d.editor : d;
82
+ _ = r.createElement(n, { portalElementRef: F, isHighlighted: o, activation: x, onChange: Y, value: k, initialValue: b, onFinishedEditing: L, validatedSelection: I(k) ? k.selectionRange : void 0, forceEditMode: f, target: s, imageEditorOverride: C, markdownDivCreateNode: a, isValid: y, theme: m });
83
+ }
84
+ v = { ...v, ...z };
85
+ const V = F?.current ?? document.getElementById("portal");
86
+ if (V === null)
87
+ return console.error('Cannot open Data Grid overlay editor, because portal not found. Please, either provide a portalElementRef or add `<div id="portal" />` as the last child of your `<body>`.'), null;
88
+ let D = N ? "gdg-style" : "gdg-unstyle";
89
+ y || (D += " gdg-invalid"), M && (D += " gdg-pad");
90
+ const G = w?.[0] ?? 1, H = w?.[1] ?? 1;
91
+ return J(r.createElement(
92
+ ee.Provider,
93
+ { value: m },
94
+ r.createElement(
95
+ te,
96
+ { style: re(m), className: O, onClickOutside: j, isOutsideClick: X, customEventTarget: A },
97
+ r.createElement(
98
+ de,
99
+ { ref: $, id: W, className: D, style: v, as: B === !0 ? "label" : void 0, targetX: s.x - G, targetY: s.y - H, targetWidth: s.width + G * 2, targetHeight: s.height + H * 2 },
100
+ r.createElement("div", { className: "gdg-clip-region", onKeyDown: q }, _)
101
+ )
102
+ )
103
+ ), V);
104
+ };
105
+ export {
106
+ ge as default
107
+ };
@@ -0,0 +1 @@
1
+ .gdg-r17m35ur{flex-grow:1;border:none;outline:none;background-color:var(--gdg-bg-header-has-focus);border-radius:9px;padding:0 8px;box-shadow:0 0 0 1px var(--gdg-border-color);color:var(--gdg-text-group-header);min-height:var(--r17m35ur-0);font:var(--gdg-header-font-style) var(--gdg-font-family)}.gdg-c1tqibwd{padding:0 8px;display:flex;align-items:center;background-color:var(--gdg-bg-header)}.gdg-s1dgczr6 .dvn-scroller{overflow:var(--s1dgczr6-0);transform:translateZ(0)}.gdg-s1dgczr6 .dvn-hidden{visibility:hidden}.gdg-s1dgczr6 .dvn-scroll-inner{display:flex;pointer-events:none}.gdg-s1dgczr6 .dvn-scroll-inner>*{flex-shrink:0}.gdg-s1dgczr6 .dvn-scroll-inner .dvn-spacer{flex-grow:1}.gdg-s1dgczr6 .dvn-scroll-inner .dvn-stack{display:flex;flex-direction:column}.gdg-s1dgczr6 .dvn-underlay>*{position:absolute;left:0;top:0}.gdg-s1dgczr6 canvas{outline:none}.gdg-s1dgczr6 canvas *{height:0}.gdg-wmyidgi{position:relative;min-width:10px;min-height:10px;max-width:100%;max-height:100%;width:var(--wmyidgi-0);height:var(--wmyidgi-1);overflow:hidden;overflow:clip;direction:ltr}.gdg-wmyidgi>:first-child{position:absolute;left:0;top:0;width:100%;height:100%}.gdg-b1ygi5by{display:flex;flex-wrap:wrap;margin-top:auto;margin-bottom:auto;overflow:auto}.gdg-b1ygi5by .boe-bubble{display:flex;justify-content:center;align-items:center;border-radius:var(--gdg-rounding-radius, calc(var(--gdg-bubble-height) / 2));padding:0 var(--gdg-bubble-padding);height:var(--gdg-bubble-height);background-color:var(--gdg-bg-bubble);color:var(--gdg-text-dark);margin:var(--gdg-bubble-margin);white-space:nowrap}.gdg-b1ygi5by textarea{position:absolute;top:0;left:0;width:0px;height:0px;opacity:0}.gdg-u1rrojo{display:flex;flex-grow:1;align-items:center;min-height:21px}.gdg-u1rrojo .gdg-link-area{flex-grow:1;flex-shrink:1;cursor:pointer;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gdg-link-color);text-decoration:underline!important}.gdg-u1rrojo .gdg-edit-icon{flex-shrink:0;width:32px;color:var(--gdg-accent-color);cursor:pointer;display:flex;justify-content:center;align-items:center}.gdg-u1rrojo .gdg-edit-icon>*{width:24px;height:24px}.gdg-u1rrojo textarea{position:absolute;top:0;left:0;width:0px;height:0px;opacity:0}.gdg-m1pnx84e{min-width:var(--m1pnx84e-0);width:100%;display:flex;align-items:flex-start;justify-content:space-between;position:relative;color:var(--gdg-text-dark)}.gdg-m1pnx84e .gdg-g1y0xocz{flex-shrink:1;min-width:0}.gdg-m1pnx84e .gdg-spacer{flex:1}.gdg-m1pnx84e .gdg-edit-icon{position:relative;cursor:pointer;display:flex;justify-content:center;align-items:center;color:var(--gdg-accent-color);padding:0;height:24px;width:24px;flex-shrink:0;transition:all "0.125s ease";border-radius:6px}.gdg-m1pnx84e .gdg-edit-icon>*{width:16px;height:16px}.gdg-m1pnx84e .gdg-edit-hover :hover{background-color:var(--gdg-accent-light);transition:background-color .15s}.gdg-m1pnx84e .gdg-checkmark-hover :hover{color:#fff;background-color:var(--gdg-accent-color)}.gdg-m1pnx84e .gdg-md-edit-textarea{position:relative;top:0;left:0;width:0px;height:0px;margin-top:25px;opacity:0;padding:0}.gdg-m1pnx84e .gdg-ml-6{margin-left:6px}.gdg-d4zsq0x{display:flex;flex-wrap:wrap}.gdg-d4zsq0x .doe-bubble{display:flex;justify-content:center;align-items:center;padding:0 8px;height:24px;background-color:var(--gdg-bg-cell);color:var(--gdg-text-dark);margin:2px;border-radius:var(--gdg-rounding-radius, 6px);box-shadow:0 0 1px #3e415666,0 1px 3px #3e415666}.gdg-d4zsq0x .doe-bubble img{height:16px;object-fit:contain;margin-right:4px}.gdg-d4zsq0x textarea{position:absolute;top:0;left:0;width:0px;height:0px;opacity:0}.gdg-i2iowwq{display:flex;height:100%}.gdg-i2iowwq .gdg-centering-container{display:flex;justify-content:center;align-items:center;height:100%}.gdg-i2iowwq .gdg-centering-container img,.gdg-i2iowwq .gdg-centering-container canvas{max-height:calc(100vh - var(--overlay-top) - 20px);object-fit:contain;-webkit-user-select:none;user-select:none}.gdg-i2iowwq .gdg-centering-container canvas{max-width:380px}.gdg-i2iowwq .gdg-edit-icon{position:absolute;top:12px;right:0;width:48px;height:48px;color:var(--gdg-accent-color);cursor:pointer;display:flex;justify-content:center;align-items:center}.gdg-i2iowwq .gdg-edit-icon>*{width:24px;height:24px}.gdg-i2iowwq textarea{position:absolute;top:0;left:0;width:0px;height:0px;opacity:0}.gdg-n15fjm3e{display:flex;margin:6px 0 3px;color:var(--gdg-text-dark)}.gdg-n15fjm3e>input{font-size:var(--gdg-editor-font-size);padding:0;font-family:var(--gdg-font-family);color:var(--gdg-text-dark);background-color:var(--gdg-bg-cell)}.gdg-d19meir1{position:absolute;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box;--overlay-top:var(--d19meir1-0);left:var(--d19meir1-1);top:var(--d19meir1-0);min-width:var(--d19meir1-2);min-height:var(--d19meir1-3);width:max-content;max-width:400px;max-height:calc(100vh - var(--d19meir1-4));font-family:var(--gdg-font-family);font-size:var(--gdg-editor-font-size);text-align:start}@-webkit-keyframes glide_fade_in-gdg-d19meir1{0%{opacity:0%}to{opacity:100%}}@keyframes glide_fade_in-gdg-d19meir1{0%{opacity:0%}to{opacity:100%}}.gdg-d19meir1.gdg-style{border-radius:2px;background-color:var(--gdg-bg-cell);box-shadow:0 0 0 1px var(--gdg-accent-color),0 0 1px #3e415666,0 6px 12px #3e415626;animation:glide_fade_in-gdg-d19meir1 60ms 1}.gdg-d19meir1.gdg-pad{padding:var(--d19meir1-5) 8.5px 3px}.gdg-d19meir1 .gdg-clip-region{display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;border-radius:2px;flex-grow:1}.gdg-d19meir1 .gdg-clip-region .gdg-growing-entry{height:100%}.gdg-d19meir1 .gdg-clip-region input.gdg-input{width:100%;border:none;border-width:0;outline:none}.gdg-d19meir1 .gdg-clip-region textarea.gdg-input{border:none;border-width:0;outline:none}.gdg-seveqep{position:absolute;top:4px;right:20px;background-color:var(--gdg-bg-cell);color:var(--gdg-text-dark);padding:8px;border:1px solid var(--gdg-border-color);border-radius:6px;font-size:var(--gdg-editor-font-size);animation:gdg-search-fadein-gdg-seveqep .15s forwards}.gdg-seveqep.out{animation:gdg-search-fadeout-gdg-seveqep .15s forwards}.gdg-seveqep .gdg-search-bar-inner{display:flex}.gdg-seveqep .gdg-search-status{padding-top:4px;font-size:11px}.gdg-seveqep .gdg-search-progress{position:absolute;height:4px;left:0;bottom:0;background-color:var(--gdg-text-light)}.gdg-seveqep input{width:220px;color:var(--gdg-text-dark);background-color:var(--gdg-bg-cell);border:none;border-width:0;outline:none}.gdg-seveqep button{width:24px;height:24px;padding:0;border:none;outline:none;background:none;display:flex;justify-content:center;align-items:center;cursor:pointer;color:var(--gdg-text-medium)}.gdg-seveqep button:hover{color:var(--gdg-text-dark)}.gdg-seveqep button .button-icon{width:16px;height:16px}.gdg-seveqep button:disabled{opacity:.4;pointer-events:none}@-webkit-keyframes gdg-search-fadeout-gdg-seveqep{0%{transform:translate(0)}to{transform:translate(400px)}}@keyframes gdg-search-fadeout-gdg-seveqep{0%{transform:translate(0)}to{transform:translate(400px)}}@-webkit-keyframes gdg-search-fadein-gdg-seveqep{0%{transform:translate(400px)}to{transform:translate(0)}}@keyframes gdg-search-fadein-gdg-seveqep{0%{transform:translate(400px)}to{transform:translate(0)}}.gdg-mnuv029{word-break:break-word;-webkit-touch-callout:default;padding-top:6px}.gdg-mnuv029>*{margin:0}.gdg-mnuv029 *:last-child{margin-bottom:0}.gdg-mnuv029 p img{width:100%}.gdg-izpuzkl{position:absolute;inset:0;width:100%;height:100%;border-radius:0;resize:none;white-space:pre-wrap;min-width:100%;overflow:hidden;border:0;background-color:transparent;font-size:var(--gdg-editor-font-size);line-height:16px;font-family:var(--gdg-font-family);-webkit-text-fill-color:var(--gdg-text-dark);color:var(--gdg-text-dark);padding:0;margin:0}.gdg-invalid .gdg-izpuzkl{text-decoration:underline;text-decoration-color:#d60606}.gdg-izpuzkl ::-webkit-input-placeholder{color:var(--gdg-text-light)}.gdg-izpuzkl ::-moz-placeholder{color:var(--gdg-text-light)}.gdg-izpuzkl :-ms-input-placeholder{color:var(--gdg-text-light)}.gdg-izpuzkl ::placeholder{color:var(--gdg-text-light)}.gdg-s69h75o{visibility:hidden;white-space:pre-wrap;word-wrap:break-word;width:max-content;max-width:100%;min-width:100%;font-size:var(--gdg-editor-font-size);line-height:16px;font-family:var(--gdg-font-family);color:var(--gdg-text-dark);padding:0 0 2px;margin:0}.gdg-g1y0xocz{position:relative;margin-top:6px}
@@ -0,0 +1,16 @@
1
+ import { D as s, c as o, F as t, G as i, d as l, H as d, H as n, e as P, P as r, f as D, h, j as H, k as F } from "./index-CLh4oIT4.js";
2
+ export {
3
+ s as DEFAULT_CONFIG,
4
+ o as Domain,
5
+ t as FORMAT_PRESETS,
6
+ i as Gene,
7
+ l as GenomeView,
8
+ d as HoodiniDashboard,
9
+ n as HoodiniDashboardDefault,
10
+ P as HoodiniViz,
11
+ r as PhyloNode,
12
+ D as PhyloTree,
13
+ h as getPaletteColors,
14
+ H as getQualitativePalettes,
15
+ F as getSequentialPalettes
16
+ };