UNPKG

taxonium-component

Version:

React component for exploring large phylogenetic trees in the browser

24 lines (23 loc) 1.05 kB
import { jsx as c, jsxs as d, Fragment as g } from "react/jsx-runtime"; import { u as l } from "./JBrowsePanel-BNE3gNW1.js"; function u(t) { return `arc-clip-${typeof jest > "u" ? t : "jest"}`; } async function w(t, o, s) { const e = l.getContainingView(t).dynamicBlocks.totalWidthPx, i = t.height; if (o.rasterizeLayers) { const n = document.createElement("canvas"); n.width = e * 2, n.height = i * 2; const r = n.getContext("2d"); return r ? (r.scale(2, 2), s(t, r, e, i), c("image", { width: e, height: i, xlinkHref: n.toDataURL("image/png") })) : void 0; } else { const n = await import("./canvas2svg-DAAoZGqq.js").then((h) => h.c), r = new n.default(e, i); s(t, r, e, i); const a = u(t.id); return d(g, { children: [c("defs", { children: c("clipPath", { id: a, children: c("rect", { x: 0, y: 0, width: e, height: i }) }) }), c("g", { dangerouslySetInnerHTML: { __html: r.getSvg().innerHTML }, clipPath: `url(#${a})` })] }); } } export { w as renderSvg }; //# sourceMappingURL=renderSvgUtil-KkVpKsWN.js.map