@jbrowse/plugin-wiggle
Version:
JBrowse 2 wiggle adapters, tracks, etc.
12 lines (11 loc) • 738 B
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { getContainingView } from '@jbrowse/core/util';
import { when } from 'mobx';
import YScaleBar from "../shared/YScaleBar.js";
import { isReadyOrHasError } from "../svgExportUtil.js";
export async function renderSvg(self, opts, superRenderSvg) {
await when(() => isReadyOrHasError(self));
const { graphType, stats } = self;
const { offsetPx } = getContainingView(self);
return (_jsxs(_Fragment, { children: [_jsx("g", { children: await superRenderSvg(opts) }), graphType && stats ? (_jsx("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: _jsx(YScaleBar, { model: self, orientation: "left" }) })) : null] }));
}