Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e28191e67 | |||
| ef4d9d38e7 | |||
| 52626406bf | |||
| fec6c77dc2 | |||
| 4db8ee7837 | |||
| 9bfde0e39d |
+1
-1
@@ -7,7 +7,7 @@ export default class Constants
|
|||||||
public static API_URL: string = 'https://va.hydev.org/api';
|
public static API_URL: string = 'https://va.hydev.org/api';
|
||||||
|
|
||||||
/** Current version */
|
/** Current version */
|
||||||
public static VERSION: string = '0.3.5.697';
|
public static VERSION: string = '0.3.5.703';
|
||||||
|
|
||||||
/** Minimum version that still supports the same cookies */
|
/** Minimum version that still supports the same cookies */
|
||||||
public static MIN_SUPPORTED_VERSION: string = '0.3.4.561';
|
public static MIN_SUPPORTED_VERSION: string = '0.3.4.561';
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import moment from 'moment';
|
|||||||
})
|
})
|
||||||
export default class CourseScatter extends Vue
|
export default class CourseScatter extends Vue
|
||||||
{
|
{
|
||||||
|
private static DOT = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:{color}"></span>';
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@Prop({required: true}) course: Course;
|
@Prop({required: true}) course: Course;
|
||||||
|
|
||||||
@@ -30,6 +32,7 @@ export default class CourseScatter extends Vue
|
|||||||
// Map assignments
|
// Map assignments
|
||||||
let map = this.mapAssignments();
|
let map = this.mapAssignments();
|
||||||
|
|
||||||
|
// Scatter data point style
|
||||||
let itemStyle =
|
let itemStyle =
|
||||||
{
|
{
|
||||||
normal:
|
normal:
|
||||||
@@ -94,9 +97,13 @@ export default class CourseScatter extends Vue
|
|||||||
axisPointer:
|
axisPointer:
|
||||||
{
|
{
|
||||||
type: 'cross'
|
type: 'cross'
|
||||||
}
|
},
|
||||||
|
formatter: (ps: any[]) => ps[0].data[0] + '<br>' + ps.map(p =>
|
||||||
|
`${CourseScatter.DOT.replace('{color}', p.color)}
|
||||||
|
${FormatUtils.limit(p.data[2], 22)}: ${p.data[1]}%<br>`).join('')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Legend
|
||||||
legend:
|
legend:
|
||||||
{
|
{
|
||||||
bottom: 24,
|
bottom: 24,
|
||||||
@@ -152,6 +159,6 @@ export default class CourseScatter extends Vue
|
|||||||
private static assignmentsData(assignments: Assignment[])
|
private static assignmentsData(assignments: Assignment[])
|
||||||
{
|
{
|
||||||
return assignments.filter(a => a.complete == 'Complete')
|
return assignments.filter(a => a.complete == 'Complete')
|
||||||
.map(a => [FormatUtils.toChartDate(a.date), (a.score / a.scoreMax * 100).toFixed(2)]);
|
.map(a => [FormatUtils.toChartDate(a.date), (a.score / a.scoreMax * 100).toFixed(2), a.description]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ 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';
|
import {GPAUtils} from '@/utils/gpa-utils';
|
||||||
import Constants from '@/constants';
|
import Constants from '@/constants';
|
||||||
|
import {FormatUtils} from '@/utils/format-utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
})
|
})
|
||||||
@@ -40,7 +41,7 @@ export default class OverallBar extends Vue
|
|||||||
rotate: 90,
|
rotate: 90,
|
||||||
|
|
||||||
// Truncate text length
|
// Truncate text length
|
||||||
formatter: (value: string) => value.length <= 16 ? value : value.substr(0, 14) + '...'
|
formatter: (value: string) => FormatUtils.limit(value, 16)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -15,4 +15,15 @@ export class FormatUtils
|
|||||||
// Convert to yyyy-mm-dd
|
// Convert to yyyy-mm-dd
|
||||||
return moment(date).format('YYYY-MM-DD');
|
return moment(date).format('YYYY-MM-DD');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Limit string length
|
||||||
|
*
|
||||||
|
* @param str String
|
||||||
|
* @param length Max length
|
||||||
|
*/
|
||||||
|
static limit(str: string, length: number): string
|
||||||
|
{
|
||||||
|
return str.length <= length ? str : str.substr(0, length - 2) + '...'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user