The Vault Size History plugin enables Obsidian users to visualize the growth of their vault by displaying a graph that tracks the number of files over time. It allows customization of file categories, enabling users to group files by folders, patterns, or regular expressions for more detailed insights. Users can toggle visibility of specific file categories on the graph, adjust date formats, and define exclusive or inclusive categories for precise analysis. This plugin is ideal for users looking to monitor changes in their vault structure and content over time.
Implemented automatic file index to support the following use cases:
Use case 1:
Your Vault is being synchronized between devices and file creation dates are reset during the sync. You would like to build graph based on the original file creation dates.
Solution: the plugin will note the original file creation date in an index file so that even if file properties are going to be reset, the plugin would use the index when building graph.
Use case 2:
You would like to manually override creation dates for files in your Vault.
Solution: the index CSV file allows to protect dates from automated updates.
This Obsidian plugin enables users to visualize the historical growth of your vault by displaying a graph that tracks the number of files over time
Use the Vault Size History button in Ribbon bar to display the graph.
Graph Legend allows to hide/show graphs for different categories of the files. The categories can be configured in the settings.
By clicking on a line name in the legend, you can hide/show the line.
It is possible to change the display format of the dates.
Examples of supported formats:
This setting controls the order in which line titles are displayed. It allows you to choose how the legend entries are organized based on the chart values.
The two options available are:
Ascending Value: In this option, the legend entries are sorted so that the lines with the lowest chart values appear first. This means that as you read the legend from left to right, the values represented by each line increase.
Descending Value: In this option, the legend entries are sorted so that the lines with the highest chart values appear first. This means that as you read the legend from left to right, the values represented by each line decrease.
File categories section allows to define custom groups of files based on filters. Each category is rendered as a separate line on the graph.
Each category has name
which is displayed in the legend of the graph.
Category pattern
field is used to define filter to match files against.
Plugin takes full path to a file within Vault when checking the criterion.
Currently supported types of filters are:
:in:[Folder Name 1:Folder Name 2:Folder Name 3]
and the plugin will count files in these folders.:not_in:[Folder Name 1:Folder Name 2:Folder Name 3]
and the plugin will count files that are not in these folders.:regex:
. The plugin applies the expression to the full path to the file, which allows to specify criteria based on folder name, file name or file extension.There are two types of categories.
The first matching filter from this list will be used to categorize a file. If a file matches multiple criteria, it will only be counted under the first applicable filter
(topmost). Use grabbing area on the left side of the list to reorder filters.
A file will be counted under every filter it matches. Order of items in this list does not affect numbers you will see in the graph.
Let's say there is a number of files in different folders of the Vault. One of the root folders is called Periodic Notes
.
The exclusive list of categories is defined as following:
Periodic Notes
(this will count all files in the Periodic Notes folder):regex:.*\.(md)$
(this will count all Notes not matching the first filter):regex:.*$
(this will count all files in the Vault not matching first two filters)If Other Files filter was the only filter in the list, it would display total number of files in the Vault. But being part of exclusive list in the last place, it will only show a subset of files that do not match other filters from this list.
So what if we want to show the total number of files along with categories defined above?
This is done using inclusive list. We can use the same filter when specifying a new category in this list:
:regex:.*$
This configuration gives us the desired four lines on the graph:
In this example the numbers from the first three categories stack together to cover all files in the vault also represented by fourth category:
Periodic Notes + Other Notes + Other Files = 29 + 75 + 254 = 358
All Files = 358
The graph start setting allows to choose what data should define the left (start) date of the graph. Any or none of the categories can be used.
This is helpful, if the Vault includes very old non-MD files (like attachments), but you want to track the history from the first note.
Example: on 1/31/2021 the first note had been created, but Vault has 5 attachments from 2008 year. If no setting is specified, the graph will show the lines starting in 2008. If the setting is set to an MD file category, then the graph will start on 1/31/2021, but the graph of non-MD files will have initial value of 5 (all files that had been created before graph start date).
Use this button to reset the list of categories to the default.
This group of settings allows to control how the plugin should identify file creation dates for the files in the Vault.
By default, the plugin uses file creation date defined by the system. As per issue #5, system information might not be reliable due to different reasons like file sync/copy when the file is considered recreated.
There are two advanced ways to define file creation dates:
If both settings are configured, the Date property takes precedence over index file (for Notes i.e. MD files):
Frontmatter Property (for Notes) > Automated CSV Index file > System file metadata
The Date property
setting accepts a frontmatter property name to be used to parse the date from.
Date property
field's value is parsed to a valid Date using the format defined in the Date property format
.
It is empty by default and the parsing will not work until the format is defined.
The plugin uses the Moment.JS
library which is available in Obsidian to work with the dates. Please refer to the library documentation for the full list of supported formats.
YYYY-MM-DD HH:mm:ss
- 2023-01-31 15:04:49
MM/DD/YY hh:mm:ssA
- 10/31/2020 03:04:49PM
Placeholder | Time fraction |
---|---|
YYYY |
4-digit year |
YY |
2-digit year |
MMMM |
Full month name (e.g., January) |
MMM |
Abbreviated month name (e.g., Jan) |
MM |
2-digit month (e.g., 01) |
M |
Month number (e.g., 1) |
DD |
2-digit day of the month (e.g., 01) |
D |
Day of the month (e.g., 1) |
dddd |
Full name of the day (e.g., Monday) |
ddd |
Abbreviated name of the day (e.g., Mon) |
dd |
Minimized name of the day (e.g., Mo) |
HH |
2-digit hour in 24-hour format (e.g., 14) |
H |
Hour in 24-hour format (e.g., 14) |
hh |
2-digit hour in 12-hour format (e.g., 02) |
h |
Hour in 12-hour format (e.g., 2) |
mm |
2-digit minute (e.g., 05) |
m |
Minute (e.g., 5) |
ss |
2-digit second (e.g., 09) |
s |
Second (e.g., 9) |
A |
AM/PM |
a |
am/pm |
Z |
Timezone offset (e.g., +05:00) |
ZZ |
Timezone offset without colon (e.g., +0500) |
Use case 1:
Your Vault is being synchronized between devices and file creation dates are reset during the sync. You would like to build graph based on the original file creation dates.
Solution: the plugin will note the original file creation date in an index file so that even if file properties are going to be reset, the plugin would use the index when building graph.
Use case 2:
You would like to manually override creation dates for files in your Vault.
Solution: the index CSV file allows to protect dates from automated updates.
Enable file index using checkbox and define path to the index file under "File creation date index" setting to activate tracking of the file metadata in a CSV index file.
The plugin scans the Vault every 5 minutes and updates the CSV file (if the feature is enabled).
When the index is enabled, the graph will take the dates from the index file unless in-note frontmatter propery setting is activated (for Notes).
During the scan, the plugin compares creation date of the files with the values in the index file. If system file creation date is earlier than the one in the index file AND the index file does NOT have 'TRUE' in the Protect Date
column, then the plugin will update the file.
If you want to use the index and manually set creation dates for some of the files, set the Protect Date
column to TRUE
for those files.
Example 1:
User set file creation date as 2024-01-23 and setProtect Date
toTRUE
. Current system file creation date is 2023-11-20.
Since theProtect Date
is set to TRUE, the plugin will keep the date provided by the user in the CSV file.
Example 2:
User set file creation date as 2024-01-23 and setProtect Date
toFALSE
. Current system file creation date is 2023-11-20.
Since theProtect Date
is NOT set to TRUE and actual file creation date is earlier than the one in the CSV file, the plugin will override the date provided by the user in the CSV file during the next scan.
Example 3:
User set file creation date as 2020-11-01 and setProtect Date
toFALSE
. Current system file creation date is 2023-11-20.
Since actual file creation date is later than the one in the CSV file, the plugin will keep the date provided by the user in the CSV file (2020-11-01).
Made some changes to the index file of its configuration? Click this button to refresh the index and skip automatic 5 minutes delay.
Want to see what files and dates the plugin is seeing in the Vault?
Use this button to generate a CSV file with the list of all files in the Vault and their System file creation date, the raw value of the frontmatter property and its parsed Date value.
If you encounter any issues or have feedback about the plugin, feel free to open an issue on the GitHub repository.
The plugin would not be possible without the community: