Skip to content

CAMEL-26348: camel-diagram - a route diagram image draws the steps as cards - #28575

Merged
davsclaus merged 9 commits into
mainfrom
CAMEL-26348-diagram-card-style
Oct 28, 2026
Merged

davsclaus merged 9 commits into
mainfrom
CAMEL-26348-diagram-card-style

Conversation

@davsclaus

@davsclaus davsclaus commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

CAMEL-26348

The PNG image of a route diagram now draws each step as a card:

  • an icon for the kind of step, in a circle of that kind's color;
  • the kind in bold (setBody);
  • the detail below it (groovy: body.items, from the code setBody[groovy{body.items}]).

This replaces the old style, where each step was a filled box with one line of code.

A route diagram with the steps as cards

camel cmd route-diagram orders.camel.yaml --output=orders.png

What draws cards

The dark, light and transparent themes, wherever a route diagram is a PNG:

  • camel cmd route-diagram, camel get history --diagram and camel get error --diagram;
  • the camel_render_route_diagram MCP tool;
  • the route-diagram developer console with format=png;
  • RouteDiagramDumper.

The developer console and the dumper get cards through the Theme enum they already use, so camel-api doesn't change.

These don't change: the ASCII/Unicode diagrams, the topology diagram, and the web component.

Defaults

Where Before Now
camel cmd route-diagram in the terminal unicode unicode (unchanged: an image needs a terminal with a graphics protocol)
camel cmd route-diagram --output=x.png, no --theme unicode, so it saved x.txt light, so it saves the PNG
MCP camel_render_route_diagram, no theme failed with a NullPointerException light

The MCP failure came from DiagramColors.parse(null), which looked null up in the immutable map of the presets. A null spec is now the dark theme.

Changes

  • RouteDiagramIcons (new): the Lucide icons of the camel-route-diagram web component, drawn with Java2D from their SVG path data (a small parser for M/L/H/V/C/S/A/Z). No new dependency.
  • RouteDiagramLayoutEngine: setCardStyle(true) lays a node out as a card: a title line, then the detail wrapped beside the icon (at most 3 lines). The label modes still apply: description and both show the description below the kind. The text renderers keep it off.
  • RouteDiagramRenderer: draws cards only. The old box drawing is removed. The presets gain card, cardBorder, cardText and cardDetail colors, and a custom spec can set them. The constructor with nodeTextPadding is deprecated: the text of a card starts after its icon, so the padding is not used. The camel-jbang commands use the constructor without it.
  • Docs:
    • diagram.adoc gets a "Steps as Cards" section.
    • The sample image of the Route Diagram page shows the cards.
    • The card image of the component page lives in components/camel-diagram/src/main/docs, with a symlink under docs/components/modules/ROOT/images, like the other component images. (The regeneration had removed a copy that lived only under docs.)
    • The regenerated command pages are updated.
    • The 4.24 upgrade guide has an entry: the images are taller, the text color no longer applies to route steps, the .png and MCP defaults changed, and the renderer constructor with nodeTextPadding is deprecated.
    • Removed images/jbang/route-diagram-light.png and route-diagram-dark.png. They came with the first renderer (CAMEL-21975) and no page ever showed them.

A zoom level like the one in the TUI diagram can come later, for big routes.

Tests

  • RouteDiagramCardStyleTest (camel-diagram) covers:
    • the card colors of the themes and of a custom spec, and that parse(null) gives the dark theme;
    • splitting the kind from the detail in each label mode, and wrapping long detail;
    • every icon fitting its 24x24 grid;
    • the path parser: numbers run together, repeated arcs, the arc sweep, an exponent only with its digits;
    • the card and icon colors in the rendered image for all three themes.
  • CamelRouteDiagramActionRunningTest (camel-jbang-core) covers:
    • an image is laid out as cards;
    • without a theme, a .png file gets the light image and any other file gets the text diagram.
  • RouteDiagramToolsTest.imageWithoutATheme (camel-jbang-mcp): the MCP tool renders a YAML route to a PNG without a theme. It fails on main.
  • Results:
    • camel-diagram: 185 tests pass.
    • camel-jbang-core: the route-diagram, history and error command tests pass (51).
    • camel-jbang-mcp: RouteDiagramToolsTest passes (6).

Claude Code on behalf of davsclaus

🤖 Generated with Claude Code

https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS

The card and card-dark themes draw each step of a route diagram as a card: the icon of its kind in a circle of the
color of the kind, the kind in bold (setBody) and its detail below (groovy: body.items, from the code
setBody[groovy{body.items}]). A custom color spec draws cards with style=card. The icons are the Lucide icons of the
camel-route-diagram web component, drawn with Java2D from their path data.

The themes are available in camel cmd route-diagram, camel get history --diagram, camel get error --diagram and the
camel_render_route_diagram MCP tool. The existing themes do not change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus davsclaus added this to the 4.24.0 milestone Oct 27, 2026
@davsclaus davsclaus added the enhancement New feature or request label Oct 27, 2026
@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.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. The card-style rendering pipeline is coherent end-to-end: DiagramColors.parse detects style=card, the layout engine and renderer both branch on colors.isCard(), and all CLI entry points (CamelRouteDiagramAction, CamelHistoryAction, ListError, RouteDiagramTools) consistently call engine.setCardStyle(colors.isCard()) before layout. The PathParser correctly implements SVG 1.1 §F.6.5 arc endpoint-to-center conversion, handles compound numbers (1.1.9 → 1.1, .9), and the CARD_EXPRESSION greedy+DOTALL match on {...} is correct for expression languages that can contain nested braces.

One minor note for future maintainability of PathParser.number(): the method accepts e/E as an exponent marker but does not verify that at least one digit follows. If ever applied to path data containing a trailing e (e.g. "1e"), Double.parseDouble would throw. Not a concern for the current hardcoded Lucide icon data (no scientific notation), but worth a comment or guard if the parser is reused.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

davsclaus and others added 2 commits October 27, 2026 17:12
…file

camel cmd route-diagram --output=diagram.png without --theme saves the image in the card theme. Before, the default
unicode theme saved the text diagram in diagram.txt instead. A diagram in the terminal stays text by default (an image
needs a terminal with a graphics protocol).

The camel_render_route_diagram MCP tool draws in the card theme when no theme is given. Before, it failed with a
NullPointerException: DiagramColors.parse(null) looked null up in the immutable map of the presets. A null spec is now
the dark theme.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…ram image

The dark, light and transparent themes draw the steps of a route diagram image as cards, and the old style (a box
filled with the color of the kind of step, with its code in one line) is removed, with the card and card-dark themes
and the style=card key. So the route-diagram developer console (format=png) and the RouteDiagramDumper draw cards
too, through the Theme enum they already have.

camel cmd route-diagram --output=x.png and the MCP tool draw in the light theme when no theme is given. The sample
image of the route diagram page shows the cards. The upgrade guide says what changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus davsclaus changed the title CAMEL-26348: camel-diagram - a card style for route diagrams CAMEL-26348: camel-diagram - a route diagram image draws the steps as cards Oct 27, 2026
…st renderer

route-diagram-light.png and route-diagram-dark.png came with the route-diagram command (CAMEL-21975) and no page has
ever shown them. They show the style of the first renderer.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Generated files are up to date

An earlier CI run reported uncommitted generated changes; the latest run no longer does.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-diagram
  • docs
  • dsl/camel-jbang/camel-jbang-core
  • dsl/camel-jbang/camel-jbang-mcp

🔁 1 test passed only after a retry on JDK 21 (1 retried attempt)

Recovered flaky tests on JDK 21 (1)
Module Test Failed attempts First failure
dsl/camel-jbang/camel-jbang-plugin-tui MonitorStartupTest.browserOnlyServesUntilTheServerStops 1 Connection refused (connect failed)

ℹ️ These tests did not fail the build. Surefire retried them and they passed.
Retries are enabled project-wide by surefire.rerunFailingTestsCount in parent/pom.xml.


🔬 Scalpel shadow comparison — Scalpel: 8 of 708 tested, 24 compile-only — current: 8 all tested

Maveniverse Scalpel detected 8 affected modules (current approach: 8).

Skip-tests mode would test 8 modules (5 direct + 6 downstream), skip tests for 24 (generated code, meta-modules)

Modules Scalpel would test (8)
  • camel-diagram ← components/camel-diagram/src/main/docs/diagram.adoc, components/camel-diagram/src/main/docs/route-diagram-card.png, components/camel-diagram/src/main/java/org/apache/camel/diagram/DefaultRouteDiagramDumper.java, components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramIcons.java, components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramLayoutEngine.java, components/camel-diagram/src/main/java/org/apache/camel/diagram/RouteDiagramRenderer.java, components/camel-diagram/src/main/resources/META-INF/resources/camel/diagram/THIRD-PARTY-NOTICES.txt, components/camel-diagram/src/test/java/org/apache/camel/diagram/RouteDiagramCardStyleTest.java
  • camel-jbang-mcp ← dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/RouteDiagramTools.java, dsl/camel-jbang/camel-jbang-mcp/src/test/java/org/apache/camel/dsl/jbang/core/commands/mcp/RouteDiagramToolsTest.java
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-jbang-core
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
Modules with tests skipped (24)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

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

  • dsl/camel-jbang/camel-jbang-core: 2 test(s) disabled on GitHub Actions
  • dsl/camel-jbang/camel-jbang-mcp: 2 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
All tested modules (35 modules, 5m 25s total)

Total reactor time: 5m 25s

Module Duration Status
Camel :: JBang :: MCP 49.6s SUCCESS
Camel :: Component DSL 30.6s SUCCESS
Camel :: JBang :: Plugin :: Validate 30.3s SUCCESS
Camel :: YAML DSL :: Validator 28.4s SUCCESS
Camel :: Catalog :: Camel Catalog 25.0s SUCCESS
Camel :: YAML DSL 22.9s SUCCESS
Camel :: Diagram 17.3s SUCCESS
Camel :: JBang :: Plugin :: Testing 16.3s SUCCESS
Camel :: Docs 15.5s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 15.2s SUCCESS
Camel :: Kamelet Main 12.5s SUCCESS
Camel :: YAML DSL :: Deserializers 8.5s SUCCESS
Camel :: Catalog :: Camel Report Maven Plugin 8.2s SUCCESS
Camel :: Catalog :: Camel Route Parser 8.0s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 6.4s SUCCESS
Camel :: All Components Sync point 5.4s SUCCESS
Camel :: Catalog :: Suggest (deprecated) 4.3s SUCCESS
Camel :: Catalog :: Maven 3.6s SUCCESS
Camel :: YAML DSL :: Maven Plugins 3.1s SUCCESS
Camel :: Assembly 2.4s SUCCESS
Camel :: Catalog :: Dummy Component 1.8s SUCCESS
Camel :: Endpoint DSL :: Support 1.6s SUCCESS
Camel :: Coverage 1.3s SUCCESS
Camel :: JBang :: Plugin :: MCP 1.2s SUCCESS
Camel :: JBang :: Plugin :: Generate 1.2s SUCCESS
Camel :: JBang :: Plugin :: Edit 1.1s SUCCESS
Camel :: JBang :: Integration tests 1.0s SUCCESS
Camel :: Catalog :: Console 0.8s SUCCESS
Camel :: JBang :: Main 0.8s SUCCESS
Camel :: Launcher :: Container 0.7s SUCCESS
Camel :: Endpoint DSL n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a
Camel :: JBang :: Plugin :: TUI n/a
Camel :: Launcher n/a

Top 20 slowest modules:

  • Camel :: JBang :: MCP (49.6s)
  • Camel :: Component DSL (30.6s)
  • Camel :: JBang :: Plugin :: Validate (30.3s)
  • Camel :: YAML DSL :: Validator (28.4s)
  • Camel :: Catalog :: Camel Catalog (25.0s)
  • Camel :: YAML DSL (22.9s)
  • Camel :: Diagram (17.3s)
  • Camel :: JBang :: Plugin :: Testing (16.3s)
  • Camel :: Docs (15.5s)
  • Camel :: JBang :: Plugin :: Kubernetes (15.2s)
  • Camel :: Kamelet Main (12.5s)
  • Camel :: YAML DSL :: Deserializers (8.5s)
  • Camel :: Catalog :: Camel Report Maven Plugin (8.2s)
  • Camel :: Catalog :: Camel Route Parser (8.0s)
  • Camel :: YAML DSL :: Validator Maven Plugin (6.4s)
  • Camel :: All Components Sync point (5.4s)
  • Camel :: Catalog :: Suggest (deprecated) (4.3s)
  • Camel :: Catalog :: Maven (3.6s)
  • Camel :: YAML DSL :: Maven Plugins (3.1s)
  • Camel :: Assembly (2.4s)

⚙️ View full build and test results

… component, and read an exponent only with its digits

The docs images of a component are links to its src/main/docs, so the regeneration removed the card image that was only under docs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus

Copy link
Copy Markdown
Contributor Author

Thanks. PathParser.number() now reads an exponent only when digits follow it (once per number, with an optional sign), so 1e ends at 1 and the parser reports Expected a number instead of throwing NumberFormatException from Double.parseDouble. Tested in pathDataAsLucideWritesIt (e046028).

The same commit fixes what the Regen commit showed: the docs images of a component are symlinks into its src/main/docs, so route-diagram-card.png now lives in components/camel-diagram/src/main/docs with a link under docs/components/modules/ROOT/images. The body-types and problems images in #28585 and #28586 were moved the same way.

Claude Code on behalf of davsclaus

…n how the fonts of the platform wrap a plain box

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Following up on my earlier review — the PathParser.number() exponent guard has been addressed.

The updated number() method now uses exponentDigits(pos + 1) to verify that at least one digit follows the e/E marker before consuming the exponent. This correctly handles "1e" (the e is not consumed, the number parses as 1) and the test explicitly validates this edge case: assertThatThrownBy(() -> RouteDiagramIcons.path("M1e 2")) confirms the parser throws when e without digits reaches a subsequent command. ✅

The test improvement in this commit (String.join("", ...) instead of containsExactly) also removes a platform-dependent font-wrapping assumption, making the suite portable. ✅

LGTM.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@oscerd oscerd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read through the layout/renderer core, the new icons and the test. This is clean, well-factored work and the card output is a nice upgrade. A few things I checked and liked, plus a couple of small notes.

Verified:

  • Card-style wiring is consistent end to end. drawNode now always paints a card and sizes against computeCardHeight, so the layout engine must agree — and it does: RouteDiagramRenderer calls engine.setCardStyle(true), while the jbang action and the MCP tool use setCardStyle(!isTextTheme()) so the ASCII/Unicode themes keep the plain node layout. No height-vs-paint mismatch.
  • Licensing is handled. The Lucide paths are now also inlined in RouteDiagramIcons.java, and THIRD-PARTY-NOTICES.txt is updated to say exactly that (ISC, Apache-compatible). Good to see the attribution kept in step with the new location.
  • DiagramColors.parse(null) guard is a real fix, not just defensiveness: COLOR_PRESETS is a Map.of(...), so getOrDefault(null, …) would have thrown NPE — now a null spec resolves to the dark theme, and noSpecIsTheDarkTheme pins it.
  • Safe-tooling posture intact. Rendering stays in-memory (BufferedImage), the icons are inlined SVG paths with no external fetch, and nothing here reaches the network or runs route code — consistent with camel-diagram's "reads/renders without executing" contract.

Refactors read well: the fit(...) ellipsis helper removes the duplicated truncate loop, cardTitleFont centralises the bold title font, and cardLabel splitting setBody[groovy{body.items}] into setBody + groovy: body.items via CARD_EXPRESSION is tidy (and the kind.isEmpty() → info.type fallback covers the odd code). Tests are thorough and at the right level — label parsing, per-mode labels, the null-spec theme, and card layout/height — in AssertJ, which matches camel-diagram's existing convention. Docs are complete: diagram.adoc plus its catalog mirror, the jbang command page and metadata, the upgrade-guide note, and the new sample images. CI is green.

Two small, non-blocking notes:

  • The 4-arg RouteDiagramRenderer(nodeWidth, fontSizeScaled, nodeTextPadding, metrics) now ignores nodeTextPadding (card text starts after the icon), which the javadoc says. Keeping it preserves the constructor signature, but if nothing external calls it, @Deprecated or dropping it would avoid a dead parameter that reads as if it still does something.
  • This is the base of a three-PR stack (#28585 body types on arrows, #28586 marking problem steps — the latter is currently CONFLICTING). I'll look at those next; nothing here blocks them.

No blockers.

Claude Code on behalf of oscerd

@davsclaus

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @oscerd.

Claude Code on behalf of davsclaus

…ructor with the unused text padding

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>

@oscerd oscerd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TL;DR

The deprecation is done properly and every caller in the repo now uses the 3-arg constructor; one doc gap remains for the programmatic callers the deprecation is there to protect.

Blockers: None.
Other findings: 2 (non-blocking).

Since my last review (7fb30ac → 35eef58)

  • The 4-arg constructor (my note): addressed. It has @Deprecated(since = "4.24.0") and @deprecated use {@link #RouteDiagramRenderer(int, int, boolean)} (RouteDiagramRenderer.java:111-119), in the X.Y.Z form most of the codebase uses. The three jbang callers moved (CamelHistoryAction.java:469, CamelRouteDiagramAction.java:316, ListError.java:408). No caller of the 4-arg form is left: the other callers on main use the no-arg and 3-arg forms, and #28585 and #28586 add none. The upgrade-guide note (camel-4x-upgrade-guide-4_24.adoc:2533-2535) is in the card-style section, and it is needed: the constructor is public in every camel-diagram release (RouteDiagramRenderer.java:100 at camel-4.21.0, camel-4.22.0 and camel-4.23.0). That is also why deprecating it, rather than removing it, is the right call.
  • No test calls the deprecated constructor now. Its body is a one-line delegation (:118), so I would not ask for one.
  • Thanks for confirming the merge order of the stack.
  • CI on 35eef58: Build and test (JDK 21), PR doc validation and PR license check are green.

Findings

1. [Important] The standalone Java API example lays out boxes, and the renderer paints cards over them (diagram.adoc:73-78, and its catalog copy)

First, a correction to my earlier note: engine.setCardStyle(true) is called by DefaultRouteDiagramDumper.java:207, not by the renderer. cardStyle is false by default (RouteDiagramLayoutEngine.java:70, javadoc at :153-157). drawNode always paints a card, at the height the layout gives it (RouteDiagramRenderer.java:543-598).

The documented example creates new RouteDiagramLayoutEngine() and new RouteDiagramRenderer() and never calls setCardStyle. So it gets the lines and heights of the old boxes (RouteDiagramLayoutEngine.java:580-583 instead of :577-579):

  • the whole code, such as setBody[groovy{body.items}], becomes the bold title, cut with an ellipsis at the card's narrower text width (RouteDiagramRenderer.java:581-582);
  • the kind and the detail are not split;
  • at the default size, a one-line step gets a card 64 px tall instead of 84.

The callers outside Camel that the deprecation keeps compiling get the same image after upgrading, if their code is written like this example against 4.23.0.

Adding the call to the example, and one sentence to the upgrade-guide section, would cover both cases:

RouteDiagramLayoutEngine engine = new RouteDiagramLayoutEngine();
// the renderer draws the steps as cards, so lay them out as cards
engine.setCardStyle(true);
RouteDiagramRenderer renderer = new RouteDiagramRenderer();

A program that lays out routes with RouteDiagramLayoutEngine and draws them with RouteDiagramRenderer must call engine.setCardStyle(true) before layoutRoute. Without it, the cards get the height and text of the old boxes.

2. [Suggestion, pre-existing] The path-highlighting Java snippet calls a constructor that does not exist (diagram.adoc:442)

new RouteDiagramRenderer(nodeWidth, fontSize) matches none of the constructors (RouteDiagramRenderer.java:99, :104, :117). The same line is in the 4.23.0 docs. Since we are tidying the constructors anyway, the 3-arg form would make the snippet compile:

RouteDiagramRenderer pngRenderer = new RouteDiagramRenderer(
        engine.getNodeWidth(), fontSize * RouteDiagramLayoutEngine.SCALE, false);

This can go in this PR or in a follow-up. Either way, the catalog copy of diagram.adoc has to be regenerated with it.

Reviewed with Claude Code on behalf of oscerd. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

…allers

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @oscerd.

  1. The standalone example now calls engine.setCardStyle(true), and the upgrade guide says that a program using the engine and the renderer must call it before layoutRoute (57d3e78).
  2. The path-highlighting snippet uses the 3-arg constructor. The catalog copy of diagram.adoc is regenerated with both.

Claude Code on behalf of davsclaus

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Previous findings are all addressed. LGTM.

  • oscerd's concern about the missing engine.setCardStyle(true) call in the standalone Java API example (diagram.adoc): ✅ addressed — added at line 75 with a clarifying comment, and documented in the 4.24 upgrade guide.
  • oscerd's concern about the non-existent RouteDiagramRenderer(nodeWidth, fontSize) constructor in the path-highlighting snippet: ✅ fixed to RouteDiagramRenderer(engine.getNodeWidth(), fontSize * RouteDiagramLayoutEngine.SCALE, false).
  • Both the component source (components/camel-diagram/src/main/docs/diagram.adoc) and its generated catalog copy are updated identically.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@davsclaus davsclaus self-assigned this Oct 28, 2026
@davsclaus
davsclaus merged commit de4c199 into main Oct 28, 2026
7 checks passed
@davsclaus
davsclaus deleted the CAMEL-26348-diagram-card-style branch October 28, 2026 20:35
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.

4 participants