Skip to content

Instantly share code, notes, and snippets.

@xoor-io
Created April 10, 2018 19:40
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/e6502968e9d754f166781d73033705ed to your computer and use it in GitHub Desktop.
Save xoor-io/e6502968e9d754f166781d73033705ed to your computer and use it in GitHub Desktop.
d3-canvas-zoom-06
const toolsList = container.select('.tools')
.style('margin-top', margin.top + 'px')
.style('visibility', 'visible');
toolsList.select('#reset').on('click', () => {
const t = d3.zoomIdentity.translate(0, 0).scale(1);
canvasChart.transition()
.duration(200)
.ease(d3.easeLinear)
.call(zoom_function.transform, t)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment