JSFiddle - React, Tailwind, and code Playground
by Josh Pullen
CSS
canvas {
border: 1px solid black;
}
JavaScript
const points = [
[100, 100],
[200, 200],
[300, 150],
[100, 400]
];
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
document.body.appendChild(canvas);
canvas.width = 500;
canvas.height = 500;
for (const point of points) {
ctx.beginPath();
ctx.arc(point[0], point');
ctx.fill();
}