UNPKG

react-phylogeny-tree-gl

Version:

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

18 lines 731 B
import { EmptyArray } from '../utils'; export function createOnSelectPlugin(onSelect) { return function onSelectPlugin(tree, decorate) { decorate('selectNode', (delegate, args) => { var _a; delegate(...args); const selectedIds = (_a = tree.props.selectedIds) !== null && _a !== void 0 ? _a : EmptyArray; onSelect(tree, selectedIds); }); decorate('selectLeafNodes', (delegate, args) => { var _a; delegate(...args); const selectedIds = (_a = tree.props.selectedIds) !== null && _a !== void 0 ? _a : EmptyArray; onSelect(tree, selectedIds); }); }; } //# sourceMappingURL=createPluginOnSelect.js.map