Version: v1.2.3 | Status: Active | Last Updated: March 2026
The data_visualization module provides tools to transform raw data (logs, metrics, analysis results) into human-interpretable visual formats (tables, charts, graphs). It supports both terminal-based output (ASCII/Rich) and web-based or image-based rendering for reports.
- Backend Agnostic: Visualization logic should be separate from data sources.
- Renderer Abstraction: Support multiple renderers (Console, HTML, PNG).
- Consistent Styling: All visualizations should share a common color palette and style guide (Codomyrmex branding).
- Simple API:
plot(data, type='bar')style ease of use.
graph TD
Data[Raw Data] --> Adapter[Data Adapter]
Adapter --> Engine[Vis Engine]
Engine --> Renderer{Renderer}
Renderer -->|Terminal| Console[Rich Output]
Renderer -->|File| Image[PNG/SVG]
Renderer -->|Browser| Web[HTML/JS]
- Rich Terminal Output: Tables, progress bars, syntax highlighting (wrapping
rich). - Charting: Line charts, bar graphs, scatter plots.
- Report Generation: Embed charts into Markdown or HTML reports.
- Visualization Engine (Consolidated): Core rendering engine for complex plotting and theme management.
- Responsiveness: Terminal output must respect terminal width.
- Accessibility: Colors should be distinguishable.
render_table(data: List[Dict], title: str) -> Nonerender_chart(data: Any, type: str) -> Path: Returns path to generated image/file.
- External:
rich,matplotlib(optional),plotly(optional).
- Use
richfor all real-time CLI feedback. - Use
matplotlib/plotlyfor static artifacts generated for artifacts/reports.
- Human Documentation: README.md
- Technical Documentation: AGENTS.md
- Package SPEC: ../SPEC.md
uv run python -m pytest src/codomyrmex/tests/ -k data_visualization -v