Data Sources
DataGlass can load data from multiple sources. Choose the right one for your use case.
Quick Comparison
| Source | Best For | Example |
|---|---|---|
| Inline | Quick demos, small datasets | source: '[{"x": 1}]' |
| File | CSV, JSON, Parquet, MD tables | file: data/sales.csv |
| URL | External APIs, live data | url: "https://api.example.com/data" |
| Vault Query | Data from other notes | query: "from:Projects" |
| Heading Reference | Tables in same note | file: "#Sales Data" |
Basic Structure
All charts use the data block to specify where to get data:
yaml
data:
source: '...' # Inline JSON
file: '...' # Local file or heading
url: '...' # External URL
query: '...' # Vault queryOnly one source type can be used per chart.
Examples
Inline Data
yaml
data:
source: '[{"month": "Jan", "sales": 100}, {"month": "Feb", "sales": 150}]'CSV File
yaml
data:
file: data/sales.csvAPI Endpoint
yaml
data:
url: "https://api.example.com/metrics.json"Vault Query
yaml
data:
query: "from:Projects where:status=active"Table in Same Note
yaml
data:
file: "#Revenue Table"Next Steps
- Inline Data - JSON embedded in your chart
- File Data - CSV, JSON, Parquet, Markdown tables
- URL Data - External APIs and feeds
- Vault Queries - Query your Obsidian vault
- Transformations - Filter, aggregate, sort data