Commit 37a48bc1 authored by S Anand's avatar S Anand

BUG: G.zoom() should be chainable

parent b3388f0f
......@@ -30,12 +30,13 @@ G.zoom = function(options) {
.classed('zoom', false)
}
return {
var self = {
// self.on(event, handler) binds handler to event on both smoothzoom and abruptzoom
// e.g. self.on('zoomstart', handler)
'on': function(event, handler) {
smoothzoom.on(event, handler)
abruptzoom.on(event, handler)
return self
},
'to': function (nodes) {
......@@ -66,7 +67,9 @@ G.zoom = function(options) {
.translate([(-bounds.x - bounds.width/2) * scale + width/2, (-bounds.y - bounds.height/2) * scale + height/2])
.scale(scale)
.event(container)
return self
}
}
return self
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment