react-phylogeny-tree-gl
Version:
React integration of phylocanvas.gl. Component and hook for phylogenetic tree visualistion.
16 lines • 953 B
JavaScript
import React from 'react';
import { usePhylogenyTree } from '../hooks/usePhylogenyTree';
import { ZoomButtons } from './zoom_buttons';
const wrapperStyle = { width: '100%', height: '100%', position: 'absolute' };
function TreeWithoutMenu({ initProps, controlledProps, plugins, hooks, zoomButtons = true, zoomButtonsStyle, }, ref) {
const phyloDiv = React.useRef(null);
const { handleZoomIn, handleZoomOut, getTree } = usePhylogenyTree(phyloDiv, initProps, controlledProps, plugins, hooks);
React.useImperativeHandle(ref, () => ({
getTree,
}));
return (React.createElement("div", { style: wrapperStyle },
React.createElement("div", { ref: phyloDiv }),
zoomButtons ? (React.createElement(ZoomButtons, { onZoomIn: handleZoomIn, onZoomOut: handleZoomOut, style: zoomButtonsStyle })) : null));
}
export const PhylogenyTreeWithoutMenu = React.forwardRef(TreeWithoutMenu);
//# sourceMappingURL=treeWithoutMenu.js.map