Backbone.js |
D3.js |
Data may change through user input.
Data may need to be persisted across sessions.
|
Visualize data, transition between different states of data.
User input doesn't usually affect the data displayed.
|
Models and Collections for managing data: fetch , save , destroy
|
d3.xhr.get , d3.json , d3.csv , etc. to fetch.
d3.xhr.post to persist (but I very rarely see it used).
|
Views wrap around DOM elements
|
d3.select or d3.selectAll for selecting DOM elements
.data to bind data to selected elements
.enter to create elements from bound data
|
Views subscribe to Model change events, which usually trigger re-render
|
re-fetch data, or render next set of data
enter -update-exit
|