Things I have tried
i am using this array to pull data into a couple different query’s at the moment. my heatmap calendar was working untill i decided to move mood into the array.
The array:
wellbeing:
mood: 2
mood-notes: terrible
Motivation: 4
motivation-notes: Had a lot to get finished
health: 3
health-notes: covid
pain: 4
pain-type: back and neck pain
“mood” used to be on its own in my YAML and the query worked just fine. not sure how i can get this working.
The query i had working before i added “mood” to the array under “wellbeing”:
dataviewjs
width: 100%
dv.span("")
const hue1 = 13 //red
const hue2 = 132 //green
const calendarData = {
intensityScaleStart: 1,
intensityScaleEnd: 10,
colors: { // optional, defaults to green
red2greenX21: [
`hsl(${hue1}, 100%, 37%)`, // 1 - darkest red (worst mood)
`hsl(${hue1}, 100%, 50%)`, // 2 -
`hsl(${hue1}, 100%, 60%)`, // 3 -
`hsl(${hue1}, 100%, 77%)`, // 4 - lightest red
`hsl(0, 0%, 80%)`, // 5 - gray (neutral mood)
`hsl(${hue2}, 59%, 24%)`, // 6 - lightest green
`hsl(${hue2}, 49%, 36%)`, // 7 -
`hsl(${hue2*0.85}, 43%, 56%)`, // 8 -
`hsl(${hue2*0.7}, 70%, 72%)`, // 9 - dark green
`hsl(${hue2*0.7}, 80%, 82%)`, // 10 - darkest green (best mood)
],
},
entries: [] // populated in the DataviewJS loop below
}
for(let page of dv.pages('"1. Notes/0. dailyNotes"').where(p=>p.wellbeing.mood)){
calendarData.entries.push({
date: page.file.name,
intensity: page.wellbeing.mood,
content: await dv.span(`[](${page.file.name})`), //for hover preview
})
}
renderHeatmapCalendar(this.container, calendarData)
The query when it was working and mood was on its own in the YAML
dataviewjs
width: 100%
dv.span("")
const hue1 = 13 //red
const hue2 = 132 //green
const calendarData = {
intensityScaleStart: 1,
intensityScaleEnd: 9,
colors: { // optional, defaults to green
red2greenX21: [
`hsl(${hue1}, 100%, 37%)`, // 1 - darkest red (worst mood)
`hsl(${hue1}, 100%, 50%)`, // 2 -
`hsl(${hue1}, 100%, 60%)`, // 3 -
`hsl(${hue1}, 100%, 77%)`, // 4 - lightest red
`hsl(0, 0%, 80%)`, // 5 - gray (neutral mood)
`hsl(${hue2}, 59%, 24%)`, // 6 - lightest green
`hsl(${hue2}, 49%, 36%)`, // 7 -
`hsl(${hue2*0.85}, 43%, 56%)`, // 8 -
`hsl(${hue2*0.7}, 70%, 72%)`, // 9 - darkest green (best mood)
],
},
entries: [] // populated in the DataviewJS loop below
}
for(let page of dv.pages('"1. Notes/0. dailyNotes"').where(p=>p.mood)){
calendarData.entries.push({
date: page.file.name,
intensity: page.mood,
content: await dv.span(`[](${page.file.name})`), //for hover preview
})
}
renderHeatmapCalendar(this.container, calendarData)
and the error im now getting :
VS. What it should look like.
Again, Any help would be greatly appreciated.