d3 + Backbone: updating elements for which data has changed
I'm using d3 with Backbone.js models. When the model attributes change, an event is fired and the model is marked with a hasChanged() flag and it retu开发者_运维技巧rns a changedAttributes() hash. I understand how to use d3's enter() and exit() to handle models that have either been created or removed. What I am having trouble figuring out is how I can modify the respective DOM elements based on model attributes changing. I can use the Backbone helpers to figure out what to modify, but what is the next step with d3?
I got some helpful responses on the d3 mailing list: http://groups.google.com/group/d3-js/browse_thread/thread/65c4c8ffb5515ab2 And my solution, based on that advice, is at: https://gist.github.com/1257765
精彩评论