As lookang suggested:

Define mx,my as variables to store value for cursor position, and assigned them to "Pos x" and "Pos y"

And EJS will find cursor position and translated to current plottingPanel coordinates , and assigned value to mx,my

Normally, I  will access mx,my values from action code in "OnPress, OnDrag,OnRelease, OnEnter,OnExit"

e.g. at r=Math.sqrt(mx*mx+my*my) in OnDrag
will find distance between origin and cursor position in plottingPanel
when you click and drag mouse inside plottingPanel