Headless applications
Crisol has two applications: the desktop workbench and crisol-headless, a small report renderer that consumes a HostSpec and writes a chart without a window, GPU, or egui.
Report renderer
cargo run -p crisol-headless -- crates/crisol-headless/fixtures/report.json --out report.svg
# crisol-headless 1.15.0: Headless report (2 widgets, 1 plots) -> report.svg (10715 bytes)Options:
| Flag | Meaning |
|---|---|
--out <path> | Output path (default report.svg) |
--svg | SVG (default) |
--png | PNG |
--pdf | Vector PDF with the embedded font |
The input is a normal versioned HostSpec. The renderer walks Row, Column, Card, and Tabs recursively, finds the first Plot, converts its inline series, and calls crisol-plot-render. A dataset-backed series is refused because a headless report has no host to resolve it.
Library form
use crisol_headless::render_host_spec;
use crisol_plot_render::Format;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let spec = r#"{
"version": 1,
"window": {"title": "Report"},
"widgets": [
{"kind": "plot", "id": "report", "title": "Signal", "height": 320, "renderer": "cpu",
"series": [{"name": "A", "style": "line", "points": [[0.0, 1.0], [1.0, 2.0]]}]}
]
}"#;
let report = render_host_spec(spec, Format::Svg)?;
assert_eq!(report.title, "Report");
assert_eq!(report.plots, 1);
assert!(String::from_utf8_lossy(&report.bytes).starts_with("<svg"));
println!("headless report ok: {} bytes", report.bytes.len());
Ok(())
}render_host_spec returns Report { title, widgets, plots, bytes }; ReportError is Spec, NoPlot, DatasetSeries, or Render.
GPU-free CI lane
cargo xtask headlessThe command tests crisol-core, crisol-plot-core, crisol-plot-render, crisol-host, crisol-agent, crisol-remote, crisol-extensions, and crisol-headless, rejects an egui/eframe/winit/wgpu/glow edge, and runs the report fixture end to end. The GitHub CI workflow calls the same command in the headless lane without installing X, GL, or Vulkan packages; see .github/workflows/ci.yml.
Boundary rules
crisol-coremust never name egui;cargo xtask core-checkchecks every feature.crisol-host,crisol-extensions, andcrisol-agentare headless by default.crisol-headlessdepends on the core spec and the headless renderer only.cargo xtask dependency-graphrejects a non-optional edge that points upward.