Skip to content
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

Callback/event when a label is updated #29

Open
josejulio opened this issue Aug 14, 2019 · 3 comments
Open

Callback/event when a label is updated #29

josejulio opened this issue Aug 14, 2019 · 3 comments

Comments

@josejulio
Copy link
Collaborator

Would it be possible to have a callback/event when a label is updated?
Ideally I would like a ref to the htmlElement and the cytoscapeElement

Would it be accepted if I work on a PR?

@josejulio
Copy link
Collaborator Author

Related to #12

@jeppebm
Copy link

jeppebm commented Dec 7, 2020

@josejulio anything on this?

I think this makes a lot of sense, and would enable additional functionality such as manipulation of the HTML element and syncronization between the html and the cytoscape element (like #12).

Personally I need to add transitions to the html element by adding a class after the HTML initialization.

@josejulio
Copy link
Collaborator Author

I did this on my fork. I think is something that would be ported here, but currently working on other project and have little time to update this. A PR porting/improving that would be accepted here.

You can test it out in this npm package: https://www.npmjs.com/package/cy-node-html-label

// Listening for changes
cyInstance.on('nodehtml-create-or-update nodehtml-delete', function(event, data) {
   // When created/updated data has the label, and you can get the html node with element.getNode()
   // It also has isNew to know if it was created or updated.
   // Target event is the cytoscape node associated to the label.
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants