@jbrowse/plugin-wiggle
Version:
JBrowse 2 wiggle adapters, tracks, etc.
14 lines (13 loc) • 790 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const LegendItemText = function ({ source, idx, rowHeight, model, exportSVG, }) {
const { graphType, rowHeightTooSmallForScalebar, renderColorBoxes } = model;
const svgFontSize = Math.min(rowHeight, 12);
const canDisplayLabel = rowHeight >= 6;
const colorBoxWidth = renderColorBoxes ? 15 : 0;
const svgOffset = exportSVG ? 10 : 0;
const extraOffset = svgOffset || (graphType && !rowHeightTooSmallForScalebar ? 50 : 0);
return canDisplayLabel ? ((0, jsx_runtime_1.jsx)("text", { y: idx * rowHeight + 13, x: extraOffset + colorBoxWidth + 2, fontSize: svgFontSize, children: source.name })) : null;
};
exports.default = LegendItemText;