Skip to content

Commit

Permalink
Comment out unused parameters and code in database and chart componen…
Browse files Browse the repository at this point in the history
…ts for improved clarity and maintainability
  • Loading branch information
austenstone committed Dec 6, 2024
1 parent 4f37849 commit 82d2a26
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/database/database.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class DatabaseComponent implements AfterViewInit {
}),
finalize(async () => {
await this.router.navigate(['/copilot'], {
queryParams: { celebrate: true }
// queryParams: { celebrate: true }
})
})
).subscribe(() => this.checkStatus());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class TimeSavedChartComponent implements OnInit, OnChanges {
text: 'Time Saved (hrs per week)'
},
min: 0,
max: 12,
// max: 12,
labels: {
format: '{value}hrs'
},
Expand Down Expand Up @@ -61,7 +61,7 @@ export class TimeSavedChartComponent implements OnInit, OnChanges {
headerFormat: '<b>{point.x:%b %d, %Y}</b><br/>',
pointFormat: [
'{series.name}: ',
'<b>{point.y:.1f}%</b>'
'<b>{point.y:.1f}hrs</b>'
].join(''),
style: {
fontSize: '14px'
Expand Down
60 changes: 31 additions & 29 deletions frontend/src/app/services/highcharts.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ export class HighchartsService {
);

if (dateSurveys.length > 0) {
acc[dateKey].sum = dateSurveys.reduce((sum, survey) =>
sum + survey.percentTimeSaved, 0);
const avgPercentTimeSaved = dateSurveys.reduce((sum, survey) => sum + survey.percentTimeSaved, 0)
acc[dateKey].sum = avgPercentTimeSaved * 0.01 * 0.3 * 40; // TODO pull settings
acc[dateKey].count = dateSurveys.length;
}

Expand Down Expand Up @@ -539,33 +539,35 @@ export class HighchartsService {
lineWidth: 3
}
}
}, {
type: 'scatter' as const,
name: 'Survey',
data: surveys.map(survey => ({
x: new Date(survey.createdAt!).getTime(),
y: survey.percentTimeSaved,
raw: survey
})),
marker: {
enabled: true,
radius: 4,
symbol: 'triangle',
},
tooltip: {
headerFormat: '<b>{point.x:%b %d, %Y}</b><br/>',
pointFormatter: function () {
return [
`User: `,
'<b>' + this.raw?.userId + '</b>',
`</br>Time saved: `,
'<b>' + Math.round(this.y || 0) + '%</b>',
`</br>PR: `,
'<b>#' + this.raw?.prNumber + '</b>',
].join('');
} as Highcharts.FormatterCallbackFunction<CustomHighchartsPoint>
}
}]
},
// {
// type: 'scatter' as const,
// name: 'Survey',
// data: surveys.map(survey => ({
// x: new Date(survey.createdAt!).getTime(),
// y: survey.percentTimeSaved,
// raw: survey
// })),
// marker: {
// enabled: true,
// radius: 4,
// symbol: 'triangle',
// },
// tooltip: {
// headerFormat: '<b>{point.x:%b %d, %Y}</b><br/>',
// pointFormatter: function () {
// return [
// `User: `,
// '<b>' + this.raw?.userId + '</b>',
// `</br>Time saved: `,
// '<b>' + Math.round(this.y || 0) + '%</b>',
// `</br>PR: `,
// '<b>#' + this.raw?.prNumber + '</b>',
// ].join('');
// } as Highcharts.FormatterCallbackFunction<CustomHighchartsPoint>
// }
// }
]
};
}

Expand Down

0 comments on commit 82d2a26

Please sign in to comment.