@jbrowse/plugin-wiggle
Version:
JBrowse 2 wiggle adapters, tracks, etc.
13 lines (12 loc) • 827 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 { isReadyOrHasError } from "../svgExportUtil.js";
import YScaleBars from "./components/YScaleBars.js";
import { makeSidebarSvg } from "./makeSidebarSvg.js";
export async function renderSvg(self, opts, superRenderSvg) {
await when(() => isReadyOrHasError(self));
const { offsetPx } = getContainingView(self);
const sidebarSvg = await makeSidebarSvg(self);
return (_jsxs(_Fragment, { children: [_jsx("g", { id: "data-layer", children: await superRenderSvg(opts) }), _jsx("g", { transform: `translate(${Math.max(-offsetPx, 0)})`, children: _jsx(YScaleBars, { model: self, orientation: "left", exportSVG: true }) }), sidebarSvg] }));
}