JSFiddle - React, Tailwind, and code Playground

by chriswilsondc

JavaScript

var paper = new Raphael(0, 0, 500, 500);
var circle = paper.circle(120, 110, 25).attr("fill", "yellow");

circle.drag(dragmove, dragstart, dragend);

function dragmove(dx, dy, x, y, e) {
    this.transform(this.current_transform+'T'+dx+','+dy); 
}

function dragstart(x, y, e) {
    this.current_transform = this.transform();
    this.attr("fill", "orange");
}

function dragend(e) {
    this.current_transform = this.transform();
    this.attr("fill", "yellow");
}