I use d3 for a interactive network application. The data I need to bind changes during the interaction and consists of some selected objects from my JSON variable.
For that I used map on the JSON variable and made some queries to select the appropriate objects. The objects are pushed onto a list and this list is bound as new data.
My problem is, that Javascript pushes objects just as reference. While d3 makes some fancy data modifications my JSON variable gets messy and my queries won't work anymore.
Do I need to copy each object with something like JSON.stringify()
or jQuery.extend()
or is there a different solution to decouple my JSON variable from the array of objects I pass as data?