Giter Site home page Giter Site logo

Comments (12)

dmitrygalperin avatar dmitrygalperin commented on May 14, 2024 6

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.

MrBlenny avatar MrBlenny commented on May 14, 2024 5

from react-flow-chart.

dmitrygalperin avatar dmitrygalperin commented on May 14, 2024 4

@MrBlenny Thanks, I'll see if I can put together a PR.

from react-flow-chart.

Pagebakers avatar Pagebakers commented on May 14, 2024 2

@dmitrygalperin @MrBlenny Any news? Would really like this to be merged!

from react-flow-chart.

MrBlenny avatar MrBlenny commented on May 14, 2024

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.

MrBlenny avatar MrBlenny commented on May 14, 2024

@dmitrygalperin is that ready to be a PR?

from react-flow-chart.

Pagebakers avatar Pagebakers commented on May 14, 2024

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.

mchaledg19 avatar mchaledg19 commented on May 14, 2024

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.

Pagebakers avatar Pagebakers commented on May 14, 2024

The problem has probably to do with your custom port/link components. Remove those and it should work :)

from react-flow-chart.

dmitrygalperin avatar dmitrygalperin commented on May 14, 2024

@MrBlenny @Pagebakers

Apologies, I'm just now getting time to get back to this. I think it's ready for a PR

from react-flow-chart.

mchaledg19 avatar mchaledg19 commented on May 14, 2024

any update? if this is already merged?
@MrBlenny

from react-flow-chart.

hyusetiawan avatar hyusetiawan commented on May 14, 2024

@MrBlenny ping, would love to get the smart routing merged :)

from react-flow-chart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.