cytoscape.js disable grab&moving nodes
Asked Answered
L

3

6

I'm having trouble building a graph network with cytoscapeJS. I can add nodes and handle them which is quite easy, but I'm not able to configure cytospace to disable Dragging/Moving nodes.

I have found a JSbin from somebody where you can try: http://jsbin.com/vasenatimu/2/edit?html,js,output

Have a look at http://js.cytoscape.org under 'Initialisation options', I tried all the options, but they dont solve my problem (I set nearly all options to false and I can still grab and select nodes).

Can you help me with this?

Listen answered 14/5, 2015 at 10:6 Comment(0)
S
12

initOptions.autoungrabify: true or cy.nodes().ungrabify()

Sleepwalk answered 21/5, 2015 at 17:8 Comment(0)
D
1

You can also disable selected nodes using their configuration. For example:

cytoscape({
  elements: {
    nodes: [
      { 
        data: { id: "node1" }, 
        grabbable: false,
      },
    ],
  },
});
Deandra answered 3/5, 2019 at 10:33 Comment(0)
A
0

I faced the same problem and I found out this is the solution to the problem for me:

cytoscape({
  autolock: true, <== this did the trick for me
  elements: {
    nodes: [
      { 

      },
    ],
  },
});

I hope this will help you as well.

Regards Edgar

Aviatrix answered 22/5, 2019 at 21:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.