> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quadrillion.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Vega Chart Viewer

> Preview, edit, and export Vega and Vega-Lite visualizations.

Opening a Vega or Vega-Lite file (`.vg.json`, `.vl.json`, `.vg`, or `.vl`) in Qualia renders the chart. A badge in the toolbar shows whether the file was recognized as Vega or Vega-Lite, based on its `$schema` and file extension.

## View modes

The toolbar toggle switches between three layouts:

* **Chart** — the rendered visualization on its own.
* **Split** — the JSON source beside the chart. Edits re-render the chart live as you type.
* **Source** — the JSON source on its own, in the standard text editor with find and replace, save with **Cmd+S** / **Ctrl+S**, and syntax highlighting.

Unsaved edits survive switching between modes, and charts sized with `"width": "container"` or `"height": "container"` follow the pane as you resize it.

## Live preview

While editing in split view, the chart updates shortly after you stop typing. If the JSON is mid-edit and temporarily invalid — or the spec fails to compile — the last valid chart stays on screen with the error message beneath it, so you never lose your place.

Charts are interactive: tooltips, selections, and other signals defined in the spec all work in the preview.

## Data files

Specs can reference data by URL. Relative URLs such as `"data": {"url": "data.csv"}` resolve against the chart file's own folder in your workspace, so a spec and its data files can travel together. Absolute `http(s)` URLs are fetched as-is.

## Exporting

Use **Export** in the toolbar to save the chart as a **PNG** (rendered at 2× resolution) or **SVG**. Exports use a solid background matched to your theme, so charts stay readable outside the app.

<Note>
  If the file changes on disk — for example, when an agent edits the spec — the chart reloads automatically unless you have unsaved edits, in which case Qualia warns you and offers to reload.
</Note>
