[+] GraphAverage: Map GPA and MaxGPA for each course
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import {Component, Prop, Vue} from 'vue-property-decorator';
|
import {Component, Prop, Vue} from 'vue-property-decorator';
|
||||||
import {Course} from '@/components/app/app';
|
import {Course} from '@/components/app/app';
|
||||||
|
import {GPAUtils} from '@/utils/gpa-utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
})
|
})
|
||||||
@@ -22,5 +23,15 @@ export default class GraphAverage extends Vue
|
|||||||
// Make column list
|
// Make column list
|
||||||
let columns = ['Course', 'GPA', 'MaxGPA'];
|
let columns = ['Course', 'GPA', 'MaxGPA'];
|
||||||
|
|
||||||
|
// Calculate GPA and MaxGPA for each course (rows)
|
||||||
|
let rows = courses.map(course =>
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
'Course': course.name,
|
||||||
|
'GPA': GPAUtils.getGP(course, course.letterGrade),
|
||||||
|
'MaxGPA': GPAUtils.getGP(course, 'A+')
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user