Skip to content

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 ​

bash
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:

FlagMeaning
--out <path>Output path (default report.svg)
--svgSVG (default)
--pngPNG
--pdfVector 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 ​

rust
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 ​

bash
cargo xtask headless

The 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-core must never name egui; cargo xtask core-check checks every feature.
  • crisol-host, crisol-extensions, and crisol-agent are headless by default.
  • crisol-headless depends on the core spec and the headless renderer only.
  • cargo xtask dependency-graph rejects a non-optional edge that points upward.

Released under MIT OR Apache-2.0. Icons: Lucide (ISC) and Material Icon Theme (MIT).