mirror of
https://github.com/sophokles187/data-cards.git
synced 2026-07-22 12:30:26 +00:00
3 KiB
3 KiB
Dynamic Updates
DataCards can automatically update when your note properties change, providing a real-time view of your data.
Enabling Dynamic Updates
By default, cards are not automatically updated when you change your notes. You need to enable dynamic updates explicitly.
For a Specific Card Block
Add the dynamicUpdate setting to your DataCards code block:
TABLE file.link, author, rating, genre, cover FROM #books
SORT rating DESC
// Settings
preset: portrait
imageProperty: cover
dynamicUpdate: true
Globally in Plugin Settings
To enable dynamic updates for all DataCards blocks:
- Open Obsidian Settings
- Go to the DataCards plugin settings
- Enable "Dynamic Updates"
- Optionally adjust the update interval
How Dynamic Updates Work
When dynamic updates are enabled:
- DataCards monitors changes to notes that match your query
- When a relevant property changes, the cards are automatically refreshed
- Only the affected cards are updated, not the entire display
Update Triggers
Cards will update when:
- You modify a property in a note's frontmatter
- You add or remove a tag that affects the query results
- You create or delete a note that matches the query
- You manually trigger a refresh
Manual Refresh
You can manually refresh your cards at any time:
- Command palette: "DataCards: Refresh DataCards in active view"
- Right-click on a DataCards block and select "Refresh DataCards"
Update Interval
Control how frequently DataCards checks for updates:
updateInterval: 5000 // Check every 5 seconds (in milliseconds)
The default interval is 2000ms (2 seconds).
Performance Considerations
Dynamic updates can impact performance, especially with:
- Large numbers of notes
- Complex queries
- Frequent updates
To optimize performance:
- Use specific queries that match fewer notes
- Increase the update interval
- Only enable dynamic updates where needed
Examples
Task Tracker with Dynamic Updates
TABLE file.link as "Task", status, priority, dueDate FROM #tasks
WHERE status != "Completed"
SORT dueDate ASC
// Settings
preset: grid
dynamicUpdate: true
updateInterval: 3000
Reading Progress Tracker
TABLE file.link as "Book", author, progress, cover FROM #books
WHERE status = "Reading"
SORT progress DESC
// Settings
preset: portrait
imageProperty: cover
dynamicUpdate: true
Project Dashboard
TABLE file.link as "Project", status, team, deadline FROM #projects
SORT deadline ASC
// Settings
preset: compact
dynamicUpdate: true
conditionalFormatting: {
"status": [
{ "condition": "= 'Completed'", "color": "#4CAF50" },
{ "condition": "= 'In Progress'", "color": "#FFC107" },
{ "condition": "= 'Not Started'", "color": "#F44336" }
]
}
Troubleshooting
If dynamic updates aren't working:
- Verify that
dynamicUpdate: trueis set - Check that you're in preview mode, not edit mode
- Make sure the Dataview plugin is up to date
- Try increasing the
updateIntervalvalue - Check the console for any error messages