Hello,
I would like the user to be able to create a point at the position of the mouse click. However, I do not know how to get the X,Y coordinates of the mouse cursor inside the JSX board when the mouse gets clicked.
How would I get the X and Y as shown below?
const board = JXG.JSXGraph.initBoard('jxgbox', {
boundingbox: [0, 10, 10, 0], axis:true
});
board.on('up', function () {
x = // get cursor's X
y = // get cursor's Y
var somePoint = board.create('point',[x,y], {name:'SomePoint',size:4});
});
My apologies if the answer is straightforward. I searched the API and could not find it.
Thanks.