1 unstable release
new 0.1.0 | Mar 16, 2025 |
---|
#195 in Visualization
31KB
560 lines
Report Builder
A simple report builder that can be used to generate html reports. This is meant to be used as a library in other projects, for building reports for results, plots, tables, etc.
lib.rs
:
Report Builder
This crate provides tools for generating HTML reports with interactive elements such as tables, plots, and other visualizations. It's designed to be used as a library within other Rust projects.
Features
- Create multi-section reports
- Add interactive tables with sorting, searching, and CSV export
- Include responsive Plotly charts
- Customizable styling and layout
Usage
Add report-builder
to your Cargo.toml
dependencies:
[dependencies]
report-builder = "0.1.0" # Replace with the latest version
Then, use the provided structs and methods to construct your report:
use report_builder::{Report, ReportSection};
use plotly::Plot;
fn main() {
let mut report = Report::new("MySoftware", "1.0", Some("logo.png"), "Analysis Report");
let mut section = ReportSection::new("Results");
section.add_content(html! { p { "This is a paragraph in the results section." } });
// Add a plot (assuming you have a Plot object)
let plot = Plot::new(); // Create and customize your plot
section.add_plot(plot);
report.add_section(section);
report.save_to_file("report.html").unwrap();
}
Dependencies
~13MB
~127K SLoC