feat(wrapper): add onSelectionChange handler

This commit is contained in:
moklick
2020-05-25 14:00:46 +02:00
parent 3d80fb6586
commit f154f59e74
9 changed files with 62 additions and 43 deletions
+2
View File
@@ -5,6 +5,7 @@ import ReactFlow, { removeElements, addEdge, MiniMap, Controls } from 'react-flo
const onNodeDragStart = node => console.log('drag start', node);
const onNodeDragStop = node => console.log('drag stop', node);
const onElementClick = element => console.log('click', element);
const onSelectionChange = elements => console.log('selection change', elements);
const onLoad = (graph) => {
console.log('graph loaded:', graph);
graph.fitView();
@@ -53,6 +54,7 @@ const OverviewFlow = () => {
onConnect={onConnect}
onNodeDragStart={onNodeDragStart}
onNodeDragStop={onNodeDragStop}
onSelectionChange={onSelectionChange}
style={{ width: '100%', height: '100%' }}
onLoad={onLoad}
connectionLineStyle={{ stroke: '#ddd', strokeWidth: 2 }}