Skip to content

CAMEL-23485: camel-diagram - Add ASCII art and Unicode text renderers#23152

Open
davsclaus wants to merge 8 commits into
mainfrom
camel-23485-ascii-art-renderer
Open

CAMEL-23485: camel-diagram - Add ASCII art and Unicode text renderers#23152
davsclaus wants to merge 8 commits into
mainfrom
camel-23485-ascii-art-renderer

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

  • Add RouteDiagramAsciiRenderer that renders route diagrams as plain text using the same RouteDiagramLayoutEngine as the PNG renderer
  • Support two text themes: --theme=ascii (plain + - | v) and --theme=unicode (box-drawing ┌──┐ │ └──┘ ▼)
  • Scope boxes rendered with dashed borders (- - - / : for ASCII, / for Unicode)
  • Text themes print directly to terminal (no graphics protocol required) and save as .txt files
  • Integrated into CamelRouteDiagramAction (JBang CLI), DiagramDevConsole, and RouteDiagramDumper SPI

Test plan

  • Unit tests for ASCII rendering (sequential, branching, empty, source, long labels, scope boxes)
  • Unit tests for Unicode rendering (sequential, branching, scope boxes)
  • Unit tests for text wrapping (short, wrap, truncate)
  • JBang module compiles with updated CamelRouteDiagramAction
  • Full reactor build passes
  • Visual verification of ASCII and Unicode output

Claude Code on behalf of Claus Ibsen

🤖 Generated with Claude Code

davsclaus and others added 7 commits May 12, 2026 13:43
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ommand

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…racters

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…evConsole

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

🧪 CI tested the following changed modules:

  • components/camel-diagram
  • core/camel-api
  • docs
  • dsl/camel-jbang/camel-jbang-core

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 1 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
Build reactor — dependencies compiled but only changed modules were tested (4 modules)
  • Camel :: API
  • Camel :: Diagram
  • Camel :: Docs
  • Camel :: JBang :: Core

⚙️ View full build and test results

Copy link
Copy Markdown
Contributor Author

@davsclaus davsclaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: CAMEL-23485

Overall this looks good — clean separation of concerns, backwards-compatible SPI changes, and solid test coverage (14 new tests).

Findings

1. diagram.adoc line 20 — "(PNG only)" on scope boxes is now inaccurate
Since this PR adds scope boxes to ASCII/Unicode rendering, the annotation (PNG only) should be removed from the scope boxes bullet point.

2. Unused constants UNI_T_RIGHT and UNI_T_LEFT
RouteDiagramAsciiRenderer.java declares UNI_T_RIGHT () and UNI_T_LEFT () but they are never referenced. Consider removing to avoid dead code, or adding a comment if they're intended for future use.

3. plotLine() — parentheses for clarity
The condition isVertical(current) && isHorizontal(ch) || isHorizontal(current) && isVertical(ch) is correct due to operator precedence but would be clearer with explicit parentheses.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Comment thread components/camel-diagram/src/main/docs/diagram.adoc Outdated
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant