zoreet / habit-tracker Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Would it be possible, or of interest, to add a number somewhere that shows how long each habit's streak has been kept alive?
Hi, I'm trying to compile habit-tracker from a cloned repository, in order to possibly create a PR related to the style settings, but I only get errors.
Neither npm run build
nor npm run dev
manages to create a new main.js
. What do you use to compile your plugin?
Hi! Not so much an issue as 2 quick questions, if that is alright.
Any idea what might be causing it/how to remove it?
If you need any more details on the items above, just let me know. Thanks in advance for any help! :)
Thank you for creating Hobby Tracker.
I only read the readme, so I don't know how it works.
What do you mean by creating a directory for each hobby and then creating an empty file?
Could you please explain if you create one for each day and how it shows up in the date table?
It seems like creating notes by date in a directory by hobby would create too many files, is this correct?
It would be nice to adjust the number of days displayed. This would be nice to show a full month or more.
I would suggest making it an option in the codeblock so it's easy to changed depending on where it's being used.
{
"path": "Habits/",
"days": "31"
}
I'm just thinking if I keep adding habits the list could be long, and if I at some point in time decides to change my habit it would be nice to end the tracking of that habit.
It shouldn't be too hard to implement either, as you could just add a start-date
and end-date
into the habit file, and only include if the current date range displayed matches those dates. You wouldn't need to, but you could even mark it somehow in the table, that this habit started/ended at a given date (if that date is within the currently displayed range).
I'm thinking that doing this in combination with me adding the tracker into my daily notes with an end date of the day of the daily note, would be useful as I like to shift my focus every now and then on what I want to track and build a habit towards. If it's not implemented, the display for someone like me (shifting habits to track somewhat often) would fast be cluttered with habits I'm not interested in, or which are so second nature to me that it's not needed to track them anymore).
The plugin doesn't show the habits if I put them in the following directory/folder:
"path": "2 Areas/habits/"
It does work for the following folders:
Hi here!
First of all, I love this plugin and the simplicity of creating a tracker based on folder structure. Thanks for making this!
I'm currently rendering the habit tracker in a template for my daily journaling and was wondering how, or if it's possible to use a relative date function as the input for lastDisplayedDate
?
Say I open a file today, 21 days from now the final cell would be the 26th.
But if I open a file tomorrow, 21 days from then should be the 28th. But because lastDisplayedDate
is set to a static date in my templates, each daily file has the same end date. Here's what it looks like when I don't provide lastDisplayedDate
and try using the default "Today". The first day on the tracker starts on the 15th of last month and ends on today, instead of starting on today and ending 21 days from now.
Is that possible, or that outside the scope of the plugin?
Not just a fixed end date.
really love the plugin but the tracking pixel is completely unneccessary - not even sure what use that data would be to you - please remove or at least be transparent that your collecting data -
const trackingPixel = document.createElement("img");
trackingPixel.setAttribute("src", "https://bit.ly/habitttracker21-140");
el.parentElement.appendChild(trackingPixel);
new HabitTracker(src, el, ctx, this.app);
What a great idea for a habit tracker and nicely implemented. It would be very useful to have also the ability to add comments to each day marked and this automatically added to the habit file so that mousing over a day marked in the calendar will have a popup with that note
DEFAULT_SETTINGS.lastDisplayedDate
is set when the plugin loads. By default its todays date via the getTodayDate
function which is sensible default behaviour.
If you leave Obsidian open across days and leave this default behaviour then the chart is never updated to reflect the current date - you have to restart Obsidian to have it update.
DEFAULT_SETTINGS should perhaps be replaced with a getDefaultSettings
function so that the value for lastDisplayedDate is re-evaluated each time its used by the loadSettings method?
Track how many people are on the latest version
Track each time a habit tracker is rendered
After upgrading to v1.1.2
"lastDisplayedDate": "2023-12-28" - If I put this sentence in, I get an error
Codeblocks without this sentence will work fine.
Under console error message
Uncaught (in promise) SyntaxError: Expected ',' or '}' after property value in JSON at position 22
at JSON.parse ()
at new HabitTracker (plugin:habit-tracker-21:56:31)
at eval (plugin:habit-tracker-21:247:9)
at t.initDOM (app.js:1:1539674)
at t.toDOM (app.js:1:1141789)
at t.sync (app.js:1:351034)
at e.sync (app.js:1:332767)
at app.js:1:373556
at e.ignore (app.js:1:452767)
at t.updateInner (app.js:1:373338)
at t.update (app.js:1:373093)
at e.update (app.js:1:461415)
at e.dispatchTransactions (app.js:1:458098)
at e.dispatch (app.js:1:459981)
at r (app.js:1:1558455)
at run (app.js:1:1558678)
One of the reasons I love this approach is that information for my habit is contained within the document that contains the property list.
So, clicking on the habit name and opening the document would be very intuitive.
By the way, it would also be great to have the count directly after the name of the habit, in parentheses
Originally posted by @xelaras in #3 (comment)
First of all, thank you for creating this very elegant plugin (when it works).
It's the lightest, lowest-friction and, IMO most outcome-focused take on habit tracking I've seen to date, in or outside of Obsidian.
However, as of today it's completely failing for me:
This is my Habit Tracker code block in my daily note template:
{
"path": "system/Habit Tracker 21",
"lastDisplayedDate": "2024-04-15"
}
But I'm not seeing my recent completed habit boxes and the "current month" displayed ends at 30, when March has 31 days.
Screenshot here:
This looks like a very nice plugin. However, I could not setup and use the plugin based on the instructions found on the README. Can you please provide detailed instructions on how to add the days for each habit?
So far, I have done the following:
Also, I recentely started using the Obsidian.
I've been thinking about how it'll look when you've tracked your progress for some time, with how many rows you'll get in the entries
property of a given habit. Today it occurred to me that this could be drastically used by switching the format slightly, and start using binary numbers for tracking if a habit has been done in a given month.
The gist of the idea is that you store one 32-bit number for each month you're tracking, where each bit corresponds to whether you've done it that particular day. I don't know if you know binary numbers, but the first 7 numbers are; 000 = 0, 001 = 1, 010 = 2, 011 = 3, 100 = 4, 101 = 5, 110 = 6 and 111 = 7. In our interpretation we'd store 7, aka 111, to indicate that we've done the habit the first three days of the month. If we didn't do it the second day we'd store 5, aka 101.
The actual setting/handling of the binary numbers can be easily done using bitwise operators, and this would mean that a given month could be stored in a single number. The only thing to decide then would be which of the following format would be most beneficial:
entries:
- 2024-02: 123098
- 2024-03: 65535
entries-2024-02: 123098
entries-2024-03: 65535
The main difference between these two is how they'll look natively with Obsidian:
Where the former is just going to be a data/json block, and the second variant will show the months and some seemingly random number after it.
Do this sound interesting? Do you want me to do a pull request implementing this? If so, which format would you like, and how do you suggest we tackle old data?
Instead of going to the folder and manually creating a new file, this button would create a new file for the habit from the UI. And if the folder doesn't exist, it could even create it for the user.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.