@jbrowse/plugin-linear-genome-view
Version:
JBrowse 2 linear genome view
30 lines (29 loc) • 1.48 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 ScalebarCoordinateTicks_1 = __importDefault(require("./ScalebarCoordinateTicks"));
const Block_1 = require("../../BaseLinearDisplay/components/Block");
const ScalebarCoordinateLabels = (0, mobx_react_1.observer)(function ({ model }) {
const { staticBlocks, bpPerPx } = model;
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: staticBlocks.map((b, idx) => {
const { key, widthPx } = b;
const k = `${key}-${idx}`;
if (b.type === 'ContentBlock') {
return (0, jsx_runtime_1.jsx)(ScalebarCoordinateTicks_1.default, { block: b, bpPerPx: bpPerPx }, k);
}
else if (b.type === 'ElidedBlock') {
return (0, jsx_runtime_1.jsx)(Block_1.ElidedBlock, { width: widthPx }, k);
}
else if (b.type === 'InterRegionPaddingBlock') {
return ((0, jsx_runtime_1.jsx)(Block_1.InterRegionPaddingBlock, { width: widthPx, style: { background: 'none' }, boundary: b.variant === 'boundary' }, k));
}
else {
return null;
}
}) }));
});
exports.default = ScalebarCoordinateLabels;