Slicelytics Link Format and ViewSpec
A reference for AI agents and scripts that open datasets in Slicelytics. A link carries a JSON, NDJSON/JSONL, CSV, TSV, TOON, or FIT file, or points to one hosted elsewhere, and, optionally, a ViewSpec that sets the page, the properties shown, value filters, and the chart. The same reference is available as plain text at slicelytics.com/llms.txt.
The Link
https://slicelytics.com/data/<explore|compare|visualize>?view=<URL-encoded ViewSpec JSON>#v=1&data=<D>&format=<F>&name=<N> The dataset goes in the part of the link after #, the fragment, which browsers never send to a server. Every value after # is URL-encoded, like a query string. Opening data needs a signed-in Slicelytics subscriber; a link opened before signing in or subscribing survives login and checkout.
| Parameter | Value |
|---|---|
v | Always 1. |
data | The file's text (a FIT file's bytes, as they are), gzipped or Zstandard-compressed, then base64url-encoded (- and _, no = padding). |
format | json (the default), ndjson, csv, tsv, toon, or fit. The agent skill's script may also send columns, a more compact layout of the same data. |
name | Optional. The name shown for the dataset. |
src | Instead of data: the URL of a file to open. See Linking to a File below. |
compare | For /data/compare: the second dataset, encoded like data, with compareFormat and compareName. Or compareSrc, the URL of its file. |
?view= | Optional. A ViewSpec, as URL-encoded JSON. |
Linking to a File
With src in place of data, the link points to a file instead of carrying it, so it stays short however large the file is. The browser that opens the link fetches the file straight from its host; it never passes through Slicelytics. This is what the Open in Slicelytics badge uses.
https://slicelytics.com/data/explore#v=1&src=https%3A%2F%2Fraw.githubusercontent.com%2Fowner%2Frepo%2Fmain%2Fdata%2Fruns.csv- Format: the file is read as if it were dropped into the page: its content and extension decide the format, and compressed files (
.gz,.zst) are unpacked. Leave outformat.namedefaults to the file's name. - Compare:
compareSrctakes the place ofcompare. Either side can be a URL or carried data. - Hosts: https only, up to 500 MB. The host must allow other sites to read its files (CORS). raw.githubusercontent.com, gist.githubusercontent.com, cdn.jsdelivr.net, Hugging Face (
/resolve/), Zenodo, and Socrata do; GitHub release assets don't. A github.com or Hugging Face/blob/page URL is read as its raw file. - Blocked files: if the host doesn't answer or blocks the request, the user is offered a download of the file to drop into the page instead.
Build a Link in Python
import base64, gzip, json, urllib.parse
enc = lambda text: base64.urlsafe_b64encode(gzip.compress(text.encode())).decode().rstrip("=")
view = {"v": 1, "view": "visualize", "props": ["p95_ms"], "x": "day", "chart": "line"}
url = ("https://slicelytics.com/data/visualize?view=" + urllib.parse.quote(json.dumps(view))
+ "#" + urllib.parse.urlencode({"v": 1, "data": enc(open("runs.csv").read()), "format": "csv"})) The Slicelytics agent skill ships slicelytics_link.py, a script that does this for you: it infers the format from the file extension, picks the page, and prints the link and its length. Its links are typically 1.3-2× shorter than the code above makes, as it stores the data column by column and uses Zstandard where Python has it (3.14 and later).
Size Limits
- Printed links: keep a link you show to a person to about 8,000 characters.
- Opened links: keep a link passed to another program, such as
openorxdg-open, under 900,000 characters. Operating systems limit one argument to 1 MiB. - Chrome caps URLs at 2 MB.
- Compression: gzip typically makes JSON or CSV 5-10× smaller, and base64 adds a third back. The script's links are typically 1.3-2× shorter again.
Above these limits, write the files into a folder that Slicelytics watches instead. See Open Data in Slicelytics from AI Agents.
ViewSpec
A ViewSpec is JSON describing the whole view. Fields left out are reset to their defaults, not kept from before.
{
"v": 1,
"view": "visualize",
"props": ["p95_ms", "errors"],
"filters": { "endpoint": "/api/search" },
"x": "day",
"chart": "line",
"series": { "errors": { "chart": "bar" } }
}| Field | Meaning |
|---|---|
v | Always 1. |
view | explore, compare, or visualize. |
props | Fields to show; everything else is hidden. Nested fields use dots (a.b). Indexes pick array elements: mlModel.layers.weights[0] shows only the first row of each layer's weights. An indexed path shows the whole field unless props also names fields inside it, e.g. ["mlModel.layers[1]", "mlModel.layers.bias"] shows only the second layer's bias. Omitted: all fields. |
filters | { "field": "value" }. Keeps only items whose field equals the value, compared as strings. { "field": { "not": ["a", "b"] } } keeps items whose field is neither, including items without the field. Several filters are ANDed. A filtered field doesn't need to be in props. |
x | Visualize: the field that labels the x-axis. Omitted: the item index. |
chart | Visualize: the chart type for every shown field. One of bar, line, pie, radar, bubble, doughnut, polarArea, scatter. |
series | Visualize: per field, { "chart": <type>, "metric": <metric> }. Overrides chart. |
Metrics
density: counts items per distinct value of any field, drawn as one bar per value. The field must be shown, so put it inpropsor leavepropsout, and don't setxwith it. For example,"props": ["endpoint"], "series": {"endpoint": {"metric": "density"}}shows requests per endpoint.- Arrays of numbers:
sum,mean,median,mode,min,max,range,stdDev,variance,multiplication. - Arrays of dates:
min,max,range,density. size: the length of strings and arrays.original: the default; plots the values as they are.
Getting the View Right
- Visualize needs a view: a
/data/visualizelink without?view=opens with no fields selected. - Visualize plots items in file order: one point per item. If the rows aren't ordered by the
xfield, a line chart zigzags. Put numeric fields inpropsand use a date or label field asx. - Nested arrays are one series per innermost array: a field holding arrays of arrays, e.g. a matrix of weights in each layer of a model,
mlModel.layers.weights, plots one series per row. To plot only some, put indexes inprops:mlModel.layers.weights[0]plots the first row of each layer's weights, andmlModel.layers[1].weightsonly the second layer's. - Compare matches items by position, not by key. If two files list their items in different orders, every item after the first mismatch shows as changed. A view doesn't apply on
/data/compare. - Invalid fields are skipped: an unknown field or chart type is left out, the user is told in a message, and the rest of the view still applies.
- Leave the data as it is: agents should pass files unchanged and put filtering and counting the user wants to see in the ViewSpec. If the data won't display well as it is, tell the user and ask before preparing a copy.
Watched Folder Files
In a folder Slicelytics watches, the same ViewSpec goes in a file next to the run it belongs to, with the same base name: run-42.ndjson gets run-42.view.json. To compare two runs, the newer run's view names the other one, which implies "view": "compare":
// run-42.view.json
{ "v": 1, "compare": "run-41.ndjson" } To ask Slicelytics to load a run, write slicelytics.show.json into the folder, after the run and its view are complete. Only write it when the user asked to see the run: Slicelytics never swaps the data someone is looking at unasked.
// slicelytics.show.json
{ "run": "run-42.ndjson" }