-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove cy.load() from docs & deprecate #822
Comments
Any reason for deprecation? I currently use this as a "reset" of sorts so that I can persist existing data and load old, saved sets. |
Too many complaints and too much confusion over this function. If the old data has positions defined already, I'll put this off to 2.4, and it will be backwards compatible -- but I don't think anyone new should be using |
Perhaps there's a better way to do this, but what I am doing is resetting the core to have 0 data (but to maintain the styles and any additional click handlers I've set up). I don't want to wipe the core, but rather zero it out so that I can call I've extended the core with a 'reset' function that internally calls
I use this function later when loading in a saved data set:
|
I think a call to cytoscape('core', 'reset', function( callback ){
var cy = this;
cy.elements().remove();
callback();
return this; // chainability
}); |
I do a similar thing as bertomaniac. Using
And it does the trick. |
So if we set up cyto but have the data later on, should we used the "add" and then run a layout? |
@MissChocoe Yes. You can always use that manual workflow, even at init if you want (i.e. start with empty graph in init options). |
No description provided.
The text was updated successfully, but these errors were encountered: