Skip to content

Instantly share code, notes, and snippets.

etiennecrb /
Last active July 21, 2017 09:50
d3-xyzoom demo

This plugin is a fork of d3-zoom that adds several features by separating scaling on x and y:

Scale independently along x-axis and y-axis

Constrain scale extent on zoom out to respect translate extent constraints

Apply "scale factor ratio" on user input. For instance, with a scale ratio of 0.5 on x-axis and 1 on y-axis, when user zoom with its mouse, the increase of scale factor on x-axis will only be half of the increase on y-axis.