taxonium-component
Version:
React component for exploring large phylogenetic trees in the browser
17 lines (16 loc) • 1.32 kB
JavaScript
import { jsx as o, jsxs as r } from "react/jsx-runtime";
import { forwardRef as v } from "react";
import { o as T, v as $, x as n } from "./JBrowsePanel-BNE3gNW1.js";
const i = (c) => c.toLocaleString("en-US"), u = v(function({ model: h, feature: t }, m) {
const s = t.get("start"), d = t.get("end"), g = t.get("refName"), a = s === d ? i(s) : `${i(s)}..${i(d)}`, l = t.get("sources"), p = t.get("source"), b = t.get("summary"), j = Object.fromEntries(h.sources.map((e) => [e.name, e]));
return r("div", { ref: m, children: [[g, a].filter((e) => !!e).join(":"), o("br", {}), l ? r("table", { children: [o("thead", { children: r("tr", { children: [o("th", { children: "color" }), o("th", { children: "source" }), o("th", { children: "score" })] }) }), o("tbody", { children: Object.entries(l).map(([e, x]) => r("tr", { children: [o("td", { children: o("div", { style: {
width: 16,
height: 16,
background: j[e].color
} }) }), o("td", { children: e }), o("td", { children: n(x.score) })] }, e)) })] }) : r("span", { children: [p, " ", b ? `min:${n(t.get("minScore"))} avg:${n(t.get("score"))} max:${n(t.get("maxScore"))}` : n(t.get("score"))] })] });
}), f = T((c) => o($, { useClientY: !0, TooltipContents: u, ...c }));
export {
$ as Tooltip,
f as default
};
//# sourceMappingURL=Tooltip-CZOJvflf.js.map