0

a) I have a complex of nodes and edges. I want to add a title to the complex. Is there any way in Cytoscape.js, where I can display the title of the complex?

b) Additionally, I want to give user an option to download the complex in png file with a right click option, but my right click on the cytoscape div doesn't work. Is there any way or any flag I need to change to enable my right click on the picture?

Ankita Nand
  • 137
  • 1
  • 12

2 Answers2

1

Looks like no one is going to answer my question, answering them myself:

So, after struggling with these questions; I have got the solution for my first problem i.e. putting the title. We can have a parent node with the label as your complex title and then display it on the node. Don't think that it is a good way to do it. There should be something in cytoscape.js to display the title as well. But I don't think it is there yet.

In cytoscape there is an option to bind the event on right click, "cxttap" I used that to make a right click event. But I don't know how to give options on that click, working on that..!! If you are looking for same solution, stay tuned ;)

Ankita Nand
  • 137
  • 1
  • 12
0

You can use right button with cytoscapejs by modifying the code below, adding your code

cy.on('cxttap', function(e){
  console.log("right click!"); // just to check that it works, look at the console
  // add here your code...
  // ....
})
drasc
  • 517
  • 4
  • 7