Comments (12)
I have a fork at https://github.com/dmitrygalperin/react-flow-chart/tree/master that implements this via config={{ smartRouting: true }}
If anyone would like to take a look or offer suggestions/concerns before I submit a PR, please feel free.
Some concerns:
Pathfinding is expensive so performance is slower. I am limiting pathfinding to only nodes that are in view as well as scaling down the resolution of the pathfinding matrix. As a fallback to when a path cannot be found, I create a direct right angle link between the ports.
I also feel that the pathfinding can be tweaked to make the paths neater, though I'm not sure exactly how, especially with performance in mind.
from react-flow-chart.
from react-flow-chart.
@MrBlenny Thanks, I'll see if I can put together a PR.
from react-flow-chart.
@dmitrygalperin @MrBlenny Any news? Would really like this to be merged!
from react-flow-chart.
I'm unlikely to have time to work on such a feature. Certainly not for at least a few months. Happy to accept PRs :)
from react-flow-chart.
@dmitrygalperin is that ready to be a PR?
from react-flow-chart.
I just merged this in to my project, but I don't see any difference with smartRouting enabled. @dmitrygalperin is this the latest version you shared?
It's working quite well actually :)
from react-flow-chart.
config={{ smartRouting: true }} doesn't work on my project. Any news for smart link?
<FlowChart chart={chart} callbacks={stateActions} config={{ smartRouting: true, // disabledPorts: [], validateLink: ({ linkId, fromNodeId, fromPortId, toNodeId, toPortId, chart }) => { if (chart.nodes[fromNodeId].type === chart.nodes[toNodeId].type) return false; return true; } }} Components={{ CanvasOuter: CanvasOuterCustom, NodeInner: NodeInnerCustom, Port: PortCustom, Link: props => <LinkCustom {...props} stateActions={stateActions} /> }} />
from react-flow-chart.
The problem has probably to do with your custom port/link components. Remove those and it should work :)
from react-flow-chart.
Apologies, I'm just now getting time to get back to this. I think it's ready for a PR
from react-flow-chart.
any update? if this is already merged?
@MrBlenny
from react-flow-chart.
@MrBlenny ping, would love to get the smart routing merged :)
from react-flow-chart.
Related Issues (20)
- When dragging node, link component moves fast than the node one HOT 2
- Please tell us about the future activities of this repository. Or let's discuss it! HOT 8
- The inner canvas goes out of the viewport HOT 1
- Pinch action in canvas zooms the whole webApp in safari
- The node content overflows when zoomed in and dragged. HOT 1
- Is there anyway to change link color on hover and click
- Expand size of 'Draggable View'
- How do I move the view so that it centers on a node? HOT 3
- Is there a way such that while dragging and dropping the items get dropped centered and vertical align?
- Is there a way to increase the distance between ports?
- Is this repo still maintained?
- Can't change css style on focus edge
- Documentation
- how to add custom label on the links i am getting an error on existing one. Can i get any example source code which works.
- Unoptimized loading of lodash function isEqual
- TypeError: Cannot read properties of undefined (reading 'x')
- Delete Link
- Save or Export Flows in JSON format
- This library is not supporting with React 16+ version HOT 4
- Out-of-bounds nodes can break FlowChart HOT 5
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-chart.