Skip to content

Improve ranked play rating graph's x-axis divisions#37534

Open
IceDynamix wants to merge 5 commits intoppy:masterfrom
IceDynamix:rating-graph-div
Open

Improve ranked play rating graph's x-axis divisions#37534
IceDynamix wants to merge 5 commits intoppy:masterfrom
IceDynamix:rating-graph-div

Conversation

@IceDynamix
Copy link
Copy Markdown

@IceDynamix IceDynamix commented Apr 26, 2026

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
image

after
image

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

@IceDynamix IceDynamix marked this pull request as draft April 26, 2026 02:50
@IceDynamix IceDynamix marked this pull request as ready for review April 26, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant