| Crates.io | legalis-viz |
| lib.rs | legalis-viz |
| version | 0.1.3 |
| created_at | 2026-01-05 05:47:57.88543+00 |
| updated_at | 2026-01-21 03:54:13.668441+00 |
| description | Visualization engine for legal statutes - decision trees, flowcharts, and dependency graphs |
| homepage | https://github.com/cool-japan/legalis |
| repository | https://github.com/cool-japan/legalis |
| max_upload_size | |
| id | 2023191 |
| size | 985,659 |
Visualization engine for legal statutes.
legalis-viz provides visualization capabilities for legal documents including decision trees, flowcharts, dependency graphs, and discretionary zone highlighting.
| Format | Use Case |
|---|---|
| Mermaid | Web integration, GitHub markdown |
| GraphViz DOT | Professional diagrams, PDF export |
| ASCII Tree | Terminal display, plain text |
| ASCII Box | Compact terminal display |
use legalis_viz::{DecisionTree, DependencyGraph, VizExporter};
use legalis_core::Statute;
// Create decision tree from statute
let statute = /* ... */;
let tree = DecisionTree::from_statute(&statute)?;
// Export to different formats
let mermaid = tree.to_mermaid();
let ascii = tree.to_ascii();
// Create dependency graph
let statutes = vec![/* ... */];
let graph = DependencyGraph::from_statutes(&statutes);
let dot = graph.to_graphviz();
flowchart TD
A[adult-rights] --> B{Age >= 18?}
B -->|Yes| C[Grant: Full legal capacity]
B -->|No| D[Not applicable]
adult-rights: Adult Rights
├── Condition: Age >= 18
│ ├── [Yes] → Grant: Full legal capacity
│ └── [No] → Not applicable
└── Discretion: Consider special circumstances
# Generate Mermaid diagram
legalis viz input.legalis --format mermaid
# Generate ASCII tree
legalis viz input.legalis --format ascii
# Generate GraphViz DOT
legalis viz input.legalis --format dot > output.dot
dot -Tpng output.dot -o diagram.png
MIT OR Apache-2.0