Drag and drop seats, get data of seats for saving


#1

Dear all,
It’s nice to see Seating Chart
image

However, I want to drag and drop a seat around the table and not overlap others seats or tables, able to drag to another table, get data of seats for saving or storage.
Thanks,


#2

You’ll need to change the design so that chairs are Nodes. I don’t know if you want to have Groups which are collections of simple table Nodes plus some number of chair Nodes.

Presumably you’ll want to implement a Node.dragComputation function that prevents overlapping nodes. You can start with the one used in https://gojs.net/latest/samples/dragUnoccupied.html. I don’t know if you want something smarter, recognizing that chairs and tables can be circular or elliptical.

You can analyze models to get information about all of the furniture and all of the people. Models can be saved and loaded with the standard mechanisms: Model.toJson and Model.fromJson.