Created
April 10, 2018 18:18
-
-
Save xoor-io/8e90961ded3abbaf65f5515729f3e115 to your computer and use it in GitHub Desktop.
d3-canvas-zoom-01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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