Improve ranked play rating graph's x-axis divisions#37534
Open
IceDynamix wants to merge 5 commits intoppy:masterfrom
Open
Improve ranked play rating graph's x-axis divisions#37534IceDynamix wants to merge 5 commits intoppy:masterfrom
IceDynamix wants to merge 5 commits intoppy:masterfrom
Conversation
and align x-axis divisions with factor
…gned to the divisions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the x axis division was set to a fixed number of steps rather than picking a neat step size, which created uneven numbers. this pr changes this so an appropriate factor is determined, the x-axis min/max is floor'd/ceil'd to that factor and the divisions are created based on that factor. the cumulative rating line also extends to the new end of the graph.
in addition, the bars of the bar chart are now aligned using the left edge of the bar rather than the center. in the after-image, note how the left edge of the bar for 1600 rating aligns with the division. (this is based on the assumption that a rating bucket, say "1500", spans the interval [1500, 1600]. if the bucket spans [1450, 1550] instead, i will revert the change)
before

after

could optimize the while loop into a single mathematical expression, but this is easier to read imo. lmk if you'd prefer the expression instead