Skip to content

Instantly share code, notes, and snippets.

@mpayetta
Created Mar 28, 2018
Embed
What would you like to do?
d3-canvas-8
// Draw on canvas
dataExample.forEach( point => {
drawPoint(point);
});
function drawPoint(point) {
context.beginPath();
context.fillStyle = pointColor;
const px = x(point[0]);
const py = y(point[1]);
context.arc(px, py, 1.2, 0, 2 * Math.PI,true);
context.fill();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment