Skip to content

Commit

Permalink
Correction to fix missing chemical data for table plot
Browse files Browse the repository at this point in the history
  • Loading branch information
steps39 committed May 15, 2024
1 parent c70be71 commit 804ab2d
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions sdeCharts.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,23 +536,27 @@ function dataForScatterCharting(sheetName) {
// datesSampled.sort();
i = 0;
datesSampled.forEach (ds => {
const allChemicals = Object.keys(selectedSampleMeasurements[ds][ct].chemicals);
for (const s in selectedSampleMeasurements[ds][ct].chemicals[allChemicals[0]].samples) {
scatterData[i] = ({x: sampleInfo[ds].position[s]['Position longitude'],
y: sampleInfo[ds].position[s]['Position latitude']});
if (!(selectedSampleMeasurements[ds][ct] === undefined)) {
const allChemicals = Object.keys(selectedSampleMeasurements[ds][ct].chemicals);
for (const s in selectedSampleMeasurements[ds][ct].chemicals[allChemicals[0]].samples) {
scatterData[i] = ({
x: sampleInfo[ds].position[s]['Position longitude'],
y: sampleInfo[ds].position[s]['Position latitude']
});
i += 1;
//console.log(sampleInfo[ds].position[s]['Position latitude']);
//console.log(sampleInfo[ds].position[s]['Position longitude']);
}
for (const c in selectedSampleMeasurements[ds][ct].chemicals) {
if (chemicalData[c] == undefined || chemicalData[c] == null) {
chemicalData[c] = {};
//console.log(sampleInfo[ds].position[s]['Position latitude']);
//console.log(sampleInfo[ds].position[s]['Position longitude']);
}
currentChemical = selectedSampleMeasurements[ds][ct].chemicals[c];
//console.log(currentChemical);
for (const s in currentChemical.samples) {
chemicalData[c][ds + ' : ' + s] = currentChemical.samples[s];
//console.log(currentChemical.samples[s])
for (const c in selectedSampleMeasurements[ds][ct].chemicals) {
if (chemicalData[c] == undefined || chemicalData[c] == null) {
chemicalData[c] = {};
}
currentChemical = selectedSampleMeasurements[ds][ct].chemicals[c];
//console.log(currentChemical);
for (const s in currentChemical.samples) {
chemicalData[c][ds + ' : ' + s] = currentChemical.samples[s];
//console.log(currentChemical.samples[s])
}
}
}
});
Expand Down

0 comments on commit 804ab2d

Please sign in to comment.