이 예 :에클릭 한 노드의 ID를 cytoscape.js에서 얻으려면 어떻게해야합니까? 문서에서
cy.on('click', function(evt){
console.log('clicked ' + this.id());
});
결과 :
Uncaught TypeError: Object [object Object] has no method 'id'
그리고 evt.cyTarget.data()는 undefined를 반환합니다.
덕분에,이 결과
–사실,이 작업을 수행하면 실제로 작동합니다 (h ttps : //github.com/cytoscape/cytoscape.js/blob/master/debug/init.js) : https://gist.github.com/dtenenba/4733384 –