score:1

Accepted answer

I used d3.zoom for this.

var zoom = d3.zoom() .extent([[margin.left, margin.top], [width, height]]) .scaleExtent([1, 1]) .on("zoom", zoomed);

Then call the zoom on svg selection, and change transform attribute on zoom event.

Demo: http://jsfiddle.net/b4xcg2sj/35/