blast_radius/report/
mod.rs1use anyhow::Result;
2
3use crate::cli::OutputFormat;
4use crate::graph::AnalysisResult;
5
6mod graph_formats;
7use graph_formats::{render_dot, render_mermaid};
8
9mod theme;
10
11mod tree;
12use tree::render_tree;
13
14pub fn render(
15 format: &OutputFormat,
16 result: &AnalysisResult,
17 verbose: bool,
18 color: bool,
19) -> Result<String> {
20 let rendered = match format {
21 OutputFormat::Tree => render_tree(result, verbose, color),
22 OutputFormat::Json => serde_json::to_string_pretty(result)?,
23 OutputFormat::Mermaid => render_mermaid(result),
24 OutputFormat::Dot => render_dot(result),
25 };
26
27 Ok(rendered)
28}