Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tap distance threshold #636

Closed
maxkfranz opened this issue Jun 27, 2014 · 12 comments
Closed

Tap distance threshold #636

maxkfranz opened this issue Jun 27, 2014 · 12 comments
Labels
bug A bug in the code of Cytoscape.js priority-2-medium
Milestone

Comments

@maxkfranz
Copy link
Member

Dragging a node should not start until the user has dragged beyond a certain distance. This allows for easier tapping and selecting.

Analogous behaviour should occur for tapping and panning on the background.

@maxkfranz maxkfranz added this to the 2.3.0 milestone Jun 27, 2014
@maxkfranz maxkfranz modified the milestones: 2.3.0, 2.4.0 Aug 14, 2014
@maxkfranz maxkfranz modified the milestones: 2.3.6, 2.4.0 Nov 28, 2014
@maxkfranz maxkfranz added the bug A bug in the code of Cytoscape.js label Nov 28, 2014
@maxkfranz
Copy link
Member Author

Labelling as bug and advancing to 2.3.6 milestone -- not because it's technically a bug per se, but because without this behaviour things are less easy for users. So, we should address this as soon as possible.

maxkfranz added a commit that referenced this issue Nov 28, 2014
maxkfranz added a commit that referenced this issue Nov 28, 2014
docs TODO

Conflicts:
	src/extensions/renderer.canvas.define-and-init-etc.js
@maxkfranz
Copy link
Member Author

TODO more testing

maxkfranz added a commit that referenced this issue Dec 3, 2014
maxkfranz added a commit that referenced this issue Dec 3, 2014
@maxkfranz
Copy link
Member Author

I'm going to close this, as it seems to be working from my testing. We can reopen if there is any issue. It may be nice to experiment with different threshold values before release.

@maxkfranz maxkfranz reopened this Dec 8, 2014
@maxkfranz
Copy link
Member Author

TODO threshold should not change relative node grab position. This doesn't break anything, but it can be disconcerting to the user.

@maxkfranz
Copy link
Member Author

@ktei Would you please experiment with different tap threshold values? I don't think think programmers would want to set this value manually, but I would like to ensure that the values set in core.js are appropriate.

You mentioned that you had users who had trouble without the tap threshold, so would you mind testing with those users to see if perhaps higher values are needed? Thanks!

@ktei
Copy link
Contributor

ktei commented Dec 18, 2014

@maxkfranz I think the original issue one of the users mentioned is this: he wishes to select a node (we highlight node border for selected nodes using stylesheet) immediately after he clicks on the node. But as you know sometimes you click on a node with a little bit dragging it, which makes the system think you are dragging so the node will not be selected (highlighted), because the selection occurs in mouseup event. So I changed a bit code to make selection happen in mouse down regardless of dragging or not, as long as the node is hit. The tap distance, if I understand it correctly, is to tolerate users with fat fingers in case that can't tap on a node precisely. As far as I am concerned, none of our users has reported this kind of issue yet. Not sure if this helps you?

@maxkfranz
Copy link
Member Author

The tap threshold solves the issue you describe by not starting drag actions until the user has dragged beyond a certain distance. This means that if you drag a node a little bit, it isn't dragged and it's detected as a normal tap (and select).

If you select on mousedown, you will run into trouble eventually -- as you have restricted the possible set of interaction states.

@ktei
Copy link
Contributor

ktei commented Dec 18, 2014

Okay. I think I misunderstood the tap distance. I need to get your changes and have a try. I will let you know soon.

@maxkfranz
Copy link
Member Author

Perhaps TODO:

Threshold on background tap operations; makes things like unselect easier.

@ktei
Copy link
Contributor

ktei commented Dec 19, 2014

Hi, @maxkfranz
I just pulled your changes to my forked repository. I think it's working fine. I'm going to push that changes to production soon I think. I do think you can provide the tap distance option to developer users, but maybe warn them in the documentation that this is preferred to stay unchanged unless they know what they're doing?

@maxkfranz
Copy link
Member Author

That's fair, but perhaps it should be split into two options: One option for mouse and one for touch. I think the touch case and the mouse case need separate values, because the input accuracy is different between those cases.

maxkfranz added a commit that referenced this issue Dec 19, 2014
@maxkfranz
Copy link
Member Author

@ktei I think that should be everything. From my testing everything seems OK. Please try things out, and if it looks good I can make the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in the code of Cytoscape.js priority-2-medium
Projects
None yet
Development

No branches or pull requests

2 participants