@jbrowse/plugin-wiggle
Version:
JBrowse 2 wiggle adapters, tracks, etc.
12 lines (11 loc) • 689 B
JavaScript
import { jsx as _jsx } from "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 ? (_jsx("text", { y: idx * rowHeight + 13, x: extraOffset + colorBoxWidth + 2, fontSize: svgFontSize, children: source.name })) : null;
};
export default LegendItemText;