Giter VIP home page Giter VIP logo

habit-tracker's People

Contributors

holroy avatar middric avatar vzinculescu avatar zoreet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

habit-tracker's Issues

Single ticks not showing

I'm tracking the days I'm met my walking goal, but it doesn't show that I've met the goal on the 2024-03-08. The corresponding entries from that goal are as follows:

image

But in my daily notes it displays as:

image

It would be nice if just a single day also showed. :-D

Trying to compile it, but it fails?!

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?

Spacing after habit and limit days displayed

Hi! Not so much an issue as 2 quick questions, if that is alright.

  1. My listed habits are displaying a large space after:

image

Any idea what might be causing it/how to remove it?

  1. Is there a way to limit the number of days displayed? Say, display only the current week, rather than the last 21 days?

If you need any more details on the items above, just let me know. Thanks in advance for any help! :)

Could you please explain if you create one for each day and how it shows up in the date table?

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?

Adjust the number of days shown

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"
}

Set start and/or end dates for habits

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).

Habits in folder with number in name

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:

  • "Areas/habits/"
  • "Two Areas/habits/"

Provide a relative date function for lastDisplayDate

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.

image

Is that possible, or that outside the scope of the plugin?

Tracker Pixel ????!

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);

[Feature request ] Option to add notes to entries

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

Obsidian must be restarted to update "today"

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?

Add tracking

Track how many people are on the latest version
Track each time a habit tracker is rendered

"lastDisplayedDate" If I put this sentence in, I get an error

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)

Ignore File/Folder

I use folder notes plugin which would be convenient for this plugin because the code block could be attached to the folder note but instead it recognizes it as a habit itself:

image

If we can specify files to ignore that would be a big help to get started.

Adjusting CSS

I think it would be fantastic to be able to adjust some CSS.

image

For example

  • max-width of the overall graph
  • lines between cells
  • font size

This could be done as a plugin setting or using the "Style Settings" plugin that many others take advantage of.

Bug: Wrong data being displayed

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:

image

Improve README - Instructions to setup the plugin

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:

  • Installed and enabled the plugin
  • Created the Habit folder
  • Created Habit/habit1.md and Habit/habit2.md
  • Created a md file in the root folder with the provided code block.

Also, I recentely started using the Obsidian.

Reduce space requirements for the entries property

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:
image

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?

Add a "+ New habit" button

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.