JSFiddle - React, Tailwind, and code Playground

by alexvestin

HTML

<canvas id="canvas" width="600px" height="600px"></canvas>

JavaScript

const canv = document.getElementById("canvas")
const ctx = canv.getContext("2d")
ctx.beginPath();
ctx.strokeStyle = 'black';
ctx.lineWidth = 5;

let lastX = 200;
let lastY = 100;
ctx.fillStyle = "red"
ctx.fillRect(lastX - 2, lastY - 2, 4, 4);

ctx.moveTo(lastX, lastY);

let toX = 100;
let toY = 50;


ctx.arcTo(200, 101, 50,20, 40);
ctx.stroke();