-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graph zoom fix #137
Graph zoom fix #137
Conversation
views/user/authorized_index.ejs
Outdated
let allDates = []; | ||
for (let data of chartData) { | ||
if (data && data.assignmentDates) { | ||
allDates = allDates.concat(data.assignmentDates); | ||
} | ||
} | ||
allDates = allDates.map(dateStr => new Date(dateStr)); | ||
const earliestDate = new Date(Math.min(...allDates)); | ||
const latestDate = new Date(Math.max(...allDates)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to calculate these instead of using the startDate
and endDate
variables that exist in this scope? Also, use spaces not tabs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't use it cause there's like almost 5000 lines and I wasn't gonna read through all that so I never found those variables, but I can change it
views/user/authorized_index.ejs
Outdated
} | ||
}, limits: { | ||
xAxis: {min: earliestDate, max: latestDate}, | ||
yAxis: {min: 0, max: 100} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this react to extra credit that brings someone's grade above 100?
views/user/authorized_index.ejs
Outdated
xAxis: {min: earliestDate, max: latestDate}, | ||
yAxis: {min: 0, max: 100} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tabs should be spaces too
b8f7b7f
to
0f59d4d
Compare
The graph cannot be zoomed out farther than 0-100 on the y axis and the date of the first and last assignment for the x axis.
Also, suggestedMax was changed to 100 rather than 110 to fit into this zoom restriction.
Note: this is only for the main graph because I don't have any data for specific classes and I would rather not mess anything up, but rather do this first.