React-diagrams: Can you add an event listen on node move? If so, how?

Created on 2 Aug 2018  路  9Comments  路  Source: projectstorm/react-diagrams

I've tried everything and I can't for the life of me figure out how to determine if a node on the grid is moved. Specifically I'd like to know the node's position when the movement completes so I can persist that information in my app.

Thanks in advance.

Most helpful comment

Hello @Grandclosing , there's 3 props of diagram widget - actionStartedFiring, actionStillFiring, and actionStoppedFiring which are callbacks and provide you with current action happening. Action you're looking for is MoveItemsAction

All 9 comments

Hello @Grandclosing , there's 3 props of diagram widget - actionStartedFiring, actionStillFiring, and actionStoppedFiring which are callbacks and provide you with current action happening. Action you're looking for is MoveItemsAction

@JokerNN
Thank you!

As a follow-up, is there any place that documents this kind of stuff and is up to date?
I looked at the advertised docs here: https://projectstorm.gitbooks.io/react-diagrams/

But those docs seem to be incomplete, offering only really simple 'quick-start' information.

The demos here: http://projectstorm.cloud/react-diagrams/

Also offer only simple examples...

Hey @Grandclosing , I read the code. I understand your frustration, but this project has no commercial support, so some parts are not perfect. But everyone are more than welcome to contribute, so if you succeed in listening to moving event, you can share your demo, that would be just great.

Also you can let me know if you need any help

Thanks @JokerNN ! I will definitely contribute whatever knowledge/code I can. :)

The Build interactive diagrams with storm-react-diagrams blog post has some good notes on the API for events

Events for the diagram model

linksUpdated
offsetUpdated
zoomUpdated
gridUpdated
selectionChanged
entityRemoved

Events for Link models

targetPortChanged
selectionChanged
entityRemoved

Events for Node models and Point models

entityRemoved

The 'events and listeners' example has the basics if you haven't already seen that.

Also see #287

@ianchanning The referenced example no longer exists, has it moved?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gugaevkirill picture gugaevkirill  路  3Comments

DanieLazarLDAPPS picture DanieLazarLDAPPS  路  3Comments

shortwavedave picture shortwavedave  路  3Comments

dixitk13 picture dixitk13  路  3Comments

msaglietto picture msaglietto  路  3Comments