Comparing version 0.0.15 to 0.0.16
@@ -25,2 +25,6 @@ var ChartModel = require("./lib/ChartModel"); | ||
Charted.prototype.destroy = function() { | ||
this.model.destroy(); | ||
} | ||
exports = module.exports = Charted |
@@ -79,2 +79,3 @@ /** | ||
this.plots.remove(model); | ||
model.destroy(); | ||
} | ||
@@ -152,4 +153,11 @@ }, | ||
}, | ||
destroy: function() { | ||
// Ensure that no circular references will crop up | ||
this.trigger('destroy'); | ||
this.plots = undefined; | ||
this.unset('data'); | ||
} | ||
}); | ||
exports = module.exports = ChartModel; |
@@ -45,2 +45,3 @@ /** | ||
this.listenTo(this.model.get('data'), 'add remove reset update', this.render); | ||
this.listenTo(this.model, 'destroy', this.remove); | ||
}, | ||
@@ -47,0 +48,0 @@ |
@@ -63,2 +63,7 @@ /** | ||
return this.collection.toActualY(pixel_y, extrema); | ||
}, | ||
destroy: function() { | ||
this.trigger('destroy'); | ||
this.stopListening(); | ||
} | ||
@@ -65,0 +70,0 @@ |
@@ -26,3 +26,5 @@ /** | ||
// Listeners | ||
this.on('add remove reset', this.updateExtrema ); | ||
this.on('add remove reset', function() { | ||
this.chart.trigger('trigger_render'); | ||
} ); | ||
this.listenTo(this.chart, 'before_render', this.updateExtrema ); | ||
@@ -29,0 +31,0 @@ |
@@ -15,3 +15,8 @@ /** | ||
initialize: function() { | ||
this.chart = this.model ? this.model.chart : this.collection.chart ; | ||
if (this.model) { | ||
this.chart = this.model.chart; | ||
this.listenTo(this.model, 'destroy', this.remove); | ||
} else { | ||
this.chart = this.collection.chart ; | ||
} | ||
}, | ||
@@ -18,0 +23,0 @@ |
{ | ||
"name": "charted", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "Charts an entire collection of data. Single or multiple y-axes. Support for 64-bit integers. Auto-resizing axes.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
46598
1100