UNPKG

react-phylogeny-tree-gl

Version:

React integration of phylocanvas.gl. Component and hook for phylogenetic tree visualistion.

22 lines 740 B
export function createContextMenuPlugin(setMenuProps) { return function contextMenuPlugin(tree, decorate) { decorate('handleClick', (delegate, args) => { const [info, event] = args; if (event.rightButton) { event.preventDefault(); const node = tree.pickNodeFromLayer(info); setMenuProps({ visible: true, possition: { x: event.center.x, y: event.center.y, }, node: node, }); } else delegate(...args); }); }; } //# sourceMappingURL=createContextMenuPlugin.js.map