Skip to content
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

Lock zoom box #178

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open

Conversation

tatertotbot
Copy link

This change will prevent someone from zooming out into the abyss

tatertotbot and others added 2 commits January 25, 2024 00:25
This change will prevent someone from zooming out into the abyss
accidentally left this in
@tatertotbot
Copy link
Author

fixes #134

@@ -4364,6 +4375,14 @@
}
}
});
//sets the zoom and pan limits for the individual class graphs
charts[id+1].options.plugins.zoom.limits = {
xAxis: {min: minDate, max: maxDate},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you define minDate and maxDate anywhere in this function?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lines 4159 and 4160

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait nevermind I'll fix it

Copy link
Member

@jjoelj jjoelj Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lines 4159 and 4160

Those lines are in a different function and the variables appear to be implicitly declared, which is not good practice. If you intend for them to be global variables, you should explicitly declare them using let in the global scope.

Comment on lines +3890 to +3891
let maxDate = Infinity;
let minDate = Infinity;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These declarations are still only in the scope of renderOverviewChart(). Also, can you explain your rationale for initializing these to Infinity?

@jjoelj jjoelj deleted the branch graderoom:development March 14, 2024 14:46
@jjoelj jjoelj closed this Mar 14, 2024
@jjoelj jjoelj reopened this Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants