feat(examples): add EngineDeck flagship rendering real benchmark data#197
Merged
Conversation
No example showed the engine making the end-to-end case for itself. EngineDeck is a multi-page landscape deck GraphCompose renders about itself, doubling as a brand sheet. - Page 1: a full-page banner — the SVG wordmark and version, a four-step flow (DSL code panel -> engine capability grid -> output backends -> real rendered-document thumbnails) and a capability strip. Feature icons are bundled SVGs (with light recolours so they read on the dark panel); the thumbnails are real example PDFs (CV / invoice / report) rasterised once into resources. - Page 2: the authoring pipeline (AUTHOR -> MEASURE -> PAGINATE -> RENDER) and a short "why it's solid" row. - Pages 3-4: the comparative benchmark (GraphCompose vs iText 9 vs JasperReports). A snapshot of the suite's result file is bundled under resources/benchmarks/ and loaded at render time; the engine draws the table and every chart straight from it. The page carries the run metadata and a refresh note (re-run the suite, recopy latest.json). Registered in GenerateAllExamples so GenerateAllExamplesSmokeTest exercises it on CI. Verified: ./mvnw -f examples/pom.xml test -Dtest=GenerateAllExamplesSmokeTest -> BUILD SUCCESS.
Extract compose(DocumentSession) from generate() so a test can drive the composition before buildPdf, then assert the resolved geometry against a committed baseline via LayoutSnapshotAssertions. A layout regression now shows up in a PR instead of a silently-changed PDF. Re-bless after a deliberate layout change, or after refreshing the bundled benchmark data (chart bar geometry is data-driven), with -Dgraphcompose.updateSnapshots=true. Verified: ./mvnw -f examples/pom.xml test -Dtest=EngineDeckLayoutSnapshotTest -> BUILD SUCCESS.
Adapt the cv/v2 layered separation for the one-off deck: move the benchmark loader (BenchRun + loadBench) and the deck's structured content — capability chips, engine capabilities, output backends, pipeline steps, proof points — into a new EngineDeckData as plain records. EngineDeckExample now reads WHAT to show from the data layer and only decides HOW to draw it; the inline content lists are gone. Pure refactor — the rendered layout is byte-identical, proved by the existing EngineDeck snapshot still matching its (un-reblessed) baseline. Verified: ./mvnw -f examples/pom.xml test -> BUILD SUCCESS (2 tests, snapshot baseline unchanged).
The deck renders through PDFBox, so the PDF Producer metadata now reads "GraphCompose (PDFBox 3.0)" instead of "GraphCompose" — honest about the backend that writes the bytes. Layout is unchanged (snapshot still matches).
- Class Javadoc now matches the shipped banner — light-recoloured icons on dark cards, not "monochrome icons on light chips". - CHANGELOG v1.8.0 Documentation lists the new EngineDeck flagship. - EngineDeckData.BenchRun reports "no benchmark row: <label>" instead of an NPE when a scenario label is absent (e.g. after a data refresh renames one). Layout unchanged — snapshot still matches.
Commit the EngineDeck preview (assets/readme/examples/engine-deck.pdf), link it from the gallery row, and bring the counts up to date (63 example programs, 39 committed previews). Also lands the Engine Showcase gallery row, which was pending in the tree.
EngineDeckExample carried its 21-colour palette and every benchmark table/chart builder inline, at 862 lines. Move the palette to EngineDeckTheme and the table + chart specs to EngineDeckCharts, both package-private and statically imported — completing the data/theme/widgets split the deck began with EngineDeckData. EngineDeckExample drops to 659 lines and now only composes pages. The layout snapshot stays byte-identical, proving the move changed no output.
…EngineDeck scaling page The scaling-page narrative described the time story only around iText, where the lead widens, and left out that JasperReports closes to roughly the same render time at 1000 rows — which the line chart on the same page already plots. Add the clause so the prose matches the chart, keeping the memory-advantage point. Regenerate the layout snapshot for the reworded paragraph.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
GraphCompose had no example that makes the engine's case for itself end to end — what it is, how it composes, how it performs. EngineDeck is that artifact: a landscape deck the engine renders about itself, doubling as a brand sheet.
What changed
New flagship
EngineDeckExample(examples module, canonical lane) — four landscape pages:comparative/latest.jsonis bundled underresources/benchmarks/and loaded at render time; the engine draws the table and every chart straight from it, with run metadata and a refresh note.Data is separated from rendering: an
EngineDeckDatalayer holds the benchmark loader and the structured content as records, andEngineDeckExampleonly composes. Registered inGenerateAllExamples; CHANGELOG (Documentation) updated; the PDF Producer credits PDFBox 3.0.Verification
EngineDeckLayoutSnapshotTestlocks the layout against a committed baseline (LayoutSnapshotAssertions); the data-layer refactor is proven byte-identical by that baseline still matching un-reblessed../mvnw -f examples/pom.xml test→ BUILD SUCCESS —Tests run: 2, Failures: 0(snapshot + GenerateAllExamples smoke).No public API or engine surface touched. Out of scope here: the
examples/README.mdgallery row and a committedassets/readme/**preview (the README has unrelated in-progress edits in the working tree).