docs(website): add custom edge props closes #608

This commit is contained in:
moklick
2020-10-21 19:18:28 +02:00
parent d7c1274d4c
commit d489917b66
@@ -26,3 +26,29 @@ edgeTypes={{
Now you could use the new type `special` for an edge.
The `straight`, `default` and `step` types would still be available unless you overwrote one of them.
There is an implementation of a custom edge in the [edges example](/examples/edges/).
## Custom Edge Props
Custom edges are wrapped. They receive the following props:
- `source`: string (node id)
- `target`: string (node id)
- `selected`: boolean
- `animated`: boolean
- `label`: string
- `labelStyle`: svg attributes
- `labelShowBg`: boolean
- `labelBgStyle`: svg attributes
- `labelBgPadding`: number
- `labelBgBorderRadius`: number
- `data`: object
- `style`: svg attributes
- `arrowHeadType`: 'arrow' | 'arrowclosed'
- `sourceX`: number
- `sourceY`: number
- `targetX`: number
- `targetY`: number
- `sourcePosition`: 'left' | 'top' | 'right' | 'bottom'
- `targetPosition`: 'left' | 'top' | 'right' | 'bottom'
- `markerEndId`: string