UNPKG

@jbrowse/plugin-wiggle

Version:

JBrowse 2 wiggle adapters, tracks, etc.

24 lines (23 loc) 1.19 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { getConf } from '@jbrowse/core/configuration'; import { getContainingTrack, getContainingView, measureText, } from '@jbrowse/core/util'; import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view'; import { observer } from 'mobx-react'; import YScaleBar from '../../shared/YScaleBar'; const LinearWiggleDisplay = observer(function (props) { const { model } = props; const { stats, height, graphType } = model; const { trackLabels } = getContainingView(model); const track = getContainingTrack(model); return (_jsxs("div", { children: [_jsx(BaseLinearDisplayComponent, { ...props }), stats && graphType ? (_jsx("svg", { style: { position: 'absolute', top: 0, left: trackLabels === 'overlapping' ? measureText(getConf(track, 'name'), 12.8) + 100 : 50, pointerEvents: 'none', height, width: 50, }, children: _jsx(YScaleBar, { model: model }) })) : null] })); }); export default LinearWiggleDisplay;