Skip to content

Commit 7e8432b

Browse files
committed
fix(examples): show render-pptx in the README hero banner (#458)
The hero was the 2.0 banner with a newer version pill: the kicker read "GRAPHCOMPOSE 2.0 / MODULE-FIRST", the graph was labelled "THE 2.0 MODULE GRAPH", and the module row showed render-pdf, render-docx and an extension slot — no render-pptx. The image at the top of the README omitted the backend the release is about. Both labels now derive their line from the build version, so they cannot announce the release they were typed on again. The extension-slot card gives its place to render-pptx: the ServiceLoader SPI it stood for is already stated by the proof chip below, and the row now carries the three shipped backends. The two fixed-layout cards read alike on purpose — they consume the same resolved layout graph, which is why a deck matches the PDF. The regenerated PNG is stamped 2.1.0 rather than the working 2.1.1-SNAPSHOT, matching the published release; the release script re-renders it on the next cut.
1 parent 58ad29c commit 7e8432b

3 files changed

Lines changed: 123 additions & 66 deletions

File tree

-1.34 KB
Loading

examples/src/main/java/com/demcha/examples/flagships/EngineDeckV2Example.java

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
import java.util.Locale;
4949
import java.util.Objects;
5050
import java.util.Properties;
51+
import java.util.regex.Matcher;
52+
import java.util.regex.Pattern;
5153

5254
/**
5355
* Parallel 2.0 release concept for the GraphCompose README hero and engine
@@ -114,6 +116,15 @@ public final class EngineDeckV2Example {
114116

115117
private static final String VERSION = loadVersion();
116118

119+
/**
120+
* The {@code major.minor} of {@link #VERSION}, for the banner's prose labels.
121+
*
122+
* <p>Derived rather than written out: the banner is regenerated on every release,
123+
* so a literal would keep announcing whichever line it was typed on — the hero
124+
* still read "2.0" while the pill beside it read v2.1.0.</p>
125+
*/
126+
private static final String VERSION_LINE = majorMinor(VERSION);
127+
117128
private EngineDeckV2Example() {
118129
}
119130

@@ -251,7 +262,7 @@ private static DocumentNode heroScene() {
251262
layers.add(at(heroLogo(), 42, 24));
252263
layers.add(at(versionPill(), 742, 36));
253264

254-
layers.add(at(canvasText("HeroKicker", "GRAPHCOMPOSE 2.0 / MODULE-FIRST",
265+
layers.add(at(canvasText("HeroKicker", "GRAPHCOMPOSE " + VERSION_LINE + " / MODULE-FIRST",
255266
darkEyebrow(), TextAlign.LEFT, 420), 52, 126));
256267
layers.add(at(canvasText("HeroLine1", "Compose once.", heroTitle(), TextAlign.LEFT, 410), 52, 156));
257268
layers.add(at(canvasText("HeroLine2", "Render through modules.", heroAccentTitle(), TextAlign.LEFT, 330), 52, 202));
@@ -261,13 +272,17 @@ private static DocumentNode heroScene() {
261272
heroBody(), TextAlign.LEFT, 410), 54, 262));
262273
layers.add(at(heroCoordinate(), 52, 333));
263274

264-
layers.add(at(canvasText("GraphLabel", "THE 2.0 MODULE GRAPH",
275+
layers.add(at(canvasText("GraphLabel", "THE " + VERSION_LINE + " MODULE GRAPH",
265276
darkEyebrow(), TextAlign.LEFT, 690), 622, 112));
266277
layers.addAll(heroModuleConnectors());
267278
layers.add(at(heroCoreCard(), 646, 152));
279+
// The three shipped render backends. The two fixed-layout cards read alike on
280+
// purpose — they consume the same resolved layout graph, which is why a deck
281+
// matches the PDF. The extension slot that used to sit here is already stated
282+
// by the "ServiceLoader SPI" proof chip below, so nothing is lost.
268283
layers.add(at(heroModuleCard("pdf-file", "render-pdf", "fixed layout", MINT), 582, 330));
269-
layers.add(at(heroModuleCard("docx", "render-docx", "semantic", BLUE), 712, 330));
270-
layers.add(at(heroModuleCard("code", "backend SPI", "extension slot", VIOLET_LIGHT), 842, 330));
284+
layers.add(at(heroModuleCard("ppt-file", "render-pptx", "fixed layout", VIOLET_LIGHT), 712, 330));
285+
layers.add(at(heroModuleCard("docx", "render-docx", "semantic", BLUE), 842, 330));
271286

272287
String[][] proof = {
273288
{"graph-compose-core", "lean engine"},
@@ -895,6 +910,18 @@ private static String snapshotDate(EngineDeckData.BenchRun bench) {
895910
return timestamp.substring(0, Math.min(10, timestamp.length()));
896911
}
897912

913+
/**
914+
* Reduces a version to its {@code major.minor} line for display.
915+
*
916+
* @param version the resolved build version, possibly a qualifier or {@code "dev"}
917+
* @return {@code "2.1"} for {@code "2.1.0"} / {@code "2.1.0-SNAPSHOT"}; the input
918+
* unchanged when it carries no dotted numeric prefix
919+
*/
920+
private static String majorMinor(String version) {
921+
Matcher matcher = Pattern.compile("^(\\d+)\\.(\\d+)").matcher(version);
922+
return matcher.find() ? matcher.group(1) + "." + matcher.group(2) : version;
923+
}
924+
898925
private static String loadVersion() {
899926
Properties banner = new Properties();
900927
try (InputStream in = EngineDeckV2Example.class.getResourceAsStream("/banner.properties")) {

examples/src/test/resources/layout-snapshots/flagships/engine-deck-v2.json

Lines changed: 92 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,8 +2354,8 @@
23542354
"left" : 0.0
23552355
}
23562356
}, {
2357-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]",
2358-
"entityName" : "HeroModule_render-docx",
2357+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]",
2358+
"entityName" : "HeroModule_render-pptx",
23592359
"entityKind" : "ShapeContainerNode",
23602360
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]",
23612361
"childIndex" : 35,
@@ -2384,10 +2384,10 @@
23842384
"left" : 0.0
23852385
}
23862386
}, {
2387-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]/SvgIcon[0]",
2387+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]",
23882388
"entityName" : "SvgIcon",
23892389
"entityKind" : "LayerStackNode",
2390-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]",
2390+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]",
23912391
"childIndex" : 0,
23922392
"depth" : 4,
23932393
"layer" : 4,
@@ -2414,10 +2414,10 @@
24142414
"left" : 0.0
24152415
}
24162416
}, {
2417-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]/SvgIcon[0]/SvgLayer0[0]",
2417+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]/SvgLayer0[0]",
24182418
"entityName" : "SvgLayer0",
24192419
"entityKind" : "Path",
2420-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]/SvgIcon[0]",
2420+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]",
24212421
"childIndex" : 0,
24222422
"depth" : 5,
24232423
"layer" : 5,
@@ -2444,10 +2444,10 @@
24442444
"left" : 0.0
24452445
}
24462446
}, {
2447-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]/SvgIcon[0]/SvgLayer1[1]",
2447+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]/SvgLayer1[1]",
24482448
"entityName" : "SvgLayer1",
24492449
"entityKind" : "Path",
2450-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]/SvgIcon[0]",
2450+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]",
24512451
"childIndex" : 1,
24522452
"depth" : 5,
24532453
"layer" : 5,
@@ -2474,10 +2474,10 @@
24742474
"left" : 0.0
24752475
}
24762476
}, {
2477-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]/SvgIcon[0]/SvgLayer2[2]",
2477+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]/SvgLayer2[2]",
24782478
"entityName" : "SvgLayer2",
24792479
"entityKind" : "Path",
2480-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]/SvgIcon[0]",
2480+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]",
24812481
"childIndex" : 2,
24822482
"depth" : 5,
24832483
"layer" : 5,
@@ -2504,10 +2504,70 @@
25042504
"left" : 0.0
25052505
}
25062506
}, {
2507-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]/ParagraphNode[1]",
2507+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]/SvgLayer3[3]",
2508+
"entityName" : "SvgLayer3",
2509+
"entityKind" : "Path",
2510+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]",
2511+
"childIndex" : 3,
2512+
"depth" : 5,
2513+
"layer" : 5,
2514+
"computedX" : 724.0,
2515+
"computedY" : 181.0,
2516+
"placementX" : 724.0,
2517+
"placementY" : 181.0,
2518+
"placementWidth" : 18.0,
2519+
"placementHeight" : 18.0,
2520+
"startPage" : 0,
2521+
"endPage" : 0,
2522+
"contentWidth" : 18.0,
2523+
"contentHeight" : 18.0,
2524+
"margin" : {
2525+
"top" : 0.0,
2526+
"right" : 0.0,
2527+
"bottom" : 0.0,
2528+
"left" : 0.0
2529+
},
2530+
"padding" : {
2531+
"top" : 0.0,
2532+
"right" : 0.0,
2533+
"bottom" : 0.0,
2534+
"left" : 0.0
2535+
}
2536+
}, {
2537+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]/SvgLayer4[4]",
2538+
"entityName" : "SvgLayer4",
2539+
"entityKind" : "Path",
2540+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/SvgIcon[0]",
2541+
"childIndex" : 4,
2542+
"depth" : 5,
2543+
"layer" : 5,
2544+
"computedX" : 724.0,
2545+
"computedY" : 181.0,
2546+
"placementX" : 724.0,
2547+
"placementY" : 181.0,
2548+
"placementWidth" : 18.0,
2549+
"placementHeight" : 18.0,
2550+
"startPage" : 0,
2551+
"endPage" : 0,
2552+
"contentWidth" : 18.0,
2553+
"contentHeight" : 18.0,
2554+
"margin" : {
2555+
"top" : 0.0,
2556+
"right" : 0.0,
2557+
"bottom" : 0.0,
2558+
"left" : 0.0
2559+
},
2560+
"padding" : {
2561+
"top" : 0.0,
2562+
"right" : 0.0,
2563+
"bottom" : 0.0,
2564+
"left" : 0.0
2565+
}
2566+
}, {
2567+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/ParagraphNode[1]",
25082568
"entityName" : null,
25092569
"entityKind" : "ParagraphNode",
2510-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]",
2570+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]",
25112571
"childIndex" : 1,
25122572
"depth" : 4,
25132573
"layer" : 4,
@@ -2534,22 +2594,22 @@
25342594
"left" : 0.0
25352595
}
25362596
}, {
2537-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]/ParagraphNode[2]",
2597+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]/ParagraphNode[2]",
25382598
"entityName" : null,
25392599
"entityKind" : "ParagraphNode",
2540-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[35]",
2600+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-pptx[35]",
25412601
"childIndex" : 2,
25422602
"depth" : 4,
25432603
"layer" : 4,
25442604
"computedX" : 724.0,
25452605
"computedY" : 157.838,
25462606
"placementX" : 724.0,
25472607
"placementY" : 157.838,
2548-
"placementWidth" : 36.009,
2608+
"placementWidth" : 45.522,
25492609
"placementHeight" : 8.325,
25502610
"startPage" : 0,
25512611
"endPage" : 0,
2552-
"contentWidth" : 36.009,
2612+
"contentWidth" : 45.522,
25532613
"contentHeight" : 8.325,
25542614
"margin" : {
25552615
"top" : 0.0,
@@ -2564,8 +2624,8 @@
25642624
"left" : 0.0
25652625
}
25662626
}, {
2567-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]",
2568-
"entityName" : "HeroModule_backend SPI",
2627+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]",
2628+
"entityName" : "HeroModule_render-docx",
25692629
"entityKind" : "ShapeContainerNode",
25702630
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]",
25712631
"childIndex" : 36,
@@ -2594,10 +2654,10 @@
25942654
"left" : 0.0
25952655
}
25962656
}, {
2597-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/SvgIcon[0]",
2657+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]/SvgIcon[0]",
25982658
"entityName" : "SvgIcon",
25992659
"entityKind" : "LayerStackNode",
2600-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]",
2660+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]",
26012661
"childIndex" : 0,
26022662
"depth" : 4,
26032663
"layer" : 4,
@@ -2624,10 +2684,10 @@
26242684
"left" : 0.0
26252685
}
26262686
}, {
2627-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/SvgIcon[0]/SvgLayer0[0]",
2687+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]/SvgIcon[0]/SvgLayer0[0]",
26282688
"entityName" : "SvgLayer0",
26292689
"entityKind" : "Path",
2630-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/SvgIcon[0]",
2690+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]/SvgIcon[0]",
26312691
"childIndex" : 0,
26322692
"depth" : 5,
26332693
"layer" : 5,
@@ -2654,10 +2714,10 @@
26542714
"left" : 0.0
26552715
}
26562716
}, {
2657-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/SvgIcon[0]/SvgLayer1[1]",
2717+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]/SvgIcon[0]/SvgLayer1[1]",
26582718
"entityName" : "SvgLayer1",
26592719
"entityKind" : "Path",
2660-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/SvgIcon[0]",
2720+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]/SvgIcon[0]",
26612721
"childIndex" : 1,
26622722
"depth" : 5,
26632723
"layer" : 5,
@@ -2684,10 +2744,10 @@
26842744
"left" : 0.0
26852745
}
26862746
}, {
2687-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/SvgIcon[0]/SvgLayer2[2]",
2747+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]/SvgIcon[0]/SvgLayer2[2]",
26882748
"entityName" : "SvgLayer2",
26892749
"entityKind" : "Path",
2690-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/SvgIcon[0]",
2750+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]/SvgIcon[0]",
26912751
"childIndex" : 2,
26922752
"depth" : 5,
26932753
"layer" : 5,
@@ -2714,40 +2774,10 @@
27142774
"left" : 0.0
27152775
}
27162776
}, {
2717-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/SvgIcon[0]/SvgLayer3[3]",
2718-
"entityName" : "SvgLayer3",
2719-
"entityKind" : "Path",
2720-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/SvgIcon[0]",
2721-
"childIndex" : 3,
2722-
"depth" : 5,
2723-
"layer" : 5,
2724-
"computedX" : 854.0,
2725-
"computedY" : 181.0,
2726-
"placementX" : 854.0,
2727-
"placementY" : 181.0,
2728-
"placementWidth" : 18.0,
2729-
"placementHeight" : 18.0,
2730-
"startPage" : 0,
2731-
"endPage" : 0,
2732-
"contentWidth" : 18.0,
2733-
"contentHeight" : 18.0,
2734-
"margin" : {
2735-
"top" : 0.0,
2736-
"right" : 0.0,
2737-
"bottom" : 0.0,
2738-
"left" : 0.0
2739-
},
2740-
"padding" : {
2741-
"top" : 0.0,
2742-
"right" : 0.0,
2743-
"bottom" : 0.0,
2744-
"left" : 0.0
2745-
}
2746-
}, {
2747-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/ParagraphNode[1]",
2777+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]/ParagraphNode[1]",
27482778
"entityName" : null,
27492779
"entityKind" : "ParagraphNode",
2750-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]",
2780+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]",
27512781
"childIndex" : 1,
27522782
"depth" : 4,
27532783
"layer" : 4,
@@ -2774,22 +2804,22 @@
27742804
"left" : 0.0
27752805
}
27762806
}, {
2777-
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]/ParagraphNode[2]",
2807+
"path" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]/ParagraphNode[2]",
27782808
"entityName" : null,
27792809
"entityKind" : "ParagraphNode",
2780-
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_backend SPI[36]",
2810+
"parentPath" : "EngineDeckV2[0]/ModuleFirstHero[0]/HeroModule_render-docx[36]",
27812811
"childIndex" : 2,
27822812
"depth" : 4,
27832813
"layer" : 4,
27842814
"computedX" : 854.0,
27852815
"computedY" : 157.838,
27862816
"placementX" : 854.0,
27872817
"placementY" : 157.838,
2788-
"placementWidth" : 55.026,
2818+
"placementWidth" : 36.009,
27892819
"placementHeight" : 8.325,
27902820
"startPage" : 0,
27912821
"endPage" : 0,
2792-
"contentWidth" : 55.026,
2822+
"contentWidth" : 36.009,
27932823
"contentHeight" : 8.325,
27942824
"margin" : {
27952825
"top" : 0.0,

0 commit comments

Comments
 (0)