Calendar feature request: increase color intensity based on streak
Great plugin.
Feature request: color circles on calendar with increasing intensity based on streak length.
I want to show single days in a light color, and the longest streak should stand out immediately through its intensified color.
Thanks.
@lazyguru I'm ready to take this up.
- Do you think the increase in intensity based on streak should be a default setting?
- Or should this be allowed via a new parameter lets say - "colorIntensityByStreak"?
I believe we don't need any other parameters except that to implement this feature. Correct me if you don't think that is the case
I think you just have a single parameter for the color. If the user provides say "blue" then there is no intensity (existing behavior). If the user provides a hex or rgb (I forget exactly what we support) AND the color is a light enough shade to support intensity, then support it
Okay, so We're saying that this is going to be a default behavior if the color is light enough to support intensity. Correct?
Or do we only support it when the color is entered as hex(This is what we support) and is light enough only?
Yes, only support for hex. If I enter "blue" that could mean quite a few things. Whereas if I enter 0000ff you can adjust that for intensity.
Unless... by intensity we are actually talking about opacity? In which case a separate parameter makes sense
I feel we could do either one of opacity or intensity to achieve color by streak, just depends on what we pick. I just observed from the codebase that we already do something similar in colorCirclebyValue usecase. I felt we could use the same intensity logic here. It colors the day by the value of the measured dataset on that day, Here's an example of it.
Also it can be observed that even in the case color was "green", the feature is working the same.
let scaledColor = d3.interpolateLab( "white", circleColor )(d.scaledValue * 0.8 + 0.2);
This was how they were achieveing the different shades of a color. Interpolatelab comes up with smooth color transitions is what I've read
Yeah, that could work. I think we add a new field like circleColorByStreak: true/false to mimic the circleColorByValue setup then
Midway developing this feature I realised that we are rendering days of the current month independently i.e while the current month days are being rendered it doesn't have any information about the previous months or the next months data.
So I need a suggestion on which path aligns with the plugin's usecase better!
-
Keep things simple — each month only knows about itself. So when rendering the 1st of a month, the streak always starts fresh from 1. The last day of the month might show a streak of 28 to 31. If the user moves to a different month, the streak resets there too. It doesn’t “continue” across months.
-
Let the calendar look at data from previous months too, so it can show the exact streak on any day. For example, if someone’s streak started 90 days ago, that number will continue into the new month. But this means fetching and recalculating data again when the user switches months, refreshes the page, or reopens Obsidian.
-
Use a streak cap — for example, once a streak hits 15, 30, or 50 days, the color intensity stays the same after that. This way, we only need to look one month back to check whether the cap has been hit. It keeps the streak feeling “continuous” across months without needing too much data or calculation. This is the approach I recommend!
If we go with the last approach, I’d appreciate your thoughts on what a good cap might be.
I think option 3 is the best. I would say the cap should be 28 days (simplifies dealing with February and comes out to a nice even 4 weeks)