@model.on 'destroy', @remove, this
@model.on 'change', @render, this
+ @model.on 'change:dataset', ~>
+ changes = @model.changedAttributes()
+ console.log 'VisModel.changed(dataset) ->', JSON.stringify changes
+ @chart.updateOptions file:that if changes?.dataset
@model.on 'change:options', ~>
changes = @model.changedAttributes()
- # console.log 'Model.changed(options) ->', changes
- @chartOptions changes, {+silent}
+ console.log 'VisModel.changed(options) ->', JSON.stringify changes
+ @chartOptions that, {+silent} if changes?.options
@viewport = @$el.find '.viewport'
onReady: ->
- console.log 'VisView.ready!'
+ console.log "#this.ready!"
@ready = @scaffold.ready = true
@change()
@renderAll()
render: ->
return this unless @ready
- console.log 'VisView.render!'
+ console.log "#this.render!"
size = @resizeViewport()
options = @chartOptions() import size
renderAll: ->
return this unless @ready
- console.log 'VisView.renderAll!'
+ console.log "#this.renderAll!"
_.invoke @scaffold.subviews, 'render'
@scaffold.render()
@render()
data = _.synthesize do
@$el.find('form.details').serializeArray()
-> [it.name, it.value]
- console.log @$el, JSON.stringify data
@model.set data
false