@jbrowse/plugin-wiggle
Version:
JBrowse 2 wiggle adapters, tracks, etc.
12 lines (11 loc) • 1.06 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { observer } from 'mobx-react';
import ColorLegend from "./ColorLegend.js";
import ScoreLegend from "./ScoreLegend.js";
import YScaleBar from "../../shared/YScaleBar.js";
const IndividualScaleBars = observer(function IndividualScaleBars({ model, orientation, exportSVG, }) {
const { sources, rowHeight, rowHeightTooSmallForScalebar, needsCustomLegend, ticks, hierarchy, showTree, } = model;
const treeIsShowing = hierarchy && showTree;
return sources?.length ? (_jsxs(_Fragment, { children: [treeIsShowing ? null : (_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;