Status Chart: Merged PR line smoothing and bar chart #1170
Merged
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.
Implement merged PR line smoothing
The comment in
calculate_sliding_window()explains the rationale and technique.index.htmlexplains the technique briefly.Add bars to Monthly Merged PRs
gather_stats.jswrite_generated_file().write_monthly_table(). This is very fast (and doesn't need a progress bar) because it iterates through each PR and increments values in a map indexed by year-month.monthly_tablerecords complete months, so 2019-10 is the first month, and 2020-07 is currently the last month.merge_baras the key, to avoid confusion withmergedin thedaily_table.index.htmlmonthly_table.js.type: 'bar'.borderWidth: 1because I think it looks nice.maxdate (to the final value in thedaily_table). This is necessary because the bar chart ends earlier - e.g. currently its final date is 2020-07-16. Without an explicitmax, hiding the line causes the chart to readjust the x-axis to end when the bars end, at 2020-07-16. This is confusing, and cuts off half of the final bar. With an explicitmax, the x-axis remains unchanged when hiding the line.Other changes
weekly_table.js: 2020-08-07 update.usernames_contributors.txt.daily_table.js,monthly_table.js.Live preview: stephantlavavej.github.io/STL/