Need to Drag SVG element


#1

Hello All,

I have SVG element as canvas. Need to drag this canvas when my graph goes beyong candvas width & height.

How to do that. Can anybody help with same?

Thanks, Priyanka.


#2

When you set up the mousemove listener … don’t set it to listen to the canvas element, but instead the document

Example:

let handleMoveFn = this.myHandleMoveFunction.bind(this);
$(document).on('mousemove', handleMoveFn);

#3

/

Whats myHandleMoveFunction function…is it in build in or custom function?


#4

its whatever you want it to be.


#5

i need to drag the div which includes canvas of graph so what it will be…?

Sorry very new to this so could not get it?

Thanks in advance, Priyanka