const circle = function circle(opts) {
  const {
    context,
    px = d => d,
    x,
    y,
    r,
    fill,
    stroke,
    strokeWidth = 1,
    alpha = 1
  } = opts;
  context.save();
  context.globalAlpha = alpha;
  context.beginPath();
  context.arc(x, y, px(r), 0, 2 * Math.PI, false);
  context.fillStyle = fill;
  context.fill();
  if (stroke) {
    context.strokeStyle = stroke;
    context.lineWidth = px(strokeWidth);
    context.stroke();
  }
  context.restore();
};
export default circle;