UNPKG

@jbrowse/plugin-linear-genome-view

Version:

JBrowse 2 linear genome view

25 lines (24 loc) 1.23 kB
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; import { observer } from 'mobx-react'; import ScalebarCoordinateTicks from './ScalebarCoordinateTicks'; import { ElidedBlock as ElidedBlockComponent, InterRegionPaddingBlock as InterRegionPaddingBlockComponent, } from '../../BaseLinearDisplay/components/Block'; const ScalebarCoordinateLabels = observer(function ({ model }) { const { staticBlocks, bpPerPx } = model; return (_jsx(_Fragment, { children: staticBlocks.map((b, idx) => { const { key, widthPx } = b; const k = `${key}-${idx}`; if (b.type === 'ContentBlock') { return _jsx(ScalebarCoordinateTicks, { block: b, bpPerPx: bpPerPx }, k); } else if (b.type === 'ElidedBlock') { return _jsx(ElidedBlockComponent, { width: widthPx }, k); } else if (b.type === 'InterRegionPaddingBlock') { return (_jsx(InterRegionPaddingBlockComponent, { width: widthPx, style: { background: 'none' }, boundary: b.variant === 'boundary' }, k)); } else { return null; } }) })); }); export default ScalebarCoordinateLabels;