From 0eeb632ddef0218e7d6cf837876c82f1f58368c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20Mo=CC=88ller?= Date: Tue, 3 Nov 2020 16:26:43 +0100 Subject: [PATCH] add panOnScroll options to documentation --- website/src/markdown/docs/api/component-props.md | 4 +++- website/src/markdown/docs/api/handle.md | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/website/src/markdown/docs/api/component-props.md b/website/src/markdown/docs/api/component-props.md index 27259b5f..e8335b00 100644 --- a/website/src/markdown/docs/api/component-props.md +++ b/website/src/markdown/docs/api/component-props.md @@ -53,7 +53,9 @@ import ReactFlow from 'react-flow-renderer'; - `nodesDraggable`: default: `true`. This applies to all nodes. You can also change the behavior of a specific node with the `draggable` node option - `nodesConnectable`: default: `true`. This applies to all nodes. You can also change the behavior of a specific node with the `connectable` node option - `elementsSelectable`: default: `true`. This applies to all elements. You can also change the behavior of a specific node with the `selectable` node option -- `zoomOnScroll`: default: `true` +- `zoomOnScroll`: default: `true`. Zoom the graph in and out using the mousewheel or trackpad +- `panOnScroll`: default: `false`. Move the graph while keeping the zoomlevel using mousewheel or trackpad. Overwrites `zoomOnScroll`. +- `panOnScrollSpeed`: default: `0.5`. Controls how fast the canvas is moved while using the mousewheel. Only has an effect if `panOnScroll` is enabled. - `zoomOnDoubleClick`: default: `true` - `selectNodesOnDrag`: default: `true` - `paneMoveable`: default: `true` - If set to `false`, panning and zooming is disabled diff --git a/website/src/markdown/docs/api/handle.md b/website/src/markdown/docs/api/handle.md index 8bdf1486..837b9dc7 100644 --- a/website/src/markdown/docs/api/handle.md +++ b/website/src/markdown/docs/api/handle.md @@ -23,8 +23,8 @@ const targetHandleWithValidation = ( - `type`: 'source' or 'target' - `id`: string - you only need this when you have multiple source or target handles (otherwise the node id is used) - `position`: 'left', 'right', 'top' or 'bottom' handle position - default: 'top' for type target, 'bottom' for type source -- `onConnect`: function that gets triggered on connect -- `isValidConnection`: function receives a connection `{ target: 'some-id', source: 'another-id', sourceHandle: 'source handle id or null', targetHandle: 'target handle id or null' }` as param, returns a boolean - default: `true` +- `onConnect`: function that gets triggered on connect. This callback only gets executed on source handles. +- `isValidConnection`: function receives a connection `{ target: 'some-id', source: 'another-id', sourceHandle: 'source handle id or null', targetHandle: 'target handle id or null' }` as param, returns a boolean - default: `true`. - `style`: css properties - `className`: additional class name