docs(website): add documentation of exported interfaces to website docs
This commit is contained in:
@@ -71,3 +71,9 @@ import ReactFlow from 'react-flow-renderer';
|
||||
### Keys
|
||||
- `deleteKeyCode`: default: `8` (backspace)
|
||||
- `selectionKeyCode`: default: `16` (shift)
|
||||
|
||||
**Typescript:** The interface of the ReactFlow Prop Types are exported as `ReactFlowProps`. You can use it in your code as follows:
|
||||
|
||||
```javascript
|
||||
import { ReactFlowProps } from 'react-flow-renderer';
|
||||
```
|
||||
|
||||
@@ -29,3 +29,5 @@ const FlowWithBackground = () => (
|
||||
- `color`: string - the color of the dots or lines - default: `#81818a` for dots, `#eee` for lines
|
||||
- `style`: css properties
|
||||
- `className`: additional class name
|
||||
|
||||
**Typescript:** The interface of the Background Prop Types are exported as `BackgroundProps`.
|
||||
@@ -22,4 +22,6 @@ const FlowWithControls = () => (
|
||||
- `showFitView`: boolean - default: true
|
||||
- `showInteractive`: boolean - default: true
|
||||
- `style`: css properties
|
||||
- `className`: additional class name
|
||||
- `className`: additional class name
|
||||
|
||||
**Typescript:** The interface of the Controls Prop Types are exported as `ControlProps`.
|
||||
@@ -33,4 +33,6 @@ const FlowWithMiniMap = () => (
|
||||
- `nodeClassName`: string or function for adding an additional class to the nodes inside the mini map
|
||||
- `maskColor`: string
|
||||
- `style`: css properties
|
||||
- `className`: additional class name
|
||||
- `className`: additional class name
|
||||
|
||||
**Typescript:** The interface of the MiniMap Prop Types are exported as `MiniMapProps`.
|
||||
@@ -28,6 +28,8 @@ const targetHandleWithValidation = (
|
||||
- `style`: css properties
|
||||
- `className`: additional class name
|
||||
|
||||
**Typescript:** The interface of the Handle Prop Types are exported as `HandleProps`.
|
||||
|
||||
### Validation
|
||||
|
||||
The handle receives the additional class names `connecting` when the connection line is above the handle and `valid` if the connection is valid. You can find an example which uses these classes [here](/examples/validation).
|
||||
@@ -35,4 +37,4 @@ The handle receives the additional class names `connecting` when the connection
|
||||
### Multiple Handles
|
||||
|
||||
If you need multiple source or target handles you can achieve this by creating a custom node. Normally you just use the id of a node for the `source` or `target` of an edge. If you have multiple source or target handles you need to pass an id to these handles. These ids get then added to the node id, so that you can connect a specific handle. If you have a node with an id = `1` and a handle with an id = `a` you can connect this handle by using the id = `1__a`.
|
||||
You can find an example of how to implement a custom node with multiple handles in the [custom node example](https://github.com/wbkd/react-flow/blob/main/example/src/CustomNode/ColorSelectorNode.js#L18-L29).
|
||||
You can find an example of how to implement a custom node with multiple handles in the [custom node example](https://github.com/wbkd/react-flow/blob/main/example/src/CustomNode/ColorSelectorNode.js#L18-L29).
|
||||
|
||||
Reference in New Issue
Block a user