@jbrowse/plugin-linear-genome-view
Version:
JBrowse 2 linear genome view
12 lines (11 loc) • 858 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { coarseStripHTML, stripAlpha } from '@jbrowse/core/util';
import { useTheme } from '@mui/material';
export default function SVGTrackLabel({ trackLabels, trackName, fontSize, trackLabelOffset, x, }) {
const theme = useTheme();
const fill = stripAlpha(theme.palette.text.primary);
const xoff = trackLabels === 'overlay' ? 5 : 0;
const yoff = trackLabels === 'offset' ? 5 : 0;
const name = coarseStripHTML(trackName);
return trackLabels !== 'none' ? (_jsx("g", { children: trackLabels === 'left' ? (_jsx("text", { x: trackLabelOffset - 40, y: 20, fill: fill, fontSize: fontSize, dominantBaseline: "hanging", textAnchor: "end", children: name })) : (_jsx("text", { x: x + xoff, y: yoff, fill: fill, fontSize: fontSize, dominantBaseline: "hanging", children: name })) })) : null;
}