Skip to content

Overview - Obsidian Research ๐Ÿชจ

Description

Adding heatmap calendar to my obsidian set up to to give me annual/year in review style stats/heatmaps

Dan's Blog ๐Ÿ“ - take notes for this! potentially great post!

Notes

SCRIPTS!

PUBLIC OPEN SOURCE PROJECT / TUTORIAL - https://github.com/dan1229/ai-file-analyzer

REPO - https://github.com/dan1229/dans-notes-analyzer

Heatmap Calendar Plugin

github - heatmap calendar

things to figure out: - how many days I worked out and how many times - count bullets and sub bullets - did habits like duolingo, scalp massage, etc. - in 2024 Long Term TODO ๐Ÿ“† - which months were busiest / had most bullets - which tasks had most sub bullets - i.e., details?

gonna try with what should be a simple/useful one - daily workouts! - curious how this stacks up to my apple watch stats...

  1. add metadata to page - specifically daily notes template
    simple in-line metadata:
    (longKeyIDontNeedWhenReading:: key).
    
    how to attach to a workout?
  2. TODO

  3. create query to get it

    TABLE
        WITH completed_dates AS (
            SELECT file.name, JSON_EXTRACT(file.content, '$.tasks[*].content') AS tasks
            FROM file
            WHERE file.extension = 'md'
        )
        SELECT count(*), tasks
        FROM completed_dates
        WHERE JSON_EXTRACT_ARRAY_LENGTH(tasks, '$[*].children[*].checked') > 0
    

  4. Create dataview block:

    dv.span("** ๐Ÿ˜Š Title  ๐Ÿ˜ฅ**") /* optional โน๏ธ๐Ÿ’คโšกโš ๐Ÿงฉโ†‘โ†“โณ๐Ÿ“”๐Ÿ’พ๐Ÿ“๐Ÿ“๐Ÿ”„๐Ÿ“๐Ÿ”€โŒจ๏ธ๐Ÿ•ธ๏ธ๐Ÿ“…๐Ÿ”โœจ */
    const calendarData = {
        year: 2022,  // (optional) defaults to current year
        colors: {    // (optional) defaults to green
            blue:        ["#8cb9ff", "#69a3ff", "#428bff", "#1872ff", "#0058e2"], // first entry is considered default if supplied
            green:       ["#c6e48b", "#7bc96f", "#49af5d", "#2e8840", "#196127"],
            red:         ["#ff9e82", "#ff7b55", "#ff4d1a", "#e73400", "#bd2a00"],
            orange:      ["#ffa244", "#fd7f00", "#dd6f00", "#bf6000", "#9b4e00"],
            pink:        ["#ff96cb", "#ff70b8", "#ff3a9d", "#ee0077", "#c30062"],
            orangeToRed: ["#ffdf04", "#ffbe04", "#ff9a03", "#ff6d02", "#ff2c01"]
        },
        showCurrentDayBorder: true, // (optional) defaults to true
        defaultEntryIntensity: 4,   // (optional) defaults to 4
        intensityScaleStart: 10,    // (optional) defaults to lowest value passed to entries.intensity
        intensityScaleEnd: 100,     // (optional) defaults to highest value passed to entries.intensity
        entries: [],                // (required) populated in the DataviewJS loop below
    }
    
    //DataviewJS loop
    for (let page of dv.pages('"daily notes"').where(p => p.exercise)) {
        //dv.span("<br>" + page.file.name) // uncomment for troubleshooting
        calendarData.entries.push({
            date: page.file.name,     // (required) Format YYYY-MM-DD
            intensity: page.exercise, // (required) the data you want to track, will map color intensities automatically
            content: "๐Ÿ‹๏ธ",           // (optional) Add text to the date cell
            color: "orange",          // (optional) Reference from *calendarData.colors*. If no color is supplied; colors[0] is used
        })
    }
    
    renderHeatmapCalendar(this.container, calendarData)
    

  5. CLEANUP

  6. update upcoming todos
  7. update template itself
  8. update previous todos from this year?

Other ideas/heatmaps?

  • journaling?
  • hebrew?
  • massaging head?
  • plants?
  • anything recurring lol

Tags

obsidian #notes #weekly #daily #todo #post #blog #blogpost #research #heatmap #heat #map #stats #statistics #annual #review #yearinreview #year #yearly

publish-me