Skip to content

Commit

Permalink
cleaned changes and updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vickyc2266 committed Dec 8, 2024
1 parent 175c736 commit 55a6d92
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,15 @@ function App() {
doc.setFontSize(24);
doc.text('Harmony Data Report', 105, 20, { align: 'center' });

// Prepare summary data for the first table
const summaryData = [
['Total Instruments', apiData.instruments.length],
['Total Matches', computedMatches.length],
['Selected Matches', computedMatches.filter(m => m.selected).length],
['Match Threshold', `${resultsOptions.threshold[0]}%`]
];

// Add summary table to the PDF
doc.autoTable({
startY: 30,
body: summaryData,
Expand All @@ -332,6 +334,7 @@ function App() {
styles: { fontSize: 12 }
});

// Prepare detailed match data for the second table
const matchesTableData = computedMatches.map(match => {
const q1 = getQuestion(match.qi);
const q2 = getQuestion(match.mqi);
Expand All @@ -344,6 +347,7 @@ function App() {
];
});

// Add matches table to the PDF
doc.autoTable({
startY: doc.autoTable.previous.finalY + 10,
head: [['Question 1', 'Instrument 1', 'Question 2', 'Instrument 2', 'Score']],
Expand Down

0 comments on commit 55a6d92

Please sign in to comment.