Skip to content

Instantly share code, notes, and snippets.

@mpayetta
Created March 28, 2018 22:37
Show Gist options
  • Save mpayetta/0d65b9d5c4add91ac49b2bb9d0f999f2 to your computer and use it in GitHub Desktop.
Save mpayetta/0d65b9d5c4add91ac49b2bb9d0f999f2 to your computer and use it in GitHub Desktop.
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