Skip to content

Conversation

@StephanTLavavej
Copy link
Member

Implement merged PR line smoothing

The comment in calculate_sliding_window() explains the rationale and technique. index.html explains the technique briefly.

Add bars to Monthly Merged PRs

  • 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.

Other changes

  • Handle deleted users by assuming that they were contributors. (We don't have any yet, but vcpkg did.)
  • weekly_table.js: 2020-08-07 update.
  • Update usernames_contributors.txt.
  • Regen daily_table.js, monthly_table.js.

Live preview: stephantlavavej.github.io/STL/

* `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.
@StephanTLavavej StephanTLavavej added the documentation Related to documentation or comments label Aug 9, 2020
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner August 9, 2020 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Related to documentation or comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants