UNPKG

@jbrowse/plugin-wiggle

Version:

JBrowse 2 wiggle adapters, tracks, etc.

14 lines (13 loc) 1.18 kB
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; import { getContainingView } from '@jbrowse/core/util'; import MultiWiggleLegendBar from "./components/MultiWiggleLegendBar.js"; import RectBg from "./components/RectBg.js"; import SvgTree from "./components/SvgTree.js"; export async function makeSidebarSvg(self) { const { offsetPx } = getContainingView(self); const { hierarchy, showTree, treeAreaWidth, height, isMultiRow } = self; if (!isMultiRow) { return null; } return (_jsxs("g", { id: "tree-layer", "data-testid": "tree-layer", transform: `translate(${Math.max(-offsetPx, 0)})`, clipPath: "url(#sidebarClip)", children: [_jsx("clipPath", { id: "sidebarClip", children: _jsx("rect", { x: "0", y: "0", width: "100%", height: height }) }), _jsx("g", { id: "legend-layer", transform: `translate(${showTree && hierarchy ? treeAreaWidth : 0})`, children: _jsx(MultiWiggleLegendBar, { model: self, orientation: "left", exportSVG: true }) }), showTree && hierarchy ? (_jsxs(_Fragment, { children: [_jsx(RectBg, { x: 0, y: 0, width: treeAreaWidth, height: height }), _jsx(SvgTree, { model: self })] })) : null] })); }