visualizer
visualizer copied to clipboard
window.event is not defined on first click in spectra displayer
I need with track information to know if shift is pressed or not.
The problem is that for an unknown reason the first time I click on the spectrum the window.event is not defined. After the first time it is ok.
Any way to solve this problem ? @targos
https://www.lactame.com/visualizer/src/index.html?config=../testcase/config/default.json&viewURL=../testcase/data/jcampViewer/view.json&dataURL=../testcase/data/jcampViewer/data.json
I suggest you don't use window.event
: https://developer.mozilla.org/en-US/docs/Web/API/Window/event
Tracking the mouse is a real time event and you should use an action for it. Just configure the spectra displayer to send the event object
So in this case I would get a track hover that creates a variable and then an action with the event. In a code executor I listen to the action and make an API.getData('trackhover') to get the point. right ?
You can also send the track data as an action before the event and cache it