Skip to content

Instantly share code, notes, and snippets.

@xoor-io
Last active April 10, 2018 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xoor-io/fc4419cc9fc5c57b046830afa42e88db to your computer and use it in GitHub Desktop.
Save xoor-io/fc4419cc9fc5c57b046830afa42e88db to your computer and use it in GitHub Desktop.
d3-canvas-zoom-04
const zoom_function = d3.zoom().scaleExtent([1, 1000])
.on('zoom', () => {
const transform = d3.event.transform;
context.save();
draw(transform);
context.restore();
});
canvasChart.call(zoom_function);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment