Comments (7)
On previous versions of react-flow-smart-edge
I had debouncing code implemented on the library itself, wich got dropped with the v2 release and the introduction of getSmartEdge
function. I need to either re-introduce debouncing or improve performance overall. I will look into navmesh
as a possible path-finding substitute for this library.
For anyone facing this issue in the meantime, I recommend debouncing your custom edge implementation before calling getSmartEdge
.
from react-flow-smart-edge.
Facing this issue as well, the performance drop is pretty significant with as few as 25 nodes. I'm using a gridRatio of 9, any higher than that, and the paths lose their smoothness. I believe the issue is occurring because the react-flow hook
useNodes
re-renders all the edges even when a zoom or pan event occurs.
So I've memoized the getSmartEdge
by only executing it when the position or dimensions of a node changes, and it's a big improvement as it doesn't re-compute the edges during a zoom and pan event, only when a node is dragged around.
On previous versions of
react-flow-smart-edge
I had debouncing code implemented on the library itself, wich got dropped with the v2 release and the introduction ofgetSmartEdge
function. I need to either re-introduce debouncing or improve performance overall. I will look intonavmesh
as a possible path-finding substitute for this library.For anyone facing this issue in the meantime, I recommend debouncing your custom edge implementation before calling
getSmartEdge
.
Although @tisoap the performance is still not that great and I can notice a lot of stuttering when dragging nodes in a graph of 25-30 nodes. The navmesh
integration and other performance improvements would be really appreciated 😇
from react-flow-smart-edge.
Hey @dhruv29011991 ! Could you share an URL with a minimal example on CodeSandbox or a minimal GitHub repository where the issue happens?
from react-flow-smart-edge.
Hello @tisoap, thanks for responding, I have added the URL below for the example please have a look and let know if you require any more information from my end.
https://codesandbox.io/s/react-flow-demo-forked-jno5ub
from react-flow-smart-edge.
Facing this issue as well, the performance drop is pretty significant with as few as 25 nodes. I'm using a gridRatio of 9, any higher than that, and the paths lose their smoothness. I believe the issue is occurring because the react-flow hook useNodes
re-renders all the edges even when a zoom or pan event occurs.
from react-flow-smart-edge.
@agrawal-rohit would you mind sharing your code/instructions for how you memoized getSmartEdge
are you using React.useMemo or built your own cache?
from react-flow-smart-edge.
@AlecSchneider I didn't memoize getSmartEdge
, but I debounced component that was using it. I.E. wait a couple ms after props update before rendering the component
from react-flow-smart-edge.
Related Issues (20)
- Create templates for new issues
- Update Sponsor Badge
- Add draggable point to smart edge HOT 4
- Update to be compatible with React Flow 11 HOT 5
- In version 3.0 Beta - Edge between 2 nodes goes away if the nodes are close to each other HOT 3
- Props that are generated when you start dragging new connection are missing for <StepEdge /> in react flow v11 HOT 2
- Make edges not overlap each other HOT 1
- Connection line appears broken when using specific grid snapping HOT 3
- Connection line appears broken when using specific grid snapping HOT 1
- Demo page/Storybook is no longer working HOT 2
- Smart Edge Not Considering nodes inside a group. HOT 2
- Edges not starting/ending on XY coords HOT 1
- Bending of edge from source HOT 4
- Edge labels getting overlapped HOT 6
- Add SmoothStepPath HOT 3
- edgeCenterX and edgeCenterY sometimes aren't calculated properly! HOT 1
- Option to propagate exceptions outside of getSmartEdge HOT 2
- engine warning when installing latest version HOT 2
- Add helper function for EdgeTypes and Options
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 react-flow-smart-edge.