I currently do the following:
let $cy = $('#cy');
let cy = cytoscape({
container: $cy,
...
});
$cy.data('cytoscape', cy);
The above allow me to reobtain the cytoscape object (e.g. in a event handler) as follows:
let cy = $cy.data('cytoscape');
Is there a builtin method of obtaining the cytoscape object so I can avoid doing all this work (and technically mess with a element own by the library)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…