Richardsl / heatmap-calendar-obsidian

An Obsidian plugin for displaying data in a calendar similar to the github activity calendar
Apache License 2.0
614 stars 102 forks source link

Not showing cell with nested frontmatter #86

Open fufuShih opened 1 year ago

fufuShih commented 1 year ago

I tried to use nested frontmatter to made heatmap, but the cell not showing

Following is my preview: image

My frontmatter is:

---
date: 2023-07-04
week: 2023-W27
year: 2023
exercise: 25 min
tracks:
  mediator: true
---

My dataview is:

dv.span(`** Meditation **`) /* optional βΉοΈπŸ’€βš‘βš πŸ§©β†‘β†“β³πŸ“”πŸ’ΎπŸ“πŸ“πŸ”„πŸ“πŸ”€βŒ¨οΈπŸ•ΈοΈπŸ“…πŸ”βœ¨ */
const calendarData = {
    year: "2023",  // (optional) defaults to current year
    colors: {
        white: ["#fff","#fff","#fff","#fff","#fff"],
    },
    entries: [],                // (required) populated in the DataviewJS loop below
}

for (let page of dv.pages('"0.Project/Personal/Daily"').where(p => p.tracks)) {
    if(page.tracks.mediator) {
        calendarData.entries.push({
            date: page.file.name,  
            content: await dv.span(`[πŸ”—](${page.file.name})`)
        })
        console.log(calendarData)
    }
}

renderHeatmapCalendar(this.container, calendarData)
dv.span("**πŸ‹οΈ Exercise πŸ‹οΈ**")

const calendarData = {
    year: 2023,
    colors: {
        red: ["#ff9e82","#ff7b55","#ff4d1a","#e73400","#bd2a00",]
    },
    entries: []
}

for(let page of dv.pages('"0.Project/Personal/Daily"').where(p=>p.exercise)){
    calendarData.entries.push({
        date: page.file.name,
        intensity: page.exercise
    })

}

renderHeatmapCalendar(this.container, calendarData)

And in Console, it has entries but cell not showing. So how can I solve it image