anoop901 / graphical-functional-programming

A browser-based graphical interface for creating and running programs using the functional paradigm.
https://anoopnaravaram.com/graphical-functional-programming
0 stars 0 forks source link

rearrange cluster layout by dragging mouse #93

Closed anoop901 closed 1 year ago

anoop901 commented 1 year ago

Any changes to which clusters are in which layers should not violate the dependency constraint described in #92:

Clusters should be assigned to layers such that for any 2 clusters A and B where any block in cluster A depends (via line connection) on the root block of cluster B, cluster A is in a strictly lower layer than cluster B.

anoop901 commented 1 year ago

The mouse can temporarily drag a block (along with blocks nested in it) to arbitrary locations. When the mouse is released, the layers field of the program should be updated, and the dragged block should snap to the location where the layout puts it with the new layers value.

The new value of layers should be determined by the location of the mouse when it is released.

If updating layers as described here would violate the layer dependency constraint, then layers should remain unchanged instead.

anoop901 commented 1 year ago

Also, if this update leaves any layers empty, they should disappear.