Status Chart: Merged PR line smoothing and bar chart - #1170
Merged
Stephan T. Lavavej (StephanTLavavej) merged 7 commits intoAug 10, 2020
Merged
Stephan T. Lavavej (StephanTLavavej) merged 7 commits into
Stephan T. Lavavej (StephanTLavavej) merged 7 commits into
Conversation
* `gather_stats.js` + Extract `write_generated_file()`. + Implement `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. + The `monthly_table` records complete months, so 2019-10 is the first month, and 2020-07 is currently the last month. + Because the chart is now a daily-line/monthly-bar combo, the bars need to be given specific dates. I'm positioning them at the 16th of each month (approximately the middle). + I'm using `merge_bar` as the key, to avoid confusion with `merged` in the `daily_table`. * `index.html` + Load `monthly_table.js`. + Rename the line to 'Line: Sliding Window'. + Add the dataset for the bars. All we need to do is mark it as `type: 'bar'`. + I'm setting `borderWidth: 1` because I think it looks nice. + In the x-axis used for all charts, set an explicit `max` date (to the final value in the `daily_table`). This is necessary because the bar chart ends earlier - e.g. currently its final date is 2020-07-16. Without an explicit `max`, 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 explicit `max`, the x-axis remains unchanged when hiding the line. + Display the legend for the mergeChart, now that we have 2 datasets. + Update and clarify the Explanation.
Stephan T. Lavavej (StephanTLavavej)
requested a review
from a team
as a code owner
August 9, 2020 07:43
Billy O'Neal (BillyONeal)
approved these changes
Aug 10, 2020
Curtis J Bezault (cbezault)
approved these changes
Aug 10, 2020
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.
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/