DataviewJs Code Snippets For Obsidian You Must be Using
Based on Prakash Joshi Pax's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Tag Cloud and Page Cloud snippets provide clickable navigation over tags and pages, but large vaults benefit from folder-scoped queries to avoid performance hits.
Briefing
Obsidian users looking to turn plain notes into dashboards get a practical set of DataViewJS snippets—ranging from tag and page “clouds” to habit trackers, progress analytics, and folder-based tables of contents. The core payoff is speed: many snippets work out of the box, while the ones that depend on personal note structure can be customized by editing a few folder paths, property names, and thresholds.
A standout early example is a Tag Cloud that renders every tag in the vault with counts, and links each tag to a filtered search view for that tag. A related Page Cloud (called “pH Cloud” in the transcript) lists nodes in a visually navigable format and can be configured to query only nodes from a chosen folder—an important performance consideration for large vaults. The transcript also highlights Table of Contents-style views that generate an outline for all notes inside a folder, but only when a note exists whose title matches the folder name.
For tracking behavior over time, the transcript walks through two habit-tracking approaches. One version tracks habits via Daily Note properties: it calculates streak-like checkmarks by reading structured fields such as writing, exercise, and reading, then marks completion with a check icon or an “incomplete” red box. Customization is required—especially the folder path used for daily notes and the property names inside the Daily Note template. The walkthrough shows how to expand beyond the default three habits by adding new properties (for example expenses, XP, and day plan), then adjusting the DataViewJS logic so goals only count when minimum criteria are met (such as requiring at least six focus sessions rather than any nonzero value).
A second habit tracker logs events instead of relying on properties. In this method, users write a log entry in the Daily Note (e.g., “day plan,” “exercise writing,” “reading”) and the snippet interprets those tasks as habit activity. The transcript notes that this approach still needs edits—such as start dates and any vault-specific paths—because the snippet may be copied from an external forum.
Progress tracking is handled with two complementary snippets. One adds start and end date filtering so totals for a property (like XP) can be computed within a time window; a bug in the initial setup is corrected so values are added properly rather than concatenated or mis-summed. Another builds a progress bar in a table view using properties like goal, progress, and deadline; the transcript emphasizes that property names and casing must match exactly (e.g., “deadline” may fail if the snippet expects a different case).
Finally, the transcript extends the same progress-bar idea to a book/library database. A book progress widget computes completion percentage from properties such as current page and total page, and can be enhanced with Minimal Theme card styling via CSS. The closing sections return to navigation snippets—alphabetized lists and folder-scoped “P Cloud”—and stress that querying the entire vault can slow down large libraries, so folder scoping is the safer default. The overall message: pick the snippet that matches the data model (properties vs logs), then align property names, folder paths, and thresholds to personal templates for reliable results.
Cornell Notes
The transcript provides a toolkit of Obsidian DataViewJS snippets that turn vault metadata into interactive dashboards. Many snippets work immediately (like Tag Cloud and folder-based Table of Contents), while habit and progress trackers require edits to match the user’s folder structure and Daily Note property names. Habit tracking is demonstrated in two ways: property-based checkmarks with configurable completion thresholds, and log-based tracking where tasks written in Daily Notes are interpreted as habit activity. Progress tracking adds date filtering and progress bars, but it depends on exact property names and sometimes casing (e.g., deadline). The same progress-bar logic can be adapted for book/library tracking using current-page and total-page properties.
What makes the Tag Cloud and Page Cloud snippets useful, and what configuration matters most?
How does the property-based habit tracker decide whether a habit is complete?
What edits are typically required when adapting the habit tracker to a personal vault?
How does the log-based habit tracker differ from the property-based one?
Why can progress totals be wrong even when the snippet is correct, and how was it fixed?
What commonly breaks the progress bar table view, and how is it debugged?
Review Questions
- When adapting a property-based habit tracker, which three categories of changes are most likely required (and why)?
- How would you modify a habit tracker so a goal counts only when a minimum reading duration is met?
- What steps would you take to troubleshoot a progress bar that shows 0% or fails to read deadline values?
Key Points
- 1
Tag Cloud and Page Cloud snippets provide clickable navigation over tags and pages, but large vaults benefit from folder-scoped queries to avoid performance hits.
- 2
Property-based habit tracking depends on exact Daily Note property names and the daily-note folder path used by the snippet.
- 3
Habit completion can be threshold-based; nonzero values may still count as incomplete if the code requires a minimum (e.g., focus sessions ≥ 6).
- 4
Log-based habit tracking interprets tasks written in Daily Notes, requiring edits like start dates and vault-specific paths.
- 5
Progress tracking with date filtering requires correct aggregation logic so property values add correctly across multiple notes.
- 6
Progress bar table views are sensitive to property identifiers and casing (e.g., deadline may break if the snippet expects a different case).
- 7
Book/library progress can be computed from current-page and total-page properties and enhanced visually using Minimal Theme card CSS.