Slicelytics monogram

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, or TOON file 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.

ParameterValue
vAlways 1.
data The file's text, gzipped, then base64url-encoded (- and _, no = padding).
formatjson (the default), ndjson, csv, or toon.
nameOptional. The name shown for the dataset.
compare For /data/compare: the second dataset, encoded like data, with compareFormat and compareName.
?view=Optional. A ViewSpec, as URL-encoded JSON.

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.

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 open or xdg-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.

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" } }
}
FieldMeaning
vAlways 1.
viewexplore, compare, or visualize.
props Fields to show; everything else is hidden. Nested fields use dots (a.b). Omitted: all fields.
filters{ "field": "value" }. Keeps only items whose field equals the value, compared as strings. Several filters are ANDed. A filtered field doesn't need to be in props.
xVisualize: 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 in props or leave props out, and don't set x with 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/visualize link 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 x field, a line chart zigzags. Put numeric fields in props and use a date or label field as x.
  • 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" }