update
This commit is contained in:
56
heatmaps.md
56
heatmaps.md
@@ -1,45 +1,29 @@
|
||||
up:: [[gestion]]
|
||||
title:: "my efforts shown as heatmaps"
|
||||
#pkm
|
||||
#s/PKM
|
||||
|
||||
```dataviewjs
|
||||
dv.span("**Kung-fu**")
|
||||
const calendarData = {
|
||||
showCurrentDayBorder: true, // (optional) defaults to true
|
||||
entries: [], // (required) populated in the DataviewJS loop below
|
||||
// Update this object
|
||||
const trackerData = {
|
||||
entries: [],
|
||||
separateMonths: true,
|
||||
heatmapTitle: "This is the title for your heatmap",
|
||||
heatmapSubtitle: "This is the subtitle for your heatmap. You can use it as a description.",
|
||||
}
|
||||
|
||||
//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",
|
||||
})
|
||||
// Path to the folder with notes
|
||||
const PATH_TO_YOUR_FOLDER = "daily";
|
||||
// Name of the parameter you want to see on this heatmap
|
||||
const PARAMETER_NAME = 'kung_fu';
|
||||
|
||||
// You need dataviewjs plugin to get information from your pages
|
||||
for(let page of dv.pages(`"${PATH_TO_YOUR_FOLDER}"`).where((p) => p[PARAMETER_NAME])){
|
||||
trackerData.entries.push({
|
||||
date: page.file.name,
|
||||
intensity: page[PARAMETER_NAME],
|
||||
content: await dv.span(`[](${page.file.name})`)
|
||||
});
|
||||
}
|
||||
|
||||
renderHeatmapCalendar(this.container, calendarData)
|
||||
renderHeatmapTracker(this.container, trackerData);
|
||||
```
|
||||
|
||||
```dataviewjs
|
||||
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)
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user