Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
d3-canvas-zoom-01
function draw(transform) {
const scaleX = transform.rescaleX(x);
const scaleY = transform.rescaleY(y);
gxAxis.call(xAxis.scale(scaleX));
gyAxis.call(yAxis.scale(scaleY));
context.clearRect(0, 0, width, height);
dataExample.forEach( point => {
drawPoint(scaleX, scaleY, point, transform.k);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment