@jbrowse/plugin-wiggle
Version:
JBrowse 2 wiggle adapters, tracks, etc.
11 lines (10 loc) • 984 B
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { observer } from 'mobx-react';
import ColorLegend from './ColorLegend';
import ScoreLegend from './ScoreLegend';
import YScaleBar from '../../shared/YScaleBar';
const IndividualScaleBars = observer(function ({ model, orientation, exportSVG, }) {
const { sources, rowHeight, rowHeightTooSmallForScalebar, needsCustomLegend, ticks, } = model;
return (sources === null || sources === void 0 ? void 0 : sources.length) ? (_jsxs(_Fragment, { children: [_jsx(ColorLegend, { exportSVG: exportSVG, model: model, rowHeight: model.rowHeight }), rowHeightTooSmallForScalebar || needsCustomLegend ? (_jsx(ScoreLegend, { model: model })) : (sources.map((_source, idx) => (_jsx("g", { transform: `translate(0 ${rowHeight * idx})`, children: _jsx(YScaleBar, { model: model, orientation: orientation }) }, `${JSON.stringify(ticks)}-${idx}`))))] })) : null;
});
export default IndividualScaleBars;