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

option to disable node dragging #43

Open
bagnus opened this issue Mar 3, 2017 · 3 comments
Open

option to disable node dragging #43

bagnus opened this issue Mar 3, 2017 · 3 comments

Comments

@bagnus
Copy link

bagnus commented Mar 3, 2017

I need a way to disable dragging on some nodes.

Case test:
graph.addNode('Banana', { nodrag:true });
I changed the original code at bottom of drawNode():

node.shape.connections = [];
dragify(node.shape);

resulting in:

node.shape.connections = [];
if(!node.nodrag) {dragify(node.shape);}

Is there a better way to do it ?

Regards
Andrea

@monomon
Copy link
Contributor

monomon commented Nov 5, 2017

It would be best to specify custom drag handlers, passing undefined for no drag or default. So there are three options: default drag, no drag, custom drag. imo this is most desirable for customizability. How to make the interface for this, I'm not sure. Maybe still keep the 'nodrag' option...

@monomon
Copy link
Contributor

monomon commented Nov 5, 2017

On a second thought, preventing the default drag and then manually hooking a custom one would be fine, too.

@monomon
Copy link
Contributor

monomon commented Nov 16, 2017

I have created a pull request #47 for this. The switch is named noDefaultDrag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants