docs(examples): add the financial-report one-pager flagship#204
Merged
Conversation
Why: v1.8 shipped native vector charts, inline sparklines, free-form path clipping, and block-level alignment, but no flagship example wired them into a single real-world infographic. What: FinancialReportExample renders a one-page "Business Monthly Financial Report" on the canonical DSL — three donut gauges with centre KPIs, a monthly cash bar chart, a stacked OPEX chart, a revenue-breakdown donut, forecast revenue bars, and a horizontal forecast-vs-actual cost chart, plus masthead sparklines and a parallelogram-clipped photo. Every chart recolours through the ChartStyle cascade to a terracotta/teal/cream palette. Registered in GenerateAllExamples and listed in the examples README. Combo bar+line charts are not a native chart kind, so OPEX is a stacked bar and the trend reads as a masthead sparkline. Tests: ./mvnw test -Dtest=CanonicalSurfaceGuardTest -pl . (8 green) keeps the example on the canonical surface (no engine imports, no legacy API); ./mvnw -f examples/pom.xml exec:java ...FinancialReportExample renders a single A4 page.
…eport # Conflicts: # examples/src/main/java/com/demcha/examples/GenerateAllExamples.java
Extract FinancialReportExample.compose(DocumentSession) from generate() so the new FinancialReportLayoutSnapshotTest lays out the exact one-pager into its own session and diffs the resolved geometry against a committed baseline — the flagship pattern EngineDeck already follows. Commit the rendered preview at assets/readme/examples/financial-report.pdf and link it from the examples gallery row. Rename the resource-loader overload to loadMastheadPhoto() so it no longer collides by name with the node-building mastheadPhoto(photo).
…uffix Rename the discontinued "iPod" revenue-breakdown category to "Wearables" and switch cashAtEndCard's axis suffix from "K" to "k" so every axis on the sheet reads the same casing. Re-bless the layout snapshot baseline (the wider legend label shifts geometry) and refresh the committed preview.
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
The v1.8 illustrative surface — native vector charts, donut gauges, inline
sparklines, path-clipped images, block-level alignment — had no single flagship
exercising them together on a real one-page brief. This branch added that
example but had drifted 63 commits behind develop and shipped without a layout
snapshot test or a committed preview, unlike the other flagships.
What changed
FinancialReportExample— an A4 one-pager "Monthly Financial Report":a path-clipped photo masthead, three donut profit-margin gauges with centre
KPIs, a Cash-position block (KPI tile, cash bar, stacked OPEX, revenue donut)
and a Forecast block (revenue bars, horizontal grouped cost breakdown), plus
masthead sparklines. All vector, no raster; recoloured through the
ChartStylecascade.compose(DocumentSession)extracted fromgenerate()so the layout istestable without writing a file — the EngineDeck flagship pattern.
FinancialReportLayoutSnapshotTestlocks the resolved geometry against acommitted baseline.
assets/readme/examples/financial-report.pdfand thegallery
[PDF]link.loadMastheadPhoto()so it no longercollides by name with the node-building
mastheadPhoto(photo).GenerateAllExamplesmerge —keeps both EngineDeck and FinancialReport registered).
Verification
./mvnw -f examples/pom.xml test→ BUILD SUCCESS (snapshot test + generationsmoke green).
GenerateAllExamplesrenders every example including the new one; the reportis exactly one page.
DocumentPaint.solid(...)(no translucent gradient stops), and its one groupedbar chart uses positive data, so the zero-baseline change is byte-identical for
it.
Lane: examples (canonical surface only). No library / public-API change.