feat: add rendering-primitives crate, share non_import_rels across renderers
This commit is contained in:
@@ -2,6 +2,7 @@ use archlens_domain::{
|
||||
CodeElement, CodeGraph, DomainError, RelationshipKind, RenderOutput, RenderedFile,
|
||||
ports::DiagramRenderer,
|
||||
};
|
||||
use archlens_rendering_primitives::non_import_rels;
|
||||
|
||||
pub struct AsciiRenderer;
|
||||
|
||||
@@ -94,16 +95,12 @@ impl DiagramRenderer for AsciiRenderer {
|
||||
lines.push("└───".to_string());
|
||||
}
|
||||
|
||||
let non_import_rels: Vec<_> = graph
|
||||
.relationships()
|
||||
.iter()
|
||||
.filter(|r| r.kind() != RelationshipKind::Import)
|
||||
.collect();
|
||||
let filtered_rels: Vec<_> = non_import_rels(graph.relationships()).collect();
|
||||
|
||||
if !non_import_rels.is_empty() {
|
||||
if !filtered_rels.is_empty() {
|
||||
lines.push(String::new());
|
||||
lines.push("── Relationships ──".to_string());
|
||||
for rel in &non_import_rels {
|
||||
for rel in &filtered_rels {
|
||||
let arrow = match rel.kind() {
|
||||
RelationshipKind::Inheritance => "extends",
|
||||
RelationshipKind::Composition => "has",
|
||||
|
||||
Reference in New Issue
Block a user