JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//cdn.jsdelivr.net/snap.svg/0.1.0/snap.svg-min.js"></script>
<svg id="canvas"
width="400"
height="400"
viewbox="0 0 200 200">
</svg>
JavaScript
myCircle=Snap("#canvas").circle(100,100,20);
/* Set up generic drag */
var start=function() {
// this.data("oldt", this.transform());
}, move = function(dx, dy) {
// this.attr("fill","blue");
this.transform(this.data("oldt") + "t" + dx*.5 + "," + dy*.5);
}, up = function() {
//this.attr("fill","green");
};
myCircle.drag(move,start,up);