Describe the bug
My problem is that due to #24 the weekday output is sorted by sum, where as month and hour as sorted by their respective primary key.
In the case of hour this tends to show a nice bell curve, indicating where your peak work time is.
Where as the weekday, since the sort is by sum, it is always top heavy inverted triangle, and the "top" day may change between runs, causing you to have to inspect each line each time.
This is nice for finding what days get the max work in as its always at the top, but does not an as useful chart.
To Reproduce
Steps to reproduce the behavior:
- Run the 'commits per weekday' stat
- See the always top heavy graph.
- Run the 'commits per hour' stat.
- See the left column hours maintain their logical order, not sorted by sum ( and a likely bell curve of commit distribution)
Expected behavior
I would like the output of the weekday stat graph to be sorted by the day of the week, and not sum. With the precedent being the month graph is sorted by month (not sum) and per hour is sorted by hour (not sum)
Screenshots
I made a quick mockup to show what the effect of maintaining the day of week sorting would look like.
![weekday_with_mockup](https://user-images.githubusercontent.com/1438723/72948954-d77c0d80-3d54-11ea-9ded-c57ffd9da87b.png)
and the previously mentioned by-hour bell curve
![by_hour_bellcurve](https://user-images.githubusercontent.com/1438723/72949438-3f7f2380-3d56-11ea-9ec0-36fce18d4e87.png)
Desktop (please complete the following information):
- OS: MacOS Cataline 10.15.2
- Browser: Chrome 79
- Version: 2.0.12 (via brew)
Additional context
I could be entirely wrong, just armchair hypothesis:
I've taken a quick look at the code, and while my scripting is rusty and your code is awesome, I think the fix would be to drop the sort-by-sum post-sort
added in #24 and just prefill the count array with 0s as you iterate on the Mon-Tue-etc for loop, so that the order of the days is pre-established and not randomly filled in as they are found in the git log output which I believe to be the original root cause of the "random" order in 24.