Recording nodes being moved
See original GitHub issueLike a few other people I’m trying to store node positions. I’ve done a hack using the MouseUp, but this affecting the performance of a few other things and I’d really like to try and use events.
I’ve found lots of posts that suggest:
You can subscribe to actionStartedFiring/actionStillFiring, and it will fire MoveItemsAction where you can access moved items from action.selectionModels
But no code to show how this works
i.e. in this code, all of these events work
this.diagramModel = new DiagramModel()
this.diagramModel.addListener({
linksUpdated: this.onUpdateLinks.bind(this),
offsetUpdated: _.debounce(this.updateOffset.bind(this),500),
zoomUpdated: this.updateZoom.bind(this),
actionStillFiring: (a) => console.log(a),
})
But actionStartedFiring/actionStillFiring are never called, MoveItemsAction is never called… I just can’t find any way of listening for nodes being moved.
Please can someone give me some example code to show how this works?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Problems when developing message flows with file nodes - IBM
This problem can be caused when the FileInput node cannot move files from its input directory to the archive or backout directory because...
Read more >How I can move record to another collection? - Stack Overflow
Currently, I have a lot of records that need to be moved to another collection. I try with aggregate with $out operator, but...
Read more >Reorder and refine nodes - NVivo for Mac Help
Watch a video tutorial; Sort nodes; Copy nodes; Move nodes to a new parent or folder; Reorder nodes (within the same level of...
Read more >Move Node - Bentley - Product Documentation
To move an existing node: ... Click the Edit Datum button . Click on the node to be moved and click the Move...
Read more >Recording and playing back data — ROS 2 Documentation
In the topics tutorial, you learned that the /turtle_teleop node publishes ... Use the arrow keys to move the turtle around, and you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah ok, I looked into implementation and you need to return
true
fromactionStartedFiring
listener.https://github.com/projectstorm/react-diagrams/blob/fa34f5c98b42eb4b6770a64d9d06373cc153e4c6/src/widgets/DiagramWidget.tsx#L200
Hi, thanks for this research and you are almost there!
The thing is that
actionStartedFiring/actionStillFiring
are widget events, not model, so apropriate usage will be like this