From fb2da7a3ee4d1c0fc7703a1fc8f5e6c3c0a5e8f1 Mon Sep 17 00:00:00 2001 From: Moritz Date: Thu, 3 Sep 2020 09:17:26 +0200 Subject: [PATCH 1/2] doc(readme): add onPaneScroll --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index daaee827..2f3f6e7f 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ const BasicFlow = () => ; - `onSelectionDragStop(evt: MouseEvent, nodes: Node[])`: called when user stops to drag a selection - `onPaneClick(event: MouseEvent)`: called when user clicks directly on the canvas - `onPaneContextMenu(event: MouseEvent)`: called when user does a right-click on the canvas +- `onPaneScroll(event: WheelEvent)`: called when user scrolls pane (only works when `zoomOnScroll` is set to `false) #### Interaction - `nodesDraggable`: default: `true`. This applies to all nodes. You can also change the behavior of a specific node with the `draggable` node option. From fa193bddfc921a00df5d476e5ee47708664d46fc Mon Sep 17 00:00:00 2001 From: Stojan Stamkov Date: Fri, 4 Sep 2020 21:04:53 +0200 Subject: [PATCH 2/2] Added support for Node and Edge type updates --- src/hooks/useElementUpdater.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hooks/useElementUpdater.ts b/src/hooks/useElementUpdater.ts index 22a3c156..f0109bf5 100644 --- a/src/hooks/useElementUpdater.ts +++ b/src/hooks/useElementUpdater.ts @@ -41,6 +41,10 @@ const useElementUpdater = (propElements: Elements): void => { if (typeof propElement.isHidden !== 'undefined') { elementProps.isHidden = propElement.isHidden; } + + if (typeof propElement.type !== 'undefined') { + elementProps.type = propElement.type; + } if (isNode(existingElement)) { const propNode = propElement as Node;