@wafertools/wafermap 0.40.1 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/AGENTS.md +20 -21
  2. package/CHANGELOG.md +140 -0
  3. package/README.md +6 -6
  4. package/dist/packages/canvas-adapter/canvasTheme.d.ts +12 -0
  5. package/dist/packages/canvas-adapter/canvasTheme.js +1 -1
  6. package/dist/packages/canvas-adapter/cellShade.d.ts +2 -2
  7. package/dist/packages/canvas-adapter/cellShade.js +1 -1
  8. package/dist/packages/canvas-adapter/chartPopulation.d.ts +3 -0
  9. package/dist/packages/canvas-adapter/chartPopulation.js +1 -1
  10. package/dist/packages/canvas-adapter/charts/capability.d.ts +3 -0
  11. package/dist/packages/canvas-adapter/charts/capability.js +1 -1
  12. package/dist/packages/canvas-adapter/charts/cardAbout.d.ts +2 -1
  13. package/dist/packages/canvas-adapter/charts/cardAbout.js +1 -1
  14. package/dist/packages/canvas-adapter/charts/chartShell.d.ts +47 -27
  15. package/dist/packages/canvas-adapter/charts/chartShell.js +1 -1
  16. package/dist/packages/canvas-adapter/charts/commonality.js +4 -4
  17. package/dist/packages/canvas-adapter/charts/correlation.d.ts +6 -12
  18. package/dist/packages/canvas-adapter/charts/correlation.js +1 -1
  19. package/dist/packages/canvas-adapter/charts/divergingScale.d.ts +45 -15
  20. package/dist/packages/canvas-adapter/charts/divergingScale.js +1 -1
  21. package/dist/packages/canvas-adapter/charts/groupComparison.js +1 -1
  22. package/dist/packages/canvas-adapter/charts/palette.d.ts +16 -30
  23. package/dist/packages/canvas-adapter/charts/palette.js +1 -1
  24. package/dist/packages/canvas-adapter/charts/patCard.js +1 -1
  25. package/dist/packages/canvas-adapter/charts/plotChart.d.ts +24 -1
  26. package/dist/packages/canvas-adapter/charts/plotChart.js +1 -1
  27. package/dist/packages/canvas-adapter/charts/regionYieldDiagram.d.ts +3 -0
  28. package/dist/packages/canvas-adapter/charts/regionYieldDiagram.js +1 -1
  29. package/dist/packages/canvas-adapter/charts/sweep.d.ts +3 -0
  30. package/dist/packages/canvas-adapter/charts/sweep.js +1 -1
  31. package/dist/packages/canvas-adapter/chromeRow.d.ts +68 -0
  32. package/dist/packages/canvas-adapter/chromeRow.js +1 -0
  33. package/dist/packages/canvas-adapter/chunked.d.ts +6 -0
  34. package/dist/packages/canvas-adapter/chunked.js +1 -1
  35. package/dist/packages/canvas-adapter/columnFilterPopup.d.ts +25 -0
  36. package/dist/packages/canvas-adapter/columnFilterPopup.js +1 -0
  37. package/dist/packages/canvas-adapter/composePng.d.ts +37 -0
  38. package/dist/packages/canvas-adapter/composePng.js +1 -0
  39. package/dist/packages/canvas-adapter/dataTab.d.ts +27 -0
  40. package/dist/packages/canvas-adapter/dataTab.js +1 -1
  41. package/dist/packages/canvas-adapter/dieList.js +1 -1
  42. package/dist/packages/canvas-adapter/differenceMapPanel.d.ts +3 -1
  43. package/dist/packages/canvas-adapter/differenceMapPanel.js +1 -1
  44. package/dist/packages/canvas-adapter/drilldown.d.ts +19 -0
  45. package/dist/packages/canvas-adapter/drilldown.js +1 -1
  46. package/dist/packages/canvas-adapter/filterEditor.d.ts +5 -0
  47. package/dist/packages/canvas-adapter/filterEditor.js +1 -1
  48. package/dist/packages/canvas-adapter/guideWindow.js +1 -1
  49. package/dist/packages/canvas-adapter/icons.js +1 -1
  50. package/dist/packages/canvas-adapter/identityHeader.d.ts +5 -0
  51. package/dist/packages/canvas-adapter/identityHeader.js +1 -1
  52. package/dist/packages/canvas-adapter/index.d.ts +7 -0
  53. package/dist/packages/canvas-adapter/index.js +1 -1
  54. package/dist/packages/canvas-adapter/insightsTab.d.ts +23 -5
  55. package/dist/packages/canvas-adapter/insightsTab.js +1 -1
  56. package/dist/packages/canvas-adapter/maplessSummary.d.ts +4 -2
  57. package/dist/packages/canvas-adapter/maplessSummary.js +1 -1
  58. package/dist/packages/canvas-adapter/openWaferMode.js +1 -1
  59. package/dist/packages/canvas-adapter/panelChart.d.ts +7 -0
  60. package/dist/packages/canvas-adapter/panelChart.js +1 -0
  61. package/dist/packages/canvas-adapter/panelTable.d.ts +50 -0
  62. package/dist/packages/canvas-adapter/panelTable.js +1 -0
  63. package/dist/packages/canvas-adapter/plotCard.js +1 -1
  64. package/dist/packages/canvas-adapter/plotEditor.d.ts +12 -0
  65. package/dist/packages/canvas-adapter/plotEditor.js +10 -10
  66. package/dist/packages/canvas-adapter/plotItems.d.ts +9 -4
  67. package/dist/packages/canvas-adapter/plotItems.js +1 -1
  68. package/dist/packages/canvas-adapter/plotJsonComplete.js +1 -1
  69. package/dist/packages/canvas-adapter/plotModal.d.ts +7 -0
  70. package/dist/packages/canvas-adapter/plotModal.js +1 -1
  71. package/dist/packages/canvas-adapter/plotStore.js +1 -1
  72. package/dist/packages/canvas-adapter/plotTab.d.ts +59 -1
  73. package/dist/packages/canvas-adapter/plotTab.js +1 -1
  74. package/dist/packages/canvas-adapter/renderWaferGallery.d.ts +7 -0
  75. package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
  76. package/dist/packages/canvas-adapter/renderWaferMap.d.ts +41 -9
  77. package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
  78. package/dist/packages/canvas-adapter/reportCharts.d.ts +41 -0
  79. package/dist/packages/canvas-adapter/reportCharts.js +1 -0
  80. package/dist/packages/canvas-adapter/reportExport.d.ts +91 -0
  81. package/dist/packages/canvas-adapter/reportExport.js +1 -0
  82. package/dist/packages/canvas-adapter/reportFigures.d.ts +29 -0
  83. package/dist/packages/canvas-adapter/reportFigures.js +1 -0
  84. package/dist/packages/canvas-adapter/reportRun.d.ts +9 -0
  85. package/dist/packages/canvas-adapter/reportRun.js +1 -0
  86. package/dist/packages/canvas-adapter/selectionOverlay.d.ts +12 -0
  87. package/dist/packages/canvas-adapter/selectionOverlay.js +1 -0
  88. package/dist/packages/canvas-adapter/summaryPanel.d.ts +150 -109
  89. package/dist/packages/canvas-adapter/summaryPanel.js +7 -4
  90. package/dist/packages/canvas-adapter/summaryToggle.js +1 -1
  91. package/dist/packages/canvas-adapter/tableDrilldown.d.ts +48 -0
  92. package/dist/packages/canvas-adapter/tableDrilldown.js +1 -0
  93. package/dist/packages/canvas-adapter/tableFilter.d.ts +42 -0
  94. package/dist/packages/canvas-adapter/tableFilter.js +1 -0
  95. package/dist/packages/canvas-adapter/tablePlots.d.ts +85 -0
  96. package/dist/packages/canvas-adapter/tablePlots.js +1 -0
  97. package/dist/packages/canvas-adapter/themeWatch.d.ts +7 -0
  98. package/dist/packages/canvas-adapter/themeWatch.js +1 -0
  99. package/dist/packages/canvas-adapter/toCanvas.d.ts +3 -0
  100. package/dist/packages/canvas-adapter/toCanvas.js +1 -1
  101. package/dist/packages/canvas-adapter/toolbar.d.ts +125 -36
  102. package/dist/packages/canvas-adapter/toolbar.js +2 -2
  103. package/dist/packages/canvas-adapter/userGuideHtml.d.ts +1 -1
  104. package/dist/packages/canvas-adapter/userGuideHtml.js +521 -412
  105. package/dist/packages/canvas-adapter/version.d.ts +2 -2
  106. package/dist/packages/canvas-adapter/version.js +1 -1
  107. package/dist/packages/canvas-adapter/viewSwitch.js +1 -1
  108. package/dist/packages/canvas-adapter/virtualTable.d.ts +35 -6
  109. package/dist/packages/canvas-adapter/virtualTable.js +1 -1
  110. package/dist/packages/core/aggregates.d.ts +14 -0
  111. package/dist/packages/core/aggregates.js +1 -1
  112. package/dist/packages/core/dies.d.ts +7 -0
  113. package/dist/packages/core/dies.js +1 -1
  114. package/dist/packages/core/utils.d.ts +2 -0
  115. package/dist/packages/core/utils.js +1 -1
  116. package/dist/packages/experimental/charts.d.ts +4 -0
  117. package/dist/packages/experimental/charts.js +1 -0
  118. package/dist/packages/renderer/binColors.d.ts +6 -2
  119. package/dist/packages/renderer/binColors.js +1 -1
  120. package/dist/packages/renderer/buildView.d.ts +36 -14
  121. package/dist/packages/renderer/buildView.js +1 -1
  122. package/dist/packages/renderer/buildWaferMap.d.ts +8 -0
  123. package/dist/packages/renderer/buildWaferMap.js +1 -1
  124. package/dist/packages/renderer/categoryColors.d.ts +3 -0
  125. package/dist/packages/renderer/categoryColors.js +1 -0
  126. package/dist/packages/renderer/colorMap.d.ts +15 -16
  127. package/dist/packages/renderer/colorMap.js +1 -1
  128. package/dist/packages/renderer/colorSchemes.d.ts +34 -30
  129. package/dist/packages/renderer/colorSchemes.js +1 -1
  130. package/dist/packages/renderer/dataColors.d.ts +126 -0
  131. package/dist/packages/renderer/dataColors.js +1 -0
  132. package/dist/packages/renderer/deprecate.js +1 -1
  133. package/dist/packages/renderer/fmt.d.ts +14 -0
  134. package/dist/packages/renderer/fmt.js +1 -1
  135. package/dist/packages/renderer/index.d.ts +2 -0
  136. package/dist/packages/renderer/index.js +1 -1
  137. package/dist/packages/renderer/spec.d.ts +5 -0
  138. package/dist/packages/renderer/spec.js +1 -1
  139. package/dist/packages/renderer/stacks.d.ts +21 -0
  140. package/dist/packages/renderer/stacks.js +1 -0
  141. package/dist/packages/renderer/timeAxis.d.ts +19 -0
  142. package/dist/packages/renderer/timeAxis.js +1 -0
  143. package/dist/packages/stats/analyzeWaferLot.js +1 -1
  144. package/dist/packages/stats/analyzeWaferMap.d.ts +2 -4
  145. package/dist/packages/stats/analyzeWaferMap.js +1 -1
  146. package/dist/packages/stats/binRows.js +1 -1
  147. package/dist/packages/stats/binShifts.d.ts +59 -0
  148. package/dist/packages/stats/binShifts.js +1 -0
  149. package/dist/packages/stats/capability.d.ts +6 -1
  150. package/dist/packages/stats/capability.js +1 -1
  151. package/dist/packages/stats/chartCatalogue.d.ts +3 -0
  152. package/dist/packages/stats/chartCatalogue.js +1 -1
  153. package/dist/packages/stats/clusterDetection.js +1 -1
  154. package/dist/packages/stats/columnPlot.d.ts +38 -0
  155. package/dist/packages/stats/columnPlot.js +1 -0
  156. package/dist/packages/stats/commonality.d.ts +7 -0
  157. package/dist/packages/stats/commonality.js +1 -1
  158. package/dist/packages/stats/correlation.d.ts +7 -2
  159. package/dist/packages/stats/correlation.js +1 -1
  160. package/dist/packages/stats/dataTable.d.ts +44 -0
  161. package/dist/packages/stats/dataTable.js +1 -0
  162. package/dist/packages/stats/dieRegions.js +1 -1
  163. package/dist/packages/stats/facets.d.ts +11 -0
  164. package/dist/packages/stats/facets.js +1 -1
  165. package/dist/packages/stats/filterFindings.d.ts +21 -0
  166. package/dist/packages/stats/filterFindings.js +1 -1
  167. package/dist/packages/stats/math.d.ts +2 -0
  168. package/dist/packages/stats/math.js +1 -1
  169. package/dist/packages/stats/overview.d.ts +114 -0
  170. package/dist/packages/stats/overview.js +1 -0
  171. package/dist/packages/stats/pat.d.ts +0 -2
  172. package/dist/packages/stats/pat.js +1 -1
  173. package/dist/packages/stats/patternClassification.d.ts +20 -3
  174. package/dist/packages/stats/patternClassification.js +1 -1
  175. package/dist/packages/stats/permutationNull.d.ts +16 -0
  176. package/dist/packages/stats/permutationNull.js +1 -0
  177. package/dist/packages/stats/plotData.d.ts +131 -10
  178. package/dist/packages/stats/plotData.js +1 -1
  179. package/dist/packages/stats/plotSpec.d.ts +10 -1
  180. package/dist/packages/stats/plotSpec.js +3 -3
  181. package/dist/packages/stats/plotTable.js +1 -1
  182. package/dist/packages/stats/plotWords.d.ts +52 -0
  183. package/dist/packages/stats/plotWords.js +1 -0
  184. package/dist/packages/stats/presentation.d.ts +63 -14
  185. package/dist/packages/stats/presentation.js +1 -1
  186. package/dist/packages/stats/presentationPresets.d.ts +35 -0
  187. package/dist/packages/stats/presentationPresets.js +1 -0
  188. package/dist/packages/stats/presentationSections.d.ts +83 -0
  189. package/dist/packages/stats/presentationSections.js +1 -0
  190. package/dist/packages/stats/renderSummaryReport.d.ts +80 -2
  191. package/dist/packages/stats/renderSummaryReport.js +1 -67
  192. package/dist/packages/stats/reportBlocks.d.ts +249 -0
  193. package/dist/packages/stats/reportBlocks.js +1 -0
  194. package/dist/packages/stats/reportContents.d.ts +22 -0
  195. package/dist/packages/stats/reportContents.js +1 -0
  196. package/dist/packages/stats/reportDeck.d.ts +245 -0
  197. package/dist/packages/stats/reportDeck.js +212 -0
  198. package/dist/packages/stats/reportHtml.d.ts +44 -43
  199. package/dist/packages/stats/reportHtml.js +82 -46
  200. package/dist/packages/stats/reportMaps.d.ts +67 -0
  201. package/dist/packages/stats/reportMaps.js +1 -0
  202. package/dist/packages/stats/reportSections.d.ts +55 -0
  203. package/dist/packages/stats/reportSections.js +1 -0
  204. package/dist/packages/stats/sweep.d.ts +14 -6
  205. package/dist/packages/stats/sweep.js +1 -1
  206. package/dist/packages/stats/synthesis.d.ts +79 -9
  207. package/dist/packages/stats/synthesis.js +1 -1
  208. package/dist/packages/stats/types.d.ts +22 -0
  209. package/dist/packages/stats/worthItems.d.ts +15 -0
  210. package/dist/packages/stats/worthItems.js +1 -0
  211. package/dist/packages/stats/yield.d.ts +13 -0
  212. package/dist/packages/stats/yield.js +1 -1
  213. package/llms.txt +1 -1
  214. package/package.json +6 -1
@@ -0,0 +1,245 @@
1
+ import type { ReportBadge, ReportBlock, ReportCell, ReportDocument, ReportFigure, ReportMetric, ReportSwatch } from './reportBlocks.js';
2
+ /** The program that made the report, named on the title page and the data details slide. */
3
+ export interface ReportProducer {
4
+ /** Its name, as the product writes it (for example `tsmap`). */
5
+ name: string;
6
+ version: string;
7
+ /** Where to find it, shown under its name. */
8
+ url?: string;
9
+ /** The program's mark for the title page, as an image URL or a `data:` URL. Absent: the title page has no mark. */
10
+ icon?: string;
11
+ }
12
+ export interface ReportDeckOptions {
13
+ /** The time the deck says it was made, as text. */
14
+ now: string;
15
+ /** This library's version, always named on the data details slide. */
16
+ libraryVersion: string;
17
+ producer?: ReportProducer;
18
+ /** A second line under the title (a configuration's name, a meeting). */
19
+ subtitle?: string;
20
+ /** Further lines for the data details slide (the host's source files, a configuration name). */
21
+ details?: ReportMetric[];
22
+ /**
23
+ * Each figure's picture, as an image URL or a `data:` URL (`drawReportFigures` in canvas-adapter draws them). A figure
24
+ * without one is left out, and so is a section left with nothing to show.
25
+ */
26
+ figureSrc?: FigureSource;
27
+ }
28
+ /** A figure's picture: its URL, or its URL and a text alternative (a chart's title). */
29
+ export type FigureSource = (figure: ReportFigure) => string | {
30
+ src: string;
31
+ alt?: string;
32
+ width?: number;
33
+ height?: number;
34
+ } | undefined;
35
+ /** One cell of a slide's table, as text and how to show it. */
36
+ export interface SlideCell {
37
+ text: string;
38
+ /** A figure: right-aligned. */
39
+ numeric?: boolean;
40
+ /** Written in grey (pass bins in a bin table, a cost). */
41
+ muted?: boolean;
42
+ /** Not wrapped. */
43
+ nowrap?: boolean;
44
+ /** Bold words before `text` ("Ring 4 (edge): pass rate" in What stands out). */
45
+ lead?: string;
46
+ /** A bar beside the figure, 0–100, in `color` when given (a writer that cannot draw one keeps the figure). */
47
+ bar?: {
48
+ percent: number;
49
+ color?: string;
50
+ };
51
+ /** A shortfall of 1, 2 or 4 and more points: the cell is tinted by step (`shortfallColor`). */
52
+ shortfall?: 1 | 2 | 3;
53
+ /** A level word in its colour: a finding's strength, an item's impact. */
54
+ tone?: 'high' | 'medium';
55
+ /** Set in under the row before it (a finding a pattern explains). */
56
+ indent?: boolean;
57
+ }
58
+ /** Something placed on a slide, in reading order. */
59
+ export type SlideItem =
60
+ /** `large`: a short table, set in larger type (24 px). */
61
+ {
62
+ kind: 'table';
63
+ headers: string[];
64
+ numeric: boolean[];
65
+ rows: SlideCell[][];
66
+ large?: boolean;
67
+ }
68
+ /** Tiles, `columns` to a row. */
69
+ | {
70
+ kind: 'metrics';
71
+ items: ReportMetric[];
72
+ columns: number;
73
+ } | {
74
+ kind: 'definitions';
75
+ entries: ReportMetric[];
76
+ } | {
77
+ kind: 'text';
78
+ text: string;
79
+ style: 'legend' | 'note' | 'headline';
80
+ } | {
81
+ kind: 'subheading';
82
+ text: string;
83
+ }
84
+ /** Short labels in a row, each level in its colour (an item's importance, strength and reach). */
85
+ | {
86
+ kind: 'badges';
87
+ badges: ReportBadge[];
88
+ }
89
+ /** One map, large, with its legend beside it and, for one wafer of several, its label under it. */
90
+ | {
91
+ kind: 'map';
92
+ src: string;
93
+ alt: string;
94
+ legend: ReportSwatch[];
95
+ caption?: string;
96
+ /** Below something else on its slide: drawn a little smaller (500 px, not 560). */
97
+ compact?: boolean;
98
+ }
99
+ /**
100
+ * Many small maps in a grid of `columns`, each labelled, under one legend. `size` is each map's width in CSS pixels when
101
+ * the maps to a slide were chosen; absent, the columns share the slide's width.
102
+ */
103
+ | {
104
+ kind: 'grid';
105
+ columns: number;
106
+ maps: Array<{
107
+ src: string;
108
+ label: string;
109
+ }>;
110
+ legend: ReportSwatch[];
111
+ size?: number;
112
+ }
113
+ /** One or two charts side by side (one with the slide's width when it is wide); each picture has its title in it. */
114
+ | {
115
+ kind: 'charts';
116
+ charts: Array<{
117
+ src: string;
118
+ alt: string;
119
+ width?: number;
120
+ height?: number;
121
+ }>;
122
+ }
123
+ /**
124
+ * An item's evidence side by side: its chart on the left, the maps of its dies on the right in a grid of `columns` maps
125
+ * of `size` CSS pixels, each labelled, under the bins' legend (empty for value maps, which carry their colour bar).
126
+ */
127
+ | {
128
+ kind: 'evidence';
129
+ chart?: {
130
+ src: string;
131
+ alt: string;
132
+ width?: number;
133
+ height?: number;
134
+ };
135
+ maps: Array<{
136
+ src: string;
137
+ label: string;
138
+ }>;
139
+ columns: number;
140
+ size: number;
141
+ legend: ReportSwatch[];
142
+ };
143
+ /** A section's part of a slide: its heading, a smaller line under it (what the heading's detail was), and what is under them. */
144
+ export interface SlidePage {
145
+ title: string;
146
+ subtitle?: string;
147
+ items: SlideItem[];
148
+ /** A statement: its sentence is its whole message (nothing found here), set large in the middle of the slide. */
149
+ statement?: boolean;
150
+ }
151
+ export type ReportSlide =
152
+ /** `subtitle` is what followed a dash in the title ("Lot PVT-LOT-05"); `note` the host's own second line. */
153
+ {
154
+ kind: 'title';
155
+ title: string;
156
+ subtitle?: string;
157
+ note?: string;
158
+ facts: ReportMetric[];
159
+ madeWith: string;
160
+ url?: string;
161
+ icon?: string;
162
+ }
163
+ /** Each entry with the number of the slide it starts on (1-based); a part of a load split in several is `part`. */
164
+ | {
165
+ kind: 'contents';
166
+ entries: Array<{
167
+ title: string;
168
+ slide: number;
169
+ part?: boolean;
170
+ }>;
171
+ }
172
+ /** A part of a load split in several: what sets it apart, alone, and a line under it ("Part 1 of 2 · 19 wafers"). */
173
+ | {
174
+ kind: 'divider';
175
+ title: string;
176
+ subtitle?: string;
177
+ }
178
+ /** One section's page, several under one another, or (`columns`) the first two side by side and any others under them. */
179
+ | {
180
+ kind: 'sections';
181
+ pages: SlidePage[];
182
+ columns: boolean;
183
+ } | {
184
+ kind: 'details';
185
+ entries: ReportMetric[];
186
+ };
187
+ /** The deck's colours, as `#rrggbb`: always light, for projectors and paper. */
188
+ export interface SlideColours {
189
+ /** Text. */
190
+ ink: string;
191
+ /** Secondary text: table headers, notes, labels. */
192
+ muted: string;
193
+ /** Rules under table rows. */
194
+ line: string;
195
+ /** The ground of a metric tile and a bar's track. */
196
+ surface: string;
197
+ /** A bar's fill. */
198
+ bar: string;
199
+ /** A High and a Medium level word. */
200
+ high: string;
201
+ medium: string;
202
+ /** A shortfall's tint on white, steps 1 to 3 (`SlideCell.shortfall`). */
203
+ shortfall: readonly [string, string, string];
204
+ /** The same tints as translucent colours, for the HTML deck's styles (Classic's when absent). */
205
+ shortfallTints?: readonly [string, string, string];
206
+ }
207
+ /** The deck's colours: the report's own ink and lines, with the bars and shortfall tints from a data colour scheme. */
208
+ export declare function slideColours(dataColors?: string): SlideColours;
209
+ /** The report as slides. */
210
+ export interface ReportSlides {
211
+ title: string;
212
+ colours: SlideColours;
213
+ /** The program and library that made it ("tsmap 1.6.0 and wafermap 0.41.0"). */
214
+ generator: string;
215
+ slides: ReportSlide[];
216
+ }
217
+ /**
218
+ * A title as a slide shows it: the name, and what followed its first dash on a smaller line under it. "Hard bin breakdown
219
+ * — share of 4,199 dies" is the title "Hard bin breakdown" over "Share of 4,199 dies"; a slide's title is never a chain.
220
+ */
221
+ export declare function splitTitle(text: string): {
222
+ title: string;
223
+ subtitle?: string;
224
+ };
225
+ export declare function slideSentence(text: string): string;
226
+ /**
227
+ * A table as a slide shows it (`SlideTable`): its slide columns; at most MAX_ROWS rows, the rows it marks as bad news
228
+ * first and then the worst by its ranking column; and a note that describes the rows left out, so what is not shown is
229
+ * never unsaid ("18 more tests: limit yield 99.2% to 100.0%, none marked"). Rows keep the table's order when it has no
230
+ * ranking. The Summary report shows every row.
231
+ */
232
+ export declare function fitTable(block: Extract<ReportBlock, {
233
+ kind: 'table';
234
+ }>): {
235
+ headers: string[];
236
+ rows: ReportCell[][];
237
+ note?: string;
238
+ };
239
+ /** The report document as slides: what each slide holds, in order, for any writer. */
240
+ export declare function layoutReportSlides(doc: ReportDocument, options: ReportDeckOptions): ReportSlides;
241
+ /** Slides as a self-contained HTML deck. */
242
+ export declare function slidesHtml(deck: ReportSlides): string;
243
+ /** The report document as a self-contained HTML slide deck. */
244
+ export declare function renderReportDeckHtml(doc: ReportDocument, options: ReportDeckOptions): string;
245
+ //# sourceMappingURL=reportDeck.d.ts.map
@@ -0,0 +1,212 @@
1
+ import{findingRows as V,synthesisRows as q,synthesisLowStrengthLine as K}from"./reportHtml.js";import{SEVERITY_MARK as E,SHORTFALL_ALPHA as Y,barPercent as J,formatPoints as L,shortfallColor as x,shortfallStep as R}from"./presentation.js";import{barOnWhite as Q,dataColorsFor as Z,shortfallRgb as ee}from"../renderer/dataColors.js";import{escHtml as te}from"../core/utils.js";const ne=(e,t)=>"#"+t.map(i=>Math.round(255-e*(255-i)).toString(16).padStart(2,"0")).join("");export function slideColours(e){const t=Z(e),i=n=>ne(Y[n],ee(n,t));return{ink:"#1f2328",muted:"#5c6570",line:"#d8dee6",surface:"#f7f8fa",bar:Q(t.quantity),high:"#b4372f",medium:"#a8741a",shortfall:[i(1),i(2),i(3)],shortfallTints:[x(1,e),x(2,e),x(3,e)]}}const ie=1.9,se=7,ae=9,T=3,$=1280,D=720,O=" (continued)";export function splitTitle(e){const t=e.indexOf(" \u2014 ");if(t<0)return{title:e};const i=e.slice(t+3).trim(),n=/^[a-z]+ [a-z]+\b/.test(i);return{title:e.slice(0,t).trim(),...i?{subtitle:n?i.charAt(0).toUpperCase()+i.slice(1):i}:{}}}const re=4,H=16.5,oe=2.5,z=H-2.6,b=8,j=1.3,y=(e,t="note")=>t==="headline"?.5+Math.ceil(e.length/85)*1:.35+Math.ceil(e.length/130)*.7;function le(e){if(typeof e=="string")return{text:e};if("delta"in e){const t=R(e.delta);return{text:L(e.delta),numeric:!0,...t?{shortfall:t}:{}}}return{text:e.text,...e.numeric||e.bar?{numeric:!0}:{},...e.muted?{muted:!0}:{},...e.flag?{tone:"high"}:{},...e.bar?{bar:e.bar}:{}}}function ce(e,t){return Array.from({length:t},(i,n)=>e.length>0&&e.every(o=>{const c=o[n];return c!==void 0&&typeof c!="string"&&("delta"in c||!!c.numeric||!!c.bar)}))}function de(e){const t=Math.max(4,Math.floor((($-128)/e.length-20)/11));return Math.max(1,...e.map(i=>Math.ceil(i.length/t)))}function A(e,t,i,n){const o=i.length<=Se,c=o?n*1.35:n,s={headers:e,numeric:t,...o?{large:!0}:{}},l=1.4+(de(e)-1)*.85,p=i.length<=b?l+i.length*c:void 0,a=Math.ceil(i.length/Math.ceil(i.length/b));return i.map((d,u)=>({cost:c+(u===0?l:0),row:{table:s,cells:d},...u===0&&p?{whole:p,wholeRows:i.length}:{},...!p&&u>0&&u%a===0?{breakBefore:!0}:{}}))}const he=10,pe=8;function ue(e){if(e<=he)return[Array.from({length:e},(n,o)=>o)];const t=Math.ceil((e-1)/pe),i=Math.ceil((e-1)/t);return Array.from({length:t},(n,o)=>[0,...Array.from({length:Math.min(i,e-1-o*i)},(c,s)=>1+o*i+s)])}const fe=$-128,ge=500,C=24,F=12,P=8,me=9.5,xe=410,we=Math.floor(($-128-32)*.4),W=2.5,be=($-128-32)/2,ye=430,$e=.9,ve=9.5;function ke(e){let t={columns:e,size:0};for(let i=1;i<=e;i++){const n=Math.ceil(e/i),o=Math.floor(Math.min((we-(n-1)*F)/n,(xe-i*C-(i-1)*P-22)/i));o>t.size&&(t={columns:n,size:o})}return t}function Me(e){let t={columns:e,size:0};for(let i=1;i<=e;i++){const n=Math.ceil(e/i),o=Math.floor(Math.min((fe-(n-1)*F)/n,(ge-i*C-(i-1)*P)/i));o>t.size&&(t={columns:n,size:o})}return t}const N=170;export function slideSentence(e){if(e.length<=N)return e;const t=Math.max(e.lastIndexOf("; ",N),e.lastIndexOf(". ",N));return t>N/2?e.slice(0,t)+(e[t]==="."?".":""):e}const Se=5,U=e=>e<=4?Math.max(1,e):3,G=16;function Ee(e){if(e.length<=60)return e;const t=e.split(", ");return t.length>2?`${t.length} values: ${t[0]} \u2026 ${t[t.length-1]}`:`${e.slice(0,e.lastIndexOf(" ",57)>30?e.lastIndexOf(" ",57):57)} \u2026`}const B=6;function X(e){const t=["High","Medium","Low"],i=new Map;for(const n of e)i.set(n,(i.get(n)??0)+1);return[...i].sort((n,o)=>t.indexOf(n[0])-t.indexOf(o[0])).map(([n,o])=>`${o} ${n}`).join(", ")}function v(e){if(e===void 0)return NaN;if(typeof e!="string"&&"delta"in e)return e.delta;const t=/-?[\d,]*\.?\d+/.exec((typeof e=="string"?e:e.text).replace(/−/g,"-"));return t?Number(t[0].replace(/,/g,"")):NaN}const S=e=>e===void 0?"":typeof e=="string"?e:"delta"in e?L(e.delta):e.text,ze=e=>e.some(t=>typeof t!="string"&&("delta"in t?R(t.delta)>0:!!t.flag));export function fitTable(e){const t=e.slide,i=t?.columns??e.headers.map((r,f)=>f),n=r=>i.map(f=>r[f]),o=i.map(r=>e.headers[r]);if(e.rows.length<=b)return{headers:o,rows:e.rows.map(n)};const c=e.rows.map((r,f)=>({r,i:f,warn:ze(r)}));let s;if(t?.rank){const{column:r,worst:f}=t.rank,g=m=>{const w=v(m[r]);return Number.isNaN(w)?-1/0:f==="low"?-w:w};s=[...c].sort((m,w)=>Number(w.warn)-Number(m.warn)||g(w.r)-g(m.r)||m.i-w.i).slice(0,b)}else{const r=c.filter(f=>f.warn).slice(0,b);s=[...r,...c.filter(f=>!f.warn).slice(0,b-r.length)].sort((f,g)=>f.i-g.i)}const l=new Set(s.map(r=>r.i)),p=c.filter(r=>!l.has(r.i)),a=t?.noun??"rows",d=[];if(t?.describe!==void 0){const r=t.describe,f=p.filter(g=>Number.isFinite(v(g.r[r])));if(f.length){const g=f.reduce((k,M)=>v(M.r[r])<v(k.r[r])?M:k),m=f.reduce((k,M)=>v(M.r[r])>v(k.r[r])?M:k),w=e.headers[r].toLowerCase();d.push(S(g.r[r])===S(m.r[r])?`${w} ${S(g.r[r])}`:`${w} ${S(g.r[r])} to ${S(m.r[r])}`)}f.length<p.length&&d.push(`${p.length-f.length} with no ${e.headers[r].toLowerCase()}`)}c.some(r=>r.warn)&&!p.some(r=>r.warn)&&d.push("none marked");const u=`${p.length} more ${a}${d.length?`: ${d.join(", ")}`:""}. Every row is in the Summary report.`;return{headers:o,rows:(t?.rank,s).map(r=>n(r.r)),note:u}}function je(e,t){const i=n=>{const o=t(n);return typeof o=="string"?o:o?.src};switch(e.kind){case"figure":{const n=i(e.figure);return n?[{cost:z,item:{kind:"map",src:n,alt:e.alt,legend:e.legend,...e.caption?{caption:e.caption}:{}}}]:[]}case"badges":return e.badges.length?[{cost:1.6,item:{kind:"badges",badges:e.badges}}]:[];case"evidence":{const n=e.chart?t(e.chart):void 0,o=typeof n=="string"?n:n?.src,c=o?{src:o,alt:(typeof n=="object"?n?.alt:void 0)??"Chart",...typeof n=="object"&&n?.width&&n?.height?{width:n.width,height:n.height}:{}}:void 0,s=e.maps.flatMap(p=>{const a=i(p.figure);return a?[{src:a,label:p.label}]:[]});if(!c&&!s.length)return[];const l=s.length?ke(s.length):{columns:1,size:0};return[{cost:me,item:{kind:"evidence",...c?{chart:c}:{},maps:s,columns:l.columns,size:l.size,legend:e.legend}}]}case"plots":case"charts":{const n=(e.kind==="charts"?e.charts:e.plots).flatMap(s=>{const l=t(s),p=typeof l=="string"?l:l?.src;if(!p)return[];const a=typeof l=="object"?l:void 0;return[{src:p,alt:a?.alt??"Chart",width:a?.width,height:a?.height,wide:!!a?.width&&!!a?.height&&a.width/a.height>ie}]}),o=s=>!s.width||!s.height||Math.min(be/(s.width/W),ye/(s.height/W))>=$e,c=[];for(let s=0;s<n.length;){const l=!n[s].wide&&n[s+1]&&!n[s+1].wide&&o(n[s])&&o(n[s+1]),p=n.slice(s,s+(l?2:1));c.push({cost:ve,item:{kind:"charts",charts:p.map(({wide:a,...d})=>d)}}),s+=p.length}return c}case"figures":{const n=e.figures.flatMap(p=>{const a=i(p.figure);return a?[{src:a,label:p.label}]:[]});if(e.perSlide===1)return n.map(p=>({cost:z,item:{kind:"map",src:p.src,alt:p.label,legend:e.legend,caption:p.label}}));if(e.perSlide){const{columns:p,size:a}=Me(Math.min(e.perSlide,n.length)),d=[];for(let u=0;u<n.length;u+=e.perSlide)d.push({cost:z,item:{kind:"grid",columns:p,size:a,maps:n.slice(u,u+e.perSlide),legend:e.legend}});return d}const o=Math.ceil(n.length/(T*ae)),c=Math.ceil(n.length/Math.max(1,o)),s=Math.max(se,Math.ceil(c/T)),l=[];for(let p=0;p<n.length;p+=c)l.push({cost:z,item:{kind:"grid",columns:s,maps:n.slice(p,p+c),legend:e.legend}});return l}case"metrics":return[{cost:Math.ceil(e.items.length/U(e.items.length))*5.2,item:{kind:"metrics",items:e.items,columns:U(e.items.length)}}];case"definitions":{const n=e.entries.slice(0,G).map(s=>({...s,value:Ee(s.value)})),o=e.entries.slice(G),c=o.length?`${o.length} more: ${o.map(s=>s.label).join(", ")}. Every value is in the Summary report.`:void 0;return[{cost:Math.ceil(n.length/2)*1.3,item:{kind:"definitions",entries:n}},...c?[{cost:y(c),item:{kind:"text",text:c,style:"note"},tail:!0}]:[]]}case"text":{const n=e.style==="headline"?slideSentence(e.text):e.text;return n?[{cost:y(n,e.style),item:{kind:"text",text:n,style:e.style},tail:e.style==="legend",keepWithNext:e.style==="headline"}]:[]}case"subheading":return[{cost:1.8,item:{kind:"subheading",text:e.text},keepWithNext:!0}];case"table":{if(!e.rows.length)return[{cost:1,item:{kind:"text",text:e.emptyMessage??"No data",style:"note"}}];const n=fitTable(e),o=ce(n.rows,n.headers.length),c=n.rows.map(s=>s.map(le));return[...ue(n.headers.length).flatMap(s=>A(s.map(l=>n.headers[l]),s.map(l=>o[l]),c.map(l=>s.map(p=>l[p])),j)),...n.note?[{cost:y(n.note),item:{kind:"text",text:n.note,style:"note"},tail:!0}]:[]]}case"findings":{const{rows:n,coverageHeader:o,notes:c}=V(e.findings,e.totalWafers);if(!n.length)return[{cost:1,item:{kind:"text",text:"No significant findings",style:"note"}}];const s=r=>["high","medium","low"].indexOf(E[r.finding.severity].tier),l=new Set([...n].map((r,f)=>({r,i:f})).sort((r,f)=>s(r.r)-s(f.r)||r.i-f.i).slice(0,b).map(r=>r.r)),p=n.filter(r=>l.has(r)),a=n.filter(r=>!l.has(r)),d=a.length?`${a.length} more finding${a.length===1?"":"s"}: ${X(a.map(r=>E[r.finding.severity].level))}. Every finding is in the Summary report.`:void 0,u=p.map(r=>{const f=E[r.finding.severity].tier;return[{text:E[r.finding.severity].level,nowrap:!0,...f==="high"||f==="medium"?{tone:f}:{}},{text:r.region,...r.nested?{indent:!0}:{}},{text:r.metric},{text:r.delta,numeric:!0},{text:r.coverage,numeric:!0}]});return[...A(["Strength","Region","Metric","Delta",o],[!1,!1,!1,!0,!0],u,j),...[...d?[d]:[],...c].map(r=>({cost:y(r),item:{kind:"text",text:r,style:"note"},tail:!0}))]}case"synthesis":{const n=e.synthesis,o=q(n),c=o.slice(0,B),s=o.slice(B),l=c.map(d=>[{text:d.impact,nowrap:!0,...d.item.impact==="high"||d.item.impact==="medium"?{tone:d.item.impact}:{}},e.brief?{text:d.brief}:{lead:d.brief,text:d.text},{text:d.cost,numeric:!0,muted:!0}]),p=[s.length?`${s.length} more item${s.length===1?"":"s"}: ${X(s.map(d=>d.impact))}.`:"",K(n,e.findingsListed===!1?"":"in the Findings table")??""].filter(Boolean).join(" ")||void 0,a=e.findingsListed===!1?n.checked:`${n.checked} Every finding is in the Findings table.`;return[...e.headline!==!1?[{cost:y(n.headline,"headline"),item:{kind:"text",text:n.headline,style:"headline"}}]:[],...n.nothing?[{cost:1,item:{kind:"text",text:n.nothing,style:"note"}}]:[],...A(["Impact","What stands out","Cost"],[!1,!1,!0],l,j).map((d,u)=>({...d,cost:d.cost-j+.45+Math.ceil((c[u].brief.length+(e.brief?0:c[u].text.length+1))/75)*.85})),...p?[{cost:y(p),item:{kind:"text",text:p,style:"note"}}]:[],...e.checked!==!1?[{cost:y(a),item:{kind:"text",text:a,style:"note"}}]:[]]}}}function Ne(e){const t=[];let i;for(const n of e)n.row?((!i||i.head!==n.row.table)&&(i={head:n.row.table,item:{kind:"table",headers:n.row.table.headers,numeric:n.row.table.numeric,rows:[],...n.row.table.large?{large:!0}:{}}},t.push(i.item)),i.item.rows.push(n.row.cells)):n.item&&(i=void 0,t.push(n.item.kind==="map"&&t.length?{...n.item,compact:!0}:n.item));return t}function Ae(e,t){const i=[{pieces:[],cost:0}],n=e.blocks.flatMap(a=>je(a,t)),o=e.blocks.every(a=>a.kind==="table"&&a.headers.length<=_e||a.kind==="text"),c=a=>a.pieces.filter(d=>d.row).length;n.forEach((a,d)=>{const u=i[i.length-1],r=a.keepWithNext?a.cost+(n[d+1]?.whole??n[d+1]?.cost??0)+1.2:a.whole??a.cost,f=u.cost>0&&u.cost+r>H+(a.tail?oe:0),g=a.row&&c(u)+(a.wholeRows??1)>b&&c(u)>0;(f||g||a.breakBefore&&u.pieces.length)&&i.push({pieces:[],cost:0});const m=i[i.length-1];m.pieces.push(a),m.cost+=a.cost});for(let a=i.length-1;a>0;a--)i[a].pieces.every(d=>d.item?.kind==="text"&&d.item.style!=="headline")&&(i[a-1].pieces.push(...i[a].pieces),i[a-1].cost+=i[a].cost,i.splice(a,1));const s=i[0];if(s.pieces.length&&s.pieces.every(a=>a.item?.kind==="text"&&a.item.style!=="headline")){const a=s.pieces.findIndex(d=>{const u=d.item.text;return slideSentence(u)===u});if(a>=0){const d=s.pieces[a].item;s.pieces.splice(a,1),s.pieces.unshift({cost:y(d.text,"headline"),item:{...d,style:"headline"}})}}const{title:l,subtitle:p}=splitTitle(e.title);return i.filter(a=>a.pieces.length).map((a,d)=>({title:d===0?l:`${l}${O}`,...p?{subtitle:p}:{},...a.pieces.every(u=>u.item?.kind==="text")&&a.pieces.filter(u=>u.item?.kind==="text"&&u.item.style==="headline").length===1?{statement:!0}:{},items:Ne(a.pieces),cost:a.cost,narrow:o}))}const _e=5;function Ie(e,t){return e.map(i=>Ae(i,t)).filter(i=>i.length).flatMap(i=>i.map(n=>({pages:[n],columns:!1,whole:i.length===1})))}function _(e){return e.producer?`Made with ${e.producer.name} ${e.producer.version} and wafermap ${e.libraryVersion}`:`Made with wafermap ${e.libraryVersion}`}export function layoutReportSlides(e,t){const i=t.producer,n=splitTitle(e.title),o=[{kind:"title",title:n.title,...n.subtitle?{subtitle:n.subtitle}:{},...t.subtitle?{note:t.subtitle}:{},facts:[...e.facts??[],{label:"Prepared",value:t.now}],madeWith:_(t),...i?.url?{url:i.url.replace(/^https?:\/\//,"")}:{},...i?.icon?{icon:i.icon}:{}}],c=[],s=e.parts.map(l=>({part:l,laid:Ie(l.sections,t.figureSrc??(()=>{}))})).filter(l=>l.laid.length);return s.forEach(({part:l,laid:p},a)=>{if(s.length>1){const d=l.heading??splitTitle(l.title).subtitle??l.title,u=[`Part ${a+1} of ${s.length}`,...l.note?[l.note]:[]].join(" \xB7 ");c.push({title:d,at:o.length,part:!0}),o.push({kind:"divider",title:d,subtitle:u})}for(const{pages:d,columns:u}of p){for(const r of d)!r.title.endsWith(O)&&c[c.length-1]?.title!==r.title&&c.push({title:r.title,at:o.length});o.push({kind:"sections",columns:u,pages:d.map(({title:r,subtitle:f,items:g,statement:m})=>({title:r,...f?{subtitle:f}:{},...m?{statement:m}:{},items:g}))})}}),o.push({kind:"details",entries:[...e.details??[],...t.details??[],{label:"Made with",value:_(t).replace(/^Made with /,"")},{label:"Prepared",value:t.now}]}),c.push({title:"Data details",at:o.length-1}),c.filter(l=>!l.part).length>re&&o.splice(1,0,{kind:"contents",entries:c.map(l=>({title:l.title,slide:l.at+2,...l.part?{part:!0}:{}}))}),{title:e.title,colours:slideColours(e.dataColors),generator:_(t).replace(/^Made with /,""),slides:o}}const h=te;function Le(e){const t=[e.numeric?"num":"",e.muted?"muted":"",e.nowrap?"nowrap":"",e.shortfall?`low-${e.shortfall}`:"",e.tone?`tone-${e.tone}`:"",e.indent?"indent":""].filter(Boolean).join(" "),i=e.lead?`<strong>${h(e.lead)}</strong> ${h(e.text)}`:h(e.text),n=e.bar?`<span class="bar" aria-hidden="true"><i style="width:${J(e.bar.percent).toFixed(1)}%${e.bar.color?`;background:${h(e.bar.color)}`:""}"></i></span>`:"";return`<td${t?` class="${t}"`:""}>${e.bar?`<span class="barcell">${i}${n}</span>`:i}</td>`}function I(e,t=!1){return e.length?`<ul class="swatches${t?" column":""}">${e.map(i=>`<li><i style="background:${h(i.color)}"></i>${h(i.label)}</li>`).join("")}</ul>`:""}function Re(e){switch(e.kind){case"table":return`<table${e.large?' class="few"':""}><thead><tr>${e.headers.map((t,i)=>`<th${e.numeric[i]?' class="num"':""}>${h(t)}</th>`).join("")}</tr></thead><tbody>${e.rows.map(t=>`<tr>${t.map(Le).join("")}</tr>`).join("")}</tbody></table>`;case"metrics":return`<dl class="metrics" style="grid-template-columns:repeat(${e.columns},1fr)">${e.items.map(t=>`<div><dd>${h(t.value)}</dd><dt>${h(t.label)}</dt>${t.hint?`<span>${h(t.hint)}</span>`:""}</div>`).join("")}</dl>`;case"definitions":return`<dl class="defs">${e.entries.map(t=>`<div><dt>${h(t.label)}</dt><dd>${h(t.value)}</dd></div>`).join("")}</dl>`;case"text":return`<p class="${e.style}">${h(e.text)}</p>`;case"subheading":return`<h3>${h(e.text)}</h3>`;case"badges":return`<ul class="badges">${e.badges.map(t=>`<li${t.tone&&t.tone!=="low"?` class="tone-${t.tone}"`:""}>${h(t.text)}</li>`).join("")}</ul>`;case"map":return`<div class="figure"><figure class="map${e.compact?" compact":""}"><img src="${h(e.src)}" alt="${h(e.alt)}">${e.caption?`<figcaption>${h(e.caption)}</figcaption>`:""}</figure>${I(e.legend,!0)}</div>`;case"grid":return`<div class="grid" style="grid-template-columns:repeat(${e.columns},${e.size?`${e.size}px);justify-content:center`:"1fr)"}">${e.maps.map(t=>`<figure><img src="${h(t.src)}" alt="${h(t.label)}"><figcaption>${h(t.label)}</figcaption></figure>`).join("")}</div>${I(e.legend)}`;case"evidence":{const t=e.chart?`<figure class="chart"><img src="${h(e.chart.src)}" alt="${h(e.chart.alt)}"></figure>`:"",i=e.maps.length?`<div class="evidence-maps"><div class="grid" style="grid-template-columns:repeat(${e.columns},${e.size}px);justify-content:center">${e.maps.map(n=>`<figure><img src="${h(n.src)}" alt="${h(n.label)}">${n.label?`<figcaption>${h(n.label)}</figcaption>`:""}</figure>`).join("")}</div>${I(e.legend)}</div>`:"";return`<div class="evidence${t&&i?"":" one"}">${t}${i}</div>`}case"charts":return`<div class="charts${e.charts.length===1?" one":""}">${e.charts.map(t=>`<figure class="chart"><img src="${h(t.src)}" alt="${h(t.alt)}"></figure>`).join("")}</div>`}}function Te(e){switch(e.kind){case"title":return`<section class="slide title-slide">
2
+ ${e.icon?`<img class="mark" src="${h(e.icon)}" alt="" width="96" height="96">`:""}
3
+ <h1>${h(e.title)}</h1>
4
+ ${e.subtitle?`<p class="subtitle lead">${h(e.subtitle)}</p>`:""}
5
+ ${e.note?`<p class="subtitle">${h(e.note)}</p>`:""}
6
+ <dl class="facts">${e.facts.map(t=>`<div><dt>${h(t.label)}</dt><dd>${h(t.value)}</dd></div>`).join("")}</dl>
7
+ <p class="made-with">${h(e.madeWith)}${e.url?`<br>${h(e.url)}`:""}</p>
8
+ </section>`;case"contents":{const t=e.entries.map(i=>`<li class="${i.part?"toc-part":""}"><a href="#slide-${i.slide}"><span>${h(i.title)}</span><span class="toc-n">${i.slide}</span></a></li>`);return`<section class="slide"><h2>Contents</h2><div class="body"><ol class="toc${t.length>22?" many":""}">${t.join("")}</ol></div></section>`}case"divider":return`<section class="slide divider-slide"><h1>${h(e.title)}</h1>${e.subtitle?`<p class="subtitle">${h(e.subtitle)}</p>`:""}</section>`;case"sections":{const t=s=>`<div class="body${s.statement?" statement":""}">${s.items.map(Re).join("")}</div>`,i=(s,l="")=>`<h2${l?` class="${l}"`:""}>${h(s.title)}</h2>${s.subtitle?`<p class="h2-sub">${h(s.subtitle)}</p>`:""}`,n=e.columns?e.pages.slice(0,2):[],o=e.columns?e.pages.slice(2):e.pages,c=(n.length?`<div class="columns">${n.map(s=>`<div>${i(s)}${t(s)}</div>`).join("")}</div>`:"")+o.map((s,l)=>`${i(s,l||n.length?"next":"")}${t(s)}`).join("");return`<section class="slide${e.pages.length>1?" shared":""}">${c}</section>`}case"details":return`<section class="slide"><h2>Data details</h2><div class="body"><dl class="defs single">${e.entries.map(t=>`<div><dt>${h(t.label)}</dt><dd>${h(t.value)}</dd></div>`).join("")}</dl></div></section>`}}export function slidesHtml(e){const t=e.slides.length,i=e.slides.map((n,o)=>Te(n).replace('<section class="slide',`<section id="slide-${o+1}" aria-roledescription="slide" aria-label="${o+1} of ${t}" data-n="${o+1} / ${t}" class="slide`));return`<!DOCTYPE html>
9
+ <html lang="en">
10
+ <head>
11
+ <meta charset="UTF-8">
12
+ <meta name="viewport" content="width=device-width, initial-scale=1">
13
+ <meta name="generator" content="${h(e.generator)}">
14
+ <title>${h(e.title)}</title>
15
+ <style>
16
+ ${Oe(e.colours)}
17
+ </style>
18
+ </head>
19
+ <body>
20
+ <main class="deck" aria-label="${h(e.title)}">
21
+ ${i.join(`
22
+ `)}
23
+ </main>
24
+ <p class="hint" role="note">Use the arrow keys to move between slides and F for full screen. To make a PDF, use Print and choose Save as PDF, Landscape.</p>
25
+ <script>
26
+ ${De}
27
+ <\/script>
28
+ </body>
29
+ </html>`}export function renderReportDeckHtml(e,t){return slidesHtml(layoutReportSlides(e,t))}const De=`(function () {
30
+ var slides = Array.prototype.slice.call(document.querySelectorAll('.slide'));
31
+ if (!slides.length) return;
32
+ var i = 0;
33
+ document.body.classList.add('presenting');
34
+ // The keys hint covers the foot of a slide: it shows for a few seconds at the start, and again on a key that does nothing.
35
+ var hint = document.querySelector('.hint');
36
+ var hintTimer = 0;
37
+ function flashHint() {
38
+ if (!hint) return;
39
+ hint.classList.remove('faded');
40
+ clearTimeout(hintTimer);
41
+ hintTimer = setTimeout(function () { hint.classList.add('faded'); }, 4000);
42
+ }
43
+ function fit() {
44
+ var s = Math.min(window.innerWidth / ${$}, window.innerHeight / ${D});
45
+ document.documentElement.style.setProperty('--scale', String(s));
46
+ }
47
+ function show(n) {
48
+ i = Math.max(0, Math.min(slides.length - 1, n));
49
+ slides.forEach(function (el, k) { el.classList.toggle('current', k === i); el.setAttribute('aria-hidden', k === i ? 'false' : 'true'); });
50
+ if (history.replaceState) history.replaceState(null, '', '#' + (i + 1));
51
+ }
52
+ document.addEventListener('keydown', function (e) {
53
+ if (e.altKey || e.ctrlKey || e.metaKey) return;
54
+ var k = e.key;
55
+ if (k === 'ArrowRight' || k === 'ArrowDown' || k === 'PageDown' || k === ' ' || k === 'Enter') { show(i + 1); e.preventDefault(); }
56
+ else if (k === 'ArrowLeft' || k === 'ArrowUp' || k === 'PageUp' || k === 'Backspace') { show(i - 1); e.preventDefault(); }
57
+ else if (k === 'Home') { show(0); e.preventDefault(); }
58
+ else if (k === 'End') { show(slides.length - 1); e.preventDefault(); }
59
+ else if (k === 'f' || k === 'F') {
60
+ if (document.fullscreenElement) document.exitFullscreen();
61
+ else if (document.documentElement.requestFullscreen) document.documentElement.requestFullscreen();
62
+ }
63
+ else if (k.length === 1 || k === 'Escape') flashHint();
64
+ });
65
+ document.addEventListener('click', function (e) {
66
+ if (e.target.closest && e.target.closest('a')) return;
67
+ show(e.clientX < window.innerWidth / 3 ? i - 1 : i + 1);
68
+ });
69
+ window.addEventListener('resize', fit);
70
+ // A slide's address is #N or #slide-N (the contents slide links to the second, which a printed PDF keeps).
71
+ function hashSlide() { var m = /(\\d+)$/.exec(location.hash); return m ? parseInt(m[1], 10) : NaN; }
72
+ window.addEventListener('hashchange', function () { var n = hashSlide(); if (!isNaN(n) && n - 1 !== i) show(n - 1); });
73
+ var start = hashSlide();
74
+ fit();
75
+ show(isNaN(start) ? 0 : start - 1);
76
+ flashHint();
77
+ })();`;function Oe(e){return`
78
+ :root {
79
+ --ink: ${e.ink}; --muted: ${e.muted}; --line: ${e.line}; --surface: ${e.surface};
80
+ --bar: ${e.bar}; --high: ${e.high}; --medium: ${e.medium};
81
+ --low-1: ${(e.shortfallTints??[x(1),x(2),x(3)])[0]}; --low-2: ${(e.shortfallTints??[x(1),x(2),x(3)])[1]}; --low-3: ${(e.shortfallTints??[x(1),x(2),x(3)])[2]};
82
+ --scale: 1;
83
+ color-scheme: light;
84
+ }
85
+ * { box-sizing: border-box; }
86
+ html, body { margin: 0; background: #e9ecf0; color: var(--ink);
87
+ font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", sans-serif; }
88
+ .deck { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 24px 0; }
89
+ .slide { position: relative; width: ${$}px; height: ${D}px; padding: 48px 64px 40px; background: #fff; overflow: hidden;
90
+ box-shadow: 0 1px 4px rgba(0,0,0,.15); display: flex; flex-direction: column; }
91
+ .slide::after { content: attr(data-n); position: absolute; right: 32px; bottom: 18px; font-size: 13px; color: var(--muted); }
92
+ .title-slide::after, .divider-slide::after { content: none; }
93
+ h1 { font-size: 52px; line-height: 1.12; margin: 0 0 12px; font-weight: 700; }
94
+ h2 { font-size: 34px; line-height: 1.2; margin: 0 0 18px; font-weight: 700; }
95
+ h2:has(+ .h2-sub) { margin-bottom: 2px; }
96
+ .h2-sub { font-size: 20px; color: var(--muted); margin: 0 0 16px; }
97
+ h2.next { margin-top: 26px; }
98
+ .columns { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; min-height: 0; }
99
+ .columns h2 { font-size: 28px; }
100
+ .columns .bar { width: 90px; }
101
+ .slide.shared .body { flex: none; }
102
+ h3 { font-size: 24px; margin: 14px 0 8px; }
103
+ .body { flex: 1; min-height: 0; font-size: 20px; display: flex; flex-direction: column; }
104
+ .body > * { flex: none; }
105
+ /* Charts and an item's evidence take the rest of the slide under the text above them. */
106
+ .body > .charts, .body > .evidence { flex: 1 1 auto; min-height: 0; }
107
+ .title-slide { justify-content: center; padding-left: 96px; }
108
+ .title-slide .mark { display: block; margin-bottom: 28px; }
109
+ .subtitle { font-size: 24px; color: var(--muted); margin: 0 0 12px; }
110
+ .subtitle.lead { font-size: 30px; color: var(--ink); }
111
+ .title-slide .subtitle:last-of-type { margin-bottom: 32px; }
112
+ .facts { display: grid; grid-template-columns: max-content auto; column-gap: 32px; row-gap: 6px; margin: 0 0 6px; font-size: 20px; }
113
+ .facts div { display: contents; }
114
+ .facts dt { color: var(--muted); }
115
+ .facts dd { margin: 0; }
116
+ .made-with { position: absolute; left: 96px; bottom: 44px; margin: 0; font-size: 16px; color: var(--muted); line-height: 1.5; }
117
+ .divider-slide { justify-content: center; padding-left: 96px; }
118
+ .divider-slide h1 { font-size: 60px; }
119
+ table { border-collapse: collapse; width: 100%; font-size: 20px; }
120
+ table + table, p + table, h3 + table { margin-top: 14px; }
121
+ table + table { margin-top: 22px; }
122
+ /* A statement: one sentence, large, in the middle of the slide. */
123
+ .body.statement { justify-content: center; }
124
+ .body.statement .headline { font-size: 34px; line-height: 1.3; max-width: 960px; }
125
+ table.few { font-size: 24px; }
126
+ table.few th, table.few td { padding: 12px 16px; }
127
+ th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px 12px; }
128
+ td { padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
129
+ .num { text-align: right; font-variant-numeric: tabular-nums; }
130
+ .nowrap { white-space: nowrap; }
131
+ .muted { color: var(--muted); }
132
+ .barcell { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
133
+ .bar { display: inline-block; width: 120px; height: 10px; background: var(--surface); border: 1px solid var(--line); }
134
+ .bar i { display: block; height: 100%; background: var(--bar); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
135
+ .low-1 { background: var(--low-1); } .low-2 { background: var(--low-2); } .low-3 { background: var(--low-3); }
136
+ td.low-1, td.low-2, td.low-3 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
137
+ td.indent { padding-left: 28px; }
138
+ .tone-high { color: var(--high); font-weight: 600; }
139
+ .tone-medium { color: var(--medium); font-weight: 600; }
140
+ .headline { font-size: 24px; line-height: 1.35; margin: 0 0 14px; }
141
+ p.note, p.legend { color: var(--muted); font-size: 16px; margin: 10px 0 0; }
142
+ .badges { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; padding: 0; }
143
+ .badges li { font-size: 17px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
144
+ .badges li.tone-high { border-color: var(--high); }
145
+ .badges li.tone-medium { border-color: var(--medium); }
146
+ .metrics { display: grid; gap: 24px; margin: 12px 0 0; }
147
+ .metrics div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 32px 30px; }
148
+ .metrics dd { margin: 0; font-size: 60px; font-weight: 700; font-variant-numeric: tabular-nums; }
149
+ .metrics dt { color: var(--muted); font-size: 20px; margin-top: 6px; }
150
+ .metrics span { display: block; color: var(--muted); font-size: 16px; margin-top: 4px; }
151
+ .defs { display: grid; grid-template-columns: max-content auto max-content auto; column-gap: 24px; row-gap: 6px; margin: 0; }
152
+ .defs.single { grid-template-columns: max-content auto; }
153
+ .defs div { display: contents; }
154
+ .defs dt { color: var(--muted); }
155
+ .defs dd { margin: 0; }
156
+ figure { margin: 0; }
157
+ .figure { display: flex; gap: 48px; align-items: flex-start; }
158
+ /* A map as large as the rest of the slide allows, 560 px at most, square. */
159
+ .body > .figure { flex: 1 1 auto; min-height: 0; }
160
+ figure.map { display: flex; flex-direction: column; height: 100%; min-height: 0; }
161
+ figure.map img { display: block; flex: 1 1 auto; min-height: 0; max-height: 560px; height: 100%; width: auto; aspect-ratio: 1; object-fit: contain; }
162
+ .slide.shared figure.map img { height: 420px; flex: none; }
163
+ figure.map figcaption { text-align: center; font-size: 17px; margin-top: 4px; }
164
+ .swatches.column { flex-direction: column; flex-wrap: nowrap; gap: 8px; margin: 8px 0 0; font-size: 17px; color: var(--ink); }
165
+ .swatches.column i { width: 16px; height: 16px; }
166
+ .grid { display: grid; gap: 8px 12px; }
167
+ /* A chart fills its share of the space, at its own shape: enlarged, never cropped. */
168
+ .charts { display: flex; gap: 32px; }
169
+ .charts figure, .evidence figure.chart { flex: 1 1 0; min-width: 0; min-height: 0; }
170
+ .charts img, .evidence .chart img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
171
+ .evidence { display: flex; gap: 32px; margin: 4px 0 0; }
172
+ .evidence figure.chart { flex: 3 1 0; }
173
+ .evidence .evidence-maps { flex: 2 1 0; min-width: 0; }
174
+ /* Sharing its slide with another section, a chart has no rest of the slide to fill: its own height, capped. */
175
+ .slide.shared .charts img { height: auto; max-height: 420px; }
176
+ .grid figure { text-align: center; }
177
+ .grid img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
178
+ .grid figcaption { font-size: 16px; color: var(--ink); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
179
+ .swatches { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; font-size: 16px; color: var(--muted); }
180
+ .swatches i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.25);
181
+ -webkit-print-color-adjust: exact; print-color-adjust: exact; }
182
+ .toc { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 48px; font-size: 20px; }
183
+ .toc.many { columns: 3; font-size: 16px; }
184
+ .toc li { break-inside: avoid; }
185
+ .toc a { display: flex; gap: 12px; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
186
+ .toc a:hover { color: #0b5cad; }
187
+ .toc .toc-n { color: var(--muted); font-variant-numeric: tabular-nums; }
188
+ .toc li.toc-part a { font-weight: 700; border-bottom-color: var(--ink); margin-top: 6px; }
189
+ .toc li.toc-part { break-after: avoid; }
190
+ .hint { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); margin: 0; padding: 6px 12px; font-size: 13px;
191
+ color: var(--muted); background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 4px; }
192
+ body:not(.presenting) .hint { display: none; }
193
+ .hint { transition: opacity .6s; }
194
+ .hint.faded { opacity: 0; pointer-events: none; }
195
+
196
+ /* Presenting: one slide, scaled to the window. */
197
+ body.presenting { overflow: hidden; }
198
+ body.presenting .deck { display: block; padding: 0; }
199
+ body.presenting .slide { display: none; position: fixed; left: 50%; top: 50%; box-shadow: none;
200
+ transform: translate(-50%, -50%) scale(var(--scale)); transform-origin: center; }
201
+ body.presenting .slide.current { display: flex; }
202
+
203
+ /* Printing: every slide, one landscape page each. */
204
+ @page { size: 13.333in 7.5in; margin: 0; }
205
+ @media print {
206
+ html, body, body.presenting { background: #fff; overflow: visible; }
207
+ .hint { display: none !important; }
208
+ .deck, body.presenting .deck { display: block; padding: 0; }
209
+ .slide, body.presenting .slide, body.presenting .slide.current { display: flex; position: relative; left: auto; top: auto;
210
+ transform: none; box-shadow: none; break-after: page; page-break-after: always; }
211
+ }
212
+ `}
@@ -1,18 +1,9 @@
1
1
  import type { StatsFinding, StatsSeverity } from './types.js';
2
- import { type Synthesis, type SynthesisTarget } from './synthesis.js';
2
+ import { type Synthesis, type SynthesisItem } from './synthesis.js';
3
3
  import { type MeterTier } from './presentation.js';
4
4
  export type { MeterTier };
5
5
  import { type FacetItem } from './facets.js';
6
- export interface MetricItem {
7
- label: string;
8
- value: string;
9
- hint?: string;
10
- }
11
- export declare function renderSection(title: string, body: string, className?: string, id?: string): string;
12
- export declare function renderDefinitionList(entries: Array<{
13
- label: string;
14
- value: string;
15
- }>, className?: string): string;
6
+ import type { ReportDocument } from './reportBlocks.js';
16
7
  /**
17
8
  * The single source of metadata content for every report and panel surface
18
9
  * — built from `buildFacetTable` over the actual item(s), never
@@ -31,41 +22,16 @@ export declare function buildMetadataRows(items: FacetItem[]): Array<{
31
22
  label: string;
32
23
  value: string;
33
24
  }>;
34
- /** `buildMetadataRows` wrapped in a titled section. Returns `''` when there's nothing to show. */
35
- export declare function renderMetadataSection(items: FacetItem[]): string;
36
- export declare function renderMetricGrid(items: MetricItem[]): string;
37
- /** A table cell: raw HTML (the caller escapes), or HTML with a class for the `<td>`. */
38
- export type TableCell = string | {
39
- html: string;
40
- className?: string;
41
- };
42
- export declare function renderTable(headers: string[], rows: TableCell[][], options?: {
43
- className?: string;
44
- emptyMessage?: string;
45
- }): string;
46
25
  /**
47
- * Three dots filled by level, with the word beneath. Colour only reinforces it: the dots and the
26
+ * Three marks filled by level (dots for severity, bars for impact), with the word beneath. Colour only reinforces it: the marks and the
48
27
  * word survive a black-and-white print and colour-blind reading (WCAG 1.4.1), which a bare coloured
49
28
  * badge did not. The dots are decoration, hidden from a screen reader that reads the word.
50
29
  */
51
- export declare function renderMeter(tier: MeterTier, word: string): string;
30
+ export declare function renderMeter(tier: MeterTier, word: string, scale: 'severity' | 'impact'): string;
52
31
  export declare function renderSeverityMeter(severity: StatsSeverity): string;
53
32
  export declare const severityTier: (severity: StatsSeverity) => MeterTier;
54
- /**
55
- * A value with a bar beside it, for scanning a column of yields or shares. The figure is always
56
- * printed; the bar is a second way to read it, scaled 0–100 (so a yield bar is never stretched
57
- * to its own column's range). The figure sits beside the bar, never on it: a bar takes the bin's
58
- * own colour, and no one ink reads on every colour a bin can have.
59
- */
60
- export declare function barCell(percent: number, text: string, className?: string, color?: string): TableCell;
61
- /** A signed difference in yield points, tinted by `shortfallStep` (only a shortfall of a point or more). */
62
- export declare function deltaCell(points: number): TableCell;
63
- /**
64
- * Section ids and a contents line for a report body. Every section is produced by `renderSection`,
65
- * so its `<h2>` is the title; the ids carry `scope` so several reports in one document cannot clash.
66
- * Under four sections there is nothing to navigate and the body is returned unchanged.
67
- */
68
- export declare function withSectionNav(sectionsHtml: string, scope?: string): string;
33
+ /** A report document as one standalone HTML page, for `openHtmlReport()`. `now` is the time it states it was made. */
34
+ export declare function renderReportHtml(doc: ReportDocument, now: string): string;
69
35
  export declare function formatFindingDelta(finding: Pick<StatsFinding, 'effect' | 'variable'>): string;
70
36
  /**
71
37
  * The `†` key under a findings table, as HTML — `''` when no finding in it is
@@ -93,17 +59,52 @@ export declare function derivedFindingsKeyHtml(findings: StatsFinding[]): string
93
59
  * finding ids can never share an anchor, and valid in an `id` attribute whatever the id holds.
94
60
  */
95
61
  export declare function findingAnchor(id: string, scope?: string): string;
62
+ /** A findings table's rows as text, in the panel's order, for every writer: the HTML table below and the slide deck. */
63
+ export interface FindingRow {
64
+ finding: StatsFinding;
65
+ /** A finding a pattern explains, shown under that pattern. */
66
+ nested: boolean;
67
+ region: string;
68
+ metric: string;
69
+ delta: string;
70
+ coverage: string;
71
+ }
72
+ /**
73
+ * The rows of a findings table, the note on their order when a pattern is among them, and the derived-test
74
+ * key. `totalWafers` makes the coverage a count of wafers (a lot's findings).
75
+ */
76
+ export declare function findingRows(findings: StatsFinding[], totalWafers?: number): {
77
+ rows: FindingRow[];
78
+ coverageHeader: string;
79
+ notes: string[];
80
+ };
96
81
  export declare function findingsTableHtml(findings: StatsFinding[], totalWafers?: number, anchorScope?: string, live?: boolean): string;
97
82
  /**
98
- * The synthesis as a section: the headline, the items, and what was compared. Every item links to its
83
+ * The synthesis section's body: the headline, the items, and what was compared. Every item links to its
99
84
  * evidence the same way — the lead by a "See" line naming its target and its parts, each further item and
100
85
  * Watch line by its own text — wherever `anchorFor` finds that evidence on the page, so a link never points
101
86
  * at nothing and no item is linked only because of where its figures came from.
102
87
  */
103
- export declare function synthesisSectionHtml(synthesis: Synthesis, anchorFor: (target: SynthesisTarget) => string | undefined): string;
88
+ /** One line of "Worth a look", as text, for every writer. */
89
+ export interface SynthesisRow {
90
+ item: SynthesisItem;
91
+ /** High, Medium or Low: what the item costs. */
92
+ impact: string;
93
+ brief: string;
94
+ text: string;
95
+ cost: string;
96
+ }
97
+ /**
98
+ * "Worth a look", as the panel lists it: the comparisons and patterns, High and Medium first by what they cost, then the
99
+ * Low ones (the report has room for every one), then groups too small to confirm, then the possible ones. A test's dies
100
+ * outside its limits are in the test tables, not here. Strength is in the Findings table.
101
+ */
102
+ export declare function synthesisRows(synthesis: Synthesis): SynthesisRow[];
103
+ /** The line under "Worth a look" that counts the findings of low strength, when there are any. */
104
+ export declare function synthesisLowStrengthLine(synthesis: Synthesis, where?: string | undefined): string | undefined;
104
105
  /** The scripts at the foot of every report document: in-page links, and for a `live` report the finding clicks. */
105
106
  export declare function reportScripts(live: boolean | undefined): string;
106
107
  export declare const LIVE_FINDINGS_SCRIPT = "<script>\ndocument.addEventListener('click', function (e) {\n var row = e.target.closest && e.target.closest('[data-finding]');\n if (row && window.parent !== window) window.parent.postMessage({ wmapFinding: row.getAttribute('data-finding') }, '*');\n});\n</script>";
107
108
  export declare function formatFindingCoverage(finding: Pick<StatsFinding, 'stats'>, total?: number): string;
108
- export declare function reportStyles(): string;
109
+ export declare function reportStyles(dataColors?: string): string;
109
110
  //# sourceMappingURL=reportHtml.d.ts.map