Skip to content

Instantly share code, notes, and snippets.

@xoor-io
Created April 26, 2018 19:03
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/2dbf075a8d9ee5b50cf78931734d3852 to your computer and use it in GitHub Desktop.
Save xoor-io/2dbf075a8d9ee5b50cf78931734d3852 to your computer and use it in GitHub Desktop.
d3-canvas-brush-zoom-04
const brush = d3.brush().extent([[0, 0], [width, height]])
.on("start", () => { brush_startEvent(); })
.on("brush", () => { brush_brushEvent(); })
.on("end", () => { brush_endEvent(); })
.on("start.nokey", function() {
d3.select(window).on("keydown.brush keyup.brush", null);
});
const brushSvg = svgChart
.append("g")
.attr("class", "brush")
.call(brush);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment