Closed RK-Veltec closed 4 years ago
The difference is basically the e.cyTarget that was updated to e.target in the 3.x.x^ releases. I saw no other problems with compatibility.
That code works with this changes:
cy.on('tapdragover', 'node', _.debounce( function(e){
var ctarget = e.target;
if(ctarget.selected()){
return;
}
if( ctarget.nonempty() ){
showNodeInfo( node );
}
}, 100) );
It would be great to eventually update this demo, but it doesn't make much practical difference whether it uses 2.x or 3.x. I don't think that people should be using this as a basis for an app or copying and pasting it: It's just a little demo to show what the lib can do with a little code.
The main motivator for updating to 3.x on this demo would be to improve the options used for the concentric layout. Currently, it spreads things out more than necessary. There are options in 3.x to mitigate this.
Anyway, updating this demo to 3.x is not a high priority at the moment. If you already have the upgrade working, I'd appreciate a PR.
I don't think that people should be using this as a basis for an app or copying and pasting it: It's just a little demo to show what the lib can do with a little code.
Funny because that's exactly what I intended to do. Do you have suggestions for another code to copy/paste as a starting point for a fun project?
If you don't want to create an app's scaffolding yourself you should use something like create-react-app or yeoman.
The example uses Cytoscape.js 2.7.2 Is there any plans to update this example to Cytoscape.js +3.0.0?
Just updating the files works decently as it is, but I wrote this event and it didn't work:
It returns "cannot find property selected of null". This error doesn't occur using 2.7.2.