react-cheminfo 0.65.0 → 0.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (466) hide show
  1. package/README.md +33 -17
  2. package/lib/download/ui/FigureDownloadPanel.d.ts +7 -1
  3. package/lib/download/ui/FigureDownloadPanel.d.ts.map +1 -1
  4. package/lib/download/ui/FigureDownloadPanel.js +2 -2
  5. package/lib/download/ui/FigureDownloadPanel.js.map +1 -1
  6. package/lib/ecosystem/core/sites.js +3 -3
  7. package/lib/ecosystem/core/sites.js.map +1 -1
  8. package/lib/ecosystem/core/types.d.ts +1 -1
  9. package/lib/ecosystem/core/types.d.ts.map +1 -1
  10. package/lib/ecosystem/ui/glyphs.js +1 -1
  11. package/lib/ecosystem/ui/glyphs.js.map +1 -1
  12. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  13. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  14. package/lib/i18n/core/messageCatalog.d.ts +2 -2
  15. package/lib/i18n/vite/localeCatalog.d.ts +1 -1
  16. package/lib/ir/core/analysisSpectra.d.ts +23 -6
  17. package/lib/ir/core/analysisSpectra.d.ts.map +1 -1
  18. package/lib/ir/core/analysisSpectra.js.map +1 -1
  19. package/lib/ir/core/bandLabelPlan.d.ts.map +1 -1
  20. package/lib/ir/core/bandLabelPlan.js +11 -6
  21. package/lib/ir/core/bandLabelPlan.js.map +1 -1
  22. package/lib/ir/core/index.d.ts +15 -11
  23. package/lib/ir/core/index.d.ts.map +1 -1
  24. package/lib/ir/core/index.js +9 -6
  25. package/lib/ir/core/index.js.map +1 -1
  26. package/lib/ir/core/irBand.d.ts +45 -14
  27. package/lib/ir/core/irBand.d.ts.map +1 -1
  28. package/lib/ir/core/irBand.js +28 -6
  29. package/lib/ir/core/irBand.js.map +1 -1
  30. package/lib/ir/core/irCommands.d.ts +11 -0
  31. package/lib/ir/core/irCommands.d.ts.map +1 -1
  32. package/lib/ir/core/irCommands.js +11 -1
  33. package/lib/ir/core/irCommands.js.map +1 -1
  34. package/lib/ir/core/irDomain.d.ts +4 -3
  35. package/lib/ir/core/irDomain.d.ts.map +1 -1
  36. package/lib/ir/core/irDomain.js +10 -7
  37. package/lib/ir/core/irDomain.js.map +1 -1
  38. package/lib/ir/core/irEditorApi.d.ts +12 -0
  39. package/lib/ir/core/irEditorApi.d.ts.map +1 -1
  40. package/lib/ir/core/irFormat.d.ts +14 -2
  41. package/lib/ir/core/irFormat.d.ts.map +1 -1
  42. package/lib/ir/core/irFormat.js +33 -4
  43. package/lib/ir/core/irFormat.js.map +1 -1
  44. package/lib/ir/core/irMode.d.ts +35 -8
  45. package/lib/ir/core/irMode.d.ts.map +1 -1
  46. package/lib/ir/core/irMode.js +38 -10
  47. package/lib/ir/core/irMode.js.map +1 -1
  48. package/lib/ir/core/irReducer.d.ts +2 -30
  49. package/lib/ir/core/irReducer.d.ts.map +1 -1
  50. package/lib/ir/core/irReducer.js +1 -24
  51. package/lib/ir/core/irReducer.js.map +1 -1
  52. package/lib/ir/core/irSidePanels.d.ts +7 -1
  53. package/lib/ir/core/irSidePanels.d.ts.map +1 -1
  54. package/lib/ir/core/irSpectrum.d.ts +52 -26
  55. package/lib/ir/core/irSpectrum.d.ts.map +1 -1
  56. package/lib/ir/core/irSpectrum.js +21 -15
  57. package/lib/ir/core/irSpectrum.js.map +1 -1
  58. package/lib/ir/core/irState.d.ts +46 -5
  59. package/lib/ir/core/irState.d.ts.map +1 -1
  60. package/lib/ir/core/irState.js +38 -1
  61. package/lib/ir/core/irState.js.map +1 -1
  62. package/lib/ir/core/irTechnique.d.ts +94 -0
  63. package/lib/ir/core/irTechnique.d.ts.map +1 -0
  64. package/lib/ir/core/irTechnique.js +87 -0
  65. package/lib/ir/core/irTechnique.js.map +1 -0
  66. package/lib/ir/core/irTechniqueCommands.d.ts +26 -0
  67. package/lib/ir/core/irTechniqueCommands.d.ts.map +1 -0
  68. package/lib/ir/core/irTechniqueCommands.js +68 -0
  69. package/lib/ir/core/irTechniqueCommands.js.map +1 -0
  70. package/lib/ir/core/pickBands.d.ts +6 -5
  71. package/lib/ir/core/pickBands.d.ts.map +1 -1
  72. package/lib/ir/core/pickBands.js +49 -26
  73. package/lib/ir/core/pickBands.js.map +1 -1
  74. package/lib/ir/core/ramanBands.d.ts +30 -0
  75. package/lib/ir/core/ramanBands.d.ts.map +1 -0
  76. package/lib/ir/core/ramanBands.js +83 -0
  77. package/lib/ir/core/ramanBands.js.map +1 -0
  78. package/lib/ir/core/spectrumJcamp.d.ts +10 -5
  79. package/lib/ir/core/spectrumJcamp.d.ts.map +1 -1
  80. package/lib/ir/core/spectrumJcamp.js +63 -15
  81. package/lib/ir/core/spectrumJcamp.js.map +1 -1
  82. package/lib/ir/core/toIrSpectrum.d.ts.map +1 -1
  83. package/lib/ir/core/toIrSpectrum.js +17 -2
  84. package/lib/ir/core/toIrSpectrum.js.map +1 -1
  85. package/lib/ir/ui/BandRow.d.ts +30 -0
  86. package/lib/ir/ui/BandRow.d.ts.map +1 -0
  87. package/lib/ir/ui/BandRow.js +42 -0
  88. package/lib/ir/ui/BandRow.js.map +1 -0
  89. package/lib/ir/ui/BandsPanel.d.ts +4 -0
  90. package/lib/ir/ui/BandsPanel.d.ts.map +1 -1
  91. package/lib/ir/ui/BandsPanel.js +14 -59
  92. package/lib/ir/ui/BandsPanel.js.map +1 -1
  93. package/lib/ir/ui/IrAboutDialog.d.ts +7 -0
  94. package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -1
  95. package/lib/ir/ui/IrAboutDialog.js +16 -3
  96. package/lib/ir/ui/IrAboutDialog.js.map +1 -1
  97. package/lib/ir/ui/IrCanvas.d.ts +7 -0
  98. package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
  99. package/lib/ir/ui/IrCanvas.js +9 -4
  100. package/lib/ir/ui/IrCanvas.js.map +1 -1
  101. package/lib/ir/ui/IrChart.d.ts +2 -1
  102. package/lib/ir/ui/IrChart.d.ts.map +1 -1
  103. package/lib/ir/ui/IrChart.js +22 -21
  104. package/lib/ir/ui/IrChart.js.map +1 -1
  105. package/lib/ir/ui/IrCommandProvider.d.ts +7 -0
  106. package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -1
  107. package/lib/ir/ui/IrCommandProvider.js +2 -2
  108. package/lib/ir/ui/IrCommandProvider.js.map +1 -1
  109. package/lib/ir/ui/IrCommandTooltip.d.ts +7 -0
  110. package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -1
  111. package/lib/ir/ui/IrCommandTooltip.js +3 -2
  112. package/lib/ir/ui/IrCommandTooltip.js.map +1 -1
  113. package/lib/ir/ui/IrDocumentationDialog.d.ts +8 -1
  114. package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -1
  115. package/lib/ir/ui/IrDocumentationDialog.js +30 -7
  116. package/lib/ir/ui/IrDocumentationDialog.js.map +1 -1
  117. package/lib/ir/ui/IrEditor.d.ts +25 -5
  118. package/lib/ir/ui/IrEditor.d.ts.map +1 -1
  119. package/lib/ir/ui/IrEditor.js +3 -20
  120. package/lib/ir/ui/IrEditor.js.map +1 -1
  121. package/lib/ir/ui/IrHeader.d.ts.map +1 -1
  122. package/lib/ir/ui/IrHeader.js +5 -1
  123. package/lib/ir/ui/IrHeader.js.map +1 -1
  124. package/lib/ir/ui/IrLogo.d.ts +11 -3
  125. package/lib/ir/ui/IrLogo.d.ts.map +1 -1
  126. package/lib/ir/ui/IrLogo.js +14 -5
  127. package/lib/ir/ui/IrLogo.js.map +1 -1
  128. package/lib/ir/ui/IrShell.d.ts +9 -1
  129. package/lib/ir/ui/IrShell.d.ts.map +1 -1
  130. package/lib/ir/ui/IrShell.js +26 -74
  131. package/lib/ir/ui/IrShell.js.map +1 -1
  132. package/lib/ir/ui/IrSidePanel.d.ts +11 -0
  133. package/lib/ir/ui/IrSidePanel.d.ts.map +1 -1
  134. package/lib/ir/ui/IrSidePanel.js +12 -3
  135. package/lib/ir/ui/IrSidePanel.js.map +1 -1
  136. package/lib/ir/ui/IrStatusBar.d.ts +3 -2
  137. package/lib/ir/ui/IrStatusBar.d.ts.map +1 -1
  138. package/lib/ir/ui/IrStatusBar.js +14 -9
  139. package/lib/ir/ui/IrStatusBar.js.map +1 -1
  140. package/lib/ir/ui/IrToolbar.d.ts +3 -0
  141. package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
  142. package/lib/ir/ui/IrToolbar.js +10 -3
  143. package/lib/ir/ui/IrToolbar.js.map +1 -1
  144. package/lib/ir/ui/IrTraces.d.ts +4 -1
  145. package/lib/ir/ui/IrTraces.d.ts.map +1 -1
  146. package/lib/ir/ui/IrTraces.js +2 -0
  147. package/lib/ir/ui/IrTraces.js.map +1 -1
  148. package/lib/ir/ui/RamanEditor.d.ts +64 -0
  149. package/lib/ir/ui/RamanEditor.d.ts.map +1 -0
  150. package/lib/ir/ui/RamanEditor.js +17 -0
  151. package/lib/ir/ui/RamanEditor.js.map +1 -0
  152. package/lib/ir/ui/SpectraPanel.d.ts.map +1 -1
  153. package/lib/ir/ui/SpectraPanel.js +2 -2
  154. package/lib/ir/ui/SpectraPanel.js.map +1 -1
  155. package/lib/ir/ui/SpectrumRow.d.ts +7 -0
  156. package/lib/ir/ui/SpectrumRow.d.ts.map +1 -1
  157. package/lib/ir/ui/SpectrumRow.js +4 -5
  158. package/lib/ir/ui/SpectrumRow.js.map +1 -1
  159. package/lib/ir/ui/VibrationalEditor.d.ts +62 -0
  160. package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -0
  161. package/lib/ir/ui/VibrationalEditor.js +33 -0
  162. package/lib/ir/ui/VibrationalEditor.js.map +1 -0
  163. package/lib/ir/ui/bandsTsv.d.ts +19 -0
  164. package/lib/ir/ui/bandsTsv.d.ts.map +1 -0
  165. package/lib/ir/ui/bandsTsv.js +38 -0
  166. package/lib/ir/ui/bandsTsv.js.map +1 -0
  167. package/lib/ir/ui/index.d.ts +1 -0
  168. package/lib/ir/ui/index.d.ts.map +1 -1
  169. package/lib/ir/ui/index.js.map +1 -1
  170. package/lib/ir/ui/irActions.d.ts +3 -3
  171. package/lib/ir/ui/irActions.d.ts.map +1 -1
  172. package/lib/ir/ui/irChartProps.d.ts +21 -4
  173. package/lib/ir/ui/irChartProps.d.ts.map +1 -1
  174. package/lib/ir/ui/irChartProps.js +3 -2
  175. package/lib/ir/ui/irChartProps.js.map +1 -1
  176. package/lib/ir/ui/irCommandContext.d.ts +8 -0
  177. package/lib/ir/ui/irCommandContext.d.ts.map +1 -1
  178. package/lib/ir/ui/irCommandContext.js +14 -3
  179. package/lib/ir/ui/irCommandContext.js.map +1 -1
  180. package/lib/ir/ui/irHostPanels.d.ts +53 -0
  181. package/lib/ir/ui/irHostPanels.d.ts.map +1 -0
  182. package/lib/ir/ui/irHostPanels.js +41 -0
  183. package/lib/ir/ui/irHostPanels.js.map +1 -0
  184. package/lib/ir/ui/useIrEditor.d.ts +3 -3
  185. package/lib/ir/ui/useIrEditor.d.ts.map +1 -1
  186. package/lib/ir/ui/useIrEditor.js +13 -4
  187. package/lib/ir/ui/useIrEditor.js.map +1 -1
  188. package/lib/ir/ui/useIrHandle.d.ts +14 -0
  189. package/lib/ir/ui/useIrHandle.d.ts.map +1 -0
  190. package/lib/ir/ui/useIrHandle.js +39 -0
  191. package/lib/ir/ui/useIrHandle.js.map +1 -0
  192. package/lib/ir/ui/useIrSide.d.ts +27 -0
  193. package/lib/ir/ui/useIrSide.d.ts.map +1 -0
  194. package/lib/ir/ui/useIrSide.js +42 -0
  195. package/lib/ir/ui/useIrSide.js.map +1 -0
  196. package/lib/ir/ui/useIrText.d.ts +40 -0
  197. package/lib/ir/ui/useIrText.d.ts.map +1 -0
  198. package/lib/ir/ui/useIrText.js +118 -0
  199. package/lib/ir/ui/useIrText.js.map +1 -0
  200. package/lib/ir/ui/useIrZoom.d.ts +15 -0
  201. package/lib/ir/ui/useIrZoom.d.ts.map +1 -1
  202. package/lib/ir/ui/useIrZoom.js +6 -4
  203. package/lib/ir/ui/useIrZoom.js.map +1 -1
  204. package/lib/ir/ui/useValueAxisZoom.d.ts +20 -0
  205. package/lib/ir/ui/useValueAxisZoom.d.ts.map +1 -0
  206. package/lib/ir/ui/useValueAxisZoom.js +54 -0
  207. package/lib/ir/ui/useValueAxisZoom.js.map +1 -0
  208. package/lib/ir.d.ts +3 -0
  209. package/lib/ir.d.ts.map +1 -1
  210. package/lib/ir.js +3 -0
  211. package/lib/ir.js.map +1 -1
  212. package/lib/locales/de.json +29 -2
  213. package/lib/locales/en.json +29 -2
  214. package/lib/locales/es.json +29 -2
  215. package/lib/locales/fr.json +29 -2
  216. package/lib/locales/it.json +29 -2
  217. package/lib/molecule3d/core/animatedPng.d.ts +25 -0
  218. package/lib/molecule3d/core/animatedPng.d.ts.map +1 -0
  219. package/lib/molecule3d/core/animatedPng.js +59 -0
  220. package/lib/molecule3d/core/animatedPng.js.map +1 -0
  221. package/lib/molecule3d/core/file.d.ts +24 -0
  222. package/lib/molecule3d/core/file.d.ts.map +1 -0
  223. package/lib/molecule3d/core/file.js +2 -0
  224. package/lib/molecule3d/core/file.js.map +1 -0
  225. package/lib/molecule3d/core/index.d.ts +4 -1
  226. package/lib/molecule3d/core/index.d.ts.map +1 -1
  227. package/lib/molecule3d/core/index.js +1 -0
  228. package/lib/molecule3d/core/index.js.map +1 -1
  229. package/lib/molecule3d/core/settings.d.ts +0 -7
  230. package/lib/molecule3d/core/settings.d.ts.map +1 -1
  231. package/lib/molecule3d/core/settings.js.map +1 -1
  232. package/lib/molecule3d/ui/Molecule3DExport.d.ts +10 -2
  233. package/lib/molecule3d/ui/Molecule3DExport.d.ts.map +1 -1
  234. package/lib/molecule3d/ui/Molecule3DExport.js +15 -2
  235. package/lib/molecule3d/ui/Molecule3DExport.js.map +1 -1
  236. package/lib/molecule3d/ui/Molecule3DToolbar.js +9 -2
  237. package/lib/molecule3d/ui/Molecule3DToolbar.js.map +1 -1
  238. package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
  239. package/lib/molecule3d/ui/MoleculeCanvas3D.js +23 -41
  240. package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
  241. package/lib/molecule3d/ui/drawScene.d.ts +2 -1
  242. package/lib/molecule3d/ui/drawScene.d.ts.map +1 -1
  243. package/lib/molecule3d/ui/drawScene.js.map +1 -1
  244. package/lib/molecule3d/ui/exportMoleculeImage.d.ts +15 -1
  245. package/lib/molecule3d/ui/exportMoleculeImage.d.ts.map +1 -1
  246. package/lib/molecule3d/ui/exportMoleculeImage.js +14 -2
  247. package/lib/molecule3d/ui/exportMoleculeImage.js.map +1 -1
  248. package/lib/molecule3d/ui/moleculeFrames.d.ts +47 -0
  249. package/lib/molecule3d/ui/moleculeFrames.d.ts.map +1 -0
  250. package/lib/molecule3d/ui/moleculeFrames.js +65 -0
  251. package/lib/molecule3d/ui/moleculeFrames.js.map +1 -0
  252. package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts +14 -1
  253. package/lib/molecule3d/ui/moleculeViewer3DProps.d.ts.map +1 -1
  254. package/lib/molecule3d/ui/renderMolecule.d.ts +3 -3
  255. package/lib/molecule3d/ui/renderMolecule.d.ts.map +1 -1
  256. package/lib/molecule3d/ui/renderMolecule.js +2 -1
  257. package/lib/molecule3d/ui/renderMolecule.js.map +1 -1
  258. package/lib/molecule3d/ui/sceneDrawer.d.ts +2 -1
  259. package/lib/molecule3d/ui/sceneDrawer.d.ts.map +1 -1
  260. package/lib/molecule3d/ui/sceneDrawer.js +9 -1
  261. package/lib/molecule3d/ui/sceneDrawer.js.map +1 -1
  262. package/lib/molecule3d/ui/useImageExport.d.ts +8 -3
  263. package/lib/molecule3d/ui/useImageExport.d.ts.map +1 -1
  264. package/lib/molecule3d/ui/useImageExport.js +13 -4
  265. package/lib/molecule3d/ui/useImageExport.js.map +1 -1
  266. package/lib/molecule3d/ui/useMoleculeScene.d.ts +2 -1
  267. package/lib/molecule3d/ui/useMoleculeScene.d.ts.map +1 -1
  268. package/lib/molecule3d/ui/useMoleculeScene.js.map +1 -1
  269. package/lib/molecule3d/ui/useMoleculeViewer.d.ts +16 -0
  270. package/lib/molecule3d/ui/useMoleculeViewer.d.ts.map +1 -0
  271. package/lib/molecule3d/ui/useMoleculeViewer.js +37 -0
  272. package/lib/molecule3d/ui/useMoleculeViewer.js.map +1 -0
  273. package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts +3 -3
  274. package/lib/molecule3d/ui/usePolarSurfaceArea.d.ts.map +1 -1
  275. package/lib/molecule3d/ui/usePolarSurfaceArea.js +4 -3
  276. package/lib/molecule3d/ui/usePolarSurfaceArea.js.map +1 -1
  277. package/lib/molecule3d/ui/viewer.d.ts +4 -1
  278. package/lib/molecule3d/ui/viewer.d.ts.map +1 -1
  279. package/lib/molecule3d/ui/viewer.js +21 -19
  280. package/lib/molecule3d/ui/viewer.js.map +1 -1
  281. package/lib/molecule3d/ui/viewerTypes.d.ts +6 -0
  282. package/lib/molecule3d/ui/viewerTypes.d.ts.map +1 -1
  283. package/lib/molstar/core/captureScene.d.ts +19 -1
  284. package/lib/molstar/core/captureScene.d.ts.map +1 -1
  285. package/lib/molstar/core/captureScene.js +57 -2
  286. package/lib/molstar/core/captureScene.js.map +1 -1
  287. package/lib/molstar/core/index.d.ts +5 -2
  288. package/lib/molstar/core/index.d.ts.map +1 -1
  289. package/lib/molstar/core/index.js +4 -2
  290. package/lib/molstar/core/index.js.map +1 -1
  291. package/lib/molstar/core/trajectory.d.ts +56 -0
  292. package/lib/molstar/core/trajectory.d.ts.map +1 -0
  293. package/lib/molstar/core/trajectory.js +96 -0
  294. package/lib/molstar/core/trajectory.js.map +1 -0
  295. package/lib/panel/ui/PanelRail.d.ts.map +1 -1
  296. package/lib/panel/ui/PanelRail.js +1 -1
  297. package/lib/panel/ui/PanelRail.js.map +1 -1
  298. package/lib/raman.d.ts +17 -0
  299. package/lib/raman.d.ts.map +1 -0
  300. package/lib/raman.js +12 -0
  301. package/lib/raman.js.map +1 -0
  302. package/lib/router/core/basePath.d.ts +2 -2
  303. package/lib/router/core/basePath.js +2 -2
  304. package/lib/router/core/siteAddresses.d.ts +1 -1
  305. package/lib/router/core/siteAddresses.js +1 -1
  306. package/lib/seo/core/siteFiles.js +1 -1
  307. package/lib/seo/core/siteFiles.js.map +1 -1
  308. package/lib/server/answerAddresses.d.ts +3 -3
  309. package/lib/server/answerAddresses.js +3 -3
  310. package/lib/structure/core/index.d.ts +2 -0
  311. package/lib/structure/core/index.d.ts.map +1 -1
  312. package/lib/structure/core/index.js +1 -0
  313. package/lib/structure/core/index.js.map +1 -1
  314. package/lib/structure/core/structureTransfer.d.ts +29 -0
  315. package/lib/structure/core/structureTransfer.d.ts.map +1 -0
  316. package/lib/structure/core/structureTransfer.js +26 -0
  317. package/lib/structure/core/structureTransfer.js.map +1 -0
  318. package/lib/structure/ui/EditorImportButton.d.ts +20 -0
  319. package/lib/structure/ui/EditorImportButton.d.ts.map +1 -0
  320. package/lib/structure/ui/EditorImportButton.js +24 -0
  321. package/lib/structure/ui/EditorImportButton.js.map +1 -0
  322. package/lib/structure/ui/EditorImportProblem.d.ts +17 -0
  323. package/lib/structure/ui/EditorImportProblem.d.ts.map +1 -0
  324. package/lib/structure/ui/EditorImportProblem.js +32 -0
  325. package/lib/structure/ui/EditorImportProblem.js.map +1 -0
  326. package/lib/structure/ui/StructureDrop.d.ts +39 -0
  327. package/lib/structure/ui/StructureDrop.d.ts.map +1 -0
  328. package/lib/structure/ui/StructureDrop.js +19 -0
  329. package/lib/structure/ui/StructureDrop.js.map +1 -0
  330. package/lib/structure/ui/StructureDropOverlay.d.ts +16 -0
  331. package/lib/structure/ui/StructureDropOverlay.d.ts.map +1 -0
  332. package/lib/structure/ui/StructureDropOverlay.js +29 -0
  333. package/lib/structure/ui/StructureDropOverlay.js.map +1 -0
  334. package/lib/structure/ui/StructureEditor.d.ts +3 -80
  335. package/lib/structure/ui/StructureEditor.d.ts.map +1 -1
  336. package/lib/structure/ui/StructureEditor.js +21 -33
  337. package/lib/structure/ui/StructureEditor.js.map +1 -1
  338. package/lib/structure/ui/importedStructure.d.ts +25 -0
  339. package/lib/structure/ui/importedStructure.d.ts.map +1 -0
  340. package/lib/structure/ui/importedStructure.js +74 -0
  341. package/lib/structure/ui/importedStructure.js.map +1 -0
  342. package/lib/structure/ui/index.d.ts +2 -0
  343. package/lib/structure/ui/index.d.ts.map +1 -1
  344. package/lib/structure/ui/index.js +1 -0
  345. package/lib/structure/ui/index.js.map +1 -1
  346. package/lib/structure/ui/structureEditorProps.d.ts +98 -0
  347. package/lib/structure/ui/structureEditorProps.d.ts.map +1 -0
  348. package/lib/structure/ui/structureEditorProps.js +2 -0
  349. package/lib/structure/ui/structureEditorProps.js.map +1 -0
  350. package/lib/structure/ui/useDebouncedChange.d.ts +16 -0
  351. package/lib/structure/ui/useDebouncedChange.d.ts.map +1 -0
  352. package/lib/structure/ui/useDebouncedChange.js +30 -0
  353. package/lib/structure/ui/useDebouncedChange.js.map +1 -0
  354. package/lib/structure/ui/useStructureDrop.d.ts +30 -0
  355. package/lib/structure/ui/useStructureDrop.d.ts.map +1 -0
  356. package/lib/structure/ui/useStructureDrop.js +49 -0
  357. package/lib/structure/ui/useStructureDrop.js.map +1 -0
  358. package/lib/structure/ui/useStructureImport.d.ts +45 -0
  359. package/lib/structure/ui/useStructureImport.d.ts.map +1 -0
  360. package/lib/structure/ui/useStructureImport.js +62 -0
  361. package/lib/structure/ui/useStructureImport.js.map +1 -0
  362. package/package.json +5 -1
  363. package/src/download/ui/FigureDownloadPanel.tsx +9 -2
  364. package/src/ecosystem/core/sites.ts +3 -3
  365. package/src/ecosystem/core/types.ts +1 -1
  366. package/src/ecosystem/ui/glyphs.tsx +1 -1
  367. package/src/i18n/core/messageCatalog.ts +2 -2
  368. package/src/i18n/vite/localeCatalog.ts +1 -1
  369. package/src/ir/core/analysisSpectra.ts +26 -10
  370. package/src/ir/core/bandLabelPlan.ts +21 -10
  371. package/src/ir/core/index.ts +31 -7
  372. package/src/ir/core/irBand.ts +52 -14
  373. package/src/ir/core/irCommands.ts +15 -1
  374. package/src/ir/core/irDomain.ts +9 -7
  375. package/src/ir/core/irEditorApi.ts +13 -0
  376. package/src/ir/core/irFormat.ts +39 -6
  377. package/src/ir/core/irMode.ts +42 -10
  378. package/src/ir/core/irReducer.ts +3 -51
  379. package/src/ir/core/irSidePanels.ts +8 -1
  380. package/src/ir/core/irSpectrum.ts +59 -30
  381. package/src/ir/core/irState.ts +73 -5
  382. package/src/ir/core/irTechnique.ts +115 -0
  383. package/src/ir/core/irTechniqueCommands.ts +82 -0
  384. package/src/ir/core/pickBands.ts +63 -28
  385. package/src/ir/core/ramanBands.ts +105 -0
  386. package/src/ir/core/spectrumJcamp.ts +65 -16
  387. package/src/ir/core/toIrSpectrum.ts +20 -2
  388. package/src/ir/ui/BandRow.tsx +107 -0
  389. package/src/ir/ui/BandsPanel.tsx +32 -125
  390. package/src/ir/ui/IrAboutDialog.tsx +69 -28
  391. package/src/ir/ui/IrCanvas.tsx +29 -3
  392. package/src/ir/ui/IrChart.tsx +31 -24
  393. package/src/ir/ui/IrCommandProvider.tsx +10 -3
  394. package/src/ir/ui/IrCommandTooltip.tsx +11 -2
  395. package/src/ir/ui/IrDocumentationDialog.tsx +99 -55
  396. package/src/ir/ui/IrEditor.tsx +27 -40
  397. package/src/ir/ui/IrHeader.tsx +10 -3
  398. package/src/ir/ui/IrLogo.tsx +28 -9
  399. package/src/ir/ui/IrShell.tsx +47 -96
  400. package/src/ir/ui/IrSidePanel.tsx +36 -10
  401. package/src/ir/ui/IrStatusBar.tsx +17 -12
  402. package/src/ir/ui/IrToolbar.tsx +26 -15
  403. package/src/ir/ui/IrTraces.tsx +5 -1
  404. package/src/ir/ui/RamanEditor.tsx +71 -0
  405. package/src/ir/ui/SpectraPanel.tsx +2 -1
  406. package/src/ir/ui/SpectrumRow.tsx +14 -5
  407. package/src/ir/ui/VibrationalEditor.tsx +113 -0
  408. package/src/ir/ui/bandsTsv.ts +46 -0
  409. package/src/ir/ui/index.ts +1 -0
  410. package/src/ir/ui/irActions.ts +3 -3
  411. package/src/ir/ui/irChartProps.ts +21 -4
  412. package/src/ir/ui/irCommandContext.tsx +18 -3
  413. package/src/ir/ui/irHostPanels.ts +76 -0
  414. package/src/ir/ui/useIrEditor.ts +20 -8
  415. package/src/ir/ui/useIrHandle.ts +51 -0
  416. package/src/ir/ui/useIrSide.ts +60 -0
  417. package/src/ir/ui/useIrText.ts +170 -0
  418. package/src/ir/ui/useIrZoom.ts +22 -3
  419. package/src/ir/ui/useValueAxisZoom.ts +67 -0
  420. package/src/ir.ts +3 -0
  421. package/src/locales/de.json +29 -2
  422. package/src/locales/en.json +29 -2
  423. package/src/locales/es.json +29 -2
  424. package/src/locales/fr.json +29 -2
  425. package/src/locales/it.json +29 -2
  426. package/src/molecule3d/core/animatedPng.ts +79 -0
  427. package/src/molecule3d/core/file.ts +23 -0
  428. package/src/molecule3d/core/index.ts +3 -1
  429. package/src/molecule3d/core/settings.ts +0 -8
  430. package/src/molecule3d/ui/Molecule3DExport.tsx +43 -5
  431. package/src/molecule3d/ui/Molecule3DToolbar.tsx +9 -2
  432. package/src/molecule3d/ui/MoleculeCanvas3D.tsx +24 -38
  433. package/src/molecule3d/ui/drawScene.ts +2 -1
  434. package/src/molecule3d/ui/exportMoleculeImage.ts +28 -3
  435. package/src/molecule3d/ui/moleculeFrames.ts +88 -0
  436. package/src/molecule3d/ui/moleculeViewer3DProps.ts +14 -5
  437. package/src/molecule3d/ui/renderMolecule.ts +5 -3
  438. package/src/molecule3d/ui/sceneDrawer.ts +14 -2
  439. package/src/molecule3d/ui/useImageExport.ts +22 -5
  440. package/src/molecule3d/ui/useMoleculeScene.ts +2 -1
  441. package/src/molecule3d/ui/useMoleculeViewer.ts +46 -0
  442. package/src/molecule3d/ui/usePolarSurfaceArea.ts +6 -4
  443. package/src/molecule3d/ui/viewer.ts +34 -27
  444. package/src/molecule3d/ui/viewerTypes.ts +6 -0
  445. package/src/molstar/core/captureScene.ts +85 -2
  446. package/src/molstar/core/index.ts +13 -2
  447. package/src/molstar/core/trajectory.ts +117 -0
  448. package/src/panel/ui/PanelRail.tsx +3 -0
  449. package/src/raman.ts +20 -0
  450. package/src/router/core/basePath.ts +2 -2
  451. package/src/router/core/siteAddresses.ts +1 -1
  452. package/src/seo/core/siteFiles.ts +1 -1
  453. package/src/server/answerAddresses.ts +3 -3
  454. package/src/structure/core/index.ts +8 -0
  455. package/src/structure/core/structureTransfer.ts +37 -0
  456. package/src/structure/ui/EditorImportButton.tsx +59 -0
  457. package/src/structure/ui/EditorImportProblem.tsx +63 -0
  458. package/src/structure/ui/StructureDrop.tsx +66 -0
  459. package/src/structure/ui/StructureDropOverlay.tsx +50 -0
  460. package/src/structure/ui/StructureEditor.tsx +49 -134
  461. package/src/structure/ui/importedStructure.ts +83 -0
  462. package/src/structure/ui/index.ts +2 -0
  463. package/src/structure/ui/structureEditorProps.ts +103 -0
  464. package/src/structure/ui/useDebouncedChange.ts +41 -0
  465. package/src/structure/ui/useStructureDrop.ts +76 -0
  466. package/src/structure/ui/useStructureImport.ts +122 -0
@@ -1,6 +1,10 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Dialog, DialogBody } from '@blueprintjs/core';
3
+ import { Prose } from "../../i18n/ui/Prose.js";
4
+ import { useChromeT } from "../../i18n/ui/useT.js";
5
+ import { irCommands } from "../core/irCommands.js";
3
6
  import { IrLogo } from "./IrLogo.js";
7
+ import { useIrText } from "./useIrText.js";
4
8
  /**
5
9
  * What the viewer is, what it stands on, and who is owed for it.
6
10
  *
@@ -12,9 +16,18 @@ import { IrLogo } from "./IrLogo.js";
12
16
  * @returns The dialog.
13
17
  */
14
18
  export function IrAboutDialog(props) {
15
- const { isOpen, onClose } = props;
16
- return (_jsx(Dialog, { isOpen: isOpen, onClose: onClose, title: "About the infrared viewer", icon: _jsx(IrLogo, { size: 20 }), style: dialogStyle, children: _jsxs(DialogBody, { children: [_jsxs("div", { style: brandStyle, children: [_jsx(IrLogo, { size: 64 }), _jsxs("div", { children: [_jsx("p", { style: leadStyle, children: "react-cheminfo/ir" }), _jsx("p", { style: paragraphStyle, children: "Draws an infrared spectrum the way infrared is printed, reads it as absorbance or as percent transmittance, picks its bands and offers every functional group each band could be." })] })] }), _jsx("h4", { style: headingStyle, children: "Credits" }), _jsxs("ul", { style: listStyle, children: [_jsxs("li", { children: [_jsx("strong", { children: "ir-spectrum" }), " (cheminfo, MIT) reads the JCAMP-DX and SPC files, derives the absorbance/transmittance pair, and picks the bands. This package deliberately does none of that arithmetic itself."] }), _jsxs("li", { children: [_jsx("strong", { children: "common-spectrum" }), ", ", _jsx("strong", { children: "jcampconverter" }), ' ', "and ", _jsx("strong", { children: "spc-parser" }), " (cheminfo, MIT) are what it reads through."] }), _jsxs("li", { children: [_jsx("strong", { children: "ml-spectra-processing" }), " (mljs, MIT) for the array work."] }), _jsxs("li", { children: ["The ", _jsx("strong", { children: "shared chart" }), " of this package for the drawing \u2014 the same arithmetic every other spectrum viewer of the family is drawn with."] }), _jsxs("li", { children: [_jsx("strong", { children: "react-science" }), " and ", _jsx("strong", { children: "BlueprintJS" }), "(zakodium, Palantir) for the shell this viewer is shaped like."] }), _jsxs("li", { children: ["The ", _jsx("strong", { children: "correlation table" }), " is the conventional teaching set of group frequencies, as any introductory spectroscopy text tabulates them. The ranges are deliberately the rounded, generous ones: narrowing them to look precise would rule out assignments that are genuinely possible."] }), _jsxs("li", { children: ["The ", _jsx("strong", { children: "colours" }), " are Okabe and Ito's colour-universal palette, so two traces stay distinguishable for a reader with a colour vision deficiency."] })] })] }) }));
19
+ const { isOpen, onClose, technique = 'infrared' } = props;
20
+ const t = useChromeT();
21
+ const title = (useIrText(technique).command('about') ?? irCommands.about)
22
+ .title;
23
+ const raman = technique === 'raman';
24
+ return (_jsx(Dialog, { isOpen: isOpen, onClose: onClose, title: title, icon: _jsx(IrLogo, { size: 20, technique: technique }), style: dialogStyle, children: _jsxs(DialogBody, { children: [_jsxs("div", { style: brandStyle, children: [_jsx(IrLogo, { size: 64, technique: technique }), _jsxs("div", { children: [_jsx("p", { style: leadStyle, children: DOORS[technique] }), raman ? (_jsx("p", { style: paragraphStyle, children: t('ir.raman.aboutLead') })) : (_jsx("p", { style: paragraphStyle, children: "Draws an infrared spectrum the way infrared is printed, reads it as absorbance or as percent transmittance, picks its bands and offers every functional group each band could be." }))] })] }), _jsx("h4", { style: headingStyle, children: "Credits" }), _jsxs("ul", { style: listStyle, children: [raman ? (_jsxs(_Fragment, { children: [_jsx("li", { children: _jsx(Prose, { text: t('ir.raman.credit.picking') }) }), _jsx("li", { children: _jsx(Prose, { text: t('ir.raman.credit.jcamp') }) })] })) : (_jsxs(_Fragment, { children: [_jsxs("li", { children: [_jsx("strong", { children: "ir-spectrum" }), " (cheminfo, MIT) reads the JCAMP-DX and SPC files, derives the absorbance/transmittance pair, and picks the bands. This package deliberately does none of that arithmetic itself."] }), _jsxs("li", { children: [_jsx("strong", { children: "common-spectrum" }), ",", ' ', _jsx("strong", { children: "jcampconverter" }), " and ", _jsx("strong", { children: "spc-parser" }), ' ', "(cheminfo, MIT) are what it reads through."] })] })), _jsxs("li", { children: [_jsx("strong", { children: "ml-spectra-processing" }), " (mljs, MIT) for the array work."] }), _jsxs("li", { children: ["The ", _jsx("strong", { children: "shared chart" }), " of this package for the drawing \u2014 the same arithmetic every other spectrum viewer of the family is drawn with."] }), _jsxs("li", { children: [_jsx("strong", { children: "react-science" }), " and ", _jsx("strong", { children: "BlueprintJS" }), "(zakodium, Palantir) for the shell this viewer is shaped like."] }), raman ? null : (_jsxs("li", { children: ["The ", _jsx("strong", { children: "correlation table" }), " is the conventional teaching set of group frequencies, as any introductory spectroscopy text tabulates them. The ranges are deliberately the rounded, generous ones: narrowing them to look precise would rule out assignments that are genuinely possible."] })), _jsxs("li", { children: ["The ", _jsx("strong", { children: "colours" }), " are Okabe and Ito's colour-universal palette, so two traces stay distinguishable for a reader with a colour vision deficiency."] })] })] }) }));
17
25
  }
26
+ /** The entry point each technique's viewer is imported from. */
27
+ const DOORS = {
28
+ infrared: 'react-cheminfo/ir',
29
+ raman: 'react-cheminfo/raman',
30
+ };
18
31
  const dialogStyle = { width: 'min(680px, 92vw)' };
19
32
  const brandStyle = {
20
33
  display: 'flex',
@@ -1 +1 @@
1
- {"version":3,"file":"IrAboutDialog.js","sourceRoot":"","sources":["../../../src/ir/ui/IrAboutDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AAStC;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACL,KAAC,MAAM,IACL,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,2BAA2B,EACjC,IAAI,EAAE,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,GAAI,EAC1B,KAAK,EAAE,WAAW,YAElB,MAAC,UAAU,eACT,eAAK,KAAK,EAAE,UAAU,aACpB,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,GAAI,EACpB,0BACE,YAAG,KAAK,EAAE,SAAS,kCAAuB,EAC1C,YAAG,KAAK,EAAE,cAAc,kMAIpB,IACA,IACF,EAEN,aAAI,KAAK,EAAE,YAAY,wBAAc,EACrC,cAAI,KAAK,EAAE,SAAS,aAClB,yBACE,2CAA4B,yLAIzB,EACL,yBACE,+CAAgC,QAAE,8CAA+B,EAAC,GAAG,UACjE,0CAA2B,mDAE5B,EACL,yBACE,qDAAsC,wCAEnC,EACL,iCACM,4CAA6B,4HAG9B,EACL,yBACE,6CAA8B,WAAK,2CAA4B,sEAE5D,EACL,iCACM,iDAAkC,oQAKnC,EACL,i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,iCACM,iDAAkC,oQAKnC,CACN,EACD,iCACM,uCAAwB,uIAGzB,IACF,IACM,GACN,CACV,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,MAAM,KAAK,GAAgC;IACzC,QAAQ,EAAE,mBAAmB;IAC7B,KAAK,EAAE,sBAAsB;CAC9B,CAAC;AAEF,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAW,CAAC;AAE3D,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,YAAY;IACxB,GAAG,EAAE,EAAE;CACC,CAAC;AAEX,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,EAAE;CACJ,CAAC;AAEX,MAAM,cAAc,GAAG,EAAE,MAAM,EAAE,SAAS,EAAW,CAAC;AAEtD,MAAM,YAAY,GAAG,EAAE,MAAM,EAAE,YAAY,EAAW,CAAC;AAEvD,MAAM,SAAS,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAW,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { IrBand } from '../core/irBand.ts';
2
+ import type { IrPlotClick } from '../core/irEditorApi.ts';
2
3
  export interface IrCanvasProps {
3
4
  /**
4
5
  * The band the pointer is resting on, wherever it was hovered — the chart or
@@ -24,6 +25,12 @@ export interface IrCanvasProps {
24
25
  * @default undefined
25
26
  */
26
27
  chartId?: string;
28
+ /**
29
+ * Told of a click on the plot — a press let go without travelling, never the
30
+ * end of a drag — with the spectrum selected at that moment.
31
+ * @default undefined
32
+ */
33
+ onPlotClick?: (click: IrPlotClick) => void;
27
34
  }
28
35
  /**
29
36
  * The chart, and the status bar under it.
@@ -1 +1 @@
1
- {"version":3,"file":"IrCanvas.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrCanvas.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAOhD,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAkC5C"}
1
+ {"version":3,"file":"IrCanvas.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrCanvas.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAO1D,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CAC5C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAqD5C"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback } from 'react';
2
+ import { useCallback, useMemo } from 'react';
3
3
  import { IrChart } from "./IrChart.js";
4
4
  import { IrStatusBar } from "./IrStatusBar.js";
5
5
  import { useIrActions, useIrEditorState } from "./irStateContext.js";
@@ -19,15 +19,20 @@ import { useIrActions, useIrEditorState } from "./irStateContext.js";
19
19
  * @returns The canvas.
20
20
  */
21
21
  export function IrCanvas(props) {
22
- const { highlight = null, onHighlight, attachChart, chartId } = props;
22
+ const { highlight = null, onHighlight, attachChart, chartId, onPlotClick, } = props;
23
23
  const { state, visibleSpectra, assigned } = useIrEditorState();
24
24
  const actions = useIrActions();
25
25
  const { domain, tool, selectedId } = state.view;
26
- const { mode, showAssignments, labelLimit } = state.settings;
26
+ const { technique, mode, showAssignments, labelLimit } = state.settings;
27
27
  const onDomainChange = useCallback((next) => {
28
28
  actions.setDomain(next);
29
29
  }, [actions]);
30
- return (_jsxs("div", { style: rootStyle, children: [_jsx("div", { ref: attachChart, id: chartId, style: chartStyle, children: _jsx(IrChart, { spectra: visibleSpectra, mode: mode, assigned: assigned, showAssignments: showAssignments, labelLimit: labelLimit, highlight: highlight, onHighlight: onHighlight, domain: domain, onDomainChange: onDomainChange, drag: tool === 'box' ? 'box' : 'xAxis', emphasisedId: selectedId }) }), _jsx(IrStatusBar, {})] }));
30
+ // Which spectrum was selected is the viewer's to say, not the chart's: the
31
+ // chart only knows where the press landed.
32
+ const onClickAt = useMemo(() => onPlotClick === undefined
33
+ ? undefined
34
+ : (wavenumber) => onPlotClick({ wavenumber, spectrumId: selectedId }), [onPlotClick, selectedId]);
35
+ return (_jsxs("div", { style: rootStyle, children: [_jsx("div", { ref: attachChart, id: chartId, style: chartStyle, children: _jsx(IrChart, { spectra: visibleSpectra, technique: technique, mode: mode, assigned: assigned, showAssignments: showAssignments, labelLimit: labelLimit, highlight: highlight, onHighlight: onHighlight, domain: domain, onDomainChange: onDomainChange, drag: tool === 'box' ? 'box' : 'xAxis', emphasisedId: selectedId, onPlotClick: onClickAt }) }), _jsx(IrStatusBar, {})] }));
31
36
  }
32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X,oDAAoD;AACpD,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAW,CAAC"}
@@ -9,7 +9,8 @@ import type { IrChartProps } from './irChartProps.ts';
9
9
  * building the scale onto a reversed pixel range and nothing else: the data stays
10
10
  * in ascending wavenumbers, every window stays low end first, and no other piece
11
11
  * of arithmetic in either package has to know. That is the whole reason
12
- * `createScale` takes its range rather than deriving it.
12
+ * `createScale` takes its range rather than deriving it. A Raman spectrum is
13
+ * drawn the other way, low shifts at the left, by the same means.
13
14
  *
14
15
  * The axes go under the data, so a grid line is never read as a band. Only the
15
16
  * data band is clipped, so a zoomed trace stops at the plot edge while the
@@ -1 +1 @@
1
- {"version":3,"file":"IrChart.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAiB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAmJzD"}
1
+ {"version":3,"file":"IrChart.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAiB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAwKzD"}
@@ -6,11 +6,12 @@ import { Axes } from "../../chart/ui/Axes.js";
6
6
  import { SelectionRect } from "../../chart/ui/SelectionRect.js";
7
7
  import { chartSurfaceStyle } from "../../chart/ui/chartSurface.js";
8
8
  import { useChartSize } from "../../chart/ui/useChartSize.js";
9
- import { boxZoomOnly, yAxisTitle } from "../core/irMode.js";
9
+ import { irModeFor } from "../core/irTechnique.js";
10
10
  import { BandMarks } from "./BandMarks.js";
11
11
  import { IrPointerTracker } from "./IrPointerTracker.js";
12
12
  import { IrTraces } from "./IrTraces.js";
13
13
  import { useIrPointer } from "./useIrPointer.js";
14
+ import { useIrText } from "./useIrText.js";
14
15
  import { useIrZoom } from "./useIrZoom.js";
15
16
  /**
16
17
  * The chart: every layer of an infrared spectrum, in one SVG.
@@ -21,7 +22,8 @@ import { useIrZoom } from "./useIrZoom.js";
21
22
  * building the scale onto a reversed pixel range and nothing else: the data stays
22
23
  * in ascending wavenumbers, every window stays low end first, and no other piece
23
24
  * of arithmetic in either package has to know. That is the whole reason
24
- * `createScale` takes its range rather than deriving it.
25
+ * `createScale` takes its range rather than deriving it. A Raman spectrum is
26
+ * drawn the other way, low shifts at the left, by the same means.
25
27
  *
26
28
  * The axes go under the data, so a grid line is never read as a band. Only the
27
29
  * data band is clipped, so a zoomed trace stops at the plot edge while the
@@ -37,7 +39,9 @@ import { useIrZoom } from "./useIrZoom.js";
37
39
  * @returns The chart.
38
40
  */
39
41
  export function IrChart(props) {
40
- const { spectra, mode = 'transmittance', assigned = NO_BANDS, showAssignments = false, labelLimit, highlight = null, onHighlight, domain = null, onDomainChange, drag = 'xAxis', emphasisedId = null, width, height, children, } = props;
42
+ const { spectra, technique = 'infrared', mode: asked, assigned = NO_BANDS, showAssignments = false, labelLimit, highlight = null, onHighlight, domain = null, onDomainChange, onPlotClick, drag = 'xAxis', emphasisedId = null, width, height, children, } = props;
43
+ const mode = irModeFor(technique, asked);
44
+ const text = useIrText(technique);
41
45
  const [containerRef, measured] = useChartSize();
42
46
  const svgRef = useRef(null);
43
47
  const plot = useMemo(() => plotRect({
@@ -48,9 +52,21 @@ export function IrChart(props) {
48
52
  // laid out at nothing still draws its axes inside a box that holds them.
49
53
  const frameWidth = plot.right + MARGIN.right;
50
54
  const frameHeight = plot.bottom + MARGIN.bottom;
55
+ const onClick = useMemo(() => onPlotClick === undefined
56
+ ? undefined
57
+ : (point) => onPlotClick(point.x), [onPlotClick]);
51
58
  // The host's window goes *into* the zoom rather than over it, so a drag is
52
59
  // always measured against what is on screen.
53
- const zoom = useIrZoom({ spectra, mode, svgRef, plot, domain, drag });
60
+ const zoom = useIrZoom({
61
+ spectra,
62
+ technique,
63
+ mode,
64
+ svgRef,
65
+ plot,
66
+ domain,
67
+ drag,
68
+ onClick,
69
+ });
54
70
  // The scales the zoom measured its gestures against — the x one running right
55
71
  // to left. Taken from the hook rather than built here, because two scales over
56
72
  // one axis is two chances to disagree about which way it runs, and a chart that
@@ -87,25 +103,10 @@ export function IrChart(props) {
87
103
  // React's generated id carries the punctuation it keeps its own ids apart
88
104
  // with, which a URL fragment is under no obligation to accept.
89
105
  const clipId = `ir-plot-${useId().replaceAll(/\W/g, '')}`;
90
- return (_jsx("div", { ref: containerRef, style: containerStyle, children: _jsxs("svg", { ref: svgRef, role: "img", "aria-label": chartLabel(mode), width: frameWidth, height: frameHeight, viewBox: `0 0 ${frameWidth} ${frameHeight}`,
106
+ return (_jsx("div", { ref: containerRef, style: containerStyle, children: _jsxs("svg", { ref: svgRef, role: "img", "aria-label": text.chart(mode), width: frameWidth, height: frameHeight, viewBox: `0 0 ${frameWidth} ${frameHeight}`,
91
107
  // The arrow gives way to the chart's own crosshair over the plot, and
92
108
  // comes back over the margins, exactly as it does on a mass chart.
93
- style: chartSurfaceStyle(pointer.position !== null), ...handlers, children: [_jsx("defs", { children: _jsx("clipPath", { id: clipId, children: _jsx("rect", { x: plot.left, y: plot.top, width: plot.width, height: plot.height }) }) }), _jsx(Axes, { plot: plot, xDomain: shown.x, yDomain: shown.y, xScale: xScale, yScale: yScale, xTitle: "wavenumber (cm\u207B\u00B9)", yTitle: yAxisTitle(mode) }), _jsxs("g", { clipPath: `url(#${clipId})`, children: [_jsx(IrTraces, { spectra: spectra, mode: mode, plot: plot, xDomain: shown.x, xScale: xScale, yScale: yScale, emphasisedId: emphasisedId }), children] }), _jsx(BandMarks, { assigned: assigned, plot: plot, xScale: xScale, yScale: yScale, mode: mode, showAssignments: showAssignments, highlight: highlight, ...(labelLimit === undefined ? {} : { limit: labelLimit }) }), _jsx(SelectionRect, { selection: selection, plot: plot }), _jsx(IrPointerTracker, { position: pointer.position, readout: pointer.readout, plot: plot })] }) }));
94
- }
95
- /**
96
- * What the chart is, and what can be done to it, for whoever cannot see it.
97
- *
98
- * The gestures differ by mode, so the sentence does too — a label promising the
99
- * wheel to a reader who cannot watch it fail to do anything is worse than no
100
- * label at all.
101
- * @param mode - Which value axis is being drawn.
102
- * @returns The label.
103
- */
104
- function chartLabel(mode) {
105
- const axis = `Infrared spectrum read as ${yAxisTitle(mode)}, wavenumber running from high at the left to low at the right.`;
106
- return boxZoomOnly(mode)
107
- ? `${axis} Drag a rectangle over it to zoom to that rectangle, and double click to fit everything again.`
108
- : `${axis} Drag across it to zoom the wavenumber axis, drag past the baseline to take the value axis with it, turn the wheel to scale the value axis, and double click to fit everything again.`;
109
+ style: chartSurfaceStyle(pointer.position !== null), ...handlers, children: [_jsx("defs", { children: _jsx("clipPath", { id: clipId, children: _jsx("rect", { x: plot.left, y: plot.top, width: plot.width, height: plot.height }) }) }), _jsx(Axes, { plot: plot, xDomain: shown.x, yDomain: shown.y, xScale: xScale, yScale: yScale, xTitle: text.xTitle, yTitle: text.yTitle(mode) }), _jsxs("g", { clipPath: `url(#${clipId})`, children: [_jsx(IrTraces, { spectra: spectra, mode: mode, plot: plot, xDomain: shown.x, xScale: xScale, yScale: yScale, emphasisedId: emphasisedId }), children] }), _jsx(BandMarks, { assigned: assigned, plot: plot, xScale: xScale, yScale: yScale, mode: mode, showAssignments: showAssignments, highlight: highlight, ...(labelLimit === undefined ? {} : { limit: labelLimit }) }), _jsx(SelectionRect, { selection: selection, plot: plot }), _jsx(IrPointerTracker, { position: pointer.position, readout: pointer.readout, plot: plot })] }) }));
109
110
  }
110
111
  /** What a chart nobody has picked any bands for marks. */
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,EACV,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,KAChB,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,GAC3D,EACF,KAAC,aAAa,IAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAI,EACnD,KAAC,gBAAgB,IACf,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,IAAI,EAAE,IAAI,GACV,IACE,GACF,CACP,CAAC;AACJ,CAAC;AAED,0DAA0D;AAC1D,MAAM,QAAQ,GAA4B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE5D,wDAAwD;AACxD,MAAM,cAAc,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAW,CAAC"}
@@ -1,8 +1,15 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { IrCommandHandlers } from '../core/irCommands.ts';
3
+ import type { IrTechnique } from '../core/irTechnique.ts';
3
4
  export interface IrCommandProviderProps {
4
5
  /** What each command does. */
5
6
  handlers: IrCommandHandlers;
7
+ /**
8
+ * What the spectra were measured with, which decides how each command is
9
+ * worded in its tooltip and its label.
10
+ * @default 'infrared'
11
+ */
12
+ technique?: IrTechnique;
6
13
  /** The viewer. */
7
14
  children: ReactNode;
8
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IrCommandProvider.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAK/D,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,kBAAkB;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAW9D"}
1
+ {"version":3,"file":"IrCommandProvider.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK1D,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,kBAAkB;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,+BAW9D"}
@@ -7,8 +7,8 @@ import { commandContext } from "./irCommandContext.js";
7
7
  * @returns The provider.
8
8
  */
9
9
  export function IrCommandProvider(props) {
10
- const { handlers, children } = props;
11
- const value = useMemo(() => ({ handlers, run: (id) => handlers[id]?.() }), [handlers]);
10
+ const { handlers, technique = 'infrared', children } = props;
11
+ const value = useMemo(() => ({ handlers, technique, run: (id) => handlers[id]?.() }), [handlers, technique]);
12
12
  return (_jsx(commandContext.Provider, { value: value, children: children }));
13
13
  }
14
14
  //# sourceMappingURL=IrCommandProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IrCommandProvider.js","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandProvider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAwB,CAAC;AASxD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAErC,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EACnD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAA2B,CAC5E,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"IrCommandProvider.js","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandProvider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAwB,CAAC;AAexD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,UAAU,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAE7D,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAC9D,CAAC,QAAQ,EAAE,SAAS,CAAC,CACtB,CAAC;IAEF,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAA2B,CAC5E,CAAC;AACJ,CAAC"}
@@ -1,7 +1,14 @@
1
1
  import type { IrCommandId } from '../core/irCommands.ts';
2
+ import type { IrTechnique } from '../core/irTechnique.ts';
2
3
  export interface IrCommandTooltipProps {
3
4
  /** Which command the tooltip is about. */
4
5
  id: IrCommandId;
6
+ /**
7
+ * What the spectra were measured with, which decides how the command is
8
+ * worded.
9
+ * @default 'infrared'
10
+ */
11
+ technique?: IrTechnique;
5
12
  }
6
13
  /**
7
14
  * One command's tooltip: its title, what it does, and every way to do it.
@@ -1 +1 @@
1
- {"version":3,"file":"IrCommandTooltip.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandTooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpE,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,EAAE,EAAE,WAAW,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,+BAgB5D"}
1
+ {"version":3,"file":"IrCommandTooltip.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandTooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1D,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,EAAE,EAAE,WAAW,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,+BAgB5D"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { TooltipHelpContent } from 'react-science/ui';
3
3
  import { irCommands } from "../core/irCommands.js";
4
+ import { useIrText } from "./useIrText.js";
4
5
  /**
5
6
  * One command's tooltip: its title, what it does, and every way to do it.
6
7
  *
@@ -11,8 +12,8 @@ import { irCommands } from "../core/irCommands.js";
11
12
  * @returns The tooltip's content.
12
13
  */
13
14
  export function IrCommandTooltip(props) {
14
- const { id } = props;
15
- const entry = irCommands[id];
15
+ const { id, technique = 'infrared' } = props;
16
+ const entry = useIrText(technique).command(id) ?? irCommands[id];
16
17
  const shortcuts = entry.shortcut?.label ?? entry.shortcut?.keys;
17
18
  return (_jsx(TooltipHelpContent, { title: entry.title, description: entry.description, shortcuts: shortcuts === undefined ? undefined : [...shortcuts], subTitles: entry.gestures?.map((gesture) => ({
18
19
  title: gesture.title,
@@ -1 +1 @@
1
- {"version":3,"file":"IrCommandTooltip.js","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandTooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAOnD;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IACrB,MAAM,KAAK,GAAG,UAAU,CAAC,EAAE,CAAc,CAAC;IAC1C,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;IAEhE,OAAO,CACL,KAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,SAAS,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAC/D,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC3C,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,SAAS,EAAE,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;SAClC,CAAC,CAAC,GACH,CACH,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"IrCommandTooltip.js","sourceRoot":"","sources":["../../../src/ir/ui/IrCommandTooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAa3C;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,EAAE,EAAE,EAAE,SAAS,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAC7C,MAAM,KAAK,GAAc,SAAS,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC5E,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;IAEhE,OAAO,CACL,KAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,SAAS,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAC/D,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC3C,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,SAAS,EAAE,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;SAClC,CAAC,CAAC,GACH,CACH,CAAC;AACJ,CAAC"}
@@ -1,15 +1,22 @@
1
+ import type { IrTechnique } from '../core/irTechnique.ts';
1
2
  export interface IrDocumentationDialogProps {
2
3
  /** Whether the dialog is open. */
3
4
  isOpen: boolean;
4
5
  /** Close it. */
5
6
  onClose: () => void;
7
+ /**
8
+ * What the spectra were measured with, which decides what the guide says:
9
+ * only what is true of the technique, and only the commands it offers.
10
+ * @default 'infrared'
11
+ */
12
+ technique?: IrTechnique;
6
13
  }
7
14
  /**
8
15
  * How to use the viewer, written in the viewer.
9
16
  *
10
17
  * In the component rather than on a site, so there is nowhere to leave for and
11
18
  * nothing to keep in step: every key in the table below is read out of the same
12
- * `irCommands` the toolbar and the key handler read, so a shortcut cannot be
19
+ * command table the toolbar and the key handler read, so a shortcut cannot be
13
20
  * documented as one thing and bound as another.
14
21
  * @param props - Component props.
15
22
  * @returns The dialog.
@@ -1 +1 @@
1
- {"version":3,"file":"IrDocumentationDialog.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrDocumentationDialog.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,0BAA0B;IACzC,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,+BAmEtE"}
1
+ {"version":3,"file":"IrDocumentationDialog.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrDocumentationDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAM1D,MAAM,WAAW,0BAA0B;IACzC,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,+BA8BtE"}
@@ -1,22 +1,46 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Dialog, DialogBody } from '@blueprintjs/core';
3
+ import { Prose } from "../../i18n/ui/Prose.js";
4
+ import { useChromeT } from "../../i18n/ui/useT.js";
3
5
  import { TOKEN } from "../../tokens/core/familyTokens.js";
4
- import { irCommands } from "../core/irCommands.js";
5
6
  import { IR_MODE_RULES } from "../core/irMode.js";
7
+ import { irCommandsFor } from "../core/irTechniqueCommands.js";
6
8
  import { IrLogo } from "./IrLogo.js";
9
+ import { useIrText } from "./useIrText.js";
7
10
  /**
8
11
  * How to use the viewer, written in the viewer.
9
12
  *
10
13
  * In the component rather than on a site, so there is nowhere to leave for and
11
14
  * nothing to keep in step: every key in the table below is read out of the same
12
- * `irCommands` the toolbar and the key handler read, so a shortcut cannot be
15
+ * command table the toolbar and the key handler read, so a shortcut cannot be
13
16
  * documented as one thing and bound as another.
14
17
  * @param props - Component props.
15
18
  * @returns The dialog.
16
19
  */
17
20
  export function IrDocumentationDialog(props) {
18
- const { isOpen, onClose } = props;
19
- return (_jsx(Dialog, { isOpen: isOpen, onClose: onClose, title: "Using the infrared viewer", icon: _jsx(IrLogo, { size: 20 }), style: dialogStyle, children: _jsxs(DialogBody, { children: [_jsx("h4", { style: headingStyle, children: "Opening a spectrum" }), _jsxs("p", { style: paragraphStyle, children: ["JCAMP-DX (", _jsx("code", { children: ".jdx" }), ", ", _jsx("code", { children: ".dx" }), ") and Thermo Galactic SPC (", _jsx("code", { children: ".spc" }), ") are read. A file holding several blocks \u2014 a sample beside its background, or an infrared spectrum beside a Raman one \u2014 gives one spectrum per infrared block; the others are left to their own viewers. Two columns of numbers are not read yet."] }), _jsx("h4", { style: headingStyle, children: "The axis runs backwards" }), _jsx("p", { style: paragraphStyle, children: "Wavenumber decreases to the right, from 4000 cm\u207B\u00B9 down to 400, which is how infrared spectra have been printed since the instruments scanned that way. Every window is still stated low end first." }), _jsx("h4", { style: headingStyle, children: "Absorbance or transmittance" }), _jsxs("p", { style: paragraphStyle, children: ["The same measurement, read the other way up \u2014 the file carries both, whichever it was written in. In", ' ', _jsx("strong", { children: IR_MODE_RULES.transmittance.title }), " the bands hang down from a baseline near 100; in", ' ', _jsx("strong", { children: IR_MODE_RULES.absorbance.title }), " they stand up out of zero. The labels and the marks follow, so the pair reads the same way up in either."] }), _jsx("h4", { style: headingStyle, children: "Reading the bands" }), _jsxs("p", { style: paragraphStyle, children: ["The bands of the ", _jsx("em", { children: "selected" }), " spectrum are picked, marked on the chart, and listed in the bands panel with", ' ', _jsx("strong", { children: "every vibration whose range contains them" }), " \u2014 narrowest claim first. That is deliberate: a band at 1715 cm\u207B\u00B9 really is a ketone, an aldehyde and a carboxylic acid until something else decides between them, and the note on each candidate is what tells them apart. Hovering a row marks the band on the chart, and hovering the chart lights the row."] }), _jsx("p", { style: paragraphStyle, children: "A band is reported at the sampled point it peaked on, so on a 4 cm\u207B\u00B9 grid a carbonyl centred at 1710 reads 1708 or 1712. Do not quote one as though it were measured to the wavenumber." }), _jsx("h4", { style: headingStyle, children: "Gestures and keys" }), _jsx("table", { style: tableStyle, children: _jsx("tbody", { children: Object.keys(irCommands).map((id) => (_jsx(CommandRow, { id: id }, id))) }) })] }) }));
21
+ const { isOpen, onClose, technique = 'infrared' } = props;
22
+ const text = useIrText(technique);
23
+ const ids = Object.keys(irCommandsFor(technique));
24
+ return (_jsx(Dialog, { isOpen: isOpen, onClose: onClose, title: text.documentation, icon: _jsx(IrLogo, { size: 20, technique: technique }), style: dialogStyle, children: _jsxs(DialogBody, { children: [technique === 'raman' ? _jsx(RamanGuide, {}) : _jsx(InfraredGuide, {}), _jsx("h4", { style: headingStyle, children: "Gestures and keys" }), _jsx("table", { style: tableStyle, children: _jsx("tbody", { children: ids.map((id) => {
25
+ const entry = text.command(id);
26
+ return entry === undefined ? null : (_jsx(CommandRow, { entry: entry }, id));
27
+ }) }) })] }) }));
28
+ }
29
+ /**
30
+ * What is true of reading an infrared spectrum here.
31
+ * @returns The sections.
32
+ */
33
+ function InfraredGuide() {
34
+ return (_jsxs(_Fragment, { children: [_jsx("h4", { style: headingStyle, children: "Opening a spectrum" }), _jsxs("p", { style: paragraphStyle, children: ["JCAMP-DX (", _jsx("code", { children: ".jdx" }), ", ", _jsx("code", { children: ".dx" }), ") and Thermo Galactic SPC (", _jsx("code", { children: ".spc" }), ") are read. A file holding several blocks \u2014 a sample beside its background, or an infrared spectrum beside a Raman one \u2014 gives one spectrum per infrared block; the others are left to their own viewers. Two columns of numbers are not read yet."] }), _jsx("h4", { style: headingStyle, children: "The axis runs backwards" }), _jsx("p", { style: paragraphStyle, children: "Wavenumber decreases to the right, from 4000 cm\u207B\u00B9 down to 400, which is how infrared spectra have been printed since the instruments scanned that way. Every window is still stated low end first." }), _jsx("h4", { style: headingStyle, children: "Absorbance or transmittance" }), _jsxs("p", { style: paragraphStyle, children: ["The same measurement, read the other way up \u2014 the file carries both, whichever it was written in. In", ' ', _jsx("strong", { children: IR_MODE_RULES.transmittance.title }), " the bands hang down from a baseline near 100; in", ' ', _jsx("strong", { children: IR_MODE_RULES.absorbance.title }), " they stand up out of zero. The labels and the marks follow, so the pair reads the same way up in either."] }), _jsx("h4", { style: headingStyle, children: "Reading the bands" }), _jsxs("p", { style: paragraphStyle, children: ["The bands of the ", _jsx("em", { children: "selected" }), " spectrum are picked, marked on the chart, and listed in the bands panel with", ' ', _jsx("strong", { children: "every vibration whose range contains them" }), " \u2014 narrowest claim first. That is deliberate: a band at 1715 cm\u207B\u00B9 really is a ketone, an aldehyde and a carboxylic acid until something else decides between them, and the note on each candidate is what tells them apart. Hovering a row marks the band on the chart, and hovering the chart lights the row."] }), _jsx("p", { style: paragraphStyle, children: "A band is reported at the sampled point it peaked on, so on a 4 cm\u207B\u00B9 grid a carbonyl centred at 1710 reads 1708 or 1712. Do not quote one as though it were measured to the wavenumber." })] }));
35
+ }
36
+ /**
37
+ * What is true of reading a Raman spectrum here: only the bands, since it has
38
+ * one value axis, runs the usual way, and is not assigned.
39
+ * @returns The section.
40
+ */
41
+ function RamanGuide() {
42
+ const t = useChromeT();
43
+ return (_jsxs(_Fragment, { children: [_jsx("h4", { style: headingStyle, children: "Reading the bands" }), _jsx("p", { style: paragraphStyle, children: _jsx(Prose, { text: t('ir.raman.doc.bands') }) }), _jsx("p", { style: paragraphStyle, children: t('ir.raman.doc.sampled') })] }));
20
44
  }
21
45
  /**
22
46
  * One command: what it is called, its key, and what it does.
@@ -24,8 +48,7 @@ export function IrDocumentationDialog(props) {
24
48
  * @returns The row.
25
49
  */
26
50
  function CommandRow(props) {
27
- const { id } = props;
28
- const entry = irCommands[id];
51
+ const { entry } = props;
29
52
  const keys = entry.shortcut?.label ?? entry.shortcut?.keys;
30
53
  return (_jsxs("tr", { children: [_jsx("th", { style: commandCellStyle, children: entry.title }), _jsxs("td", { style: keyCellStyle, children: [keys === undefined
31
54
  ? null
@@ -1 +1 @@
1
- {"version":3,"file":"IrDocumentationDialog.js","sourceRoot":"","sources":["../../../src/ir/ui/IrDocumentationDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AAStC;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAiC;IACrE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACL,KAAC,MAAM,IACL,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,2BAA2B,EACjC,IAAI,EAAE,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,GAAI,EAC1B,KAAK,EAAE,WAAW,YAElB,MAAC,UAAU,eACT,aAAI,KAAK,EAAE,YAAY,mCAAyB,EAChD,aAAG,KAAK,EAAE,cAAc,2BACZ,kCAAiB,QAAE,iCAAgB,iCAC5C,kCAAiB,oQAIhB,EAEJ,aAAI,KAAK,EAAE,YAAY,wCAA8B,EACr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AM;IACjB,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,QAAQ;CACZ,CAAC;AAEX,MAAM,YAAY,GAAG;IACnB,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,QAAQ;CACZ,CAAC;AAEX,MAAM,oBAAoB,GAAG;IAC3B,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,OAAO;CACR,CAAC;AAEX,MAAM,QAAQ,GAAG;IACf,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,aAAa,KAAK,CAAC,MAAM,EAAE;IACnC,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,KAAK,CAAC,aAAa;IAC/B,QAAQ,EAAE,EAAE;CACJ,CAAC;AAEX,MAAM,YAAY,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAW,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import type { Ref } from 'react';
2
- import type { IrEditorHandle } from '../core/irEditorApi.ts';
3
- import type { IrSidePanelId } from '../core/irSidePanels.ts';
2
+ import type { IrEditorHandle, IrPlotClick } from '../core/irEditorApi.ts';
3
+ import type { IrPanelId } from '../core/irSidePanels.ts';
4
4
  import type { IrMode, IrSpectrum } from '../core/irSpectrum.ts';
5
+ import type { IrHostPanel } from './irHostPanels.ts';
5
6
  export interface IrEditorProps {
6
7
  /**
7
8
  * The spectra to open on. Read when the viewer opens and never again: what is
@@ -22,15 +23,33 @@ export interface IrEditorProps {
22
23
  */
23
24
  onChange?: (spectra: IrSpectrum[]) => void;
24
25
  /**
25
- * Which value axis to open in.
26
+ * Which value axis to open in: transmittance or absorbance. Intensity, which
27
+ * infrared does not offer, opens transmittance instead.
26
28
  * @default 'transmittance'
27
29
  */
28
30
  mode?: IrMode;
29
31
  /**
30
- * The side panels open to begin with.
32
+ * The side panels open to begin with: the viewer's own — `'spectra'`,
33
+ * `'bands'`, `'metadata'` — or the id of one of `panels`. An id no panel
34
+ * answers to is ignored.
31
35
  * @default DEFAULT_SIDE_PANELS
32
36
  */
33
- defaultPanelIds?: IrSidePanelId[];
37
+ defaultPanelIds?: readonly IrPanelId[];
38
+ /**
39
+ * Panels the host adds to the viewer's own — a structure to predict a
40
+ * spectrum from, say. Their icons come first in the activity bar, in the
41
+ * order given, and each then behaves as a built-in panel does: toggled on its
42
+ * own, stacked in the same column with a share of its height, folded and
43
+ * closed from its header.
44
+ * @default []
45
+ */
46
+ panels?: readonly IrHostPanel[];
47
+ /**
48
+ * The plot was clicked at this wavenumber (a press that did not travel, i.e.
49
+ * not a zoom drag), with the spectrum selected at that moment.
50
+ * @default undefined
51
+ */
52
+ onPlotClick?: (click: IrPlotClick) => void;
34
53
  /**
35
54
  * The handle a host drives the viewer through: take these spectra, frame this
36
55
  * wavenumber, select that one.
@@ -41,6 +60,7 @@ export interface IrEditorProps {
41
60
  /**
42
61
  * An infrared spectrum viewer: a header across the top, the chart in the middle,
43
62
  * the tools down the left, and the panels that interrogate it down the right.
63
+ * `RamanEditor`, from `react-cheminfo/raman`, is the same viewer for Raman.
44
64
  *
45
65
  * The same shape as the mass viewer, deliberately — a page may well hold both,
46
66
  * and a chemist who has learned one should not have to learn the other. The chart
@@ -1 +1 @@
1
- {"version":3,"file":"IrEditor.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAMhE,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,IAAI,CAAC,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;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,+BAE5C"}
@@ -1,11 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { RootLayout } from 'react-science/ui';
3
- import { IrShell } from "./IrShell.js";
4
- import { IrStateProvider } from "./IrStateProvider.js";
5
- import { useIrEditor } from "./useIrEditor.js";
2
+ import { VibrationalEditor } from "./VibrationalEditor.js";
6
3
  /**
7
4
  * An infrared spectrum viewer: a header across the top, the chart in the middle,
8
5
  * the tools down the left, and the panels that interrogate it down the right.
6
+ * `RamanEditor`, from `react-cheminfo/raman`, is the same viewer for Raman.
9
7
  *
10
8
  * The same shape as the mass viewer, deliberately — a page may well hold both,
11
9
  * and a chemist who has learned one should not have to learn the other. The chart
@@ -22,21 +20,6 @@ import { useIrEditor } from "./useIrEditor.js";
22
20
  * @returns The viewer.
23
21
  */
24
22
  export function IrEditor(props) {
25
- const { data = NO_SPECTRA, onChange, mode, defaultPanelIds, ref } = props;
26
- const editor = useIrEditor({
27
- spectra: data,
28
- settings: mode === undefined ? undefined : { mode },
29
- panelIds: defaultPanelIds,
30
- onChange,
31
- });
32
- return (_jsx(IrStateProvider, { editor: editor, children: _jsx(RootLayout, { style: rootLayoutStyle, children: _jsx(IrShell, { handle: ref }) }) }));
23
+ return _jsx(VibrationalEditor, { technique: "infrared", ...props });
33
24
  }
34
- /**
35
- * The viewer fills what it is given, and its own children scroll rather than
36
- * push: `react-science` lays its root out as a column of full width and height,
37
- * and a flex column with no `minHeight` grows past its parent instead.
38
- */
39
- const rootLayoutStyle = { minHeight: 0 };
40
- /** What a viewer opens on when it is handed nothing, kept stable for the memo. */
41
- const NO_SPECTRA = [];
42
25
  //# sourceMappingURL=IrEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IrEditor.js","sourceRoot":"","sources":["../../../src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"}
@@ -1 +1 @@
1
- {"version":3,"file":"IrHeader.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrHeader.tsx"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,gCAsBvB"}
1
+ {"version":3,"file":"IrHeader.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrHeader.tsx"],"names":[],"mappings":"AAOA;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,gCA2BvB"}
@@ -2,6 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Header, Toolbar, useFullscreen } from 'react-science/ui';
3
3
  import { IrLogo } from "./IrLogo.js";
4
4
  import { useIrCommandProps } from "./irCommandContext.js";
5
+ import { useIrEditorState } from "./irStateContext.js";
6
+ import { useIrText } from "./useIrText.js";
5
7
  /**
6
8
  * The bar across the top: the mark on the left, the viewer on the right.
7
9
  *
@@ -16,6 +18,8 @@ import { useIrCommandProps } from "./irCommandContext.js";
16
18
  export function IrHeader() {
17
19
  const command = useIrCommandProps();
18
20
  const { isFullScreen } = useFullscreen();
19
- return (_jsxs(Header, { children: [_jsx(Toolbar, { "aria-label": "Infrared spectrum viewer", children: _jsx(Toolbar.Item, { icon: _jsx(IrLogo, { size: 16 }), ...command('about') }) }), _jsxs(Toolbar, { "aria-label": "Infrared spectrum viewer help", children: [_jsx(Toolbar.Item, { icon: "help", ...command('documentation') }), _jsx(Toolbar.Item, { icon: "fullscreen", active: isFullScreen, ...command('fullScreen') })] })] }));
21
+ const { technique } = useIrEditorState().state.settings;
22
+ const text = useIrText(technique);
23
+ return (_jsxs(Header, { children: [_jsx(Toolbar, { "aria-label": text.viewer, children: _jsx(Toolbar.Item, { icon: _jsx(IrLogo, { size: 16, technique: technique }), ...command('about') }) }), _jsxs(Toolbar, { "aria-label": text.viewerHelp, children: [_jsx(Toolbar.Item, { icon: "help", ...command('documentation') }), _jsx(Toolbar.Item, { icon: "fullscreen", active: isFullScreen, ...command('fullScreen') })] })] }));
20
24
  }
21
25
  //# sourceMappingURL=IrHeader.js.map