chird / meteoJS

Javascript Library for meteorological and atmospheric tools
Apache License 2.0
28 stars 6 forks source link

Is There a possibility to do contextMenu event on TDDiagram of TermodinamicDiagram? #71

Closed HadjerSahariYassir closed 1 year ago

HadjerSahariYassir commented 1 year ago

Hi Chird, please i need to to a contextMenu while firing event of right click on the diagram (Termodinamic Diagram) ?
So, is there possibility to fire this event cause i have searched in the documentation there is no contextmenu event, also i need ( the tempearature and pressure) like information to handle functions that create for me isotherms , isobars,... if there is no contextmenu event on the diagram how to get T(temperature) and (p) pressure from the document event .

Thanks

chird commented 1 year ago

Hi hadjersh97, You can use the mousedown event. The passed object contains the properties button and which. In my test the left mouse button gave that button=0 and which=1. When clicked with the right mouse button, the values were button=2 and which=3. But these values come from the SVG.js library. Maybe you will find the details there. So you could check button=2 and then you have additionally in the object the properties diagramPres and diagramTmpk, which you already know. Cheers chird