UNPKG

@jbrowse/plugin-wiggle

Version:

JBrowse 2 wiggle adapters, tracks, etc.

23 lines (22 loc) 1.17 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { getContainingView } from '@jbrowse/core/util'; import { observer } from 'mobx-react'; import FullHeightScaleBar from './FullHeightScaleBar'; import IndividualScaleBars from './IndividualScaleBars'; const Wrapper = observer(function ({ children, model, exportSVG, }) { const { height } = model; return exportSVG ? (children) : (_jsx("svg", { style: { position: 'absolute', top: 0, left: 0, pointerEvents: 'none', height, width: getContainingView(model).width, }, children: children })); }); export const YScaleBars = observer(function (props) { const { model, orientation, exportSVG } = props; const { showSidebar, stats, needsFullHeightScalebar, sources } = model; return stats && sources ? (_jsx(Wrapper, { ...props, children: showSidebar ? (needsFullHeightScalebar ? (_jsx(FullHeightScaleBar, { model: model, orientation: orientation, exportSVG: exportSVG })) : (_jsx(IndividualScaleBars, { model: model, orientation: orientation, exportSVG: exportSVG }))) : null })) : null; }); export default YScaleBars;