@jbrowse/plugin-wiggle
Version:
JBrowse 2 wiggle adapters, tracks, etc.
16 lines (15 loc) • 1.4 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const mobx_react_1 = require("mobx-react");
const ColorLegend_1 = __importDefault(require("./ColorLegend"));
const ScoreLegend_1 = __importDefault(require("./ScoreLegend"));
const YScaleBar_1 = __importDefault(require("../../shared/YScaleBar"));
const IndividualScaleBars = (0, mobx_react_1.observer)(function ({ model, orientation, exportSVG, }) {
const { sources, rowHeight, rowHeightTooSmallForScalebar, needsCustomLegend, ticks, } = model;
return (sources === null || sources === void 0 ? void 0 : sources.length) ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ColorLegend_1.default, { exportSVG: exportSVG, model: model, rowHeight: model.rowHeight }), rowHeightTooSmallForScalebar || needsCustomLegend ? ((0, jsx_runtime_1.jsx)(ScoreLegend_1.default, { model: model })) : (sources.map((_source, idx) => ((0, jsx_runtime_1.jsx)("g", { transform: `translate(0 ${rowHeight * idx})`, children: (0, jsx_runtime_1.jsx)(YScaleBar_1.default, { model: model, orientation: orientation }) }, `${JSON.stringify(ticks)}-${idx}`))))] })) : null;
});
exports.default = IndividualScaleBars;