Skip to content

Instantly share code, notes, and snippets.

@xoor-io
Created April 26, 2018 18:48
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/9456745eb94b9f38ed8c4b8b356d15ec to your computer and use it in GitHub Desktop.
Save xoor-io/9456745eb94b9f38ed8c4b8b356d15ec to your computer and use it in GitHub Desktop.
d3-canvas-brush-zoom-03
const svgChartParent = d3.select('svg');
const zoomButton = toolsList.select('#zoom').on('click', () => {
toolsList.selectAll('.active').classed('active', false);
zoomButton.classed('active', true);
canvasChart.style('z-index', 1);
svgChartParent.style('z-index', 0);
});
const brushButton = toolsList.select('#brush').on('click', () => {
toolsList.selectAll('.active').classed('active', false);
brushButton.classed('active', true);
canvasChart.style('z-index', 0);
svgChartParent.style('z-index', 1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment