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