data icon indicating copy to clipboard operation
data copied to clipboard

backbone.js models and data.js graphs relation

Open lucalenardi opened this issue 12 years ago • 5 comments

Probably I'm missing something here, but I cannot understand the profound difference between a data.graph, and a backbone.model object.

Eventually, it could be useful to integrate the graphs with backbone and inherit its model features (such as bind on change etc.). Maybe it's already possibile. Isn't it?

lucalenardi avatar Nov 25 '11 14:11 lucalenardi

Data.js can be used as a drop-in-replacement for Backbone.Model. The combination works well so far, but there's of course room for improvements, since Backbone's event-based approach (model changes trigger view updates) can't be applied 1:1. In the long run, I'd like to have ways to bind data-nodes to DOM elements, much like in the fashion of D3.js. New nodes that just arrived, could be handled using an enter() selection then. However these are just some rough initial thoughts…

And I'm open for API suggestions :)

michael avatar Nov 25 '11 15:11 michael

+1 bumping ;)

elf-pavlik avatar Mar 22 '12 20:03 elf-pavlik

I'm actually working on that right now. :)

When it's ready it will probably a mix of Backbone and D3, using the best concepts of both + Data.js as a data layer.

michael avatar Mar 22 '12 21:03 michael

sounds sweeeeeeeet! thx @michael =)

elf-pavlik avatar Mar 22 '12 22:03 elf-pavlik

 D3  +  Backbone  <  Ember.js

The computed properties and bindings that Ember provides woud solve the dom-to-data binding in a much more agnostic and elegant manner.

Have you had a chance to get addicted to computed properties?

d4tocchini avatar Sep 22 '12 07:09 d4tocchini