CAMEL-21975: Add route-diagram command to display Camel route diagrams in terminal#22794
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
💡 Manual integration tests recommended:
All tested modules (6 modules)
|
|
is there a design for the colors in the diagram. I dont think we should use red as it indicate an error or something wrong. |
I've updated the PR description to show the new palette and explain customisations. That definitely looks much better now :-). If you want adjustments or switching color/eip assignment, let me know. |
|
awesome feature, thanks |
|
I wonder if we in the tui, can have a 'd' short-cut in the routes tab, to show the diagram for the given route, and with scroll bars to make it possible to browse the entire route when its large. |
|
Great idea! Yes, this is definitely doable as a follow-up PR. The rendering infrastructure from this PR (layout engine + renderer) can be reused directly — we'd just need to wire a I'll open a follow-up JIRA ticket for this once this PR is merged. Claude Code on behalf of Guillaume Nodet |
…s in terminal Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
LGTM |
Can we add an option (such as |
|
Hey maybe we can just use the |
|
@gnodet ^^^ |
CAMEL-21975
Summary
Adds a new
camel cmd route-diagramcommand that renders visual diagrams of Camel routes directly in the terminal using inline image protocols (Kitty, iTerm2, Sixel), with a text-based tree fallback for unsupported terminals.--output <file.png>to save the diagram as a PNG file--filterto narrow by route ID or source filename--themefor color customization (presets: dark, light, transparent)Architecture
RouteDiagramLayoutEngine— tree building, subtree width computation, and coordinate assignmentRouteDiagramRenderer— Java AWT rendering (nodes, arrows, merge lines) and text fallbackCamelRouteDiagramAction— CLI entry point, JSON parsing, terminal display via JLineTerminalGraphicsColor Palette
Colors are based on the GitHub Primer design system, following dark mode best practices:
#0d1117, light:#f6f8fa)Customization
Colors are fully customizable via
--theme(orDIAGRAM_COLORSenv var):Available color keys:
bg,text,arrow,label,from,to,eip,choice,default,transform,processorTest plan