JSFiddle - React, Tailwind, and code Playground

JavaScript

var w = window.innerWidth;
var h = window.innerWidth;
var paper = Raphael(0, 0, w, h);
var nodes = paper.set();

var circle1 = paper.circle(w/8, h/3, w/16)
    .attr({fill: "#000"})
    .click(line);
var circle2 = paper.circle(w - w/8, h/3, w/16).attr({fill: "#000"})
    .attr({fill: "#000"})
    .click(line);


function line() {
  var band = paper.path("M 0 0").attr({"stroke-width": 5})
  band.node.style.pointerEvents = "none";
  dimensions = this.getBBox();
  var x = dimensions.x + dimensions.width/2;
  var y = dimensions.y + dimensions.height/2;
  if (!window.onmousemove) {
    window.onmousemove = function(e){
        band.attr({path: "M " + x + " " + y + "L " + e.x + " " + e.y});
    }
  }
  else {
     window.onmousemove = null;
  }
}