Skip to content

Data Sources

DataGlass can load data from multiple sources. Choose the right one for your use case.

Quick Comparison

SourceBest ForExample
InlineQuick demos, small datasetssource: '[{"x": 1}]'
FileCSV, JSON, Parquet, MD tablesfile: data/sales.csv
URLExternal APIs, live dataurl: "https://api.example.com/data"
Vault QueryData from other notesquery: "from:Projects"
Heading ReferenceTables in same notefile: "#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 query

Only 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.csv

API 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

Released under the MIT License.