I am trying to dynamically update nodes of my cy object with the "parent" field. When the elements are first loaded in from a json file, they do not have a parent field. The documentation says I should be able to set a particular data field simply with cy.data( name, value ). However, this appears to only work the attribute name is one that already exists.
I have thought to create a copy of each node to add my parent attribute to, and then remove the old node; however my graph is quite large and this seems like a last resort.
I tried this with my code and got it to work properly with .move():
The documentation has two versions of .data(), one for the core cy element, and one for any element, so also nodes, edges, the canvas...
I think your problem came from that, if not, let me know what code you use exactly :D THX