The zoom behavior implemented by d3-zoom is a convenient but flexible abstraction for enabling pan-and-zoom on selections. It is agnostic about the DOM, so you can use it with SVG, HTML or Canvas.
Pan and zoom SVG, HTML or Canvas using mouse or touch input.