xyflow / web

📖 This monorepo contains the xyflow website and the documentation sites for React Flow and Svelte Flow.
https://xyflow.com
MIT License
30 stars 36 forks source link

Clarification in "updatable edge" docs #384

Closed IanLondon closed 1 month ago

IanLondon commented 1 month ago

Please describe the feature that you want to propose

Overview

The docs reference the concept of an updatable edge: https://reactflow.dev/examples/edges/updatable-edge

An edge is updatable by dragging it to another handle if you are using the onEdgeUpdate handler prop. The handler gets called after the edge gets dropped to a new handle. You can use the updateEdge helper function to update your edges state accordingly.

I'm going to use the phase "updatable edge behavior" below. By that I just mean "adding the draggable invisible <circle> with react-flow__edgeupdater to the end(s) of the edge", I believe this is theEdgeAnchor component.

<ReactFlow> component has several props related to updatable edge behavior:

https://reactflow.dev/api-reference/types/edge#updatable

Please let me know if I'm misunderstanding how these are intended to work.

Desired documentation

It would be nice if the behavior of the props listed above could be a bit more explicit, I listed them out because I'm not confident that I understand how they work. It would be helpful to call out "EdgeAnchor" as the name for the component the "updatable edges" have, and describe exactly how the props above contribute to rendering an EdgeAnchor or not.

hayleigh-dot-dev commented 1 month ago

Hey Ian thanks for bringing this up! We're missing descriptions on props in quite a few places so I'm on the case make sure everything is properly documented and up to date