@jbrowse/plugin-wiggle
Version:
JBrowse 2 wiggle adapters, tracks, etc.
29 lines (28 loc) • 1.6 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.YScaleBars = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const util_1 = require("@jbrowse/core/util");
const mobx_react_1 = require("mobx-react");
const FullHeightScaleBar_1 = __importDefault(require("./FullHeightScaleBar"));
const IndividualScaleBars_1 = __importDefault(require("./IndividualScaleBars"));
const Wrapper = (0, mobx_react_1.observer)(function ({ children, model, exportSVG, }) {
const { height } = model;
return exportSVG ? (children) : ((0, jsx_runtime_1.jsx)("svg", { style: {
position: 'absolute',
top: 0,
left: 0,
pointerEvents: 'none',
height,
width: (0, util_1.getContainingView)(model).width,
}, children: children }));
});
exports.YScaleBars = (0, mobx_react_1.observer)(function (props) {
const { model, orientation, exportSVG } = props;
const { showSidebar, stats, needsFullHeightScalebar, sources } = model;
return stats && sources ? ((0, jsx_runtime_1.jsx)(Wrapper, { ...props, children: showSidebar ? (needsFullHeightScalebar ? ((0, jsx_runtime_1.jsx)(FullHeightScaleBar_1.default, { model: model, orientation: orientation, exportSVG: exportSVG })) : ((0, jsx_runtime_1.jsx)(IndividualScaleBars_1.default, { model: model, orientation: orientation, exportSVG: exportSVG }))) : null })) : null;
});
exports.default = exports.YScaleBars;