react-cheminfo 0.65.0 → 0.66.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 (237) hide show
  1. package/README.md +11 -6
  2. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  3. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  4. package/lib/ir/core/analysisSpectra.d.ts +23 -6
  5. package/lib/ir/core/analysisSpectra.d.ts.map +1 -1
  6. package/lib/ir/core/analysisSpectra.js.map +1 -1
  7. package/lib/ir/core/bandLabelPlan.d.ts.map +1 -1
  8. package/lib/ir/core/bandLabelPlan.js +11 -6
  9. package/lib/ir/core/bandLabelPlan.js.map +1 -1
  10. package/lib/ir/core/index.d.ts +13 -9
  11. package/lib/ir/core/index.d.ts.map +1 -1
  12. package/lib/ir/core/index.js +9 -6
  13. package/lib/ir/core/index.js.map +1 -1
  14. package/lib/ir/core/irBand.d.ts +45 -14
  15. package/lib/ir/core/irBand.d.ts.map +1 -1
  16. package/lib/ir/core/irBand.js +28 -6
  17. package/lib/ir/core/irBand.js.map +1 -1
  18. package/lib/ir/core/irCommands.d.ts +11 -0
  19. package/lib/ir/core/irCommands.d.ts.map +1 -1
  20. package/lib/ir/core/irCommands.js +11 -1
  21. package/lib/ir/core/irCommands.js.map +1 -1
  22. package/lib/ir/core/irDomain.d.ts +4 -3
  23. package/lib/ir/core/irDomain.d.ts.map +1 -1
  24. package/lib/ir/core/irDomain.js +10 -7
  25. package/lib/ir/core/irDomain.js.map +1 -1
  26. package/lib/ir/core/irFormat.d.ts +14 -2
  27. package/lib/ir/core/irFormat.d.ts.map +1 -1
  28. package/lib/ir/core/irFormat.js +33 -4
  29. package/lib/ir/core/irFormat.js.map +1 -1
  30. package/lib/ir/core/irMode.d.ts +35 -8
  31. package/lib/ir/core/irMode.d.ts.map +1 -1
  32. package/lib/ir/core/irMode.js +38 -10
  33. package/lib/ir/core/irMode.js.map +1 -1
  34. package/lib/ir/core/irReducer.d.ts +0 -28
  35. package/lib/ir/core/irReducer.d.ts.map +1 -1
  36. package/lib/ir/core/irReducer.js +1 -24
  37. package/lib/ir/core/irReducer.js.map +1 -1
  38. package/lib/ir/core/irSpectrum.d.ts +52 -26
  39. package/lib/ir/core/irSpectrum.d.ts.map +1 -1
  40. package/lib/ir/core/irSpectrum.js +21 -15
  41. package/lib/ir/core/irSpectrum.js.map +1 -1
  42. package/lib/ir/core/irState.d.ts +40 -2
  43. package/lib/ir/core/irState.d.ts.map +1 -1
  44. package/lib/ir/core/irState.js +38 -1
  45. package/lib/ir/core/irState.js.map +1 -1
  46. package/lib/ir/core/irTechnique.d.ts +94 -0
  47. package/lib/ir/core/irTechnique.d.ts.map +1 -0
  48. package/lib/ir/core/irTechnique.js +87 -0
  49. package/lib/ir/core/irTechnique.js.map +1 -0
  50. package/lib/ir/core/irTechniqueCommands.d.ts +26 -0
  51. package/lib/ir/core/irTechniqueCommands.d.ts.map +1 -0
  52. package/lib/ir/core/irTechniqueCommands.js +68 -0
  53. package/lib/ir/core/irTechniqueCommands.js.map +1 -0
  54. package/lib/ir/core/pickBands.d.ts +6 -5
  55. package/lib/ir/core/pickBands.d.ts.map +1 -1
  56. package/lib/ir/core/pickBands.js +49 -26
  57. package/lib/ir/core/pickBands.js.map +1 -1
  58. package/lib/ir/core/ramanBands.d.ts +30 -0
  59. package/lib/ir/core/ramanBands.d.ts.map +1 -0
  60. package/lib/ir/core/ramanBands.js +83 -0
  61. package/lib/ir/core/ramanBands.js.map +1 -0
  62. package/lib/ir/core/spectrumJcamp.d.ts +10 -5
  63. package/lib/ir/core/spectrumJcamp.d.ts.map +1 -1
  64. package/lib/ir/core/spectrumJcamp.js +63 -15
  65. package/lib/ir/core/spectrumJcamp.js.map +1 -1
  66. package/lib/ir/core/toIrSpectrum.d.ts.map +1 -1
  67. package/lib/ir/core/toIrSpectrum.js +17 -2
  68. package/lib/ir/core/toIrSpectrum.js.map +1 -1
  69. package/lib/ir/ui/BandRow.d.ts +30 -0
  70. package/lib/ir/ui/BandRow.d.ts.map +1 -0
  71. package/lib/ir/ui/BandRow.js +42 -0
  72. package/lib/ir/ui/BandRow.js.map +1 -0
  73. package/lib/ir/ui/BandsPanel.d.ts +4 -0
  74. package/lib/ir/ui/BandsPanel.d.ts.map +1 -1
  75. package/lib/ir/ui/BandsPanel.js +14 -59
  76. package/lib/ir/ui/BandsPanel.js.map +1 -1
  77. package/lib/ir/ui/IrAboutDialog.d.ts +7 -0
  78. package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -1
  79. package/lib/ir/ui/IrAboutDialog.js +16 -3
  80. package/lib/ir/ui/IrAboutDialog.js.map +1 -1
  81. package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
  82. package/lib/ir/ui/IrCanvas.js +2 -2
  83. package/lib/ir/ui/IrCanvas.js.map +1 -1
  84. package/lib/ir/ui/IrChart.d.ts +2 -1
  85. package/lib/ir/ui/IrChart.d.ts.map +1 -1
  86. package/lib/ir/ui/IrChart.js +18 -21
  87. package/lib/ir/ui/IrChart.js.map +1 -1
  88. package/lib/ir/ui/IrCommandProvider.d.ts +7 -0
  89. package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -1
  90. package/lib/ir/ui/IrCommandProvider.js +2 -2
  91. package/lib/ir/ui/IrCommandProvider.js.map +1 -1
  92. package/lib/ir/ui/IrCommandTooltip.d.ts +7 -0
  93. package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -1
  94. package/lib/ir/ui/IrCommandTooltip.js +3 -2
  95. package/lib/ir/ui/IrCommandTooltip.js.map +1 -1
  96. package/lib/ir/ui/IrDocumentationDialog.d.ts +8 -1
  97. package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -1
  98. package/lib/ir/ui/IrDocumentationDialog.js +30 -7
  99. package/lib/ir/ui/IrDocumentationDialog.js.map +1 -1
  100. package/lib/ir/ui/IrEditor.d.ts +3 -1
  101. package/lib/ir/ui/IrEditor.d.ts.map +1 -1
  102. package/lib/ir/ui/IrEditor.js +3 -20
  103. package/lib/ir/ui/IrEditor.js.map +1 -1
  104. package/lib/ir/ui/IrHeader.d.ts.map +1 -1
  105. package/lib/ir/ui/IrHeader.js +5 -1
  106. package/lib/ir/ui/IrHeader.js.map +1 -1
  107. package/lib/ir/ui/IrLogo.d.ts +11 -3
  108. package/lib/ir/ui/IrLogo.d.ts.map +1 -1
  109. package/lib/ir/ui/IrLogo.js +14 -5
  110. package/lib/ir/ui/IrLogo.js.map +1 -1
  111. package/lib/ir/ui/IrShell.d.ts.map +1 -1
  112. package/lib/ir/ui/IrShell.js +23 -56
  113. package/lib/ir/ui/IrShell.js.map +1 -1
  114. package/lib/ir/ui/IrStatusBar.d.ts +3 -2
  115. package/lib/ir/ui/IrStatusBar.d.ts.map +1 -1
  116. package/lib/ir/ui/IrStatusBar.js +14 -9
  117. package/lib/ir/ui/IrStatusBar.js.map +1 -1
  118. package/lib/ir/ui/IrToolbar.d.ts +3 -0
  119. package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
  120. package/lib/ir/ui/IrToolbar.js +10 -3
  121. package/lib/ir/ui/IrToolbar.js.map +1 -1
  122. package/lib/ir/ui/IrTraces.d.ts +4 -1
  123. package/lib/ir/ui/IrTraces.d.ts.map +1 -1
  124. package/lib/ir/ui/IrTraces.js +2 -0
  125. package/lib/ir/ui/IrTraces.js.map +1 -1
  126. package/lib/ir/ui/RamanEditor.d.ts +46 -0
  127. package/lib/ir/ui/RamanEditor.d.ts.map +1 -0
  128. package/lib/ir/ui/RamanEditor.js +17 -0
  129. package/lib/ir/ui/RamanEditor.js.map +1 -0
  130. package/lib/ir/ui/SpectraPanel.d.ts.map +1 -1
  131. package/lib/ir/ui/SpectraPanel.js +2 -2
  132. package/lib/ir/ui/SpectraPanel.js.map +1 -1
  133. package/lib/ir/ui/SpectrumRow.d.ts +7 -0
  134. package/lib/ir/ui/SpectrumRow.d.ts.map +1 -1
  135. package/lib/ir/ui/SpectrumRow.js +4 -5
  136. package/lib/ir/ui/SpectrumRow.js.map +1 -1
  137. package/lib/ir/ui/VibrationalEditor.d.ts +48 -0
  138. package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -0
  139. package/lib/ir/ui/VibrationalEditor.js +31 -0
  140. package/lib/ir/ui/VibrationalEditor.js.map +1 -0
  141. package/lib/ir/ui/bandsTsv.d.ts +19 -0
  142. package/lib/ir/ui/bandsTsv.d.ts.map +1 -0
  143. package/lib/ir/ui/bandsTsv.js +38 -0
  144. package/lib/ir/ui/bandsTsv.js.map +1 -0
  145. package/lib/ir/ui/irChartProps.d.ts +14 -4
  146. package/lib/ir/ui/irChartProps.d.ts.map +1 -1
  147. package/lib/ir/ui/irChartProps.js +3 -2
  148. package/lib/ir/ui/irChartProps.js.map +1 -1
  149. package/lib/ir/ui/irCommandContext.d.ts +8 -0
  150. package/lib/ir/ui/irCommandContext.d.ts.map +1 -1
  151. package/lib/ir/ui/irCommandContext.js +14 -3
  152. package/lib/ir/ui/irCommandContext.js.map +1 -1
  153. package/lib/ir/ui/useIrEditor.d.ts +3 -3
  154. package/lib/ir/ui/useIrEditor.d.ts.map +1 -1
  155. package/lib/ir/ui/useIrEditor.js +13 -4
  156. package/lib/ir/ui/useIrEditor.js.map +1 -1
  157. package/lib/ir/ui/useIrHandle.d.ts +14 -0
  158. package/lib/ir/ui/useIrHandle.d.ts.map +1 -0
  159. package/lib/ir/ui/useIrHandle.js +39 -0
  160. package/lib/ir/ui/useIrHandle.js.map +1 -0
  161. package/lib/ir/ui/useIrText.d.ts +40 -0
  162. package/lib/ir/ui/useIrText.d.ts.map +1 -0
  163. package/lib/ir/ui/useIrText.js +118 -0
  164. package/lib/ir/ui/useIrText.js.map +1 -0
  165. package/lib/ir/ui/useIrZoom.d.ts +7 -0
  166. package/lib/ir/ui/useIrZoom.d.ts.map +1 -1
  167. package/lib/ir/ui/useIrZoom.js +5 -4
  168. package/lib/ir/ui/useIrZoom.js.map +1 -1
  169. package/lib/ir/ui/useValueAxisZoom.d.ts +20 -0
  170. package/lib/ir/ui/useValueAxisZoom.d.ts.map +1 -0
  171. package/lib/ir/ui/useValueAxisZoom.js +54 -0
  172. package/lib/ir/ui/useValueAxisZoom.js.map +1 -0
  173. package/lib/ir.d.ts +3 -0
  174. package/lib/ir.d.ts.map +1 -1
  175. package/lib/ir.js +3 -0
  176. package/lib/ir.js.map +1 -1
  177. package/lib/locales/de.json +20 -1
  178. package/lib/locales/en.json +20 -1
  179. package/lib/locales/es.json +20 -1
  180. package/lib/locales/fr.json +20 -1
  181. package/lib/locales/it.json +20 -1
  182. package/lib/raman.d.ts +16 -0
  183. package/lib/raman.d.ts.map +1 -0
  184. package/lib/raman.js +12 -0
  185. package/lib/raman.js.map +1 -0
  186. package/package.json +2 -1
  187. package/src/ir/core/analysisSpectra.ts +26 -10
  188. package/src/ir/core/bandLabelPlan.ts +21 -10
  189. package/src/ir/core/index.ts +25 -5
  190. package/src/ir/core/irBand.ts +52 -14
  191. package/src/ir/core/irCommands.ts +15 -1
  192. package/src/ir/core/irDomain.ts +9 -7
  193. package/src/ir/core/irFormat.ts +39 -6
  194. package/src/ir/core/irMode.ts +42 -10
  195. package/src/ir/core/irReducer.ts +1 -49
  196. package/src/ir/core/irSpectrum.ts +59 -30
  197. package/src/ir/core/irState.ts +67 -2
  198. package/src/ir/core/irTechnique.ts +115 -0
  199. package/src/ir/core/irTechniqueCommands.ts +82 -0
  200. package/src/ir/core/pickBands.ts +63 -28
  201. package/src/ir/core/ramanBands.ts +105 -0
  202. package/src/ir/core/spectrumJcamp.ts +65 -16
  203. package/src/ir/core/toIrSpectrum.ts +20 -2
  204. package/src/ir/ui/BandRow.tsx +107 -0
  205. package/src/ir/ui/BandsPanel.tsx +32 -125
  206. package/src/ir/ui/IrAboutDialog.tsx +69 -28
  207. package/src/ir/ui/IrCanvas.tsx +2 -1
  208. package/src/ir/ui/IrChart.tsx +20 -24
  209. package/src/ir/ui/IrCommandProvider.tsx +10 -3
  210. package/src/ir/ui/IrCommandTooltip.tsx +11 -2
  211. package/src/ir/ui/IrDocumentationDialog.tsx +99 -55
  212. package/src/ir/ui/IrEditor.tsx +5 -36
  213. package/src/ir/ui/IrHeader.tsx +10 -3
  214. package/src/ir/ui/IrLogo.tsx +28 -9
  215. package/src/ir/ui/IrShell.tsx +27 -75
  216. package/src/ir/ui/IrStatusBar.tsx +17 -12
  217. package/src/ir/ui/IrToolbar.tsx +26 -15
  218. package/src/ir/ui/IrTraces.tsx +5 -1
  219. package/src/ir/ui/RamanEditor.tsx +53 -0
  220. package/src/ir/ui/SpectraPanel.tsx +2 -1
  221. package/src/ir/ui/SpectrumRow.tsx +14 -5
  222. package/src/ir/ui/VibrationalEditor.tsx +94 -0
  223. package/src/ir/ui/bandsTsv.ts +46 -0
  224. package/src/ir/ui/irChartProps.ts +14 -4
  225. package/src/ir/ui/irCommandContext.tsx +18 -3
  226. package/src/ir/ui/useIrEditor.ts +20 -8
  227. package/src/ir/ui/useIrHandle.ts +51 -0
  228. package/src/ir/ui/useIrText.ts +170 -0
  229. package/src/ir/ui/useIrZoom.ts +12 -3
  230. package/src/ir/ui/useValueAxisZoom.ts +67 -0
  231. package/src/ir.ts +3 -0
  232. package/src/locales/de.json +20 -1
  233. package/src/locales/en.json +20 -1
  234. package/src/locales/es.json +20 -1
  235. package/src/locales/fr.json +20 -1
  236. package/src/locales/it.json +20 -1
  237. package/src/raman.ts +19 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BandRow.js","sourceRoot":"","sources":["../../../src/ir/ui/BandRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAmBtE;;;;;;;;;GASG;AACH,MAAM,UAAU,OAA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E;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,CACL,aAAI,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YACrC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACzB,eAAM,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,uBAAU,CACxC,CAAC,CAAC,CAAC,CACF,gBAAM,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,aAClC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,OAAG,UAAU,CAAC,CAAC,CAAC,EAAE,SAAS,EAC/C,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACvB,gBAAM,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,aAC1B,GAAG,EACJ,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAE,EAAE,GAAI,OAAE,UAAU,CAAC,MAAM,GAAG,CAAC,aAChD,CACR,CAAC,CAAC,CAAC,IAAI,IACH,CACR,GACE,CACN,CAAC;AACJ,CAAC;AAED,kFAAkF;AAClF,MAAM,eAAe,GAAG;IACtB,CAAC,EAAE,iCAAiC;IACpC,CAAC,EAAE,mCAAmC;IACtC,CAAC,EAAE,mCAAmC;CAC9B,CAAC;AAEX,MAAM,WAAW,GAAG,EAAE,UAAU,EAAE,SAAS,EAAW,CAAC"}
@@ -24,6 +24,10 @@ export interface BandsPanelProps {
24
24
  * Hovering a row marks the band on the chart and hovering the chart lights the
25
25
  * row, which is the whole reason the highlight is threaded through the shell
26
26
  * rather than held here: the two views are of one thing.
27
+ *
28
+ * For a technique the correlation table does not cover — Raman — the column of
29
+ * candidates and the button naming them are left out, and the table is the
30
+ * bands themselves.
27
31
  * @param props - Component props.
28
32
  * @returns The panel.
29
33
  */
@@ -1 +1 @@
1
- {"version":3,"file":"BandsPanel.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/BandsPanel.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMhD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BA2GhD"}
1
+ {"version":3,"file":"BandsPanel.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/BandsPanel.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAShD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAqHhD"}
@@ -1,10 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Icon } from '@blueprintjs/core';
3
2
  import { useMemo } from 'react';
4
3
  import { Button, Toolbar } from 'react-science/ui';
5
- import { panelBodyStyle, panelCellStyle, panelEmptyStyle, panelHeaderCellStyle, panelNumberCellStyle, panelStyle, panelTableStyle, panelToolbarStyle, } from "../../panel/core/panelStyles.js";
4
+ import { panelBodyStyle, panelEmptyStyle, panelHeaderCellStyle, panelStyle, panelTableStyle, panelToolbarStyle, } from "../../panel/core/panelStyles.js";
6
5
  import { sameIrBand } from "../core/irBand.js";
7
- import { formatIrValue, formatWavenumber } from "../core/irFormat.js";
6
+ import { shortModeLabel } from "../core/irFormat.js";
7
+ import { IR_TECHNIQUE_RULES } from "../core/irTechnique.js";
8
+ import { BandRow } from "./BandRow.js";
9
+ import { bandsToTsv } from "./bandsTsv.js";
8
10
  import { useIrActions, useIrEditorState } from "./irStateContext.js";
9
11
  /**
10
12
  * Every band of the selected spectrum, and everything each one might be.
@@ -19,6 +21,10 @@ import { useIrActions, useIrEditorState } from "./irStateContext.js";
19
21
  * Hovering a row marks the band on the chart and hovering the chart lights the
20
22
  * row, which is the whole reason the highlight is threaded through the shell
21
23
  * rather than held here: the two views are of one thing.
24
+ *
25
+ * For a technique the correlation table does not cover — Raman — the column of
26
+ * candidates and the button naming them are left out, and the table is the
27
+ * bands themselves.
22
28
  * @param props - Component props.
23
29
  * @returns The panel.
24
30
  */
@@ -26,65 +32,14 @@ export function BandsPanel(props) {
26
32
  const { highlight = null, onHighlight } = props;
27
33
  const { state, selectedSpectrum, assigned } = useIrEditorState();
28
34
  const actions = useIrActions();
29
- const { mode, pickBands, showAssignments, picking } = state.settings;
35
+ const { mode, pickBands, showAssignments, picking, technique } = state.settings;
36
+ const { assignments } = IR_TECHNIQUE_RULES[technique];
30
37
  const rows = useMemo(() => assigned, [assigned]);
31
- const tsv = useMemo(() => bandsToTsv(rows, mode), [rows, mode]);
32
- return (_jsxs("div", { style: panelStyle, children: [_jsxs("div", { style: panelToolbarStyle, children: [_jsxs(Toolbar, { "aria-label": "Band actions", children: [_jsx(Toolbar.Item, { icon: "locate", active: pickBands, tooltip: pickBands ? 'Stop picking bands' : 'Pick the bands', "aria-label": "Pick the bands", onClick: () => actions.setSettings({ pickBands: !pickBands }) }), _jsx(Toolbar.Item, { icon: "label", active: showAssignments, tooltip: "Name the assignments on the chart", "aria-label": "Name the assignments on the chart", disabled: !pickBands, onClick: () => actions.setSettings({ showAssignments: !showAssignments }) })] }), _jsxs("label", { style: thresholdStyle, children: [_jsx("span", { style: { opacity: 0.7 }, children: "threshold" }), _jsx("input", { type: "range", min: 0.005, max: 0.3, step: 0.005, value: picking.minRelativeHeight ?? 0.02, disabled: !pickBands, "aria-label": "How tall a band must be to be picked", onChange: (event) => actions.setSettings({
38
+ const tsv = useMemo(() => bandsToTsv(rows, mode, assignments), [rows, mode, assignments]);
39
+ return (_jsxs("div", { style: panelStyle, children: [_jsxs("div", { style: panelToolbarStyle, children: [_jsxs(Toolbar, { "aria-label": "Band actions", children: [_jsx(Toolbar.Item, { icon: "locate", active: pickBands, tooltip: pickBands ? 'Stop picking bands' : 'Pick the bands', "aria-label": "Pick the bands", onClick: () => actions.setSettings({ pickBands: !pickBands }) }), assignments ? (_jsx(Toolbar.Item, { icon: "label", active: showAssignments, tooltip: "Name the assignments on the chart", "aria-label": "Name the assignments on the chart", disabled: !pickBands, onClick: () => actions.setSettings({ showAssignments: !showAssignments }) })) : null] }), _jsxs("label", { style: thresholdStyle, children: [_jsx("span", { style: { opacity: 0.7 }, children: "threshold" }), _jsx("input", { type: "range", min: 0.005, max: 0.3, step: 0.005, value: picking.minRelativeHeight ?? 0.02, disabled: !pickBands, "aria-label": "How tall a band must be to be picked", onChange: (event) => actions.setSettings({
33
40
  picking: { minRelativeHeight: event.target.valueAsNumber },
34
- }) })] }), _jsx("span", { style: { flex: 1 } }), _jsx(Button, { variant: "minimal", icon: "clipboard", disabled: rows.length === 0, tooltipProps: { content: 'Copy the table' }, "aria-label": "Copy the table", onClick: () => void navigator.clipboard?.writeText(tsv) })] }), _jsx("div", { style: panelBodyStyle, children: selectedSpectrum === null ? (_jsx("p", { style: panelEmptyStyle, children: "No spectrum is selected." })) : !pickBands ? (_jsx("p", { style: panelEmptyStyle, children: "The bands are not being picked. Press the locate button above to find them." })) : rows.length === 0 ? (_jsx("p", { style: panelEmptyStyle, children: "No band was found above the threshold. Lower it to pick the weaker ones." })) : (_jsxs("table", { style: panelTableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: panelHeaderCellStyle, children: "cm\u207B\u00B9" }), _jsx("th", { style: panelHeaderCellStyle }), _jsx("th", { style: { ...panelHeaderCellStyle, textAlign: 'right' }, children: mode === 'absorbance' ? 'A' : '%T' }), _jsx("th", { style: panelHeaderCellStyle, children: "could be" })] }) }), _jsx("tbody", { children: rows.map((entry) => (_jsx(BandRow, { entry: entry, mode: mode, lit: sameIrBand(entry.band, highlight), onHighlight: onHighlight }, `${entry.band.spectrumId} ${entry.band.wavenumber}`))) })] })) })] }));
35
- }
36
- /**
37
- * One band: where it is, how strong, and every vibration it could be.
38
- *
39
- * The candidates are written as one line rather than a list, so a strong band
40
- * with four of them stays one row of the table and the wavenumbers keep reading
41
- * down the column. The `title` carries them again with each one's note, which is
42
- * where the reason to prefer one lives.
43
- * @param props - Component props.
44
- * @returns The row.
45
- */
46
- function BandRow(props) {
47
- const { entry, mode, lit, onHighlight } = props;
48
- const { band, candidates } = entry;
49
- const value = mode === 'absorbance' ? band.absorbance : band.transmittance;
50
- const detail = candidates
51
- .map((candidate) => candidate.note === undefined
52
- ? `${candidate.group} ${candidate.vibration}`
53
- : `${candidate.group} ${candidate.vibration} — ${candidate.note}`)
54
- .join('\n');
55
- return (_jsxs("tr", { style: lit ? litRowStyle : undefined, onPointerEnter: () => onHighlight?.(band), onPointerLeave: () => onHighlight?.(null), children: [_jsx("td", { style: panelNumberCellStyle, children: formatWavenumber(band.wavenumber) }), _jsx("td", { style: panelCellStyle, title: STRENGTH_TITLES[band.strength], children: band.strength }), _jsx("td", { style: panelNumberCellStyle, children: formatIrValue(value, mode) }), _jsx("td", { style: panelCellStyle, title: detail, children: candidates.length === 0 ? (_jsx("span", { style: { opacity: 0.5 }, children: "\u2014" })) : (_jsxs("span", { style: { whiteSpace: 'normal' }, children: [candidates[0]?.group, " ", candidates[0]?.vibration, candidates.length > 1 ? (_jsxs("span", { style: { opacity: 0.6 }, children: [' ', _jsx(Icon, { icon: "more", size: 10 }), " ", candidates.length - 1, " more"] })) : null] })) })] }));
56
- }
57
- /** What each strength letter means, for the column that shows only the letter. */
58
- const STRENGTH_TITLES = {
59
- w: 'weak, relative to this spectrum',
60
- m: 'medium, relative to this spectrum',
61
- S: 'strong, relative to this spectrum',
62
- };
63
- /**
64
- * The table as text, for pasting into a notebook.
65
- *
66
- * Tab separated with every candidate on the row, because the reason to copy a
67
- * band table is to put it beside a structure and argue about it — and the
68
- * argument is over the candidates rather than over the wavenumbers.
69
- * @param rows - The bands, as they are shown.
70
- * @param mode - Which value axis is being read.
71
- * @returns The table, one line per band, with a heading.
72
- */
73
- function bandsToTsv(rows, mode) {
74
- const heading = ['wavenumber', 'strength', mode, 'could be'].join('\t');
75
- const lines = rows.map((entry) => [
76
- formatWavenumber(entry.band.wavenumber),
77
- entry.band.strength,
78
- formatIrValue(mode === 'absorbance'
79
- ? entry.band.absorbance
80
- : entry.band.transmittance, mode),
81
- entry.candidates
82
- .map((candidate) => `${candidate.group} ${candidate.vibration}`)
83
- .join('; '),
84
- ].join('\t'));
85
- return [heading, ...lines].join('\n');
41
+ }) })] }), _jsx("span", { style: { flex: 1 } }), _jsx(Button, { variant: "minimal", icon: "clipboard", disabled: rows.length === 0, tooltipProps: { content: 'Copy the table' }, "aria-label": "Copy the table", onClick: () => void navigator.clipboard?.writeText(tsv) })] }), _jsx("div", { style: panelBodyStyle, children: selectedSpectrum === null ? (_jsx("p", { style: panelEmptyStyle, children: "No spectrum is selected." })) : !pickBands ? (_jsx("p", { style: panelEmptyStyle, children: "The bands are not being picked. Press the locate button above to find them." })) : rows.length === 0 ? (_jsx("p", { style: panelEmptyStyle, children: "No band was found above the threshold. Lower it to pick the weaker ones." })) : (_jsxs("table", { style: panelTableStyle, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: panelHeaderCellStyle, children: "cm\u207B\u00B9" }), _jsx("th", { style: panelHeaderCellStyle }), _jsx("th", { style: { ...panelHeaderCellStyle, textAlign: 'right' }, children: shortModeLabel(mode) }), assignments ? (_jsx("th", { style: panelHeaderCellStyle, children: "could be" })) : null] }) }), _jsx("tbody", { children: rows.map((entry) => (_jsx(BandRow, { entry: entry, mode: mode, assignments: assignments, lit: sameIrBand(entry.band, highlight), onHighlight: onHighlight }, `${entry.band.spectrumId} ${entry.band.wavenumber}`))) })] })) })] }));
86
42
  }
87
- const litRowStyle = { background: '#fff3e0' };
88
43
  const thresholdStyle = {
89
44
  display: 'inline-flex',
90
45
  alignItems: 'center',
@@ -1 +1 @@
1
- {"version":3,"file":"BandsPanel.js","sourceRoot":"","sources":["../../../src/ir/ui/BandsPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EACL,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAerE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACjE,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC;IAErE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEjD,M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AAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACtB,YAAG,KAAK,EAAE,eAAe,yFAGrB,CACL,CAAC,CAAC,CAAC,CACF,iBAAO,KAAK,EAAE,eAAe,aAC3B,0BACE,yBACE,aAAI,KAAK,EAAE,oBAAoB,+BAAW,EAC1C,aAAI,KAAK,EAAE,oBAAoB,GAAI,EACnC,aAAI,KAAK,EAAE,EAAE,GAAG,oBAAoB,EAAE,SAAS,EAAE,OAAO,EAAE,YACvD,cAAc,CAAC,IAAI,CAAC,GAClB,EACJ,WAAW,CAAC,CAAC,CAAC,CACb,aAAI,KAAK,EAAE,oBAAoB,yBAAe,CAC/C,CAAC,CAAC,CAAC,IAAI,IACL,GACC,EACR,0BACG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACnB,KAAC,OAAO,IAEN,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,EACtC,WAAW,EAAE,WAAW,IALnB,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,CAMxD,CACH,CAAC,GACI,IACF,CACT,GACG,IACF,CACP,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG;IACrB,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,GAAG,EAAE,CAAC;IACN,QAAQ,EAAE,EAAE;CACJ,CAAC"}
@@ -1,8 +1,15 @@
1
+ import type { IrTechnique } from '../core/irTechnique.ts';
1
2
  export interface IrAboutDialogProps {
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 viewer says it
9
+ * does and whom it credits for it.
10
+ * @default 'infrared'
11
+ */
12
+ technique?: IrTechnique;
6
13
  }
7
14
  /**
8
15
  * What the viewer is, what it stands on, and who is owed for it.
@@ -1 +1 @@
1
- {"version":3,"file":"IrAboutDialog.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrAboutDialog.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAkEtD"}
1
+ {"version":3,"file":"IrAboutDialog.d.ts","sourceRoot":"","sources":["../../../src/ir/ui/IrAboutDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK1D,MAAM,WAAW,kBAAkB;IACjC,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,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAyFtD"}
@@ -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,wCA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ACvD;;;;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;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,+BAmC5C"}
@@ -23,11 +23,11 @@ export function IrCanvas(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
+ 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 }) }), _jsx(IrStatusBar, {})] }));
31
31
  }
32
32
  const rootStyle = {
33
33
  display: 'flex',
@@ -1 +1 @@
1
- {"version":3,"file":"IrCanvas.js","sourceRoot":"","sources":["../../../src/ir/ui/IrCanvas.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAKpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA6BrE;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACtE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC/D,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;IAChD,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC;IAE7D,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,IAAc,EAAE,EAAE;QACjB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL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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;AAgB1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CA8JzD"}
@@ -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, 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({
@@ -50,7 +54,15 @@ export function IrChart(props) {
50
54
  const frameHeight = plot.bottom + MARGIN.bottom;
51
55
  // The host's window goes *into* the zoom rather than over it, so a drag is
52
56
  // always measured against what is on screen.
53
- const zoom = useIrZoom({ spectra, mode, svgRef, plot, domain, drag });
57
+ const zoom = useIrZoom({
58
+ spectra,
59
+ technique,
60
+ mode,
61
+ svgRef,
62
+ plot,
63
+ domain,
64
+ drag,
65
+ });
54
66
  // The scales the zoom measured its gestures against — the x one running right
55
67
  // to left. Taken from the hook rather than built here, because two scales over
56
68
  // one axis is two chances to disagree about which way it runs, and a chart that
@@ -87,25 +99,10 @@ export function IrChart(props) {
87
99
  // React's generated id carries the punctuation it keeps its own ids apart
88
100
  // with, which a URL fragment is under no obligation to accept.
89
101
  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}`,
102
+ 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
103
  // The arrow gives way to the chart's own crosshair over the plot, and
92
104
  // 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.`;
105
+ 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
106
  }
110
107
  /** What a chart nobody has picked any bands for marks. */
111
108
  const NO_BANDS = Object.freeze([]);
@@ -1 +1 @@
1
- {"version":3,"file":"IrChart.js","sourceRoot":"","sources":["../../../src/ir/ui/IrChart.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAE,e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AC1D,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;A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K,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