Comments (6)
plz check this
https://codesandbox.io/p/sandbox/reactflow-handle-positions-forked-j6lz6k?file=%2Fsrc%2Fcomponents%2FCustomNode.tsx
from xyflow.
If you are updating your handle positions programmatically you have to use updateNodeInternals
We have to redetermine the exact position of the handle every step of the way (in you case on every frame of the transition) to get the correct positions for the edges.
If you just want to have an animated handle, I would suggest you just transform an inner element with position absolute without actually moving the whole container. This way you still achieve the desired effect but the handle positions don't actually ever move.
from xyflow.
thank you
from xyflow.
Could you please help with proximity connection as well?
This works correctly for only one source and target handle.
However, when there are multiple source and target handles, only the first handle works and the rest do not work.
from xyflow.
The code for the proximity connect simply calculates the closest node and then creates a an edge from the source to target handle. If you have multiple handles you need to actually address specific handle ids because there can be more then one source & target handle. You can also determine the closest handle by accessing the handle bounds. Here is an example that also accesses the handle bounds. https://reactflow.dev/examples/edges/multi-connection-line
from xyflow.
thank you
from xyflow.
Related Issues (20)
- Multiple dragging doesn't trigger onNodeDragStop event. HOT 2
- Class for connecting from node HOT 1
- How automatically enabled the lock viewport of controls in ReactFlow HOT 1
- SvelteFlow: Copy/Paste (If not supported out-of-the-box, the easiest way to achieve it) HOT 6
- Source and Target handle getting null HOT 5
- Working Reactflow, when i add a Panel it errors HOT 1
- Drag problem after changing parentNode HOT 1
- SvelteFlow: Copy/Paste (continued issue) HOT 1
- Be able to pan the viewport on right mouse click on Node. HOT 6
- Disable node drag on multitouch HOT 3
- Remove pointer events from Pane if user selection active HOT 1
- Not possible to deselect edges HOT 1
- Edges not initially rendered onlyRenderVisibleElements is set and connecting offscreen node has height set HOT 1
- @types packages should be devDependencies HOT 1
- In SvelteFlow, setting viewport on initialization gets overridden on pan HOT 1
- Dynamic edge label updates not working HOT 1
- Rename `updateEdge` to `reconnectEdge` HOT 5
- Using Jest to click on handle throws "S?.elementFromPoint is not a function" error HOT 5
- when draggin a node it leave a trail
- [React Flow]: Couldn't create edge for target handle id HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xyflow.