davsclaus opened a new pull request, #28575: URL: https://github.com/apache/camel/pull/28575
[CAMEL-26348](https://issues.apache.org/jira/browse/CAMEL-26348) A card style for the PNG route diagrams. The `card` and `card-dark` themes draw each step as a card with three parts: - 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}]`). <img src="https://raw.githubusercontent.com/apache/camel/CAMEL-26348-diagram-card-style/docs/components/modules/ROOT/images/route-diagram-card.png" width="240" alt="A route diagram in the card style"> ``` camel cmd route-diagram orders.camel.yaml --theme=card --output=orders.png ``` ## 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 each 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. - `RouteDiagramRenderer`: the new `card` and `card-dark` presets, plus a `style=card` key with `card`, `cardBorder`, `cardText` and `cardDetail` colors for custom specs. - These all use the card themes: `camel cmd route-diagram`, `camel get history --diagram`, `camel get error --diagram`, the `camel_render_route_diagram` MCP tool, and `DefaultRouteDiagramDumper.renderImage`. - Docs: a Card Style section in `diagram.adoc`, with an image. The three regenerated command pages list the new themes. The existing themes and their output do not change. ## Not in this PR - The developer console and `RouteDiagramDumper` take the `Theme` enum of camel-api (DARK, LIGHT, TRANSPARENT), so they can't select a card theme yet. Adding it would be an API change. - The `camel-route-diagram` web component already draws light cards with these icons. It still shows one line of text per step. ## Tests - `RouteDiagramCardStyleTest` (camel-diagram): presets, kind/detail split by label mode, wrapping, every icon within its 24x24 grid, the path parser (numbers run together, repeated arcs, arc sweep), and the card and icon colors in the rendered image. - `CamelRouteDiagramActionRunningTest.cardThemeDrawsTheStepsAsCards`: `--theme=card` lays the route out as cards. - camel-diagram: 184 tests pass. camel-jbang-core: the route-diagram, history and error command tests pass (49). _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
