@wafertools/wafermap 0.36.0 → 0.37.1

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 (158) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +385 -0
  3. package/README.md +7 -7
  4. package/dist/packages/canvas-adapter/charts/capability.js +1 -1
  5. package/dist/packages/canvas-adapter/charts/cardAbout.d.ts +21 -0
  6. package/dist/packages/canvas-adapter/charts/cardAbout.js +1 -0
  7. package/dist/packages/canvas-adapter/charts/chartShell.d.ts +65 -12
  8. package/dist/packages/canvas-adapter/charts/chartShell.js +1 -1
  9. package/dist/packages/canvas-adapter/charts/commonality.d.ts +18 -0
  10. package/dist/packages/canvas-adapter/charts/commonality.js +1 -0
  11. package/dist/packages/canvas-adapter/charts/correlation.js +1 -1
  12. package/dist/packages/canvas-adapter/charts/groupComparison.d.ts +31 -0
  13. package/dist/packages/canvas-adapter/charts/groupComparison.js +1 -0
  14. package/dist/packages/canvas-adapter/charts/index.d.ts +0 -10
  15. package/dist/packages/canvas-adapter/charts/index.js +1 -1
  16. package/dist/packages/canvas-adapter/charts/patCard.d.ts +23 -0
  17. package/dist/packages/canvas-adapter/charts/patCard.js +1 -0
  18. package/dist/packages/canvas-adapter/charts/plotChart.d.ts +56 -2
  19. package/dist/packages/canvas-adapter/charts/plotChart.js +1 -1
  20. package/dist/packages/canvas-adapter/charts/pointInteractions.d.ts +2 -0
  21. package/dist/packages/canvas-adapter/charts/pointInteractions.js +1 -1
  22. package/dist/packages/canvas-adapter/charts/regionYieldDiagram.js +1 -1
  23. package/dist/packages/canvas-adapter/charts/sweep.js +1 -1
  24. package/dist/packages/canvas-adapter/dataTab.d.ts +3 -0
  25. package/dist/packages/canvas-adapter/dataTab.js +1 -1
  26. package/dist/packages/canvas-adapter/dieList.d.ts +12 -0
  27. package/dist/packages/canvas-adapter/dieList.js +2 -2
  28. package/dist/packages/canvas-adapter/differenceMapPanel.d.ts +26 -0
  29. package/dist/packages/canvas-adapter/differenceMapPanel.js +1 -0
  30. package/dist/packages/canvas-adapter/drilldown.d.ts +3 -0
  31. package/dist/packages/canvas-adapter/drilldown.js +1 -1
  32. package/dist/packages/canvas-adapter/filterButton.d.ts +3 -0
  33. package/dist/packages/canvas-adapter/filterButton.js +1 -0
  34. package/dist/packages/canvas-adapter/filterEditor.d.ts +53 -0
  35. package/dist/packages/canvas-adapter/filterEditor.js +1 -0
  36. package/dist/packages/canvas-adapter/guideWindow.d.ts +9 -1
  37. package/dist/packages/canvas-adapter/guideWindow.js +1 -1
  38. package/dist/packages/canvas-adapter/icons.js +1 -1
  39. package/dist/packages/canvas-adapter/insightsTab.d.ts +52 -2
  40. package/dist/packages/canvas-adapter/insightsTab.js +1 -1
  41. package/dist/packages/canvas-adapter/pageFilter.d.ts +84 -0
  42. package/dist/packages/canvas-adapter/pageFilter.js +2 -0
  43. package/dist/packages/canvas-adapter/patMode.d.ts +27 -0
  44. package/dist/packages/canvas-adapter/patMode.js +1 -0
  45. package/dist/packages/canvas-adapter/plotCard.d.ts +67 -0
  46. package/dist/packages/canvas-adapter/plotCard.js +1 -0
  47. package/dist/packages/canvas-adapter/plotEditor.d.ts +13 -2
  48. package/dist/packages/canvas-adapter/plotEditor.js +1 -1
  49. package/dist/packages/canvas-adapter/plotModal.js +1 -1
  50. package/dist/packages/canvas-adapter/plotStore.js +1 -1
  51. package/dist/packages/canvas-adapter/plotTab.d.ts +6 -0
  52. package/dist/packages/canvas-adapter/plotTab.js +1 -1
  53. package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
  54. package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
  55. package/dist/packages/canvas-adapter/summaryPanel.d.ts +15 -5
  56. package/dist/packages/canvas-adapter/summaryPanel.js +4 -4
  57. package/dist/packages/canvas-adapter/toolbar.d.ts +17 -2
  58. package/dist/packages/canvas-adapter/toolbar.js +2 -2
  59. package/dist/packages/canvas-adapter/userGuideHtml.d.ts +1 -1
  60. package/dist/packages/canvas-adapter/userGuideHtml.js +590 -140
  61. package/dist/packages/canvas-adapter/version.d.ts +2 -2
  62. package/dist/packages/canvas-adapter/version.js +1 -1
  63. package/dist/packages/core/classify.d.ts +11 -0
  64. package/dist/packages/core/classify.js +1 -1
  65. package/dist/packages/core/dies.d.ts +2 -0
  66. package/dist/packages/core/dies.js +1 -1
  67. package/dist/packages/core/wafer.d.ts +2 -2
  68. package/dist/packages/renderer/buildView.js +1 -1
  69. package/dist/packages/renderer/buildWaferMap.d.ts +2 -0
  70. package/dist/packages/renderer/buildWaferMap.js +1 -1
  71. package/dist/packages/renderer/deprecate.d.ts +2 -8
  72. package/dist/packages/renderer/deprecate.js +1 -1
  73. package/dist/packages/renderer/fmt.js +1 -1
  74. package/dist/packages/renderer/testLabel.d.ts +0 -11
  75. package/dist/packages/renderer/testLabel.js +1 -1
  76. package/dist/packages/stats/analyzeWaferLot.d.ts +6 -0
  77. package/dist/packages/stats/analyzeWaferLot.js +1 -1
  78. package/dist/packages/stats/analyzeWaferMap.d.ts +8 -0
  79. package/dist/packages/stats/analyzeWaferMap.js +1 -1
  80. package/dist/packages/stats/binPareto.d.ts +2 -54
  81. package/dist/packages/stats/binPareto.js +1 -1
  82. package/dist/packages/stats/binRows.js +1 -1
  83. package/dist/packages/stats/capability.d.ts +10 -0
  84. package/dist/packages/stats/capability.js +1 -1
  85. package/dist/packages/stats/cardSpec.d.ts +53 -0
  86. package/dist/packages/stats/cardSpec.js +1 -0
  87. package/dist/packages/stats/chartCatalogue.d.ts +37 -0
  88. package/dist/packages/stats/chartCatalogue.js +1 -0
  89. package/dist/packages/stats/clusterDetection.d.ts +9 -0
  90. package/dist/packages/stats/clusterDetection.js +1 -1
  91. package/dist/packages/stats/commonality.d.ts +62 -0
  92. package/dist/packages/stats/commonality.js +1 -0
  93. package/dist/packages/stats/control.d.ts +21 -0
  94. package/dist/packages/stats/control.js +1 -0
  95. package/dist/packages/stats/correlation.d.ts +9 -3
  96. package/dist/packages/stats/correlation.js +1 -1
  97. package/dist/packages/stats/dieRegions.d.ts +4 -1
  98. package/dist/packages/stats/dieRegions.js +1 -1
  99. package/dist/packages/stats/differenceMap.d.ts +22 -0
  100. package/dist/packages/stats/differenceMap.js +1 -0
  101. package/dist/packages/stats/examplePicks.d.ts +22 -0
  102. package/dist/packages/stats/examplePicks.js +1 -0
  103. package/dist/packages/stats/filterFile.d.ts +41 -0
  104. package/dist/packages/stats/filterFile.js +2 -0
  105. package/dist/packages/stats/filterFindings.d.ts +20 -5
  106. package/dist/packages/stats/filterFindings.js +1 -1
  107. package/dist/packages/stats/groupCompare.d.ts +87 -0
  108. package/dist/packages/stats/groupCompare.js +1 -0
  109. package/dist/packages/stats/guideSections.d.ts +55 -0
  110. package/dist/packages/stats/guideSections.js +1 -0
  111. package/dist/packages/stats/index.d.ts +3 -1
  112. package/dist/packages/stats/index.js +1 -1
  113. package/dist/packages/stats/math.d.ts +29 -4
  114. package/dist/packages/stats/math.js +1 -1
  115. package/dist/packages/stats/metadataColumns.d.ts +3 -0
  116. package/dist/packages/stats/metadataColumns.js +1 -1
  117. package/dist/packages/stats/pat.d.ts +58 -0
  118. package/dist/packages/stats/pat.js +1 -0
  119. package/dist/packages/stats/patSummary.d.ts +45 -0
  120. package/dist/packages/stats/patSummary.js +1 -0
  121. package/dist/packages/stats/patternClassification.d.ts +3 -3
  122. package/dist/packages/stats/patternClassification.js +1 -1
  123. package/dist/packages/stats/plotData.d.ts +294 -17
  124. package/dist/packages/stats/plotData.js +1 -1
  125. package/dist/packages/stats/plotId.d.ts +2 -0
  126. package/dist/packages/stats/plotId.js +1 -1
  127. package/dist/packages/stats/plotReferences.d.ts +17 -0
  128. package/dist/packages/stats/plotReferences.js +1 -0
  129. package/dist/packages/stats/plotSpec.d.ts +239 -3
  130. package/dist/packages/stats/plotSpec.js +4 -4
  131. package/dist/packages/stats/regions.js +1 -1
  132. package/dist/packages/stats/renderSummaryReport.js +31 -31
  133. package/dist/packages/stats/reportHtml.js +9 -13
  134. package/dist/packages/stats/synthesis.d.ts +44 -16
  135. package/dist/packages/stats/synthesis.js +1 -1
  136. package/dist/packages/stats/testPassRate.d.ts +7 -0
  137. package/dist/packages/stats/testPassRate.js +1 -1
  138. package/dist/packages/stats/types.d.ts +13 -8
  139. package/dist/packages/stats/yield.d.ts +3 -11
  140. package/dist/packages/stats/yield.js +1 -1
  141. package/llms.txt +1 -1
  142. package/package.json +10 -2
  143. package/dist/packages/canvas-adapter/charts/barPanel.d.ts +0 -83
  144. package/dist/packages/canvas-adapter/charts/barPanel.js +0 -1
  145. package/dist/packages/canvas-adapter/charts/binCluster.d.ts +0 -27
  146. package/dist/packages/canvas-adapter/charts/binCluster.js +0 -1
  147. package/dist/packages/canvas-adapter/charts/boxplot.d.ts +0 -72
  148. package/dist/packages/canvas-adapter/charts/boxplot.js +0 -1
  149. package/dist/packages/canvas-adapter/charts/groupedBarPlot.d.ts +0 -53
  150. package/dist/packages/canvas-adapter/charts/groupedBarPlot.js +0 -1
  151. package/dist/packages/canvas-adapter/charts/histogram.d.ts +0 -61
  152. package/dist/packages/canvas-adapter/charts/histogram.js +0 -1
  153. package/dist/packages/canvas-adapter/charts/scatter.d.ts +0 -80
  154. package/dist/packages/canvas-adapter/charts/scatter.js +0 -1
  155. package/dist/packages/canvas-adapter/charts/testPassRate.d.ts +0 -27
  156. package/dist/packages/canvas-adapter/charts/testPassRate.js +0 -1
  157. package/dist/packages/canvas-adapter/charts/trend.d.ts +0 -50
  158. package/dist/packages/canvas-adapter/charts/trend.js +0 -1
package/AGENTS.md CHANGED
@@ -112,7 +112,7 @@ worth reporting, not a pattern to build on.
112
112
  - **The analysis surfaces are already built — do not reimplement them.** Pass
113
113
  `statsSummary` to `renderWaferMap` and it mounts the Summary panel. The
114
114
  chart suite (Insights) is on by default (`insights: { enabled: false }` removes it): yield, bin pareto,
115
- boxplot, histogram, correlation, scatter, capability, and a Plot tab where the reader's own plots
115
+ boxplot, histogram, correlation, scatter, capability, and a My plots tab where the reader's own plots
116
116
  and sweeps (`chart: 'sweep'`, in `insights.plots`) are cards. `renderWaferGallery` takes the same option across a whole
117
117
  lot. Supply or replace the analysis later with `setStatsSummary()`. There is no
118
118
  chart-data API to hand-build them from. Charting a selection or one wafer (right-click → histogram, capability,
@@ -250,7 +250,7 @@ compatibility shims for them.
250
250
  - [API reference](https://wafertools.github.io/wafermap/api/) — every type, option and return value
251
251
  - [Developer guide](https://wafertools.github.io/wafermap/guide/) — worked walkthroughs
252
252
  - [Troubleshooting](https://wafertools.github.io/wafermap/troubleshooting/)
253
- - [Examples](https://wafertools.github.io/wafermap/examples/) — 25 runnable pages, also
253
+ - [Examples](https://wafertools.github.io/wafermap/examples/) — 27 runnable pages, also
254
254
  [downloadable](https://wafertools.github.io/wafermap/wafermap-examples.zip) to run offline
255
255
 
256
256
  When a rule here and the API reference disagree, the API reference wins — tell the
package/CHANGELOG.md CHANGED
@@ -24,6 +24,391 @@ under `### Breaking`.
24
24
 
25
25
  ## [Unreleased]
26
26
 
27
+ ## [0.37.1] — 2026-10-22
28
+
29
+ ### Added
30
+
31
+ - **PAT verdict as a plot mode.** The **Plot mode** menu of a map and of a gallery offers **PAT verdict** when a test has both
32
+ limits and a wafer has enough dies to set PAT limits from: each die is coloured within the PAT limits (blue), PAT outlier
33
+ (amber) or fails (red), with the legend, counts, tooltips, Expand and a gallery's shared colours as in the other modes. The dies
34
+ keep their bins and measurements, and the verdicts are judged over the dies the page filter keeps, as the PAT card's are.
35
+
36
+ ### Changed
37
+
38
+ - **Enter in a long list's filter box picks the only test left showing.** In the test pickers and the Plot mode menu's test list, typing
39
+ until one test remains and pressing Enter chooses it.
40
+ - **Map the verdicts on the PAT card shows the maps in that mode** instead of opening them in a window, so the map's own yield,
41
+ legend, selection and filter apply.
42
+
43
+ ### Fixed
44
+
45
+ - **A filtered wafer's gross yield and edge count leave out the dies the filter drops.** `computeYield` counts only the
46
+ edge-excluded dies that are kept, so a filtered-out edge die no longer enters the gross denominator.
47
+ - **Group comparison reads the dies a yield judges.** `compareTestsByGroup` leaves out partial, edge-excluded and
48
+ filtered-out dies, as the Insights plots beside it do, so its means and p-values describe the same population.
49
+ - **PAT: a die failing its bin is in "Fails (bin or limits)" even when none of its limited tests has a value.**
50
+ - **The gallery's filtered Summary follows `setItems()` and `setLotStatsSummary()`.** With a filter on, the lot analysis
51
+ is rerun over the new items or the host's new analysis, so the panel and findings describe what is shown.
52
+ - **A command menu taller than the window scrolls inside it.** The right-click menu lists every saved plot, and with many
53
+ of them its last rows, **New plot…**, **New sweep…** and the tables, stay reachable.
54
+
55
+ ## [0.37.0] — 2026-10-20
56
+
57
+ ### Added
58
+
59
+ - **A group shift is an item in What stands out and Worth a look.** In a lot, every wafer field Group by offers is
60
+ compared test by test, each wafer one value (Welch, or Kruskal–Wallis where Welch cannot be computed), adjusted over
61
+ every field and test (Benjamini–Hochberg). A field whose groups differ is one item, however many tests it moves, so a
62
+ corner lot's split lists once: it names the largest shift as the group furthest from the other wafers ("Vth is higher
63
+ on Process split Hi-dose than on Process split POR (3 and 3 wafers): a shift of 1.4σ"), then how many tests differ and
64
+ the next ones, with a chip for each of the first tests. Each shift is sized in within-wafer standard deviations and
65
+ weighted by that group's dies as a region shift is, and charted as a box of the test by the field. A field that moves
66
+ one test an item already names is said within that item. The Compared line names the fields.
67
+ - **Worth a look on the Insights Overview.** The items What stands out lists beside the map are drawn on the
68
+ Overview, below the yield, bin and region cards, as the charts that show them (a region's loss as yield by that kind
69
+ of region, a fail bin as the bins' shares by it, a shifted test by region, a failing or too-wide test as its
70
+ histogram or pass rate, a trend as a control chart; a yield or pass rate with each bar's value and the median of the
71
+ bars), each saying in one sentence why it is shown (the panel's whole sentence on hover), with Show on map going back to the
72
+ map with the item shown as its row shows it. Each of the panel's top rows gains a Chart link to its card. It
73
+ describes the whole lot, so it says so in place of the cards while the filter or Show narrows the
74
+ population.
75
+ - **A page filter on the maps, the gallery and Insights.** **Filter…**, last in the toolbar row, in the same place on a map,
76
+ in the gallery and in Insights, narrows all three to the wafers and dies that meet conditions the reader sets, the
77
+ same conditions a plot's filter takes, edited in a window that states what they would keep before **Apply**. It is one
78
+ filter: setting it in any view sets it in the others. A condition on a wafer field (split, yield) removes that wafer's
79
+ card from the gallery; one on a die field (bin, ring, a test) draws the dies it drops dimmed on every map and leaves
80
+ them out of the legend, the yield and every figure beside the map (`Die.filteredOut`, which `isYieldEligibleDie`
81
+ honours). While a filter exists a line above the view states it with the wafers and dies it keeps (*2 of 3 wafers ·
82
+ 48 of 72 dies*), a switch that turns it off without losing it, **Edit…** and **Remove**; a filter naming a field the
83
+ wafers lack filters nothing and says so. The analysis runs again over the wafers and dies a filter keeps, so the
84
+ Summary panel and button, What stands out, the findings and warnings, each wafer's own summary, the report and the
85
+ tables all describe what is shown, on a map and in the gallery alike; removing the filter brings back the host's.
86
+ It is view state: `insights.filter` starts it, `onFilterChange` reports it, and it is never written into a plots file.
87
+ `insights.filter` is read as a plots file's filter is, so one restored from storage that holds a condition it cannot
88
+ read keeps the rest and logs what it left out.
89
+ - **Saved filters, with a file to move them.** The Filter window lists filters saved under a name: **Save** keeps the
90
+ conditions in the editor (a name already used is updated), **Load** puts a saved filter's conditions in the editor
91
+ without applying them, **Delete** removes it, and one naming a field the open lot lacks says so. **Export…** and
92
+ **Import…** move the list as a `wafermap-filters` file: JSON with `format`, `version` and `filters` (each `id`, `name` and
93
+ `conditions`), read as leniently as a plots file (`readFiltersFile` / `writeFiltersFile`, `SavedFilter`): a condition that
94
+ cannot be read is named and left out, a bare list or a bare condition is accepted, and an import adds a filter whose id is
95
+ already saved as a copy. `insights.savedFilters` starts the list, `onSavedFiltersChange` reports it, and
96
+ `onPickFiltersFile` supplies a desktop host's own file dialog.
97
+ - **A scatter plot states r and n**, Pearson's r over every point drawn (the rule the correlation matrix uses), in its
98
+ footnote, and warns when its points pool several values of a split or lot field that neither the colour nor the panels
99
+ divide by (a trend across them may be the groups' offset: Simpson's paradox).
100
+ - **Axis limits and clipping on a plot.** `PlotAxis.includeLimits` widens a value axis to every limit drawn on it
101
+ (`true`) or never (`false`); absent keeps the rule that it does when the data keeps a third of the axis.
102
+ `PlotAxis.clip` narrows the axis to the robust range (quartiles ± 1.5 IQR) worked out over the whole plot; marks
103
+ beyond it are not drawn, the footnote counts them, and every statistic still uses them.
104
+ - **Drag across a line plot** to select the run of X values between the drag's ends, with every unit each point
105
+ averages, for the same menu a click opens.
106
+ - **Pass rates of several tests in one plot, and the tester's flag.** A set of tests can be read as pass rates,
107
+ `{ tests: [...], passRate: true }` (editor: *Read as* → *Pass rates*), one bar per test by the Test field, each die
108
+ judged as the Overview pass-rate card judges it. A pass rate, one test's or a set's, takes `judge: 'flag'` (*Judged
109
+ by* → *Tester flag*) to read the tester's recorded pass or fail instead of the test limits; a functional test is
110
+ judged by its verdict either way. A test the chosen judgement cannot judge is left out and named.
111
+ - **Categories smallest first.** `PlotSpec.sort: 'ascending'` (*Order* → *Smallest first*) puts the worst pass rate at
112
+ the top. With colours, a category is ordered by all its colours together: added up for counts and sums, pooled (or
113
+ combined over every value) otherwise.
114
+ - **Horizontal box and bar plots.** `PlotSpec.orientation: 'horizontal'` (Customise → *Orientation*) puts the categories
115
+ down the left and the values along the bottom, for many categories or long names. Limit labels are drawn over the
116
+ marks, on the chart's background. The left margin fits the labels,
117
+ nested categories' outer levels are columns with dividers across the plot, a pareto's share axis runs across the top,
118
+ bar values sit at the bars' right ends, and the card grows so each category keeps room. Hover, click, right-click,
119
+ stacks, limits and reference lines work as on vertical plots.
120
+ - **Bars as each colour's share of its own total.** `PlotSpec.barNorm: 'percent'` (Customise → Colours: *Share of
121
+ colour*) draws a bar of counts or sums with each colour as a percentage of that colour's total, so groups of
122
+ different sizes compare (the bin mix of a small split beside a large one). Categories sort by their summed shares.
123
+ - **Median and mean lines on a plot's axis.** A reference line can be `{ stat: 'median' }` or `{ stat: 'mean' }` (typed
124
+ as `median` or `mean` in Reference lines), drawn at that statistic of what the plot shows along the axis: the bars'
125
+ heights, the points, the values in the boxes. Worked out over the whole plot, so every panel shares it. Plot files
126
+ stay at version 1; an older build leaves such a line out with a warning.
127
+ - **Values on a plot's bars.** `PlotSpec.valueLabels` (Customise: *Values on the bars*) prints each bar's value at its
128
+ end, only when every value fits its bar's width. A reference line's label moves clear of them and is drawn over the
129
+ bars on a halo.
130
+ - **Right-click a wafer's mark in a plot** (a wafer's bar or box, a point per wafer) for that wafer's menu, as on the
131
+ maps and the Insights cards.
132
+ - **Several tests in one plot, and rescaled values.** A plot's Y can be a set of tests, `{ tests: [1050, "1060..1080"] }`
133
+ (numbers or ranges, read as a sweep's tests are), in a box, bar, line or histogram; the new `test` field divides it,
134
+ on X (a box or bar with no X puts one box per test along it) or as the colour. `PlotSpec.normalize` rescales each
135
+ test on its own: `'limits'` (0 at the low limit, 1 at the high; spec limits when a test has both, else test limits,
136
+ as Process capability places them), `'zscore'` (standard deviations from the mean of the values in view) or
137
+ `'robust'` (from the median, with 1.4826 × the median absolute deviation). Tests in different units are refused until
138
+ they are rescaled; a test the dies do not hold, or one that cannot be rescaled, is left out and named; a missing value
139
+ is counted against its own test; and a limit line is drawn only where every test puts it at the same place. A set
140
+ reads at most four million values (dies × tests). The editor offers **Several tests…** in the values list, a **Tests**
141
+ box, and **Rescale values**. Plot files stay at version 1.
142
+ - **A PAT showcase lot.** `docs/data/showcase-pat-screen.csv` (with `.meta.json`, from `scripts/gen-showcase-csvs.mjs`) is a synthetic
143
+ lot of four wafers with four tests that each have both limits, planted PAT outliers on every wafer, a group of them on one,
144
+ a log-normal (lopsided) Iddq and a few dies outside their limits, for trying the PAT card, columns and plots.
145
+ - **Pointers to the explanations.** The comparison, commonality and PAT cards, and the footnotes of probability, control, goal and
146
+ heatmap plots, say where in the user guide to read how to interpret them.
147
+ - **The statistics explained.** The user guide has a new section, *The statistics, explained*: for each figure the Insights and Plot
148
+ tabs show (group comparison and its p and q, what divides yield, probability plots, fit lines, bands, control charts,
149
+ capability and the goal plot, rescaling, ranges, what-if limits, heatmaps and the difference map, part average testing
150
+ and the example plots) what question it answers, how it is worked out, how to read it and what it cannot say. PAT's
151
+ entry states how the limits are set and how they differ from AEC-Q001. The glossary gains matching entries.
152
+ - **Reference lines and bands on a plot axis.** `PlotAxis.references` is a list of up to eight `{ at, to?, label? }`: a dash-dot
153
+ line at `at`, or a shaded band from `at` to `to`, in the axis's own unit, on any value axis (scatter X and Y, a
154
+ histogram's or probability plot's values, a box, bar, line or control chart's values). Each is labelled with its name and
155
+ value and takes part in the axis range as test limits do; one off the edge is marked there. The editor's **Reference
156
+ lines** box in Customise reads `0.45 Target, 0.3..0.5 Window`. Plot files stay at version 1.
157
+ - **PAT in Insights and the Dies table.** The Overview has a **Part average testing (PAT)** card (shown when a test has both
158
+ limits and a wafer has enough passing dies): per wafer the dies within the PAT limits, the outliers and their rate, and the
159
+ dies that fail anyway, with the wafers with the most outliers first, the tests the outliers are outside on, and the tests
160
+ whose values are lopsided (quartile skewness of 0.2 or more), where symmetric limits fit less well. The Dies
161
+ table and its CSV gain a **PAT** column, and **PAT tests** when there are outliers, for whole wafers (a part of a wafer
162
+ has none: its limits are the whole wafer's). **Map the verdicts** on the card opens a gallery of the wafers, each die coloured by its PAT verdict (within the limits, outlier, fails anyway), so the gallery's legend, value toggles, expand and tooltips show where on each wafer the outliers are. The maps state no yield, as a verdict is not a bin.
163
+ - **More example plots, chosen from the lot.** The Plot tab's **Add examples** takes its tests and split from the data in view: the lead
164
+ test varies most between wafers (for one wafer, follows radial position most), its partner tracks it best, and the split
165
+ is the lot field that explains most of the lead test's wafer-to-wafer spread (`stats/examplePicks.ts`, which reads a sample of
166
+ at most 4,000 dies and 60 tests). The examples are coloured by the split (by ring where the lot has no split), so groups are told apart at a glance. It also draws, where the lot has the data for them, the first
167
+ tests as a rescaled set (a box per test, and a heatmap of tests by wafer), the first test by split and by wafer
168
+ nested in split, panels by ring, the first test by ranges of the second and of radial position, a pareto of the hard
169
+ bins, each wafer's bin mix, the first test by PAT verdict, an individuals control chart (five or more wafers), and,
170
+ where the test definitions carry limits, a capability goal plot and a pass-rate bar. The
171
+ scatter carries a fitted line, the histogram its normal curve and the line a ±1 SD band.
172
+ - **A measured value in ranges, as a category.** A field `{ binned: field, bins?, by? }` cuts a test, a die position
173
+ (Radial position, Die X, Die Y) or a wafer figure such as Yield into 2 to 20 ranges (default 5) that each hold about
174
+ the same number of values (`by: 'count'`, the default) or span the same width (`'width'`), named by their limits in the field's unit
175
+ ("7.16 pA to 19.4 pA") and listed lowest first. It takes the places a category does: the X of a box or bar (Vth by Idsat decile), a
176
+ colour, a heatmap's rows or columns, and the panels. The edges are set over the whole population plotted, so every
177
+ panel and colour shares them. The editor lists such fields as "Idsat in ranges" with a count and Equal counts or
178
+ Equal widths beneath. A field that is a category already is refused with the reason. Plot files stay at version 1.
179
+ - **Heatmaps and a difference map.** `chart: 'heatmap'` draws one cell per value of `fields.rows` and of `fields.x`,
180
+ coloured by Y combined over the cell's dies (a count without Y): it resolves as the bar of the two fields nested, so
181
+ sets of tests (Test as the rows), rescaling, pass rates, pooled yield and `where` all apply, with a colour bar over
182
+ the cells, values written where they fit, and a click on a cell for its dies. With Group by on, Insights
183
+ Distributions has a **Difference map**: one group's mean minus another's at every die position (each the mean over
184
+ the group's wafers by the stacked maps' own rule; yield as the share passing), drawn as a wafer map on the first
185
+ wafer's geometry and orientation, coloured symmetrically about zero, following the section's test.
186
+ - **Control charts and capability goal plots.** `chart: 'control'` is an individuals chart of one value per wafer (a
187
+ test's wafer mean, a yield or a pass rate) along wafer order or another wafer field with a number per wafer: the
188
+ centre is the mean, the limits ±3σ with σ the average moving range / 1.128, faint ±1σ and ±2σ zones, and each point
189
+ that breaks a Western Electric rule (beyond 3σ; 2 of 3 beyond 2σ; 4 of 5 beyond 1σ; 8 in a row on one side) marked
190
+ with its rule. `baseline: n` sets the limits from the first n wafers. `chart: 'goal'` places each test with both
191
+ limits (or the set on Y) by its mean's offset from the centre of its limit window and its standard deviation, both
192
+ as shares of the window, against triangles of Ppk 1 and 1.33, with a point per colour group; tests short of 1.33 are
193
+ named.
194
+ - **Fit lines, histogram shares and what-if limits in plots.** A scatter can carry a fitted line per colour
195
+ (`fit: 'linear'`, least squares of Y on X, or `'orthogonal'`, Deming regression with equal errors, for two
196
+ measurements of one quantity), each stated above the chart as its equation with R² and n, and a y = x line
197
+ (`identity`) where X and Y share a unit. A histogram can show each colour's bars as a share of its own values
198
+ (`histNorm: 'percent'`) and each colour's fitted normal curve (`normalCurve`). `whatIf: { lo, hi }` on a histogram or
199
+ probability plot of one test draws proposed limits as their own kind of line and states the test's pass rate by its
200
+ test limits and with the proposed ones, with the dies that change.
201
+ - **Pass rates, die filters and spread bands in plots.** A field `{ passRate: n }` is test n's pass rate (each die 100
202
+ or 0, judged as the test pass-rate card judges: test limits for a parametric test, the recorded outcome for a
203
+ functional one), pooled over the dies of a bar or line, or per wafer with one mark per wafer; a die-level box,
204
+ scatter or histogram of it is refused. `where: { conditions, off? }` keeps only the dies that meet every condition,
205
+ before panels and everything else: a category with the `values` kept, or a number from `min` to `max` (either end
206
+ open), each with `not` to keep the rest instead. A condition on a wafer field keeps whole wafers and is judged on the
207
+ whole wafer; a unit with no value for a condition's field meets none. `off` keeps the conditions and applies none.
208
+ The card states the filter on a line with a switch, on or off, and the statement says what was kept. `spread` puts a band round a line
209
+ of means or medians: ±1 SD, the mean's 95% interval with Student's t, the quartiles or the range.
210
+ - **Radial position, stacked bars and paretos in plots.** A die field **Radial position** gives a die's distance from
211
+ the wafer centre as a percentage of the radius, from the same centre offset the rings and quadrants use, so a ring is
212
+ a band of it. A bar's colours can be stacked (`stack: 'stack'`) or shown as shares of each category
213
+ (`stack: 'percent'`), for counts and sums. Box and bar categories can be sorted by value (`sort: 'value'`; a box by
214
+ median) and cut to the first `top`, with the rest counted in a note, and a value-sorted bar of counts or sums can
215
+ carry a cumulative-percentage line (`cumulative: true`) on a 0–100% axis at the right, counting every category.
216
+ - **What divides yield.** With four or more wafers and wafer fields to compare, the Insights Overview ranks every field
217
+ (the Group by list) by how clearly its groups differ in yield and in the rate of each of the five most common fail
218
+ bins, with each wafer as one value: Welch's ANOVA and Kruskal–Wallis per field and measure, ranked by
219
+ Benjamini–Hochberg q. A row gives the worst and best group with their means and the spread in points, and its
220
+ **Group by** groups the tab by that field. Fields with no two groups of two or more wafers are listed as not compared,
221
+ and fields that group the wafers identically are named as not separable.
222
+ - **Dynamic PAT in plots.** A die field **PAT** gives each die's part-average-testing verdict on its wafer: for every
223
+ test with both limits, the wafer's PAT limits are the median ± 6 × (Q3 − Q1) / 1.35 of its passing dies' values inside
224
+ the test's limits, never wider than those limits (spec first, as capability takes them). A die is Within PAT limits,
225
+ a PAT outlier (passes its bin and every limit, outside PAT on at least one test) or Fails (bin or limits); a test with
226
+ fewer than 30 passing values, or no spread, does not judge that wafer. It can be a colour, categories or panels, and
227
+ the limits are the whole wafer's even in a panel of part of it. A plot of one wafer draws that wafer's PAT limits as
228
+ dotted *PAT lo* / *PAT hi* lines with whichever limits are shown; the statement says how PAT is set.
229
+ - **Panels (small multiples).** `fields.facet` draws a plot once per value of a category field, up to 24 panels in a
230
+ grid: a wafer field (split, lot) takes whole wafers, a die field (ring, site) each wafer's dies with that value, and
231
+ Test, with a set of tests as the values, one test per panel. Every panel shares the whole plot's colours and axis
232
+ ranges (limit lines included), and rescaling is measured over the whole population. One statement and legend sit
233
+ above the grid, a legend chip filters every panel, each panel has its own Expand, and Save as PNG saves the whole
234
+ grid. A wafer or die with no value for the field is in no panel and is counted. The editor has a **Panels** choice.
235
+ - **Comparing splits, wafer by wafer.** With Group by on, Distributions opens with a **Comparison by** table: every
236
+ measured test compared across the groups with each wafer as one value (the mean of its dies), so n is wafers. Per test:
237
+ each group's mean, Welch's ANOVA (Welch's t for two groups), Kruskal–Wallis (marked approximate below five wafers a
238
+ group), the Benjamini–Hochberg q the table is ranked by, and the largest shift in wafer-to-wafer standard deviations
239
+ and as a share of the limit window. A chosen control adds each group's difference from it with a Holm-adjusted p. A
240
+ row shows its test in the other Distributions panels; **Comparison CSV** saves the table. A box or bar plot of one
241
+ test divided by a wafer field states the same wafer-level comparison under the chart. The t, F and chi-square tails
242
+ behind it are exact (incomplete beta and gamma functions), not normal approximations.
243
+ - **Probability plot.** A new plot chart, `chart: 'probability'`, draws each colour group's values in order against
244
+ the share of the group at or below them, (rank − ½) / n, on a normal-probability axis (a normal distribution is a
245
+ straight line) or, with `probabilityAxis: 'linear'`, a plain 0–100% one. It takes what a histogram takes: one test, a
246
+ set of tests, rescaled or not, per die or per wafer. Limits are drawn on the values axis; a point's tooltip gives its
247
+ die, its rank and where it is plotted; click opens its wafer, and dragging a box selects every die inside it, though a large group draws a
248
+ sample of its middle (both tails in full). **Add examples** adds one, and Customise has a **Share axis** choice.
249
+ - **Nested categories in a box or bar.** `fields.x` may be a list of up to three fields, outer first, one category per
250
+ combination of their values: Test then Ring draws a box per ring within each test. The axis shows the innermost
251
+ values at the ticks and each outer level as a row of spanning labels with dividers. In the editor, **+ Add a level**
252
+ adds one under Categories, and each level has buttons to move it out or in a level and to remove it. A field can be
253
+ one level only; a unit missing a level's value is counted against that level.
254
+
255
+ - **Clusters of one hard bin.** `analyzeWaferMap` also looks for clusters in each failing hard bin on its own, besides
256
+ the clusters of every fail bin together. A spot of one bin next to other bins' fails (a spot touching an edge ring) is
257
+ reported as that bin's cluster, where the run over every fail bin finds one group with the fails round it. A bin is
258
+ tested when it has at least the minimum cluster size of dies (`max(5, 0.3%` of the dies`)`) and at most 80% of the
259
+ failing dies; up to eight bins, the largest first, share the significance level. The finding has
260
+ `comparison.family: 'cluster'`, `variable.kind: 'hardBin'` with its bin, and a rise in that bin as its effect; its
261
+ summary reads "HBin 4 (Spot) cluster at (x, y): …". A bin's cluster that is most of a cluster over every fail bin is
262
+ left to that cluster. Interior clusters only: edge arcs stay with the run over every fail bin.
263
+ - **Edit as plot on the Insights cards.** The yield, bin pareto, pass rate, box plot, histogram, trend and scatter cards,
264
+ and the right-click Value histogram, open as a draft plot of the reader's own over the same wafers, with the test and
265
+ Group by the card shows filled in as fields, so it draws the same thing on any lot. It joins My plots only when added.
266
+ - **About this chart.** Every chart card can show one line under its title saying what it shows and how to read it
267
+ (*About this table* on the comparison, What divides yield and PAT tables).
268
+
269
+ ### Changed
270
+
271
+ - **"How to read this" opens the user guide at its section.** The PAT card, What divides yield, the Comparison by table,
272
+ process capability, the difference map and the probability, control, goal and heatmap plots name the guide section
273
+ that explains them by its title; a plot also names the section for a fit line or y = x, a band, rescaled values,
274
+ ranges, panels, what-if limits or a wafer-by-wafer comparison while it shows one. Each title is a link
275
+ that opens the guide there beside the app (its own window where the platform allows one, a floating window over the
276
+ app otherwise). An open guide moves to the section and comes to the front. A saved image or print names the section.
277
+ The guide's own cross-references name their sections too.
278
+ - **Guide window heading ids are the section titles**, prefixed `wmap-` (`wmap-part-average-testing-pat`), without the
279
+ section number, so a link into the guide survives renumbering and cannot clash with a host extension's headings.
280
+ - **The lot summary report's comparison of wafer fields is headed Group Comparison**, as it compares the wafers by
281
+ any field Group by offers (lot, program, process split).
282
+ - **What stands out ranks parametric signals with yield loss.** A test whose values shift in a region (a test-value
283
+ finding of at least half a standard deviation), a trend across the wafers, a test whose spread is too wide for its
284
+ limits (Ppk under 1.0) and dies outside a test's limits but binned as passing are items like a region's loss, so a
285
+ characterisation lot with no limits or fails still has items. All are ranked by the share of the lot they affect: a
286
+ loss by the dies it cost, a shift by its dies weighted by the square of its size (in full from two standard
287
+ deviations), a trend by its size, a spread by the dies it would put outside its limits. A shift standing on a loss
288
+ item's dies, or of a test an item already names, is said within that item. The separate Watch lines are gone, and
289
+ the compact list shows each item's size as fits it (`2.4%`, `1.3σ`, `Ppk 0.62`).
290
+
291
+ - **A card in the Insights grid is the size of the others, whatever the data; what does not fit scrolls inside it.**
292
+ A horizontal bar or box plot (the Overview's test pass rate among them) draws the rows in view under a fixed value
293
+ axis, with a scrollbar at its right edge and the mouse wheel over the chart; the process capability chart does the
294
+ same sideways for its test columns. A plot's colour legend scrolls after about three lines, and a PAT or "what
295
+ divides yield" table listed in full scrolls after about twelve rows. Expanded, the plots and their legends take the
296
+ window's room before they scroll.
297
+
298
+ - **A scatter draws its rarer colours on top.** Every colour keeps one dot and one strength, and the colours with fewer
299
+ dots are drawn last, so a small group (PAT outliers, a failing bin, a small split) lies over a dense one instead of
300
+ under it.
301
+
302
+ - **A percentage is written 83.8%**, with no space before the sign, on plots, their hover text, axes and range names,
303
+ and it is never given an SI prefix: a small share reads 0.50%.
304
+
305
+ - **A wafer attribute has one name everywhere.** Plot titles, axis titles, footnotes, filter conditions and the wafer
306
+ columns of the Dies table and its CSV name an attribute by the host's `attributes` label, as Group by, the field
307
+ list, the Wafers table and the reports already did; without one, by the default label or the key spelled out.
308
+
309
+ - **One ⋯ menu on every chart card** holds Save as PNG, Edit as plot and About this chart, in place of the camera icon.
310
+ It is a keyboard-operable command menu; a table leaves out Save as PNG. **Expand** stays a button of its own beside
311
+ it, hidden while the card is in its own window.
312
+ - **Plots read the dies a yield judges.** Every plot leaves out partial dies and dies inside the edge exclusion, as the
313
+ Insights cards (bin pareto, boxplot, trend, capability) do, so a plot and a card of the same thing give the same
314
+ numbers. Counts, means, boxes and histograms on a lot with edge exclusion move accordingly; the footnote states how many
315
+ dies were left out ("12 edge-excluded dies left out, as a yield leaves them out"). PAT limits are still read over the
316
+ whole wafer.
317
+ - **A plot coloured by hard or soft bin draws each bin in its map colour**, from the same bin colours as the maps and
318
+ legends (palette, `BinDef.color`, colour-blind palettes), in the Plot tab, the plot editor and plots opened from a
319
+ right-click. A plot whose colour is also its X (bars by bin coloured by bin) has no legend, since the axis names
320
+ every colour.
321
+ - **The Distributions box plot, value histogram and wafer-to-wafer trend are drawn as plots.** Each keeps its test
322
+ picker and the section's shared axis settings (which limits, *Axis includes limits*, *Clip outliers*), linked across
323
+ the cards as before. The box plot runs down the left, one box per wafer, or with Group by on one per group whose click
324
+ narrows the section to it (Back returns); it keeps its log scale. The histogram shows all wafers, one wafer (the
325
+ picker) or a series per group, and a bar opens the dies in its range; a group clicked in its legend narrows the
326
+ section to it, with Back. The trend draws each wafer's mean in the population's order with a ± 1 standard deviation
327
+ band and the lot mean as a line; a point opens its wafer, a right-click opens its menu and a drag picks a run of
328
+ wafers. A click on a wafer's box or bar in any plot is offered as "click a box (bar) to …".
329
+ - **The Insights tab for the reader's own plots is named My plots**, so it reads as theirs beside the cards Insights
330
+ draws for the data.
331
+ - **The right-click menu's Value histogram is drawn as a plot**, with its test picker and *Edit as plot*, over the same
332
+ dies.
333
+ - **The Correlation tab's test scatter is drawn as a plot**: X and Y pickers, die-level points in the maps' hard-bin
334
+ colours (or by group with Group by on), the wafer picker ungrouped, the shared *Limits* choice, r and n in its
335
+ statement; a matrix cell still sets its pair, a point opens its wafer on the X test, and a drag opens the menu on the
336
+ dies inside it. The correlation matrix itself is unchanged.
337
+ - **The Overview's pass-rate card is drawn as a plot**: a horizontal bar per test on a fixed 0–100% axis, worst first,
338
+ each with its rate at the end (one bar per group with Group by on), with the same Test limits / Tester flag /
339
+ Functional choice where the data supports it and the count of dies the two parametric judgements disagree on. A bar's
340
+ tooltip counts its passing and failing dies and, judged by test limits, how many failed below the low limit and above
341
+ the high. A bar opens the dies that fail its test (in its group). With nothing judgeable the Overview has no pass-rate card.
342
+ - **Yield by wafer in Insights is drawn as a plot**: vertical bars with each yield at its end, the median of the bars
343
+ as a line (three bars or more), *Sort: yield* or the wafers' own order, a wafer's bar opening that wafer (right-click
344
+ for its menu). With Group by on, one bar per group, and a group's bar drills into its wafers in place, with **Back**
345
+ and the sort then naming the wafers.
346
+ - **A group's yield pools passing dies over judged dies.** The combined yield of a group (the grouped yield bars, the
347
+ Overview's combined figures) weights each wafer by its judged dies, not by every die in it, so a die with no bin
348
+ recorded no longer counts; where some dies carry no bin, a group's yield moves slightly (for example 77.01% to 76.92%).
349
+ - **The Insights bin pareto is drawn as a plot**: vertical bars by bin, largest first, in the map colours, with the
350
+ cumulative share on a right-hand axis, and the same Hard / Soft bins toggle. With Group by on it has one bar per
351
+ group in each bin, as each group's share of its own dies (*Share of …*, the default, so groups of different sizes
352
+ compare) or as counts; a bar opens that bin's dies in that group.
353
+ - **With Group by on, Distributions puts the comparison cards first**: the comparison table and the difference map under
354
+ *Comparing …*, then the cards for each test under *Test by test*.
355
+ - **Insights lists the Group by values in one order everywhere**: by number when every value is one, else naturally
356
+ (W2 before W10), the order plots use, so a group has the same colour on every card and plot. Clicking a bar opens exactly the dies it
357
+ counts (partial and edge-excluded dies are not among them).
358
+ - **A PAT verdict has its own colour in a plot** (outliers amber, fails red). A goal plot names the tests short of Ppk 1.33 only where the name fits beside its point without covering another; hovering names the rest.
359
+ - **A box or bar category has places only for the colours it holds.** Each category lays out the colour groups that
360
+ have a value there, centred, at the width the fullest category needs, so a category one colour fills (a ring
361
+ coloured by ring, a wafer coloured by its split) draws one full-width mark. A box's tooltip names its colour only
362
+ when the category does not already.
363
+
364
+ - **A cluster of one bin lists the region findings it explains.** A rise in its bin in a ring, quadrant or sector that
365
+ the cluster's dies make up at least half of, and that is no more severe than the cluster, is named in the cluster's
366
+ `relatedIds` and marked info, as a pattern's are; a more severe row stands on its own.
367
+ The Summary panel and the reports show them under the cluster, which leads its own group, so a spot reads once,
368
+ first, and its coarser regions follow it. A pattern does not claim those rows.
369
+ - **A row another absorbed as a restatement is not shown under a pattern either** (a soft-bin twin, or the single pass
370
+ bin beside the yield row); it was hidden only from the region groups. The Summary panel takes a pattern's rows from
371
+ `arrangeFindings`, as the reports do.
372
+ - **A centre-cluster pattern lists only the clusters that reach the core ring** under it (`relatedIds`), as it does
373
+ ring findings.
374
+ - **The results summary keeps one bin's cluster with one item.** It goes with the finding of its bin, or the pass rate,
375
+ that it shares most dies with and makes up at least half the loss of, and does not join two items into one. A
376
+ pattern's item takes only the findings it explains that no other item holds.
377
+
378
+ ### Fixed
379
+
380
+ - **A limit beyond a plot's axis is marked at the edge clear of the other axis's limit labels.** The "← Lo limit"
381
+ markers in a corner and a limit line's own label take separate rows rather than one being drawn over the other.
382
+
383
+ - **Map the verdicts opens from a single map's Insights as it does from a gallery's**, drawing that wafer's PAT
384
+ verdict map; a failure to draw the maps is logged rather than leaving an empty window.
385
+
386
+ - **Typing in a text box inside a window is typing.** The E (close, in a modal) and F (maximise, in a window) shortcuts apply only when focus is not in a text box, text area or list; a letter typed into a plot's title, tests or reference-lines box goes into the box.
387
+ - **A segmented choice keeps its highlight when the pointer leaves it.** Choosing a segment that does not redraw the
388
+ editor (a plot's Limits or Rescale values) shows it as selected after the pointer moves away.
389
+
390
+ - **Cluster and edge-arc detection leave out dies with no bin.** A die with neither a hard nor a soft bin is no data
391
+ there, as it is in the yield: neither a failure nor part of the background, so a block of unbinned dies is not
392
+ reported as a failure cluster. Wafers whose dies all carry a bin are analysed as before.
393
+ - **The Findings section's Analyse runs only on the data it was offered for.** In `renderWaferGallery`, `setItems`
394
+ and `setLotStatsSummary` cancel a test-value analysis in progress, and its result is neither shown nor reported
395
+ through `onStatsSummaryChange`. In `renderWaferMap`, a result arriving after `setResult` or `setStatsSummary` is
396
+ dropped the same way. A run that fails puts the Analyse offer back.
397
+ - **A cluster of one bin has a Findings group of its own** even when another bin's cluster, or a cluster of every fail
398
+ bin, carries the same "Cluster at (x, y)" label; the groups `arrangeFindings` returns carry a `key` that tells them apart.
399
+ - **The correlation matrix chooses its tests from an even spread of the dies on a very large program.** Above 300
400
+ tests, the tests with the most dies outside their limits (then the widest spread) are scored on at most 25,000,000
401
+ values, so a program of 15,000 tests is ranked on about 1,700 dies rather than reading every die of the sample.
402
+ - **Analysis of a program with thousands of tests reads its test definitions once per call**, by number, where each
403
+ test searched the list.
404
+ - **A derived test that fails its limits is marked † in the results summary**, as on every other surface:
405
+ `stats.testSpecYield[].label` carries the mark, as `functionalYield[].label` does.
406
+ - **A value stack counts no bins.** A `lotStack` by mean, median, minimum, maximum, standard deviation or count keeps
407
+ one wafer's bins on its dies, which describe that wafer and not the stack. Its analysis has no `hardBinCounts`,
408
+ `softBinCounts` or bins considered, every die outside a test's limits counts towards that test's cost
409
+ (`testFailures[].lostDies`), so the results summary says no die is binned as passing, and the Summary panel and the
410
+ wafer report show no bin breakdown, region yield or pass and fail counts for it. A `'mode'` stack is unchanged.
411
+
27
412
  ## [0.36.0] — 2026-10-13
28
413
 
29
414
  ### Breaking
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![CI and deploy](https://github.com/wafertools/wafermap/actions/workflows/deploy.yml/badge.svg)](https://github.com/wafertools/wafermap/actions/workflows/deploy.yml)
6
6
  [![npm](https://img.shields.io/npm/v/@wafertools/wafermap.svg)](https://www.npmjs.com/package/@wafertools/wafermap)
7
7
  ![runtime deps](https://img.shields.io/badge/runtime%20deps-0-brightgreen)
8
- ![bundle](https://img.shields.io/badge/data%20layer%20min%2Bgz-~73%20kB-blue)
8
+ ![bundle](https://img.shields.io/badge/data%20layer%20min%2Bgz-~81%20kB-blue)
9
9
  [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
10
10
 
11
11
  <img src="docs/images/hero-test-values.png" alt="wafermap demo" style="max-width:640px; display:block; margin:8px 0;" />
@@ -13,7 +13,7 @@
13
13
  Browser-first wafer map visualization for semiconductor test data.
14
14
 
15
15
  **Zero runtime dependencies.** Pure ES modules with TypeScript types — works in React,
16
- Svelte, Vue, plain HTML, or a Web Worker. The DOM-free data-and-stats layer is ~73 kB
16
+ Svelte, Vue, plain HTML, or a Web Worker. The DOM-free data-and-stats layer is ~81 kB
17
17
  min+gz; the interactive renderer is larger, and its chart suite and in-app guide are
18
18
  loaded on demand rather than shipped up front — [measured sizes](docs/performance.md).
19
19
 
@@ -31,11 +31,11 @@ wafermap renders interactive wafer maps from semiconductor prober output. Hard b
31
31
  - Geometry inference — pass full physical dimensions or raw prober step positions; die pitch, wafer diameter, and coordinate origin are resolved automatically
32
32
  - `renderWaferMap` — interactive canvas map with toolbar, zoom/pan, tooltips, die selection, and summary panel
33
33
  - `renderWaferGallery` — lot-level card grid with shared controls and click-to-expand
34
- - Insights tab (`insights: { enabled: true }`) — a chart suite behind the Maps | Insights switch (yield, per-test pass rate, bin pareto, capability, boxplot, histogram, wafer-to-wafer trend, correlation, scatter) computed from the same wafer/lot data, for one wafer or the whole gallery
34
+ - Insights tab — a chart suite behind the Maps | Insights switch, on by default (`insights: { enabled: false }` removes it) (yield, per-test pass rate, bin pareto, capability, boxplot, histogram, wafer-to-wafer trend, correlation, scatter) computed from the same wafer/lot data, for one wafer or the whole gallery
35
35
  - Derived tests (`derivedTests`) — tests computed per die from other tests (`abs(t[1020] - t[1010])`), which then work everywhere a measured test does, marked † as not measured
36
- - Parametric sweeps (plots with `chart: 'sweep'`, edited on the Plot tab) — an ordered run of tests read as a response curve, with the crossing and widths between two curves measured; x values given directly or read from the test names, on a linear or log axis
37
- - Drilldown — right-click selected dies, a wafer card or a wafer's bar to chart just that population, with the population stated on the chart
38
- - Plot tab and Data tab — a chart builder (scatter, histogram, box, bar, line, sweep over any test, die field or wafer attribute) whose saved plots your app keeps with `insights.plots` and `onPlotsChange`, and the lot as sortable tables (statistics, dies, wafers) with CSV export
36
+ - Parametric sweeps (plots with `chart: 'sweep'`, edited on the My plots tab) — an ordered run of tests read as a response curve, with the crossing and widths between two curves measured; x values given directly or read from the test names, on a linear or log axis
37
+ - Drilldown — right-click selected dies, a finding, a legend bin, a wafer card or a wafer's bar to chart and tabulate just that population, with the population stated on the chart; in a gallery, select the same dies on every wafer to read one region across the lot
38
+ - My plots tab and Data tab — a chart builder (scatter, histogram, box, bar, line, sweep over any test, die field or wafer attribute) whose saved plots your app keeps with `insights.plots` and `onPlotsChange`, and the lot as sortable tables (statistics, dies, wafers) with CSV export
39
39
  - Validity limits (`TestDef.validLow` / `validHigh`, `valueFilter`) — tester clamps and open-circuit readings are kept out of the map, statistics and charts, and counted wherever a population is shown
40
40
  - Reticle and multi-project wafers — stepper-field overlay, reticle cell and shot as die fields to colour, split and chart by, reticle-position findings, and a compact layout for sparse multi-project reticles
41
41
  - `analyzeWaferMap` / `analyzeWaferLot` — spatial analysis across rings, quadrants, sectors, and reticle positions; failure cluster detection; lot trend series
@@ -78,7 +78,7 @@ export. Add `analyzeWaferMap` for the findings and summary panel, swap in
78
78
 
79
79
  The API reference is long because it documents every option, not because you need
80
80
  them: [tsmap](https://github.com/wafertools/tsmap), a complete cross-platform desktop
81
- application built on this library, imports **20** of its ~100 exports. Read the
81
+ application built on this library, imports **22** of its ~100 exports. Read the
82
82
  [Quick Start](https://wafertools.github.io/wafermap/quickstart/) first and treat the
83
83
  [API reference](https://wafertools.github.io/wafermap/api/) as something to search,
84
84
  not to read.
@@ -1 +1 @@
1
- import{buildCapabilityData as Se}from"../../stats/capability.js";import{capabilityColor as G}from"./palette.js";import{LEADING as $e,SPACE as M,fontPx as Z,FONT as ee,CLR as j}from"../toolbar.js";import{cardShell as Me,isExpandedCard as Te,chartFillHeight as Ce,applyCanvasFlow as Le,observeResize as ke,makeTooltip as Pe,positionChartTooltip as Ee,renderEmptyState as we,resolveChartCanvasColors as De,chartSwatchCss as Ae,prepareCanvas as We,chartDpr as Ne}from"./chartShell.js";import{fmt as Ie}from"../../renderer/fmt.js";import{limitSetName as ae}from"../../renderer/valueFilter.js";import{escHtml as q}from"../../core/utils.js";import{DERIVED_MARK as te,DERIVED_KEY as re}from"../../renderer/testLabel.js";function I(v){return v==="spec"?{lo:"LSL",hi:"USL",noun:"spec limits"}:{lo:"Lo limit",hi:"Hi limit",noun:"test limits"}}function ce(v){let w;for(const X of v){if(!X.hasSpec)continue;const D=X.limitBasis??"test";if(w===void 0)w=D;else if(w!==D)return"mixed"}return w}const Be=30,me=160,de=90,pe=28,L=42;function z(v){return v===null?"\u2014":v.toFixed(2)}export function renderCapabilityPanel(v){const{title:w="Process capability",items:X,testDefs:D,onSaveImage:fe,onSelectTest:F}=v;let K=v.selectedTestNumber??null;const{card:p,body:k}=Me(w,fe,v.ownerDocument),he=D.some(t=>t.testNumber!==void 0);k.style.overflowX="auto";function ue(){return X}const A=p.ownerDocument.createElement("div");Object.assign(A.style,{display:"flex",flexDirection:"column",gap:M.xs,marginBottom:M.sm}),p.insertBefore(A,k);const B=Pe(p);let U=()=>{};function be(t,s,S,T,f,a){A.innerHTML="";const c=p.ownerDocument.createElement("span");Object.assign(c.style,{display:"inline-flex",alignItems:"center",gap:M.sm,color:j.value,fontSize:ee.body,fontWeight:"500"});const b=S-t,$=(s>0?` \xB7 ${s} without both limits`:"")+(a?` \xB7 ${a.total.toLocaleString("en-GB")} values outside ${ae(a.limitSet)} excluded`:""),C=p.ownerDocument.createElement("span");C.dataset.wmapCaption="1",C.textContent=b>0?`${t} of ${S} tests shown${$} \xB7 ${b} excluded (no recorded values)`:`${t} test${t!==1?"s":""} shown${$}`,c.appendChild(C),A.appendChild(c);const x=s>=t,W=p.ownerDocument.createElement("div");W.dataset.wmapCaption="1",W.textContent=x?"No test has both limits, so each is normalised to its own observed range (min = 0, max = 1) and sorted most-variable first. Ppk needs limits, so none is shown.":(f==="mixed"?"Normalised to each test's spec limits (LSL = 0, USL = 1), or its test limits (Lo limit = 0, Hi limit = 1) where it has no spec limits, worst Ppk first. ":`Normalised to ${I(f).noun} (${I(f).lo} = 0, ${I(f).hi} = 1), worst Ppk first. `)+"Tests without both limits are normalised to their own observed range and drawn muted/dashed.",Object.assign(W.style,{color:j.label,fontSize:ee.body,lineHeight:$e.base,marginTop:M.xs,maxWidth:"78ch"}),A.appendChild(W),A.appendChild(xe(p.ownerDocument,s>0,x,T>0))}function xe(t,s,S=!1,T=!1){const f=t.createElement("div");Object.assign(f.style,{display:"flex",flexWrap:"wrap",alignItems:"center",gap:`${M.xs} ${M.xl}`,marginTop:M.xl,marginBottom:M.xs,fontSize:ee.body,color:j.label});const a=S?[]:[{color:G(2),label:"Capable \xB7 Ppk \u2265 1.33"},{color:G(1.1),label:"Marginal \xB7 Ppk \u2265 1.0"},{color:G(.5),label:"Poor \xB7 Ppk < 1.0"}];s&&a.push({color:j.label,label:"No limits \xB7 no Ppk",dashed:!0});for(const c of a){const b=t.createElement("span");Object.assign(b.style,{display:"inline-flex",alignItems:"center",gap:M.sm});const $=t.createElement("span");$.style.cssText=Ae(c.color,c.dashed?"outline":"solid");const C=t.createElement("span");C.textContent=c.label,b.append($,C),f.appendChild(b)}if(T){const c=t.createElement("span");Object.assign(c.style,{display:"inline-flex",alignItems:"center",gap:M.sm});const b=t.createElement("span");b.textContent=te,Object.assign(b.style,{color:j.value,fontWeight:"600"});const $=t.createElement("span");$.textContent=re,c.append(b,$),f.appendChild(c)}return f}function ye(t){if(k.innerHTML="",t.length===0)return we(k,"No parametric tests have any recorded values.",{maxWidth:"480px"}),()=>{};const s=p.ownerDocument.createElement("canvas");s.style.display="block",s.style.cursor="default",k.appendChild(s);const S=t.length,T=Math.min(0,...t.map(n=>n.min)),f=Math.max(1,...t.map(n=>n.max)),a=(f-T)*.05||.1,c=T-a,$=f+a-c||1;function C(n){const o=Math.floor(n/S);return Math.max(Be,Te(p)?o:Math.min(me,o))}function x(n,o,i){return o+(1-(n-c)/$)*i}function W(n,o,i,l,P){const y=t.filter(g=>g.hasSpec).length,N=y===t.length,h=y===0,E=ce(t),e=E==="mixed"?{lo:"Lo",hi:"Hi",noun:"limits"}:I(E),u=h?"max":E==="spec"?e.hi:"Hi",r=h?"min":E==="spec"?e.lo:"Lo",R=N?`normalised to ${e.noun}`:h?"normalised to range":"normalised (per test)";n.font=`${Z(-1)}px system-ui, sans-serif`,n.textAlign="right",n.textBaseline="middle";for(const[g,m]of[[1,u],[0,r]]){const d=x(g,i,l);d<i-1||d>i+l+1||(n.strokeStyle=o.limitLine,n.lineWidth=1,n.beginPath(),n.moveTo(L-5,d),n.lineTo(L,d),n.stroke(),n.fillStyle=o.textMuted,n.fillText(m,L-8,d))}n.save(),n.translate(9,i+l/2),n.rotate(-Math.PI/2),n.textAlign="center",n.fillStyle=o.textMuted,n.fillText(R,0,0),n.restore()}let H=-1;function Q(){Le(s);const n=k.clientWidth,o=C(n-L),i=o*S,l=pe,P=L+i,y=Ce(p,k,s,pe+200+de),N=Math.max(l+60,y-de),h=N-l,E=We(s,p,P,y);if(!E)return;const{ctx:e}=E,u=De(p);t.forEach((r,R)=>{const g=L+R*o,m=g+o/2,d=Math.max(4,Math.min(o,me)*.55);if(R===H&&(e.fillStyle=u.bgHover,e.fillRect(g,l,o,N-l)),t[R].testNumber===K&&(e.fillStyle=u.accent,e.fillRect(g,N-2,o,2)),r.hasSpec){const le=x(0,l,h),se=x(1,l,h);e.strokeStyle=u.limitLine,e.setLineDash([3,3]),e.lineWidth=1,e.beginPath(),e.moveTo(g,le),e.lineTo(g+o,le),e.moveTo(g,se),e.lineTo(g+o,se),e.stroke(),e.setLineDash([])}const V=r.hasSpec?G(r.ppk):u.textMuted,Y=x(r.min,l,h),O=x(r.q1,l,h),ie=x(r.median,l,h),_=x(r.q3,l,h),J=x(r.max,l,h);e.strokeStyle=u.textMuted,e.lineWidth=1,e.beginPath(),e.moveTo(m,Y),e.lineTo(m,O),e.moveTo(m,_),e.lineTo(m,J),e.moveTo(m-d/4,Y),e.lineTo(m+d/4,Y),e.moveTo(m-d/4,J),e.lineTo(m+d/4,J),e.stroke(),e.fillStyle=V,e.globalAlpha=.5,e.fillRect(m-d/2,Math.min(O,_),d,Math.max(1,Math.abs(_-O))),e.globalAlpha=1,e.strokeStyle=V,r.hasSpec||e.setLineDash([4,2]),e.strokeRect(m-d/2,Math.min(O,_),d,Math.max(1,Math.abs(_-O))),e.setLineDash([]),e.strokeStyle=u.text,e.lineWidth=2,e.beginPath(),e.moveTo(m-d/2,ie),e.lineTo(m+d/2,ie),e.stroke(),e.lineWidth=1,e.font=`${Z(-1)}px system-ui, sans-serif`,e.textAlign="center",e.textBaseline="alphabetic",e.fillStyle=r.hasSpec?V:u.textMuted,e.fillText(r.hasSpec?z(r.ppk):"\u2014",m,l-8);const oe=r.label.length>12?`${r.label.slice(0,11)}\u2026`:r.label;e.save(),e.translate(m,N+6),e.rotate(-Math.PI/4),e.textAlign="right",e.textBaseline="middle",e.font=`${Z(-1)}px system-ui, sans-serif`,e.fillStyle=u.textMuted,e.fillText(oe,0,0),r.derived&&(e.fillStyle=u.text,e.fillText(`${te} `,-e.measureText(oe).width,0)),e.restore()}),e.strokeStyle=u.border,e.lineWidth=1,e.strokeRect(L,l,i,h),W(e,u,l,h,i)}function ne(n){const o=s.getBoundingClientRect(),i=k.clientWidth,l=C(i-L),P=(n.clientX-o.left)*(s.width/Ne(s)/o.width)-L,y=Math.floor(P/l);return y>=0&&y<S?y:-1}return s.addEventListener("mousemove",n=>{const o=ne(n);if(o!==H&&(H=o,Q()),o===-1){B.style.display="none";return}const i=t[o],l=y=>q(Ie(y,i.unit)),P=i.derived?`<em>${te} ${q(re)}</em>`+(i.expression?`<br><code>${q(i.expression)}</code>`:"")+"<br>":"";B.innerHTML=`<strong>${q(i.label)}</strong> (n=${i.n}${i.excluded?`, ${i.excluded.count} outside ${ae(i.excluded.limitSet)} excluded`:""})<br>${P}`+(i.hasSpec?`${I(i.limitBasis).lo} ${l(i.lsl)} \xB7 ${I(i.limitBasis).hi} ${l(i.usl)}<br>mean ${l(i.mean)}<br>Cp ${z(i.cp)} \xB7 Cpk ${z(i.cpk)}<br>Pp ${z(i.pp)} \xB7 Ppk ${z(i.ppk)}`:`<em>No limits \u2014 sorted by variability</em><br>mean ${l(i.mean)} \xB7 stddev ${l(i.stdOverall)}`)+(F?"<br><em>click to view in boxplot</em>":""),B.style.display="block",Ee(B,p,n.clientX,n.clientY),s.style.cursor=F?"pointer":"default"}),s.addEventListener("mouseleave",()=>{H!==-1&&(H=-1,Q()),B.style.display="none"}),s.addEventListener("click",n=>{if(!F)return;const o=ne(n);o!==-1&&F(t[o].testNumber)}),Q}function ge(){const t=Se(ue(),D),s=D.filter(a=>a.testNumber!==void 0).length,S=t.filter(a=>!a.hasSpec).length,T=t.reduce((a,c)=>a+(c.excluded?.count??0),0),f=t.find(a=>a.excluded)?.excluded?.limitSet;be(t.length,S,s,t.filter(a=>a.derived).length,ce(t),T>0&&f?{total:T,limitSet:f}:void 0),U=ye(t),U()}const ve=ke(p,()=>U());return ge(),{card:p,hasData:he,setTest:t=>{K!==t&&(K=t,U())},destroy:()=>ve.disconnect()}}
1
+ import{buildCapabilityData as De}from"../../stats/capability.js";import{capabilityColor as Z}from"./palette.js";import{LEADING as Ae,SPACE as C,fontPx as ie,FONT as se,CLR as F}from"../toolbar.js";import{cardShell as We,guideCite as Ne,isExpandedCard as Ie,chartFillHeight as Be,applyCanvasFlow as Oe,observeResize as Re,makeTooltip as He,positionChartTooltip as _e,renderEmptyState as je,resolveChartCanvasColors as Xe,chartSwatchCss as ze,prepareCanvas as Fe,chartDpr as Ue}from"./chartShell.js";import{GUIDE_SECTIONS as Ge}from"../../stats/guideSections.js";import{fmt as Ye}from"../../renderer/fmt.js";import{limitSetName as he}from"../../renderer/valueFilter.js";import{escHtml as ee}from"../../core/utils.js";import{DERIVED_MARK as ae,DERIVED_KEY as ue}from"../../renderer/testLabel.js";import{cardAbout as Ke}from"./cardAbout.js";function H($){return $==="spec"?{lo:"LSL",hi:"USL",noun:"spec limits"}:{lo:"Lo limit",hi:"Hi limit",noun:"test limits"}}function be($){let W;for(const G of $){if(!G.hasSpec)continue;const N=G.limitBasis??"test";if(W===void 0)W=N;else if(W!==N)return"mixed"}return W}const qe=30,xe=160,ye=90,ge=28,y=42;function U($){return $===null?"\u2014":$.toFixed(2)}export function renderCapabilityPanel($){const{title:W="Process capability",items:G,testDefs:N,onSaveImage:ve,onSelectTest:Y}=$;let te=$.selectedTestNumber??null;const{card:c,body:T,setAbout:Se}=We(W,ve,$.ownerDocument);Se(Ke("capability"));const Me=N.some(n=>n.testNumber!==void 0);T.style.overflowX="hidden";function $e(){return G}const I=c.ownerDocument.createElement("div");Object.assign(I.style,{display:"flex",flexDirection:"column",gap:C.xs,marginBottom:C.sm}),c.insertBefore(I,T);const B=He(c);let K=()=>{};function Le(n,i,m,s,p,a){I.innerHTML="";const f=c.ownerDocument.createElement("span");Object.assign(f.style,{display:"inline-flex",alignItems:"center",gap:C.sm,color:F.value,fontSize:se.body,fontWeight:"500"});const b=m-n,g=(i>0?` \xB7 ${i} without both limits`:"")+(a?` \xB7 ${a.total.toLocaleString("en-GB")} values outside ${he(a.limitSet)} excluded`:""),k=c.ownerDocument.createElement("span");k.dataset.wmapCaption="1",k.textContent=b>0?`${n} of ${m} tests shown${g} \xB7 ${b} excluded (no recorded values)`:`${n} test${n!==1?"s":""} shown${g}`,f.appendChild(k),I.appendChild(f);const q=i>=n,P=c.ownerDocument.createElement("div");P.dataset.wmapCaption="1",P.textContent=q?"No test has both limits, so each is normalised to its own observed range (min = 0, max = 1) and sorted most-variable first. Ppk needs limits, so none is shown.":(p==="mixed"?"Normalised to each test's spec limits (LSL = 0, USL = 1), or its test limits (Lo limit = 0, Hi limit = 1) where it has no spec limits, worst Ppk first. ":`Normalised to ${H(p).noun} (${H(p).lo} = 0, ${H(p).hi} = 1), worst Ppk first. `)+"Tests without both limits are normalised to their own observed range and drawn muted/dashed.",q||P.append(" ",Ne(c.ownerDocument,Ge.goal),"."),Object.assign(P.style,{color:F.label,fontSize:se.body,lineHeight:Ae.base,marginTop:C.xs,maxWidth:"78ch"}),I.appendChild(P),I.appendChild(Ce(c.ownerDocument,i>0,q,s>0))}function Ce(n,i,m=!1,s=!1){const p=n.createElement("div");Object.assign(p.style,{display:"flex",flexWrap:"wrap",alignItems:"center",gap:`${C.xs} ${C.xl}`,marginTop:C.xl,marginBottom:C.xs,fontSize:se.body,color:F.label});const a=m?[]:[{color:Z(2),label:"Capable \xB7 Ppk \u2265 1.33"},{color:Z(1.1),label:"Marginal \xB7 Ppk \u2265 1.0"},{color:Z(.5),label:"Poor \xB7 Ppk < 1.0"}];i&&a.push({color:F.label,label:"No limits \xB7 no Ppk",dashed:!0});for(const f of a){const b=n.createElement("span");Object.assign(b.style,{display:"inline-flex",alignItems:"center",gap:C.sm});const g=n.createElement("span");g.style.cssText=ze(f.color,f.dashed?"outline":"solid");const k=n.createElement("span");k.textContent=f.label,b.append(g,k),p.appendChild(b)}if(s){const f=n.createElement("span");Object.assign(f.style,{display:"inline-flex",alignItems:"center",gap:C.sm});const b=n.createElement("span");b.textContent=ae,Object.assign(b.style,{color:F.value,fontWeight:"600"});const g=n.createElement("span");g.textContent=ue,f.append(b,g),p.appendChild(f)}return p}function Te(n){if(T.innerHTML="",n.length===0)return je(T,"No parametric tests have any recorded values.",{maxWidth:"480px"}),()=>{};const i=c.ownerDocument.createElement("canvas");i.style.display="block",i.style.cursor="default",T.appendChild(i);let m=0;const s=c.ownerDocument.createElement("div");s.dataset.wmapColScroll="1",s.tabIndex=0,s.setAttribute("aria-label",`Scroll the ${n.length} tests`),Object.assign(s.style,{position:"absolute",display:"none",height:"12px",overflowX:"auto",overflowY:"hidden",zIndex:"1"});const p=c.ownerDocument.createElement("div");p.style.height="1px",s.appendChild(p),T.appendChild(s),s.addEventListener("scroll",()=>{Math.abs(s.scrollLeft-m)<1||(m=s.scrollLeft,B.style.display="none",Q())}),i.addEventListener("wheel",t=>{if(s.style.display==="none")return;const l=t.deltaX||(t.shiftKey?t.deltaY:0);if(!l)return;const o=s.scrollLeft;s.scrollLeft+=t.deltaMode===1?l*16:l,s.scrollLeft!==o&&t.preventDefault()},{passive:!1});const a=n.length,f=Math.min(0,...n.map(t=>t.min)),b=Math.max(1,...n.map(t=>t.max)),g=(b-f)*.05||.1,k=f-g,P=b+g-k||1;function re(t){const l=Math.floor(t/a);return Math.max(qe,Ie(c)?l:Math.min(xe,l))}function E(t,l,o){return l+(1-(t-k)/P)*o}function we(t,l,o,r,v){const S=n.filter(e=>e.hasSpec).length,V=S===n.length,d=S===0,O=be(n),w=O==="mixed"?{lo:"Lo",hi:"Hi",noun:"limits"}:H(O),R=d?"max":O==="spec"?w.hi:"Hi",M=d?"min":O==="spec"?w.lo:"Lo",J=V?`normalised to ${w.noun}`:d?"normalised to range":"normalised (per test)";t.font=`${ie(-1)}px system-ui, sans-serif`,t.textAlign="right",t.textBaseline="middle";for(const[e,x]of[[1,R],[0,M]]){const D=E(e,o,r);D<o-1||D>o+r+1||(t.strokeStyle=l.limitLine,t.lineWidth=1,t.beginPath(),t.moveTo(y-5,D),t.lineTo(y,D),t.stroke(),t.fillStyle=l.textMuted,t.fillText(x,y-8,D))}t.save(),t.translate(9,o+r/2),t.rotate(-Math.PI/2),t.textAlign="center",t.fillStyle=l.textMuted,t.fillText(J,0,0),t.restore()}let _=-1;function Q(){Oe(i);const t=T.clientWidth,l=re(t-y),o=l*a,r=Math.max(10,Math.min(o,t-y)),v=o>r+.5,S=v?14:0;m=v?Math.max(0,Math.min(m,o-r)):0;const V=r,d=ge,O=y+r,w=Be(c,T,i,ge+200+ye+S),R=Math.max(d+60,w-ye-S),M=R-d;s.style.display=v?"block":"none",v&&(Object.assign(s.style,{left:`${i.offsetLeft+y}px`,width:`${r}px`,top:`${i.offsetTop+w-13}px`}),p.style.width=`${o}px`,Math.abs(s.scrollLeft-m)>=1&&(s.scrollLeft=m));const J=Fe(i,c,O,w);if(!J)return;const{ctx:e}=J,x=Xe(c);e.save(),e.beginPath(),e.rect(y,0,r,w),e.clip();const D=Math.max(0,Math.floor(m/l)-1),Pe=Math.min(a,Math.ceil((m+r)/l)+1);n.forEach((h,j)=>{if(j<D||j>=Pe)return;const A=y+j*l-m,u=A+l/2,L=Math.max(4,Math.min(l,xe)*.55);if(j===_&&(e.fillStyle=x.bgHover,e.fillRect(A,d,l,R-d)),n[j].testNumber===te&&(e.fillStyle=x.accent,e.fillRect(A,R-2,l,2)),h.hasSpec){const pe=E(0,d,M),fe=E(1,d,M);e.strokeStyle=x.limitLine,e.setLineDash([3,3]),e.lineWidth=1,e.beginPath(),e.moveTo(A,pe),e.lineTo(A+l,pe),e.moveTo(A,fe),e.lineTo(A+l,fe),e.stroke(),e.setLineDash([])}const ne=h.hasSpec?Z(h.ppk):x.textMuted,oe=E(h.min,d,M),X=E(h.q1,d,M),de=E(h.median,d,M),z=E(h.q3,d,M),le=E(h.max,d,M);e.strokeStyle=x.textMuted,e.lineWidth=1,e.beginPath(),e.moveTo(u,oe),e.lineTo(u,X),e.moveTo(u,z),e.lineTo(u,le),e.moveTo(u-L/4,oe),e.lineTo(u+L/4,oe),e.moveTo(u-L/4,le),e.lineTo(u+L/4,le),e.stroke(),e.fillStyle=ne,e.globalAlpha=.5,e.fillRect(u-L/2,Math.min(X,z),L,Math.max(1,Math.abs(z-X))),e.globalAlpha=1,e.strokeStyle=ne,h.hasSpec||e.setLineDash([4,2]),e.strokeRect(u-L/2,Math.min(X,z),L,Math.max(1,Math.abs(z-X))),e.setLineDash([]),e.strokeStyle=x.text,e.lineWidth=2,e.beginPath(),e.moveTo(u-L/2,de),e.lineTo(u+L/2,de),e.stroke(),e.lineWidth=1,e.font=`${ie(-1)}px system-ui, sans-serif`,e.textAlign="center",e.textBaseline="alphabetic",e.fillStyle=h.hasSpec?ne:x.textMuted,e.fillText(h.hasSpec?U(h.ppk):"\u2014",u,d-8);const me=h.label.length>12?`${h.label.slice(0,11)}\u2026`:h.label;e.save(),e.translate(u,R+6),e.rotate(-Math.PI/4),e.textAlign="right",e.textBaseline="middle",e.font=`${ie(-1)}px system-ui, sans-serif`,e.fillStyle=x.textMuted,e.fillText(me,0,0),h.derived&&(e.fillStyle=x.text,e.fillText(`${ae} `,-e.measureText(me).width,0)),e.restore()}),e.restore(),e.strokeStyle=x.border,e.lineWidth=1,e.strokeRect(y,d,V,M),we(e,x,d,M,V)}function ce(t){const l=i.getBoundingClientRect(),o=T.clientWidth,r=re(o-y),v=(t.clientX-l.left)*(i.width/Ue(i)/l.width)-y;if(v<0)return-1;const S=Math.floor((v+m)/r);return S>=0&&S<a?S:-1}return i.addEventListener("mousemove",t=>{const l=ce(t);if(l!==_&&(_=l,Q()),l===-1){B.style.display="none";return}const o=n[l],r=S=>ee(Ye(S,o.unit)),v=o.derived?`<em>${ae} ${ee(ue)}</em>`+(o.expression?`<br><code>${ee(o.expression)}</code>`:"")+"<br>":"";B.innerHTML=`<strong>${ee(o.label)}</strong> (n=${o.n}${o.excluded?`, ${o.excluded.count} outside ${he(o.excluded.limitSet)} excluded`:""})<br>${v}`+(o.hasSpec?`${H(o.limitBasis).lo} ${r(o.lsl)} \xB7 ${H(o.limitBasis).hi} ${r(o.usl)}<br>mean ${r(o.mean)}<br>Cp ${U(o.cp)} \xB7 Cpk ${U(o.cpk)}<br>Pp ${U(o.pp)} \xB7 Ppk ${U(o.ppk)}`:`<em>No limits \u2014 sorted by variability</em><br>mean ${r(o.mean)} \xB7 stddev ${r(o.stdOverall)}`)+(Y?"<br><em>click to view in boxplot</em>":""),B.style.display="block",_e(B,c,t.clientX,t.clientY),i.style.cursor=Y?"pointer":"default"}),i.addEventListener("mouseleave",()=>{_!==-1&&(_=-1,Q()),B.style.display="none"}),i.addEventListener("click",t=>{if(!Y)return;const l=ce(t);l!==-1&&Y(n[l].testNumber)}),Q}function ke(){const n=De($e(),N),i=N.filter(a=>a.testNumber!==void 0).length,m=n.filter(a=>!a.hasSpec).length,s=n.reduce((a,f)=>a+(f.excluded?.count??0),0),p=n.find(a=>a.excluded)?.excluded?.limitSet;Le(n.length,m,i,n.filter(a=>a.derived).length,be(n),s>0&&p?{total:s,limitSet:p}:void 0),K=Te(n),K()}const Ee=Re(c,()=>K());return ke(),{card:c,hasData:Me,setTest:n=>{te!==n&&(te=n,K())},destroy:()=>Ee.disconnect()}}
@@ -0,0 +1,21 @@
1
+ import type { PlotChart } from '../../stats/plotSpec.js';
2
+ import { type CardKind } from '../../stats/chartCatalogue.js';
3
+ export type { CardKind };
4
+ /** A card's About line, and what the card is, which names its menu row. */
5
+ export interface CardAboutLine {
6
+ text: string;
7
+ noun: 'chart' | 'table';
8
+ }
9
+ /** The About line of a plot: its built-in card's, or its chart type's for a reader's own plot. */
10
+ export declare function plotAbout(spec: {
11
+ id: string;
12
+ chart: PlotChart;
13
+ }): CardAboutLine;
14
+ /** The About line of a built-in card that is not a plot. */
15
+ export declare function cardAbout(kind: CardKind): CardAboutLine;
16
+ /** @internal Every line the table holds, for tests. */
17
+ export declare const ABOUT_LINES: {
18
+ cards: Record<string, string>;
19
+ charts: Record<"scatter" | "histogram" | "box" | "bar" | "line" | "sweep" | "probability" | "control" | "goal" | "heatmap", string>;
20
+ };
21
+ //# sourceMappingURL=cardAbout.d.ts.map
@@ -0,0 +1 @@
1
+ import{CHART_CATALOGUE as c}from"../../stats/chartCatalogue.js";const a={},n={},o={};for(const t of c){for(const r of t.cards??[])a[r]=t.about;t.card&&(n[t.card]=t.about),t.chart&&(o[t.chart]=t.about)}const s=new Set(c.flatMap(t=>t.kind==="table"&&t.card?[t.card]:[]));export function plotAbout(t){const r=t.id.startsWith("card-pass-rate-")?"card-pass-rate":t.id;return{text:a[r]??o[t.chart],noun:"chart"}}export function cardAbout(t){return{text:n[t],noun:s.has(t)?"table":"chart"}}export const ABOUT_LINES={cards:a,charts:o};