UNPKG

taxonium-component

Version:

React component for exploring large phylogenetic trees in the browser

65 lines (64 loc) 2.61 kB
import { jsxs as p, jsx as r } from "react/jsx-runtime"; import { lazy as f } from "react"; import { B as m } from "./BaseCard-CrWzwjYv.js"; import { u as d, T as w } from "./JBrowsePanel-uJIA-L6s.js"; import { L as h } from "./Link-CZ78-213.js"; const g = f(() => import("./BreakendMultiLevelOptionDialog-BvUoBPXo.js")), k = f(() => import("./BreakendSingleLevelOptionDialog-C1RaRAFy.js")); function y({ locStrings: s, model: e }) { const l = d.getSession(e); return p("div", { children: [r(w, { children: "Navigate to breakend endpoint in linear view:" }), r("ul", { children: s.map((i, a) => p("li", { children: [i, " ", r(h, { href: "#", onClick: (o) => { var n; o.preventDefault(); const { view: t } = e; try { if (t) (n = t.navToLocString) === null || n === void 0 || n.call(t, i); else throw new Error("No view associated with this feature detail panel anymore"); } catch (c) { console.error(c), l.notify(`${c}`); } }, children: "(LGV)" })] }, `${i}-${a}`)) })] }); } function L({ locStrings: s, model: e, feature: l }) { var i, a; const o = d.getSession(e), n = new d.SimpleFeature(l), t = (a = (i = e.view) === null || i === void 0 ? void 0 : i.displayedRegions[0]) === null || a === void 0 ? void 0 : a.assemblyName; return p("div", { children: [r(w, { children: "Launch split view" }), r("ul", { children: s.map((c) => p("li", { children: [`${l.refName}:${l.start} // ${c}`, " ", r(h, { href: "#", onClick: (u) => { u.preventDefault(), o.queueDialog((v) => [ g, { handleClose: v, session: o, feature: n, stableViewId: `${e.id}_${t}_breakpointsplitview_multilevel`, view: e.view, assemblyName: t } ]); }, children: "(top/bottom)" }), " ", r(h, { href: "#", onClick: (u) => { u.preventDefault(), o.queueDialog((v) => [ k, { handleClose: v, session: o, feature: n, stableViewId: `${e.id}_${t}_breakpointsplitview_singlelevel`, view: e.view, assemblyName: t } ]); }, children: "(single row)" })] }, JSON.stringify(c))) })] }); } function D(s) { const { model: e, locStrings: l, feature: i } = s, a = d.getSession(e), { pluginManager: o } = d.getEnv(a); let n = !1; try { n = !!o.getViewType("BreakpointSplitView"); } catch { } return p(m, { ...s, title: "Breakends", children: [r(y, { model: e, locStrings: l }), n ? r(L, { model: e, locStrings: l, feature: i }) : null] }); } export { D as default }; //# sourceMappingURL=LaunchBreakendPanel-axw90gdZ.js.map