iVis-at-Bilkent / cytoscape.js-grid-guide

A Cytsocape.js extension to provide a framework for grid interactions such as grid lines and snapping to grid, and guidelines and snap support for alignment of nodes.
MIT License
58 stars 9 forks source link

Option for specifying what type of alignments to check #11

Closed ugurdogrusoz closed 7 years ago

ugurdogrusoz commented 7 years ago

Most users will probably be interested in center-center alignment. Perhaps we can discuss and have options to determine which type of alignments to check. This might help with performance as well.

kinimesi commented 7 years ago

In unstable version first the center of node is checked for alignment. If the center is not aligned, then left and right (top and bottom) sides are checked for alignment.

If alignment for center of node exists, it is shown first, hence user can do center-to-center, center-to-left or center-to-right alignments by moving the node around.

ugurdogrusoz commented 7 years ago

One idea is to either make all these combinations optional or completely get rid of alignment other than centers (very rarely people will try to align top of a node with another node's center, etc. Let's discuss.

kinimesi commented 7 years ago

We already implemented all types of alignments. So getting rid of some of them is not a good idea (we or someone might use it later on). But we can make those combinations optional. Let's ask the users whether those combinations are useful or not.

ugurdogrusoz commented 7 years ago

I agree I meant not using them in our editor, we ll talk.

ugurdogrusoz commented 7 years ago

We agreed on an option for whether or not center-to-edge alignments should be searched for.