Closed tedblizzard100 closed 2 years ago
Dear @tedblizzard100 , good morning/afternoon/evening. I just faced the same situation here in my vault and I was able to solve the problem with some tricky Javascript. I'll share only the important part:
let groups = dv.pages().where(YOUR_FILTERS).groupBy(DATE_GROUPING_CLAUSE);
let max = Math.max.apply(Math, groups.map(function(o) { return o.rows.length; })); // calculates the maximum number of notes on a single day
for (let group of groups) {
calendarData.entries.push({
date: group.key, // (required) Format YYYY-MM-DD
intensity: (120 * group.rows.length / max), // (required) the data you want to track, will map color intensities automatically
// the line above normalizes the amount of notes throughout the heatmap
content: group.rows.length, // (optional) Add text to the date cell - I USED HERE THE NUMBER OF NOTES
color: "blue", // (optional) Reference from *calendarData.colors*. If no color is supplied; colors[0] is used
})
}
I hope this helps!
Thank you so much @agnoldo I appreciate your help and will dig into this code.
Thank you so much for this work. I love using your heatmaps. One question I had is there a way to ADD up multiple entries. For example, if you are doing something more than once a day (like eating or even writing). I keep a sepreate daily log file by time for each day. I added a Nutrution heatmap (see below) but I want to add all entrest on one day together. Thank you for your help.