React-diagrams: Crash when using smart routing

Created on 26 Jul 2019  路  27Comments  路  Source: projectstorm/react-diagrams

Hey!

I've got this error when using smart routing:

Uncaught TypeError: Cannot set property 'g' of undefined
    at JPFNeverMoveDiagonally.JumpPointFinderBase.findPath (:1338/.temp/localDevUMD/nodeEditor/babylon.nodeEditor.js:61210)
    at PathFinding.calculateDirectPath (:1338/.temp/localDevUMD/nodeEditor/babylon.nodeEditor.js:61210)
    at DefaultLinkWidget.render (:1338/.temp/localDevUMD/nodeEditor/babylon.nodeEditor.js:61210)
    at finishClassComponent (:1338/.temp/localDevUMD/nodeEditor/babylon.nodeEditor.js:52291)
    at updateClassComponent (:1338/.temp/localDevUMD/nodeEditor/babylon.nodeEditor.js:52254)
    at beginWork (:1338/.temp/localDevUMD/nodeEditor/babylon.nodeEditor.js:53072)
    at performUnitOfWork (:1338/.temp/localDevUMD/nodeEditor/babylon.nodeEditor.js:55810)
    at workLoop (:1338/.temp/localDevUMD/nodeEditor/babylon.nodeEditor.js:55850)
    at renderRoot (:1338/.temp/localDevUMD/nodeEditor/babylon.nodeEditor.js:55936)
    at performWorkOnRoot (:1338/.temp/localDevUMD/nodeEditor/babylon.nodeEditor.js:56827)

If I turn smart routing off, it works flawlessly

Here is our setup (with smart routing off):
https://github.com/BabylonJS/Babylon.js/blob/master/nodeEditor/src/graphEditor.tsx#L528

Thanks a lot!

architecture bug

Most helpful comment

Man we love your library:)
image

All 27 comments

Oh wow, its now in a game engine O_O I am busy reworking the entire smart routing system as we speak. The new system introduces smart routing as a new type of Link. I hope to have something out in the next few days, and this might solve your issue. If not, I'm really interested in working with you to help make this a success in your project.

to follow the progress, head on over to https://gitter.im/projectstorm/react-diagrams

Also the new structure of the project: https://github.com/projectstorm/react-diagrams/tree/lerna (you will be interested in the lib-routing folder)

Man we love your library:)
image

What should I do to switch to the new project? (using 5.2.1 for now)
Your tool will be a central piece of our 4.1 release as it will fuel our Node Material system :)

So glad we can work together

Definitely getting some blender comp-pipeline and Unreal-engine vibes in that screenshot. Ill let you know as soon I have something available

Im also busy fixing the link issue (the one where it doesnt respect horizonal mode)

Clearly:) feel free to ping me at [email protected] if you want to chat!

New fixes rolling out soon:
Screenshot 2019-07-27 at 16 11 52
Screenshot 2019-07-27 at 16 10 58
Screenshot 2019-07-27 at 16 10 05

You can specify the alignment of a port (top, left, bottom, right etc..)

Exactly what we need!!!

update from my side:

  • thanks to lots of componentShouldUpdate improvements, the large performance demo goes down from 140ms rendering times to 3 to 10 ms rendering times.
  • you no longer need to call recalculatePortCoords (method is removed)
  • there is no longer a double render cycle on initial render, the links now efficiently track their target ports on initial renders and wait for them to report initial dimensions.

if you check out the lerna branch, run yarn in the root and then head to the lib-demo-gallery you can run yarn start and then you should get the new demos. Ive been giving this some thought, and I wouldn't mind getting involved in upgrading your current implementation in Babylone.js when this releases

Oh man I did not dare asking but we will be honored to get your help on using your lib the best possible way

So version 6 [Beta] is now out, and I would love to get your thoughts on the new system. I also have smart routing working again (the original issue in this ticket). Let me know!

Yeah!!! It is on npm right?

Well I have a few issues when moving to 6.0.0. Mostly breaking changes :(
Some examples:

Do you have a doc or a way to help me port our code? I created that branch https://github.com/BabylonJS/Babylon.js/tree/projectstorm. If you want to have a look:

  • Fork the branch
  • go to tools/gulp
  • npm install
  • npm install -g gulp
  • With vscode, just go to debug tools, pick that:
    image
  • Hit F5 (with Chrome debugger extension installed in vscode)
  • In localdev/src, replace or create the index.js file with the file attached:
    index.zip
  • When the scene is running, you can click edit on the right panel and it will (at last ;D) open the editor with your tool :) Providing it is compiling ;)
    Thanks a million

Most of the stuff you listed is still in the library, we just made the API more consistent:

I am still busy writing docs including a migration guide, so stay tuned

Perfect !! Will give it a try asap

If you need faster assistance, feel free to message me here https://gitter.im/projectstorm/react-diagrams

@deltakosh I've seen the same nodeUpdated type error. The temporary workaround is to cast it to the type you need, like

.registerListener({
  nodesUpdated: () => {}
} as DiagramListener)

Wonderful! Still blocked on the other issue though

Any news, team?

Well just in case, we started doing some videos using your lib:

up?

@deltakosh
@dylanvorster
i'm using 5.2.1 verrsion and also get this error in some device
anyone has suggest for fix it ? i hope i can keep smart routing on

@memsenpai same for me. By the way, I am Vietnamese =))

Was this page helpful?
0 / 5 - 0 ratings