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.
- package/README.md +11 -6
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/ir/core/analysisSpectra.d.ts +23 -6
- package/lib/ir/core/analysisSpectra.d.ts.map +1 -1
- package/lib/ir/core/analysisSpectra.js.map +1 -1
- package/lib/ir/core/bandLabelPlan.d.ts.map +1 -1
- package/lib/ir/core/bandLabelPlan.js +11 -6
- package/lib/ir/core/bandLabelPlan.js.map +1 -1
- package/lib/ir/core/index.d.ts +13 -9
- package/lib/ir/core/index.d.ts.map +1 -1
- package/lib/ir/core/index.js +9 -6
- package/lib/ir/core/index.js.map +1 -1
- package/lib/ir/core/irBand.d.ts +45 -14
- package/lib/ir/core/irBand.d.ts.map +1 -1
- package/lib/ir/core/irBand.js +28 -6
- package/lib/ir/core/irBand.js.map +1 -1
- package/lib/ir/core/irCommands.d.ts +11 -0
- package/lib/ir/core/irCommands.d.ts.map +1 -1
- package/lib/ir/core/irCommands.js +11 -1
- package/lib/ir/core/irCommands.js.map +1 -1
- package/lib/ir/core/irDomain.d.ts +4 -3
- package/lib/ir/core/irDomain.d.ts.map +1 -1
- package/lib/ir/core/irDomain.js +10 -7
- package/lib/ir/core/irDomain.js.map +1 -1
- package/lib/ir/core/irFormat.d.ts +14 -2
- package/lib/ir/core/irFormat.d.ts.map +1 -1
- package/lib/ir/core/irFormat.js +33 -4
- package/lib/ir/core/irFormat.js.map +1 -1
- package/lib/ir/core/irMode.d.ts +35 -8
- package/lib/ir/core/irMode.d.ts.map +1 -1
- package/lib/ir/core/irMode.js +38 -10
- package/lib/ir/core/irMode.js.map +1 -1
- package/lib/ir/core/irReducer.d.ts +0 -28
- package/lib/ir/core/irReducer.d.ts.map +1 -1
- package/lib/ir/core/irReducer.js +1 -24
- package/lib/ir/core/irReducer.js.map +1 -1
- package/lib/ir/core/irSpectrum.d.ts +52 -26
- package/lib/ir/core/irSpectrum.d.ts.map +1 -1
- package/lib/ir/core/irSpectrum.js +21 -15
- package/lib/ir/core/irSpectrum.js.map +1 -1
- package/lib/ir/core/irState.d.ts +40 -2
- package/lib/ir/core/irState.d.ts.map +1 -1
- package/lib/ir/core/irState.js +38 -1
- package/lib/ir/core/irState.js.map +1 -1
- package/lib/ir/core/irTechnique.d.ts +94 -0
- package/lib/ir/core/irTechnique.d.ts.map +1 -0
- package/lib/ir/core/irTechnique.js +87 -0
- package/lib/ir/core/irTechnique.js.map +1 -0
- package/lib/ir/core/irTechniqueCommands.d.ts +26 -0
- package/lib/ir/core/irTechniqueCommands.d.ts.map +1 -0
- package/lib/ir/core/irTechniqueCommands.js +68 -0
- package/lib/ir/core/irTechniqueCommands.js.map +1 -0
- package/lib/ir/core/pickBands.d.ts +6 -5
- package/lib/ir/core/pickBands.d.ts.map +1 -1
- package/lib/ir/core/pickBands.js +49 -26
- package/lib/ir/core/pickBands.js.map +1 -1
- package/lib/ir/core/ramanBands.d.ts +30 -0
- package/lib/ir/core/ramanBands.d.ts.map +1 -0
- package/lib/ir/core/ramanBands.js +83 -0
- package/lib/ir/core/ramanBands.js.map +1 -0
- package/lib/ir/core/spectrumJcamp.d.ts +10 -5
- package/lib/ir/core/spectrumJcamp.d.ts.map +1 -1
- package/lib/ir/core/spectrumJcamp.js +63 -15
- package/lib/ir/core/spectrumJcamp.js.map +1 -1
- package/lib/ir/core/toIrSpectrum.d.ts.map +1 -1
- package/lib/ir/core/toIrSpectrum.js +17 -2
- package/lib/ir/core/toIrSpectrum.js.map +1 -1
- package/lib/ir/ui/BandRow.d.ts +30 -0
- package/lib/ir/ui/BandRow.d.ts.map +1 -0
- package/lib/ir/ui/BandRow.js +42 -0
- package/lib/ir/ui/BandRow.js.map +1 -0
- package/lib/ir/ui/BandsPanel.d.ts +4 -0
- package/lib/ir/ui/BandsPanel.d.ts.map +1 -1
- package/lib/ir/ui/BandsPanel.js +14 -59
- package/lib/ir/ui/BandsPanel.js.map +1 -1
- package/lib/ir/ui/IrAboutDialog.d.ts +7 -0
- package/lib/ir/ui/IrAboutDialog.d.ts.map +1 -1
- package/lib/ir/ui/IrAboutDialog.js +16 -3
- package/lib/ir/ui/IrAboutDialog.js.map +1 -1
- package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
- package/lib/ir/ui/IrCanvas.js +2 -2
- package/lib/ir/ui/IrCanvas.js.map +1 -1
- package/lib/ir/ui/IrChart.d.ts +2 -1
- package/lib/ir/ui/IrChart.d.ts.map +1 -1
- package/lib/ir/ui/IrChart.js +18 -21
- package/lib/ir/ui/IrChart.js.map +1 -1
- package/lib/ir/ui/IrCommandProvider.d.ts +7 -0
- package/lib/ir/ui/IrCommandProvider.d.ts.map +1 -1
- package/lib/ir/ui/IrCommandProvider.js +2 -2
- package/lib/ir/ui/IrCommandProvider.js.map +1 -1
- package/lib/ir/ui/IrCommandTooltip.d.ts +7 -0
- package/lib/ir/ui/IrCommandTooltip.d.ts.map +1 -1
- package/lib/ir/ui/IrCommandTooltip.js +3 -2
- package/lib/ir/ui/IrCommandTooltip.js.map +1 -1
- package/lib/ir/ui/IrDocumentationDialog.d.ts +8 -1
- package/lib/ir/ui/IrDocumentationDialog.d.ts.map +1 -1
- package/lib/ir/ui/IrDocumentationDialog.js +30 -7
- package/lib/ir/ui/IrDocumentationDialog.js.map +1 -1
- package/lib/ir/ui/IrEditor.d.ts +3 -1
- package/lib/ir/ui/IrEditor.d.ts.map +1 -1
- package/lib/ir/ui/IrEditor.js +3 -20
- package/lib/ir/ui/IrEditor.js.map +1 -1
- package/lib/ir/ui/IrHeader.d.ts.map +1 -1
- package/lib/ir/ui/IrHeader.js +5 -1
- package/lib/ir/ui/IrHeader.js.map +1 -1
- package/lib/ir/ui/IrLogo.d.ts +11 -3
- package/lib/ir/ui/IrLogo.d.ts.map +1 -1
- package/lib/ir/ui/IrLogo.js +14 -5
- package/lib/ir/ui/IrLogo.js.map +1 -1
- package/lib/ir/ui/IrShell.d.ts.map +1 -1
- package/lib/ir/ui/IrShell.js +23 -56
- package/lib/ir/ui/IrShell.js.map +1 -1
- package/lib/ir/ui/IrStatusBar.d.ts +3 -2
- package/lib/ir/ui/IrStatusBar.d.ts.map +1 -1
- package/lib/ir/ui/IrStatusBar.js +14 -9
- package/lib/ir/ui/IrStatusBar.js.map +1 -1
- package/lib/ir/ui/IrToolbar.d.ts +3 -0
- package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
- package/lib/ir/ui/IrToolbar.js +10 -3
- package/lib/ir/ui/IrToolbar.js.map +1 -1
- package/lib/ir/ui/IrTraces.d.ts +4 -1
- package/lib/ir/ui/IrTraces.d.ts.map +1 -1
- package/lib/ir/ui/IrTraces.js +2 -0
- package/lib/ir/ui/IrTraces.js.map +1 -1
- package/lib/ir/ui/RamanEditor.d.ts +46 -0
- package/lib/ir/ui/RamanEditor.d.ts.map +1 -0
- package/lib/ir/ui/RamanEditor.js +17 -0
- package/lib/ir/ui/RamanEditor.js.map +1 -0
- package/lib/ir/ui/SpectraPanel.d.ts.map +1 -1
- package/lib/ir/ui/SpectraPanel.js +2 -2
- package/lib/ir/ui/SpectraPanel.js.map +1 -1
- package/lib/ir/ui/SpectrumRow.d.ts +7 -0
- package/lib/ir/ui/SpectrumRow.d.ts.map +1 -1
- package/lib/ir/ui/SpectrumRow.js +4 -5
- package/lib/ir/ui/SpectrumRow.js.map +1 -1
- package/lib/ir/ui/VibrationalEditor.d.ts +48 -0
- package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -0
- package/lib/ir/ui/VibrationalEditor.js +31 -0
- package/lib/ir/ui/VibrationalEditor.js.map +1 -0
- package/lib/ir/ui/bandsTsv.d.ts +19 -0
- package/lib/ir/ui/bandsTsv.d.ts.map +1 -0
- package/lib/ir/ui/bandsTsv.js +38 -0
- package/lib/ir/ui/bandsTsv.js.map +1 -0
- package/lib/ir/ui/irChartProps.d.ts +14 -4
- package/lib/ir/ui/irChartProps.d.ts.map +1 -1
- package/lib/ir/ui/irChartProps.js +3 -2
- package/lib/ir/ui/irChartProps.js.map +1 -1
- package/lib/ir/ui/irCommandContext.d.ts +8 -0
- package/lib/ir/ui/irCommandContext.d.ts.map +1 -1
- package/lib/ir/ui/irCommandContext.js +14 -3
- package/lib/ir/ui/irCommandContext.js.map +1 -1
- package/lib/ir/ui/useIrEditor.d.ts +3 -3
- package/lib/ir/ui/useIrEditor.d.ts.map +1 -1
- package/lib/ir/ui/useIrEditor.js +13 -4
- package/lib/ir/ui/useIrEditor.js.map +1 -1
- package/lib/ir/ui/useIrHandle.d.ts +14 -0
- package/lib/ir/ui/useIrHandle.d.ts.map +1 -0
- package/lib/ir/ui/useIrHandle.js +39 -0
- package/lib/ir/ui/useIrHandle.js.map +1 -0
- package/lib/ir/ui/useIrText.d.ts +40 -0
- package/lib/ir/ui/useIrText.d.ts.map +1 -0
- package/lib/ir/ui/useIrText.js +118 -0
- package/lib/ir/ui/useIrText.js.map +1 -0
- package/lib/ir/ui/useIrZoom.d.ts +7 -0
- package/lib/ir/ui/useIrZoom.d.ts.map +1 -1
- package/lib/ir/ui/useIrZoom.js +5 -4
- package/lib/ir/ui/useIrZoom.js.map +1 -1
- package/lib/ir/ui/useValueAxisZoom.d.ts +20 -0
- package/lib/ir/ui/useValueAxisZoom.d.ts.map +1 -0
- package/lib/ir/ui/useValueAxisZoom.js +54 -0
- package/lib/ir/ui/useValueAxisZoom.js.map +1 -0
- package/lib/ir.d.ts +3 -0
- package/lib/ir.d.ts.map +1 -1
- package/lib/ir.js +3 -0
- package/lib/ir.js.map +1 -1
- package/lib/locales/de.json +20 -1
- package/lib/locales/en.json +20 -1
- package/lib/locales/es.json +20 -1
- package/lib/locales/fr.json +20 -1
- package/lib/locales/it.json +20 -1
- package/lib/raman.d.ts +16 -0
- package/lib/raman.d.ts.map +1 -0
- package/lib/raman.js +12 -0
- package/lib/raman.js.map +1 -0
- package/package.json +2 -1
- package/src/ir/core/analysisSpectra.ts +26 -10
- package/src/ir/core/bandLabelPlan.ts +21 -10
- package/src/ir/core/index.ts +25 -5
- package/src/ir/core/irBand.ts +52 -14
- package/src/ir/core/irCommands.ts +15 -1
- package/src/ir/core/irDomain.ts +9 -7
- package/src/ir/core/irFormat.ts +39 -6
- package/src/ir/core/irMode.ts +42 -10
- package/src/ir/core/irReducer.ts +1 -49
- package/src/ir/core/irSpectrum.ts +59 -30
- package/src/ir/core/irState.ts +67 -2
- package/src/ir/core/irTechnique.ts +115 -0
- package/src/ir/core/irTechniqueCommands.ts +82 -0
- package/src/ir/core/pickBands.ts +63 -28
- package/src/ir/core/ramanBands.ts +105 -0
- package/src/ir/core/spectrumJcamp.ts +65 -16
- package/src/ir/core/toIrSpectrum.ts +20 -2
- package/src/ir/ui/BandRow.tsx +107 -0
- package/src/ir/ui/BandsPanel.tsx +32 -125
- package/src/ir/ui/IrAboutDialog.tsx +69 -28
- package/src/ir/ui/IrCanvas.tsx +2 -1
- package/src/ir/ui/IrChart.tsx +20 -24
- package/src/ir/ui/IrCommandProvider.tsx +10 -3
- package/src/ir/ui/IrCommandTooltip.tsx +11 -2
- package/src/ir/ui/IrDocumentationDialog.tsx +99 -55
- package/src/ir/ui/IrEditor.tsx +5 -36
- package/src/ir/ui/IrHeader.tsx +10 -3
- package/src/ir/ui/IrLogo.tsx +28 -9
- package/src/ir/ui/IrShell.tsx +27 -75
- package/src/ir/ui/IrStatusBar.tsx +17 -12
- package/src/ir/ui/IrToolbar.tsx +26 -15
- package/src/ir/ui/IrTraces.tsx +5 -1
- package/src/ir/ui/RamanEditor.tsx +53 -0
- package/src/ir/ui/SpectraPanel.tsx +2 -1
- package/src/ir/ui/SpectrumRow.tsx +14 -5
- package/src/ir/ui/VibrationalEditor.tsx +94 -0
- package/src/ir/ui/bandsTsv.ts +46 -0
- package/src/ir/ui/irChartProps.ts +14 -4
- package/src/ir/ui/irCommandContext.tsx +18 -3
- package/src/ir/ui/useIrEditor.ts +20 -8
- package/src/ir/ui/useIrHandle.ts +51 -0
- package/src/ir/ui/useIrText.ts +170 -0
- package/src/ir/ui/useIrZoom.ts +12 -3
- package/src/ir/ui/useValueAxisZoom.ts +67 -0
- package/src/ir.ts +3 -0
- package/src/locales/de.json +20 -1
- package/src/locales/en.json +20 -1
- package/src/locales/es.json +20 -1
- package/src/locales/fr.json +20 -1
- package/src/locales/it.json +20 -1
- package/src/raman.ts +19 -0
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What
|
|
2
|
+
* What a vibrational spectrum is once it has been read, whatever it was read
|
|
3
|
+
* from.
|
|
3
4
|
*
|
|
4
|
-
* One acquisition becomes one `IrSpectrum` carrying **both** value
|
|
5
|
-
* absorbance and percent transmittance — over one shared array of
|
|
6
|
-
* Both are held rather than one being derived on demand because
|
|
7
|
-
* already produces both when it reads a file: it adds an `a` and
|
|
8
|
-
* to every spectrum whichever of the two the instrument wrote, so
|
|
9
|
-
* happens once, in the one place that knows what the file's y
|
|
10
|
-
* the answer means switching what is drawn costs nothing,
|
|
11
|
-
* axes can never drift apart through a round trip.
|
|
5
|
+
* One infrared acquisition becomes one `IrSpectrum` carrying **both** value
|
|
6
|
+
* axes — absorbance and percent transmittance — over one shared array of
|
|
7
|
+
* wavenumbers. Both are held rather than one being derived on demand because
|
|
8
|
+
* `ir-spectrum` already produces both when it reads a file: it adds an `a` and
|
|
9
|
+
* a `t` variable to every spectrum whichever of the two the instrument wrote, so
|
|
10
|
+
* the conversion happens once, in the one place that knows what the file's y
|
|
11
|
+
* axis meant. Holding the answer means switching what is drawn costs nothing,
|
|
12
|
+
* and means the two axes can never drift apart through a round trip.
|
|
13
|
+
*
|
|
14
|
+
* A Raman acquisition carries its intensity instead, over its Raman shifts —
|
|
15
|
+
* also wavenumbers in cm⁻¹ — and neither infrared axis: there is no
|
|
16
|
+
* transmittance of scattered light to convert it to.
|
|
12
17
|
*
|
|
13
18
|
* The arrays are `Float64Array` and are replaced on a change, never written
|
|
14
|
-
* into, since every consumer holds the same object by reference.
|
|
19
|
+
* into, since every consumer holds the same object by reference. A vibrational
|
|
15
20
|
* spectrum is a few thousand points rather than a mass spectrum's few hundred
|
|
16
21
|
* thousand, so holding two value axes costs nothing worth counting.
|
|
17
22
|
*/
|
|
@@ -26,8 +31,11 @@ import type { ChartDomain } from '../../chart/core/chartDomain.ts';
|
|
|
26
31
|
* adapter at each boundary.
|
|
27
32
|
*/
|
|
28
33
|
export type IrTrace = DataXY<Float64Array>;
|
|
29
|
-
/**
|
|
30
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The formats a spectrum can have been read from. `wdf` is Renishaw's Raman
|
|
36
|
+
* format, which a host reads with its own parser and hands over.
|
|
37
|
+
*/
|
|
38
|
+
export type IrFormat = 'jcamp' | 'spc' | 'text' | 'wdf' | 'calculated';
|
|
31
39
|
/**
|
|
32
40
|
* Where a spectrum came from, and what the file said about the acquisition.
|
|
33
41
|
*
|
|
@@ -79,8 +87,11 @@ export interface IrMeta {
|
|
|
79
87
|
/** The fields that are populated, in display order. */
|
|
80
88
|
fields: IrMetaField[];
|
|
81
89
|
}
|
|
82
|
-
/**
|
|
83
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Which value axis is being drawn and read: absorbance or percent
|
|
92
|
+
* transmittance for an infrared spectrum, intensity for a Raman one.
|
|
93
|
+
*/
|
|
94
|
+
export type IrMode = 'absorbance' | 'transmittance' | 'intensity';
|
|
84
95
|
/** One spectrum as the viewer holds it. */
|
|
85
96
|
export interface IrSpectrum {
|
|
86
97
|
/** Identity, stable across edits so a selection survives a rename. */
|
|
@@ -90,19 +101,33 @@ export interface IrSpectrum {
|
|
|
90
101
|
/** The colour it is drawn in. */
|
|
91
102
|
color: string;
|
|
92
103
|
/**
|
|
93
|
-
* The wavenumbers in cm⁻¹, **ascending
|
|
104
|
+
* The wavenumbers in cm⁻¹, **ascending** — of the light absorbed for an
|
|
105
|
+
* infrared spectrum, the Raman shift for a Raman one.
|
|
94
106
|
*
|
|
95
|
-
* Ascending even though the axis is read from 4000 down to 400:
|
|
96
|
-
* numbers run on screen is the chart's business, and every
|
|
97
|
-
* every extent taken off index zero downstream wants them in
|
|
98
|
-
* the data instead would make the drawing simpler once and
|
|
99
|
-
* wrong.
|
|
107
|
+
* Ascending even though the infrared axis is read from 4000 down to 400:
|
|
108
|
+
* which way the numbers run on screen is the chart's business, and every
|
|
109
|
+
* binary search and every extent taken off index zero downstream wants them in
|
|
110
|
+
* order. Reversing the data instead would make the drawing simpler once and
|
|
111
|
+
* everything else wrong.
|
|
100
112
|
*/
|
|
101
113
|
wavenumber: Float64Array;
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Absorbance at each wavenumber, as `ir-spectrum` supplied it. An infrared
|
|
116
|
+
* spectrum carries it beside `transmittance`.
|
|
117
|
+
* @default undefined
|
|
118
|
+
*/
|
|
119
|
+
absorbance?: Float64Array;
|
|
120
|
+
/**
|
|
121
|
+
* Percent transmittance at each wavenumber, likewise.
|
|
122
|
+
* @default undefined
|
|
123
|
+
*/
|
|
124
|
+
transmittance?: Float64Array;
|
|
125
|
+
/**
|
|
126
|
+
* Intensity at each Raman shift, which a Raman spectrum carries instead of
|
|
127
|
+
* the two infrared axes.
|
|
128
|
+
* @default undefined
|
|
129
|
+
*/
|
|
130
|
+
intensity?: Float64Array;
|
|
106
131
|
/** What the file said about the acquisition, `null` when it said nothing. */
|
|
107
132
|
meta: IrMeta | null;
|
|
108
133
|
/** Where it came from. */
|
|
@@ -134,7 +159,8 @@ export type IrDomain = ChartDomain;
|
|
|
134
159
|
* render of every spectrum is a copy per frame for no gain.
|
|
135
160
|
* @param spectrum - The spectrum.
|
|
136
161
|
* @param mode - Which value axis is being drawn.
|
|
137
|
-
* @returns The trace, sharing the spectrum's own arrays
|
|
162
|
+
* @returns The trace, sharing the spectrum's own arrays, or `undefined` when the
|
|
163
|
+
* spectrum carries no such axis — a Raman spectrum has no absorbance.
|
|
138
164
|
*/
|
|
139
|
-
export declare function traceOf(spectrum: IrSpectrum, mode: IrMode): IrTrace;
|
|
165
|
+
export declare function traceOf(spectrum: IrSpectrum, mode: IrMode): IrTrace | undefined;
|
|
140
166
|
//# sourceMappingURL=irSpectrum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irSpectrum.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irSpectrum.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"irSpectrum.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irSpectrum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,YAAY,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,mCAAmC;IACnC,MAAM,EAAE,QAAQ,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wCAAwC;AACxC,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,MAAM;IACrB,2DAA2D;IAC3D,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uDAAuD;IACvD,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG,eAAe,GAAG,WAAW,CAAC;AAElE,2CAA2C;AAC3C,MAAM,WAAW,UAAU;IACzB,sEAAsE;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;OASG;IACH,UAAU,EAAE,YAAY,CAAC;IACzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,6EAA6E;IAC7E,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,0BAA0B;IAC1B,MAAM,EAAE,QAAQ,CAAC;IACjB,2BAA2B;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC;AAEnC;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CACrB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,MAAM,GACX,OAAO,GAAG,SAAS,CAKrB"}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What
|
|
2
|
+
* What a vibrational spectrum is once it has been read, whatever it was read
|
|
3
|
+
* from.
|
|
3
4
|
*
|
|
4
|
-
* One acquisition becomes one `IrSpectrum` carrying **both** value
|
|
5
|
-
* absorbance and percent transmittance — over one shared array of
|
|
6
|
-
* Both are held rather than one being derived on demand because
|
|
7
|
-
* already produces both when it reads a file: it adds an `a` and
|
|
8
|
-
* to every spectrum whichever of the two the instrument wrote, so
|
|
9
|
-
* happens once, in the one place that knows what the file's y
|
|
10
|
-
* the answer means switching what is drawn costs nothing,
|
|
11
|
-
* axes can never drift apart through a round trip.
|
|
5
|
+
* One infrared acquisition becomes one `IrSpectrum` carrying **both** value
|
|
6
|
+
* axes — absorbance and percent transmittance — over one shared array of
|
|
7
|
+
* wavenumbers. Both are held rather than one being derived on demand because
|
|
8
|
+
* `ir-spectrum` already produces both when it reads a file: it adds an `a` and
|
|
9
|
+
* a `t` variable to every spectrum whichever of the two the instrument wrote, so
|
|
10
|
+
* the conversion happens once, in the one place that knows what the file's y
|
|
11
|
+
* axis meant. Holding the answer means switching what is drawn costs nothing,
|
|
12
|
+
* and means the two axes can never drift apart through a round trip.
|
|
13
|
+
*
|
|
14
|
+
* A Raman acquisition carries its intensity instead, over its Raman shifts —
|
|
15
|
+
* also wavenumbers in cm⁻¹ — and neither infrared axis: there is no
|
|
16
|
+
* transmittance of scattered light to convert it to.
|
|
12
17
|
*
|
|
13
18
|
* The arrays are `Float64Array` and are replaced on a change, never written
|
|
14
|
-
* into, since every consumer holds the same object by reference.
|
|
19
|
+
* into, since every consumer holds the same object by reference. A vibrational
|
|
15
20
|
* spectrum is a few thousand points rather than a mass spectrum's few hundred
|
|
16
21
|
* thousand, so holding two value axes costs nothing worth counting.
|
|
17
22
|
*/
|
|
@@ -23,12 +28,13 @@
|
|
|
23
28
|
* render of every spectrum is a copy per frame for no gain.
|
|
24
29
|
* @param spectrum - The spectrum.
|
|
25
30
|
* @param mode - Which value axis is being drawn.
|
|
26
|
-
* @returns The trace, sharing the spectrum's own arrays
|
|
31
|
+
* @returns The trace, sharing the spectrum's own arrays, or `undefined` when the
|
|
32
|
+
* spectrum carries no such axis — a Raman spectrum has no absorbance.
|
|
27
33
|
*/
|
|
28
34
|
export function traceOf(spectrum, mode) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
const values = spectrum[mode];
|
|
36
|
+
return values === undefined
|
|
37
|
+
? undefined
|
|
38
|
+
: { x: spectrum.wavenumber, y: values };
|
|
33
39
|
}
|
|
34
40
|
//# sourceMappingURL=irSpectrum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irSpectrum.js","sourceRoot":"","sources":["../../../src/ir/core/irSpectrum.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"irSpectrum.js","sourceRoot":"","sources":["../../../src/ir/core/irSpectrum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA+IH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,OAAO,CACrB,QAAoB,EACpB,IAAY;IAEZ,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,MAAM,KAAK,SAAS;QACzB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;AAC5C,CAAC"}
|
package/lib/ir/core/irState.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { IrSidePanelId } from './irSidePanels.ts';
|
|
16
16
|
import type { IrDomain, IrMode, IrSpectrum } from './irSpectrum.ts';
|
|
17
|
+
import type { IrTechnique } from './irTechnique.ts';
|
|
17
18
|
import type { PickBandsOptions } from './pickBands.ts';
|
|
18
19
|
/** The document: what a file holds. */
|
|
19
20
|
export interface IrData {
|
|
@@ -43,7 +44,12 @@ export interface IrView {
|
|
|
43
44
|
}
|
|
44
45
|
/** The workspace: how every spectrum is drawn, whichever ones are open. */
|
|
45
46
|
export interface IrSettings {
|
|
46
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* What the spectra were measured with. Chosen when the viewer opens and fixed
|
|
49
|
+
* from then on: a change asking for another is ignored.
|
|
50
|
+
*/
|
|
51
|
+
technique: IrTechnique;
|
|
52
|
+
/** Which value axis the spectra are read in, always one the technique offers. */
|
|
47
53
|
mode: IrMode;
|
|
48
54
|
/** Whether the bands are picked at all. */
|
|
49
55
|
pickBands: boolean;
|
|
@@ -92,6 +98,36 @@ export declare const DEFAULT_LABEL_LIMIT = 12;
|
|
|
92
98
|
export declare const DEFAULT_PICKING: PickBandsOptions;
|
|
93
99
|
/** The workspace a fresh viewer starts from. */
|
|
94
100
|
export declare const DEFAULT_SETTINGS: IrSettings;
|
|
101
|
+
/** What a viewer opens on. */
|
|
102
|
+
export interface CreateIrStateOptions {
|
|
103
|
+
/**
|
|
104
|
+
* The spectra to open on.
|
|
105
|
+
* @default []
|
|
106
|
+
*/
|
|
107
|
+
spectra?: IrSpectrum[];
|
|
108
|
+
/**
|
|
109
|
+
* The workspace to open in. Its `technique` is fixed for the life of the
|
|
110
|
+
* viewer, and its `mode` falls back to the technique's first when the
|
|
111
|
+
* technique does not offer it.
|
|
112
|
+
* @default DEFAULT_SETTINGS
|
|
113
|
+
*/
|
|
114
|
+
settings?: Partial<IrSettings>;
|
|
115
|
+
/**
|
|
116
|
+
* The panels open to begin with.
|
|
117
|
+
* @default DEFAULT_SIDE_PANELS
|
|
118
|
+
*/
|
|
119
|
+
panelIds?: IrSidePanelId[];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The state a viewer opens with.
|
|
123
|
+
*
|
|
124
|
+
* The panel list is spread rather than stored by reference: a caller's array is
|
|
125
|
+
* the caller's to mutate, and a viewer holding it would find its open panels
|
|
126
|
+
* changing under it.
|
|
127
|
+
* @param options - What it opens on.
|
|
128
|
+
* @returns The state.
|
|
129
|
+
*/
|
|
130
|
+
export declare function createIrState(options?: CreateIrStateOptions): IrState;
|
|
95
131
|
/**
|
|
96
132
|
* Fold a change into the workspace, refusing what no chart survives.
|
|
97
133
|
*
|
|
@@ -99,7 +135,9 @@ export declare const DEFAULT_SETTINGS: IrSettings;
|
|
|
99
135
|
* not yet a number — a lone minus sign, an empty box — and a limit of `NaN`
|
|
100
136
|
* silently stops every label being drawn. So each is checked, and the current
|
|
101
137
|
* value is kept where the new one is unusable rather than the field being
|
|
102
|
-
* fought with while it is being typed in.
|
|
138
|
+
* fought with while it is being typed in. The technique is never changed, and a
|
|
139
|
+
* mode it does not offer is refused the same way: a Raman spectrum has no
|
|
140
|
+
* absorbance to draw.
|
|
103
141
|
* @param current - The workspace in force.
|
|
104
142
|
* @param change - What to change about it.
|
|
105
143
|
* @returns The new workspace.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irState.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,uCAAuC;AACvC,MAAM,WAAW,MAAM;IACrB,kDAAkD;IAClD,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED,8DAA8D;AAC9D,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAEpC,mCAAmC;AACnC,MAAM,WAAW,MAAM;IACrB,mEAAmE;IACnE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;;;OAMG;IACH,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACxB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,uEAAuE;IACvE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,2EAA2E;AAC3E,MAAM,WAAW,UAAU;IACzB,
|
|
1
|
+
{"version":3,"file":"irState.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAA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puts — `useIrEditor` recomputes them instead, and
|
|
13
13
|
* a stale band is then impossible rather than merely unlikely.
|
|
14
14
|
*/
|
|
15
|
+
import { defaultIrMode, irModeFor, offersIrMode } from "./irTechnique.js";
|
|
15
16
|
/** The panel the splitter brings back when it is dragged open on nothing. */
|
|
16
17
|
export const DEFAULT_SIDE_PANEL = 'spectra';
|
|
17
18
|
/**
|
|
@@ -33,6 +34,7 @@ export const DEFAULT_PICKING = {
|
|
|
33
34
|
};
|
|
34
35
|
/** The workspace a fresh viewer starts from. */
|
|
35
36
|
export const DEFAULT_SETTINGS = {
|
|
37
|
+
technique: 'infrared',
|
|
36
38
|
mode: 'transmittance',
|
|
37
39
|
pickBands: true,
|
|
38
40
|
picking: DEFAULT_PICKING,
|
|
@@ -40,6 +42,35 @@ export const DEFAULT_SETTINGS = {
|
|
|
40
42
|
labelLimit: DEFAULT_LABEL_LIMIT,
|
|
41
43
|
assignmentTolerance: 5,
|
|
42
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* The state a viewer opens with.
|
|
47
|
+
*
|
|
48
|
+
* The panel list is spread rather than stored by reference: a caller's array is
|
|
49
|
+
* the caller's to mutate, and a viewer holding it would find its open panels
|
|
50
|
+
* changing under it.
|
|
51
|
+
* @param options - What it opens on.
|
|
52
|
+
* @returns The state.
|
|
53
|
+
*/
|
|
54
|
+
export function createIrState(options = {}) {
|
|
55
|
+
const { spectra = [], settings, panelIds } = options;
|
|
56
|
+
const technique = settings?.technique ?? DEFAULT_SETTINGS.technique;
|
|
57
|
+
const opened = {
|
|
58
|
+
...DEFAULT_SETTINGS,
|
|
59
|
+
technique,
|
|
60
|
+
mode: defaultIrMode(technique),
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
data: { spectra: [...spectra] },
|
|
64
|
+
view: {
|
|
65
|
+
selectedId: spectra[0]?.id ?? null,
|
|
66
|
+
domain: null,
|
|
67
|
+
tool: 'read',
|
|
68
|
+
openPanelIds: [...(panelIds ?? DEFAULT_SIDE_PANELS)],
|
|
69
|
+
error: null,
|
|
70
|
+
},
|
|
71
|
+
settings: mergeIrSettings(opened, settings),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
43
74
|
/**
|
|
44
75
|
* Fold a change into the workspace, refusing what no chart survives.
|
|
45
76
|
*
|
|
@@ -47,7 +78,9 @@ export const DEFAULT_SETTINGS = {
|
|
|
47
78
|
* not yet a number — a lone minus sign, an empty box — and a limit of `NaN`
|
|
48
79
|
* silently stops every label being drawn. So each is checked, and the current
|
|
49
80
|
* value is kept where the new one is unusable rather than the field being
|
|
50
|
-
* fought with while it is being typed in.
|
|
81
|
+
* fought with while it is being typed in. The technique is never changed, and a
|
|
82
|
+
* mode it does not offer is refused the same way: a Raman spectrum has no
|
|
83
|
+
* absorbance to draw.
|
|
51
84
|
* @param current - The workspace in force.
|
|
52
85
|
* @param change - What to change about it.
|
|
53
86
|
* @returns The new workspace.
|
|
@@ -58,6 +91,10 @@ export function mergeIrSettings(current, change = {}) {
|
|
|
58
91
|
return {
|
|
59
92
|
...current,
|
|
60
93
|
...change,
|
|
94
|
+
technique: current.technique,
|
|
95
|
+
mode: offersIrMode(current.technique, change.mode)
|
|
96
|
+
? change.mode
|
|
97
|
+
: irModeFor(current.technique, current.mode),
|
|
61
98
|
picking: { ...current.picking, ...change.picking },
|
|
62
99
|
labelLimit: Number.isFinite(asked)
|
|
63
100
|
? Math.min(MAXIMUM_LABEL_LIMIT, Math.max(0, Math.round(asked)))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irState.js","sourceRoot":"","sources":["../../../src/ir/core/irState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"irState.js","sourceRoot":"","sources":["../../../src/ir/core/irState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAyE1E,6EAA6E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,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,SAAS,QAAQ,CAAC,MAAwB;IACxC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC;IAC1B,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything that differs between an infrared spectrum and a Raman one.
|
|
3
|
+
*
|
|
4
|
+
* Both are vibrational spectra over wavenumbers in cm⁻¹, and the viewer reads
|
|
5
|
+
* them the same way — one chart, one set of panels, one set of gestures — so
|
|
6
|
+
* what is left to differ is a handful of facts: which value axes a spectrum is
|
|
7
|
+
* read on, what the horizontal axis is called and which way it runs, whether the
|
|
8
|
+
* correlation table has anything to say about a band, and what a written file
|
|
9
|
+
* calls itself. They are gathered here for the reason `IR_MODE_RULES` gathers
|
|
10
|
+
* what differs between the value axes: a component that asked which technique
|
|
11
|
+
* it was drawing would be the first of many to ask, and they would come to
|
|
12
|
+
* disagree.
|
|
13
|
+
*/
|
|
14
|
+
import type { IrMode } from './irSpectrum.ts';
|
|
15
|
+
/** What was measured: the light a sample absorbs, or the light it scatters. */
|
|
16
|
+
export type IrTechnique = 'infrared' | 'raman';
|
|
17
|
+
/** What is true of one technique. */
|
|
18
|
+
export interface IrTechniqueRules {
|
|
19
|
+
/** How it is written inside a sentence; a sentence opening on it capitalises it. */
|
|
20
|
+
name: string;
|
|
21
|
+
/** The value axes a spectrum is read on, in the order a control offers them. */
|
|
22
|
+
modes: readonly IrMode[];
|
|
23
|
+
/** What the horizontal axis is called. */
|
|
24
|
+
xTitle: string;
|
|
25
|
+
/** Whether the horizontal axis runs from high at the left to low at the right. */
|
|
26
|
+
reverseX: boolean;
|
|
27
|
+
/** Whether the correlation table is asked what a band might be. */
|
|
28
|
+
assignments: boolean;
|
|
29
|
+
/** The `##DATA TYPE=` a written spectrum states when its file stated none. */
|
|
30
|
+
dataType: string;
|
|
31
|
+
}
|
|
32
|
+
/** The techniques, in the order a control would offer them. */
|
|
33
|
+
export declare const IR_TECHNIQUES: readonly IrTechnique[];
|
|
34
|
+
/** How each technique behaves, every fact in one place. */
|
|
35
|
+
export declare const IR_TECHNIQUE_RULES: {
|
|
36
|
+
readonly infrared: {
|
|
37
|
+
readonly name: "infrared";
|
|
38
|
+
readonly modes: readonly ["transmittance", "absorbance"];
|
|
39
|
+
readonly xTitle: "wavenumber (cm⁻¹)";
|
|
40
|
+
/**
|
|
41
|
+
* 4000 at the left and 400 at the right, which is how every infrared
|
|
42
|
+
* spectrum has been printed since the instruments scanned that way.
|
|
43
|
+
*/
|
|
44
|
+
readonly reverseX: true;
|
|
45
|
+
readonly assignments: true;
|
|
46
|
+
readonly dataType: "INFRARED SPECTRUM";
|
|
47
|
+
};
|
|
48
|
+
readonly raman: {
|
|
49
|
+
readonly name: "Raman";
|
|
50
|
+
/** One axis: a Raman spectrum is the light scattered, and nothing else. */
|
|
51
|
+
readonly modes: readonly ["intensity"];
|
|
52
|
+
readonly xTitle: "Raman shift (cm⁻¹)";
|
|
53
|
+
/** The shift grows away from the laser line, left to right. */
|
|
54
|
+
readonly reverseX: false;
|
|
55
|
+
/**
|
|
56
|
+
* The table holds infrared group frequencies and infrared strengths. A
|
|
57
|
+
* vibration strong in one technique is often weak or silent in the other,
|
|
58
|
+
* so its candidates offered for a Raman band would claim what the table
|
|
59
|
+
* does not know.
|
|
60
|
+
*/
|
|
61
|
+
readonly assignments: false;
|
|
62
|
+
readonly dataType: "RAMAN SPECTRUM";
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The value axis a viewer of a technique opens on.
|
|
67
|
+
* @param technique - What was measured.
|
|
68
|
+
* @returns Its first mode.
|
|
69
|
+
*/
|
|
70
|
+
export declare function defaultIrMode(technique: IrTechnique): IrMode;
|
|
71
|
+
/**
|
|
72
|
+
* Whether a technique reads its spectra on a value axis.
|
|
73
|
+
* @param technique - What was measured.
|
|
74
|
+
* @param mode - The axis asked about; `undefined` is offered by none.
|
|
75
|
+
* @returns Whether the technique offers it.
|
|
76
|
+
*/
|
|
77
|
+
export declare function offersIrMode(technique: IrTechnique, mode: IrMode | undefined): mode is IrMode;
|
|
78
|
+
/**
|
|
79
|
+
* The value axis to read a technique's spectra on, given the one asked for.
|
|
80
|
+
* @param technique - What was measured.
|
|
81
|
+
* @param mode - The axis asked for, if any.
|
|
82
|
+
* @returns It when the technique offers it, the technique's first otherwise.
|
|
83
|
+
*/
|
|
84
|
+
export declare function irModeFor(technique: IrTechnique, mode?: IrMode): IrMode;
|
|
85
|
+
/**
|
|
86
|
+
* The technique that reads its spectra on a value axis.
|
|
87
|
+
*
|
|
88
|
+
* Every axis belongs to exactly one technique, so the axis a file was written
|
|
89
|
+
* on says what was measured.
|
|
90
|
+
* @param mode - The value axis.
|
|
91
|
+
* @returns The technique offering it.
|
|
92
|
+
*/
|
|
93
|
+
export declare function irModeTechnique(mode: IrMode): IrTechnique;
|
|
94
|
+
//# sourceMappingURL=irTechnique.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irTechnique.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irTechnique.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,+EAA+E;AAC/E,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/C,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,QAAQ,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,WAAW,EAAE,OAAO,CAAC;IACrB,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAA0B,CAAC;AAE3E,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB;;;;;QAK3B;;;WAGG;;;;;;;QAOH,2EAA2E;;;QAG3E,+DAA+D;;QAE/D;;;;;WAKG;;;;CAImD,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,WAAW,EACtB,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,IAAI,IAAI,MAAM,CAIhB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAEzD"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything that differs between an infrared spectrum and a Raman one.
|
|
3
|
+
*
|
|
4
|
+
* Both are vibrational spectra over wavenumbers in cm⁻¹, and the viewer reads
|
|
5
|
+
* them the same way — one chart, one set of panels, one set of gestures — so
|
|
6
|
+
* what is left to differ is a handful of facts: which value axes a spectrum is
|
|
7
|
+
* read on, what the horizontal axis is called and which way it runs, whether the
|
|
8
|
+
* correlation table has anything to say about a band, and what a written file
|
|
9
|
+
* calls itself. They are gathered here for the reason `IR_MODE_RULES` gathers
|
|
10
|
+
* what differs between the value axes: a component that asked which technique
|
|
11
|
+
* it was drawing would be the first of many to ask, and they would come to
|
|
12
|
+
* disagree.
|
|
13
|
+
*/
|
|
14
|
+
/** The techniques, in the order a control would offer them. */
|
|
15
|
+
export const IR_TECHNIQUES = ['infrared', 'raman'];
|
|
16
|
+
/** How each technique behaves, every fact in one place. */
|
|
17
|
+
export const IR_TECHNIQUE_RULES = {
|
|
18
|
+
infrared: {
|
|
19
|
+
name: 'infrared',
|
|
20
|
+
modes: ['transmittance', 'absorbance'],
|
|
21
|
+
xTitle: 'wavenumber (cm⁻¹)',
|
|
22
|
+
/**
|
|
23
|
+
* 4000 at the left and 400 at the right, which is how every infrared
|
|
24
|
+
* spectrum has been printed since the instruments scanned that way.
|
|
25
|
+
*/
|
|
26
|
+
reverseX: true,
|
|
27
|
+
assignments: true,
|
|
28
|
+
dataType: 'INFRARED SPECTRUM',
|
|
29
|
+
},
|
|
30
|
+
raman: {
|
|
31
|
+
name: 'Raman',
|
|
32
|
+
/** One axis: a Raman spectrum is the light scattered, and nothing else. */
|
|
33
|
+
modes: ['intensity'],
|
|
34
|
+
xTitle: 'Raman shift (cm⁻¹)',
|
|
35
|
+
/** The shift grows away from the laser line, left to right. */
|
|
36
|
+
reverseX: false,
|
|
37
|
+
/**
|
|
38
|
+
* The table holds infrared group frequencies and infrared strengths. A
|
|
39
|
+
* vibration strong in one technique is often weak or silent in the other,
|
|
40
|
+
* so its candidates offered for a Raman band would claim what the table
|
|
41
|
+
* does not know.
|
|
42
|
+
*/
|
|
43
|
+
assignments: false,
|
|
44
|
+
dataType: 'RAMAN SPECTRUM',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The value axis a viewer of a technique opens on.
|
|
49
|
+
* @param technique - What was measured.
|
|
50
|
+
* @returns Its first mode.
|
|
51
|
+
*/
|
|
52
|
+
export function defaultIrMode(technique) {
|
|
53
|
+
return IR_TECHNIQUE_RULES[technique].modes[0];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Whether a technique reads its spectra on a value axis.
|
|
57
|
+
* @param technique - What was measured.
|
|
58
|
+
* @param mode - The axis asked about; `undefined` is offered by none.
|
|
59
|
+
* @returns Whether the technique offers it.
|
|
60
|
+
*/
|
|
61
|
+
export function offersIrMode(technique, mode) {
|
|
62
|
+
if (mode === undefined)
|
|
63
|
+
return false;
|
|
64
|
+
const modes = IR_TECHNIQUE_RULES[technique].modes;
|
|
65
|
+
return modes.includes(mode);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The value axis to read a technique's spectra on, given the one asked for.
|
|
69
|
+
* @param technique - What was measured.
|
|
70
|
+
* @param mode - The axis asked for, if any.
|
|
71
|
+
* @returns It when the technique offers it, the technique's first otherwise.
|
|
72
|
+
*/
|
|
73
|
+
export function irModeFor(technique, mode) {
|
|
74
|
+
return offersIrMode(technique, mode) ? mode : defaultIrMode(technique);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The technique that reads its spectra on a value axis.
|
|
78
|
+
*
|
|
79
|
+
* Every axis belongs to exactly one technique, so the axis a file was written
|
|
80
|
+
* on says what was measured.
|
|
81
|
+
* @param mode - The value axis.
|
|
82
|
+
* @returns The technique offering it.
|
|
83
|
+
*/
|
|
84
|
+
export function irModeTechnique(mode) {
|
|
85
|
+
return offersIrMode('raman', mode) ? 'raman' : 'infrared';
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=irTechnique.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irTechnique.js","sourceRoot":"","sources":["../../../src/ir/core/irTechnique.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAuBH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAE3E,2DAA2D;AAC3D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC;QACtC,MAAM,EAAE,mBAAmB;QAC3B;;;WAGG;QACH,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,mBAAmB;KAC9B;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,2EAA2E;QAC3E,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,MAAM,EAAE,oBAAoB;QAC5B,+DAA+D;QAC/D,QAAQ,EAAE,KAAK;QACf;;;;;WAKG;QACH,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,gBAAgB;KAC3B;CACuD,CAAC;AAE3D;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,SAAsB;IAClD,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,SAAsB,EACtB,IAAwB;IAExB,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACrC,MAAM,KAAK,GAAsB,kBAAkB,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC;IACrE,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,SAAsB,EAAE,IAAa;IAC7D,OAAO,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;AACzE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The commands each technique's viewer offers.
|
|
3
|
+
*
|
|
4
|
+
* A Raman viewer offers the infrared table less the commands with nothing to
|
|
5
|
+
* act on — one value axis is nothing to toggle, and no assignment is nothing to
|
|
6
|
+
* name — and words the rest without the absorbance and transmittance it does
|
|
7
|
+
* not have. It is built from the infrared table, so a command added there
|
|
8
|
+
* reaches both.
|
|
9
|
+
*/
|
|
10
|
+
import type { IrCommandId, IrCommandTable } from './irCommands.ts';
|
|
11
|
+
import type { IrTechnique } from './irTechnique.ts';
|
|
12
|
+
/**
|
|
13
|
+
* Whether a viewer of a technique offers a command at all.
|
|
14
|
+
* @param technique - What was measured.
|
|
15
|
+
* @param id - Which command.
|
|
16
|
+
* @returns False for the toggle of a technique with one value axis, and for
|
|
17
|
+
* the assignments of one the correlation table says nothing about.
|
|
18
|
+
*/
|
|
19
|
+
export declare function irCommandOffered(technique: IrTechnique, id: IrCommandId): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Everything a viewer of a technique offers, in the order it is reached for.
|
|
22
|
+
* @param technique - What was measured.
|
|
23
|
+
* @returns The table; for infrared, `irCommands` itself.
|
|
24
|
+
*/
|
|
25
|
+
export declare function irCommandsFor(technique: IrTechnique): IrCommandTable;
|
|
26
|
+
//# sourceMappingURL=irTechniqueCommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irTechniqueCommands.d.ts","sourceRoot":"","sources":["../../../src/ir/core/irTechniqueCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAa,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,WAAW,EACtB,EAAE,EAAE,WAAW,GACd,OAAO,CAKT;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,WAAW,GAAG,cAAc,CAEpE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The commands each technique's viewer offers.
|
|
3
|
+
*
|
|
4
|
+
* A Raman viewer offers the infrared table less the commands with nothing to
|
|
5
|
+
* act on — one value axis is nothing to toggle, and no assignment is nothing to
|
|
6
|
+
* name — and words the rest without the absorbance and transmittance it does
|
|
7
|
+
* not have. It is built from the infrared table, so a command added there
|
|
8
|
+
* reaches both.
|
|
9
|
+
*/
|
|
10
|
+
import { irCommands } from "./irCommands.js";
|
|
11
|
+
import { IR_TECHNIQUE_RULES } from "./irTechnique.js";
|
|
12
|
+
/**
|
|
13
|
+
* Whether a viewer of a technique offers a command at all.
|
|
14
|
+
* @param technique - What was measured.
|
|
15
|
+
* @param id - Which command.
|
|
16
|
+
* @returns False for the toggle of a technique with one value axis, and for
|
|
17
|
+
* the assignments of one the correlation table says nothing about.
|
|
18
|
+
*/
|
|
19
|
+
export function irCommandOffered(technique, id) {
|
|
20
|
+
const { modes, assignments } = IR_TECHNIQUE_RULES[technique];
|
|
21
|
+
if (id === 'toggleMode')
|
|
22
|
+
return modes.length > 1;
|
|
23
|
+
if (id === 'toggleAssignments')
|
|
24
|
+
return assignments;
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Everything a viewer of a technique offers, in the order it is reached for.
|
|
29
|
+
* @param technique - What was measured.
|
|
30
|
+
* @returns The table; for infrared, `irCommands` itself.
|
|
31
|
+
*/
|
|
32
|
+
export function irCommandsFor(technique) {
|
|
33
|
+
return COMMAND_TABLES[technique];
|
|
34
|
+
}
|
|
35
|
+
/** Where the chart is, for a gesture made anywhere on it. */
|
|
36
|
+
const OVER_THE_CHART = 'Over the chart';
|
|
37
|
+
/** How a Raman viewer words the commands it shares with infrared. */
|
|
38
|
+
const RAMAN_WORDING = {
|
|
39
|
+
about: { title: 'About the Raman viewer' },
|
|
40
|
+
documentation: {
|
|
41
|
+
description: 'How the bands are read, and every gesture.',
|
|
42
|
+
},
|
|
43
|
+
readTool: {
|
|
44
|
+
description: 'A drag narrows the Raman shift axis. Released past the baseline, it takes the intensity axis with it.',
|
|
45
|
+
gestures: [{ title: OVER_THE_CHART, shortcuts: ['Drag'] }],
|
|
46
|
+
},
|
|
47
|
+
boxTool: {
|
|
48
|
+
description: 'A drag zooms to exactly the rectangle it sweeps out, both axes at once — for looking into a baseline or a shoulder rather than across the spectrum.',
|
|
49
|
+
},
|
|
50
|
+
zoomIn: {
|
|
51
|
+
description: 'Brings the weak bands up, scaling the intensity axis about zero.',
|
|
52
|
+
gestures: [{ title: OVER_THE_CHART, shortcuts: ['Scroll wheel'] }],
|
|
53
|
+
},
|
|
54
|
+
zoomOut: {
|
|
55
|
+
gestures: [{ title: OVER_THE_CHART, shortcuts: ['Scroll wheel'] }],
|
|
56
|
+
},
|
|
57
|
+
togglePicking: {
|
|
58
|
+
description: 'Finds the bands of the selected spectrum, marks them on the chart and lists them.',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
/** The command table of each technique. */
|
|
62
|
+
const COMMAND_TABLES = {
|
|
63
|
+
infrared: irCommands,
|
|
64
|
+
raman: Object.fromEntries(Object.keys(irCommands)
|
|
65
|
+
.filter((id) => irCommandOffered('raman', id))
|
|
66
|
+
.map((id) => [id, { ...irCommands[id], ...RAMAN_WORDING[id] }])),
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=irTechniqueCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irTechniqueCommands.js","sourceRoot":"","sources":["../../../src/ir/core/irTechniqueCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAsB,EACtB,EAAe;IAEf,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC7D,IAAI,EAA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