UNPKG

@jbrowse/plugin-wiggle

Version:

JBrowse 2 wiggle adapters, tracks, etc.

19 lines (18 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 { observer } from 'mobx-react'; const MultiWiggleLegendBarWrapper = observer(function MultiWiggleLegendBarWrapper({ children, model, exportSVG, }) { const { id, scrollTop, height, hierarchy, treeAreaWidth, showTree } = model; const clipid = `legend-${typeof jest === 'undefined' ? id : 'test'}`; const leftOffset = hierarchy && showTree ? treeAreaWidth : 0; return exportSVG ? (_jsxs(_Fragment, { children: [_jsx("defs", { children: _jsx("clipPath", { id: clipid, children: _jsx("rect", { x: 0, y: 0, width: 1000, height: height }) }) }), _jsx("g", { clipPath: `url(#${clipid})`, children: _jsx("g", { transform: `translate(0,${-scrollTop})`, children: children }) })] })) : (_jsx("svg", { style: { position: 'absolute', top: 0, left: leftOffset, zIndex: 100, pointerEvents: 'none', height: model.totalHeight, width: getContainingView(model).width, }, children: children })); }); export default MultiWiggleLegendBarWrapper;