Reports¶
Overview¶
The scald report command generates offline HTML reports from configuration files. This provides an alternative to the programmatic report interface and is useful for creating static documentation, analysis summaries, and automated report generation.
Basic Usage¶
Generate an offline HTML report:
scald report -c /path/to/report_config.yml -o /path/to/output_directory
Report Configuration¶
Reports are defined using YAML configuration files that specify the structure, content, and styling of the generated HTML output.
Basic Configuration Structure¶
report:
title: "My Analysis Report"
theme: "default"
tabs:
- name: "Overview"
content:
- name: "plot"
title: "Data Visualization"
path: "/path/to/data.json"
- name: "Details"
content:
- name: "image"
path: "/path/to/plot.png"
Report Components¶
Reports can include various types of content:
Plot Elements¶
Include interactive plots and visualizations:
content:
- name: "plot"
title: "Timeseries Data"
path: "data/timeseries.json"
layout:
xaxis:
title: "Time"
yaxis:
title: "Amplitude"
Image Elements¶
Embed static images and figures:
content:
- name: "image"
path: "images/analysis_plot.png"
title: "Analysis Results"
Table Elements¶
Display tabular data:
content:
- name: "table"
title: "Summary Statistics"
path: "data/summary_table.json"
Text Elements¶
Add headers, descriptions, and documentation:
content:
- name: "header"
header: "Analysis Section"
- name: "description"
description: "This section presents the main analysis results."
Programmatic Report Generation¶
Reports can also be created programmatically using the Python API:
from ligo.scald.report import Report, Tab, Plot
# Create a new report
report = Report(title="Analysis Report", theme="dark")
# Create a tab with content
tab = Tab(name="Results")
# Add a plot to the tab
plot = Plot(title="Data Visualization", path="/path/to/data.json")
tab += plot
# Add the tab to the report
report += tab
# Save the report
report.save("/path/to/output", config_name="my_report")
Advanced Features¶
Multi-tab Reports¶
Organize content across multiple tabs for better navigation:
report:
title: "Comprehensive Analysis"
tabs:
- name: "Data Quality"
content: [...]
- name: "Signal Analysis"
content: [...]
- name: "Background Studies"
content: [...]
Custom Themes¶
Apply custom styling and themes to reports:
report:
title: "Custom Report"
theme: "custom"
# Additional theme configuration
Grid Layouts¶
Organize multiple plots or images in grid layouts:
content:
- name: "plot_grid"
grid_size: 6
plots:
- title: "Plot 1"
path: "data/plot1.json"
- title: "Plot 2"
path: "data/plot2.json"