Add Yearly Activity Heatmap to Stats Page#604
Add Yearly Activity Heatmap to Stats Page#604rdearman wants to merge 6 commits intoLuteOrg:masterfrom
Conversation
|
Hi @rdearman - sorry for the delay in responding. Thanks for the PR! A heatmap based on word status dates will be misleading, so I think it should be based on words read instead (which is the e.g., if I created a bunch of status 1 words yesterday while reading, but today I read more and don't create or update any new words, a heatmap based on word status dates would only show the items from the prior day, even though I read a bunch today. Another example: if I read 10 new words last week, and then updated their statuses again this week, the heatmap would only show the entries for this week, and nothing for last week. I think that to do a word-status-based heatmap correctly, Lute would need to track the status history of words, and not just track the current status. The idea of tracking status history was mentioned in issue "Add word stats breakdown", and then maybe this work could be combined with that. Thoughts? Cheers and thanks again for taking the time with this submission! |
|
I looked at that. But I am looking at it more like an anki heat map which would show me that I have consistently been using it every day. The problem with words read is that it is only updated when you move to the next page. For me learning Korean I am only reading about 3 sentences a week and it is going to take ages before wordsread gets updated. So while perhaps more accurate it is less motivating. I did consider putting in an activity table and creating a trigger to show when you were active on that day. Might need to rethink it. |
This PR introduces a yearly activity heatmap to the /stats page. It visualises user activity over the current year (e.g., 2025), based on the number of WoStatusChanged updates per day.
Features:
Visual heatmap using a calendar-style layout (similar to AnkiDroid)
Data is pulled from the existing words table, using WoStatusChanged dates
Only shows activity for the current calendar year, dynamically updated
Displays in UTC to ensure consistent date mapping across timezones
Includes a legend showing activity intensity levels
Notes:
Existing stats functionality is untouched (original /stats/data logic remains)
Heatmap rendering and endpoint are fully self-contained
Let me know if you'd like any changes or enhancements!