Visualise your Habits based on DataViewJS in Obsidian
- Annotate the data you want to track in your daily notes (see Dataview annotation documentation)
- Create a DataviewJS block wherever you want the Habit Tracker to display.
- Collect the data you want to display using DataviewJS
- Pass the data into Habit Tracker using renderHabitTracker()
```dataviewjs
const weekData = {
year: 2022,
week: 25,
habits: [
{
colors: ["#c6e48b", "#49af5d"],
name: "iRacing",
entries: [
{
date: "2022-06-26",
value: 30
},
{
date: "2022-06-21",
value: 45
}
]
},
{
colors: ["#49af5d", "#c6e48b"],
name: "Language",
entries: [
{
date: "2022-06-23",
value: 30
}
]
}
]
}
renderHabitTracker(this.container, weekData)
```
- It currently only supports up to 7 habits.
This Plugin has been created on the foundation of the Heatmap Calendar by Richard Slettevoll
- Further clean up as per Request
- Removed settings references
- Make the EL and UL creation cleaner
- Remove conflict with Heatmap calendar due to same named css classses
- Fixed a bug where a value wasn't assigned to the right color
- Added tests for two core logic functions
- Added rollup for better file management
- Added the concept of intensities.
- Provide a value to the entity
- Provide multiple colors to map the values equidistant to the colors based on the min and max value
- initial release