cours/heatmaps.md
Oscar Plaisant a5521e7d1b update
2024-03-28 14:09:52 +01:00

1.4 KiB

up:: gestion title:: "my efforts shown as heatmaps" #pkm

dv.span("**Kung-fu**")
const calendarData = {
    showCurrentDayBorder: true, // (optional) defaults to true
    entries: [],                // (required) populated in the DataviewJS loop below
}

//DataviewJS loop
for (let page of dv.pages('"daily"').where(p => p.kung_fu)) {
    //dv.span("<br>" + page.file.name) // uncomment for troubleshooting
    calendarData.entries.push({
        date: page.file.name,     // (required) Format YYYY-MM-DD
        intensity: page.kung_fu, // (required) the data you want to track, will map color intensities automatically
        color: "dark_green",
    })
}

renderHeatmapCalendar(this.container, calendarData)
dv.span("**Spaced repetition :luc_repeat: 🧠**")
const calendarData = {
    showCurrentDayBorder: true, // (optional) defaults to true
    entries: [],                // (required) populated in the DataviewJS loop below
}

//DataviewJS loop
for (let page of dv.pages('"daily"').where(p => p.kung_fu)) {
    //dv.span("<br>" + page.file.name) // uncomment for troubleshooting
    calendarData.entries.push({
        date: page.file.name,     // (required) Format YYYY-MM-DD
        intensity: page.spaced_repetition, // (required) the data you want to track, will map color intensities automatically
        color: "dark_purple",
    })
}


renderHeatmapCalendar(this.container, calendarData)