Add Yearly Activity Heatmap to Stats Page -- INCOMPLETE#604
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. |
|
(Apologies for the delay in responding, I've had some vision issues, detail here) Hi again @rdearman , hope all is well. There's been a recent "reading streak" PR which might address some of what you want, maybe. Check out #668 and #669 . |
|
Following up: I do like the heatmap idea, but to base it on word status alone won't be sufficiently accurate, and since the "page read" doesn't work for you, we're kind of at a loss on how to proceed. For this to have the complete picture that you need, we need to track the "word status history" as well (ref #178), and then combine this with the "page read" somehow, as that really is what the activity is. I'm marking the PR as "incomplete" so that someone can come and finish it if they want, including the status history mentioned above. I won't push for this PR to be finished and merged. This PR is a good base, and hopefully someone will be motivated. Cheers and thanks! |
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!