src

Present

2-min readUpdated Sep 03, 2026main

Copied Raw Markdown!
Copied copy path!

src — rows from a fileURL copied

src replaces the fence body. It works on every registry visual.

The path is relative to this document, must stay under the content root, and must end in .json, .yaml, .yml, or .csv.

JSON, with selectURL copied

Commits per month
Dec 202560 · 6.0%
Jan 202666 · 6.6%
Feb 2026155 · 15.5%
Mar 202642 · 4.2%
Apr 202688 · 8.8%
May 2026165 · 16.5%
Jun 2026190 · 19.0%
Jul 2026139 · 13.9%
Aug 202693 · 9.3%
```bar title="Commits per month" total=sum src="../data/repo-archaeology.json" select="commits_by_month"
```

select is a dotted path into the file, so one file can hold several series. The same file feeds the next two charts.

Commits by time of day
18:00-23:59445 · 44.6%
12:00-17:59310 · 31.1%
06:00-11:59170 · 17.0%
00:00-05:5973 · 7.3%
Commits by weekday
Friday202 · 20.2%
Tuesday166 · 16.6%
Wednesday162 · 16.2%
Thursday142 · 14.2%
Sunday139 · 13.9%
Monday97 · 9.7%
Saturday90 · 9.0%

YAMLURL copied

Tracked files by directory
vyasa/ — 255demo/ — 133.agents/ — 57tests + tests_js — 36docs, root, other — 69
```stack title="Tracked files by directory" src="../data/tree.yaml" select="by_directory"
```

CSV, naming the columnsURL copied

A CSV has named columns, so say which two to read.

bar block
src not found: ../data/hotspots.csv
```bar title="Churn hotspots" total=998 src="../data/hotspots.csv" label_key="file" value_key="commits"
```

Accepted shapesURL copied

shape example
mapping {"Dec": 60, "Jan": 66}
pairs [["Dec", 60], ["Jan", 66]]
objects [{"month": "Dec", "commits": 60}]
CSV a header row, then rows

For objects and CSV, name the columns with label_key and value_key. Without them the first two keys are read, in order.

Inline rows and file rows become the same objects, so a renderer never knows which it got.

When to use itURL copied

Use src when the numbers are generated, shared between charts, or long enough to bury the prose. Keep a short one-off series inline — a reader should not open a second file to check four numbers.

src reads a file from disk. To pull data over the network, that is vega-remote.