UNPKG

taxonium-component

Version:

React component for exploring large phylogenetic trees in the browser

35 lines (34 loc) 1.83 kB
import { jsxs as d, jsx as o } from "react/jsx-runtime"; import { o as s, a as f, D as u, T as h, d as p, B as g, m as b, s as C } from "./JBrowsePanel-uJIA-L6s.js"; import "react"; import { F as k } from "./FormControlLabel-CwjOxa71.js"; import { C as x } from "./Checkbox-BG4jcGUl.js"; function y(e) { return e.length > 20 ? `${e.slice(0, 20)}...` : e; } const v = b()((e) => ({ connectionContainer: { width: 500, margin: e.spacing(4) } })), j = s(function({ conf: n, session: t, breakConnection: r }) { const { connectionInstances: c = [] } = t, a = C.readConfObject(n, "name"), l = C.readConfObject(n, "assemblyNames"), m = c.find((i) => a === i.name); return o(k, { control: o(x, { checked: !!m, onChange: () => { var i; m ? r(n) : (i = t.makeConnection) === null || i === void 0 || i.call(t, n); }, color: "primary" }), label: [ a, l.length ? `(${y(l.join(","))})` : "" ].filter((i) => !!i).join(" ") }, n.connectionId); }), D = s(function({ session: n, breakConnection: t }) { const { classes: r } = v(); return o("div", { className: r.connectionContainer, children: n.connections.length ? n.connections.map((c, a) => o("div", { children: o(j, { conf: c, session: n, breakConnection: t }) }, `${c.name}_${a}`)) : o(h, { children: "No connections found" }) }); }), B = s(function({ session: e, handleClose: n, breakConnection: t }) { return d(f.Dialog, { open: !0, onClose: n, maxWidth: "lg", title: "Turn on/off connections", children: [d(u, { children: [o(h, { children: "Use the checkbox to turn on/off connections" }), o(D, { session: e, breakConnection: t })] }), o(p, { children: o(g, { onClick: () => { n(); }, variant: "contained", color: "primary", children: "Close" }) })] }); }); export { B as default }; //# sourceMappingURL=ToggleConnectionsDialog-oafDg6aH.js.map