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

Use adaptive buckets for the submission graph #2944

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

Kevinjil
Copy link
Contributor

@Kevinjil Kevinjil commented Mar 2, 2025

We determine a suitable unit based on the contest length and some min/max bucket bounds. We convert all submission times in seconds to this unit and determine nice locations to put ticks on the x-axis.

Scaling for e.g. 1-year contest:
image

Fixes #2934

Copy link

github-actions bot commented Mar 2, 2025

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 9619722. ± Comparison against base commit 6209e3c.

♻️ This comment has been updated with latest results.

// We want whole values in the unit, and the ticks MUST match a corresponding bucket otherwise the resulting
// coordinate will be NaN.
const convert_factor = seconds_per_bucket / unit.convert;
const maxTicks = Math.min(bucket_count, contest_duration / unit.step, 31)
Copy link
Member

Choose a reason for hiding this comment

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

Where does this 31 come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea was to limit the max number of ticks shown to some reasonable number. Changed it to the minimum bucket count as it looks pleasant.

We determine a suitable unit based on the contest length and some min/max bucket bounds. We convert all submission times in seconds to this unit and determine nice locations to put ticks on the x-axis.
@Kevinjil Kevinjil force-pushed the feature/analysis-buckets branch from f7a3276 to 9619722 Compare March 2, 2025 15:37
@Kevinjil Kevinjil enabled auto-merge March 2, 2025 15:42
@Kevinjil Kevinjil added this pull request to the merge queue Mar 2, 2025
Merged via the queue into DOMjudge:main with commit 31344ad Mar 2, 2025
37 checks passed
@Kevinjil Kevinjil deleted the feature/analysis-buckets branch March 2, 2025 16:05
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.

Limit bucket count for submission graph
3 participants