retejs / rete

JavaScript framework for visual programming
https://retejs.org
MIT License
9.8k stars 643 forks source link

Auto Snap & Align Nodes when Dragging #90

Closed ALPEEN closed 5 years ago

ALPEEN commented 6 years ago

UX Suggestion: Auto Snap & Align nodes when dragging would be a great enhancement to the UX.

Ni55aN commented 6 years ago

Okay, now I'm looking for the best architectural solution for implementing such features in the form of plugins, so as not to complicate the exist codebase

ALPEEN commented 6 years ago

I see, it is good to keep in mind to keep everything as simple as possible, but with the growth of this awesome lib and its features, things will start getting complicated, too naturally. I think what it is healthy to do is to comment well the code bases: the role of each methods and parameters, the events and its triggers etc. I suggest too to use some libs that can reduce and organize the code such RxJS, I see that a node have all the properties of an observable so maybe we can take profits from reactive programming features etc.

Ni55aN commented 5 years ago

https://github.com/retejs/area-plugin/commit/b5892012152537bc63835ecc69024483c765f277

editor.use(AreaPlugin, {snap: {size: 64. dynamic: true}});