Skip to content

Commit

Permalink
fix: plotting the derived value
Browse files Browse the repository at this point in the history
formula cell object should include the spectra ID

close #2834
  • Loading branch information
hamed-musallam committed Jan 19, 2024
1 parent 1571b50 commit f176fc0
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/data/data1d/multipleSpectraAnalysis.ts
Expand Up @@ -194,19 +194,23 @@ export function generateAnalyzeSpectra(
const result = Object.fromEntries(
Object.keys(columns).map((key) => {
const isFormula = columns[key].type === AnalysisColumnsTypes.FORMULA;
return [
key,
isFormula
? {
colKey: key,
value: calculate(
columns,
data[spectra[0]],
columns[key].formula,
),
}
: { ...spectra[1][key], colKey: key },
];
if (isFormula) {
const { SID, id } = spectra[1][key];
return [
key,
{
SID,
id,
colKey: key,
value: calculate(
columns,
data[spectra[0]],
columns[key].formula,
),
},
];
}
return [key, { ...spectra[1][key], colKey: key }];
}),
);
return [spectra[0], result];
Expand Down

0 comments on commit f176fc0

Please sign in to comment.