createDot = (radius, {fill = null, alpha = 1, dpr = 1, strokeWidth = 1, stroke = "black"} = {}) => {
const center = Math.ceil(radius + strokeWidth / 2 + 1);
const ctx = DOM.context2d(center * 2, center * 2, dpr);
ctx.beginPath();
ctx.moveTo(center + radius, center);
ctx.arc(center, center, radius, 0, Math.PI * 2);
ctx.globalAlpha = alpha;
if(fill) {
ctx.fillStyle = fill;
ctx.fill();
}
if(stroke && strokeWidth) {
ctx.strokeStyle = stroke;
ctx.lineWidth = strokeWidth;
ctx.stroke();
}
return {x: -center * dpr, y: -center * dpr, image: ctx.canvas};
}