Questo esempio nella documentazione:Come ottengo l'ID di un nodo cliccato in cytoscape.js?
cy.on('click', function(evt){
console.log('clicked ' + this.id());
});
risultati in:
Uncaught TypeError: Object [object Object] has no method 'id'
E evt.cyTarget.data() restituisce indefinito.
Grazie, questo si traduce in : Unchaught TypeError: Impossibile leggere la proprietà 'id' di undefined –
In realtà, funziona se lo faccio (leggera modifica di h ttps: //github.com/cytoscape/cytoscape.js/blob/master/debug/init.js): https://gist.github.com/dtenenba/4733384 –