@jbrowse/plugin-wiggle
Version:
JBrowse 2 wiggle adapters, tracks, etc.
20 lines (19 loc) • 811 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { observer } from 'mobx-react';
const SvgTree = observer(function SvgTree({ model, }) {
const { treeAreaWidth: _treeAreaWidth, hierarchy } = model;
const svg = [];
let idx = 0;
if (hierarchy) {
for (const link of hierarchy.links()) {
const { source, target } = link;
const sy = source.x;
const ty = target.x;
const tx = target.y;
const sx = source.y;
svg.push(_jsx("line", { x1: sx, y1: sy, x2: sx, y2: ty, stroke: "black", opacity: "0.4" }, `${sx}-${sy}-${tx}-${ty}-${idx++}`), _jsx("line", { x1: sx, y1: ty, x2: tx, y2: ty, stroke: "black", opacity: "0.4" }, `${sx}-${sy}-${tx}-${ty}-${idx++}`));
}
}
return svg;
});
export default SvgTree;