@wafertools/wafermap 0.34.0 → 0.35.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.
- package/AGENTS.md +7 -1
- package/CHANGELOG.md +189 -1
- package/README.md +6 -3
- package/dist/packages/canvas-adapter/charts/barPanel.d.ts +1 -1
- package/dist/packages/canvas-adapter/charts/binCluster.js +1 -1
- package/dist/packages/canvas-adapter/charts/boxplot.js +1 -1
- package/dist/packages/canvas-adapter/charts/capability.js +1 -1
- package/dist/packages/canvas-adapter/charts/chartShell.d.ts +17 -2
- package/dist/packages/canvas-adapter/charts/chartShell.js +1 -1
- package/dist/packages/canvas-adapter/charts/correlation.js +1 -1
- package/dist/packages/canvas-adapter/charts/histogram.js +1 -1
- package/dist/packages/canvas-adapter/charts/plotChart.js +1 -1
- package/dist/packages/canvas-adapter/charts/regionYieldDiagram.d.ts +6 -1
- package/dist/packages/canvas-adapter/charts/regionYieldDiagram.js +1 -1
- package/dist/packages/canvas-adapter/charts/scatter.js +1 -1
- package/dist/packages/canvas-adapter/charts/testPassRate.js +1 -1
- package/dist/packages/canvas-adapter/dataTab.d.ts +6 -0
- package/dist/packages/canvas-adapter/dataTab.js +1 -1
- package/dist/packages/canvas-adapter/dieList.js +6 -6
- package/dist/packages/canvas-adapter/drilldown.d.ts +3 -0
- package/dist/packages/canvas-adapter/drilldown.js +1 -1
- package/dist/packages/canvas-adapter/identityHeader.d.ts +4 -1
- package/dist/packages/canvas-adapter/identityHeader.js +1 -1
- package/dist/packages/canvas-adapter/insightsTab.d.ts +3 -1
- package/dist/packages/canvas-adapter/insightsTab.js +1 -1
- package/dist/packages/canvas-adapter/plotEditor.js +1 -1
- package/dist/packages/canvas-adapter/plotTab.d.ts +3 -0
- package/dist/packages/canvas-adapter/plotTab.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferGallery.d.ts +8 -0
- package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferMap.d.ts +22 -1
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/summaryPanel.d.ts +39 -11
- package/dist/packages/canvas-adapter/summaryPanel.js +4 -2
- package/dist/packages/canvas-adapter/summaryToggle.d.ts +11 -0
- package/dist/packages/canvas-adapter/summaryToggle.js +1 -0
- package/dist/packages/canvas-adapter/sweepEditor.js +1 -1
- package/dist/packages/canvas-adapter/toolbar.d.ts +8 -0
- package/dist/packages/canvas-adapter/toolbar.js +2 -2
- package/dist/packages/canvas-adapter/userGuideHtml.d.ts +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.js +57 -27
- package/dist/packages/canvas-adapter/version.d.ts +2 -2
- package/dist/packages/canvas-adapter/version.js +1 -1
- package/dist/packages/canvas-adapter/warnings.js +1 -1
- package/dist/packages/core/classify.d.ts +5 -0
- package/dist/packages/core/classify.js +1 -1
- package/dist/packages/core/dieTable.d.ts +26 -0
- package/dist/packages/core/dieTable.js +1 -1
- package/dist/packages/core/index.d.ts +1 -1
- package/dist/packages/core/index.js +1 -1
- package/dist/packages/core/passBins.d.ts +6 -0
- package/dist/packages/core/passBins.js +1 -1
- package/dist/packages/core/reticle.d.ts +20 -0
- package/dist/packages/core/reticle.js +1 -1
- package/dist/packages/core/wafer.d.ts +15 -0
- package/dist/packages/core/wafer.js +1 -1
- package/dist/packages/renderer/buildView.js +1 -1
- package/dist/packages/renderer/buildWaferMap.d.ts +32 -1
- package/dist/packages/renderer/buildWaferMap.js +1 -1
- package/dist/packages/renderer/derivedTests/apply.js +1 -1
- package/dist/packages/renderer/derivedTests/evaluate.d.ts +3 -1
- package/dist/packages/renderer/derivedTests/evaluate.js +1 -1
- package/dist/packages/renderer/derivedTests/parser.d.ts +7 -0
- package/dist/packages/renderer/derivedTests/parser.js +2 -2
- package/dist/packages/renderer/spec.d.ts +4 -0
- package/dist/packages/renderer/spec.js +1 -1
- package/dist/packages/renderer/valueFilter.d.ts +55 -0
- package/dist/packages/renderer/valueFilter.js +1 -0
- package/dist/packages/stats/analyzeWaferLot.js +1 -1
- package/dist/packages/stats/analyzeWaferMap.d.ts +44 -3
- package/dist/packages/stats/analyzeWaferMap.js +1 -1
- package/dist/packages/stats/capability.d.ts +5 -0
- package/dist/packages/stats/capability.js +1 -1
- package/dist/packages/stats/clusterDetection.js +1 -1
- package/dist/packages/stats/connectedComponents.d.ts +19 -0
- package/dist/packages/stats/connectedComponents.js +1 -1
- package/dist/packages/stats/dieRegions.d.ts +42 -0
- package/dist/packages/stats/dieRegions.js +1 -0
- package/dist/packages/stats/facets.d.ts +8 -0
- package/dist/packages/stats/facets.js +1 -1
- package/dist/packages/stats/index.d.ts +2 -1
- package/dist/packages/stats/index.js +1 -1
- package/dist/packages/stats/lotPattern.js +1 -1
- package/dist/packages/stats/math.d.ts +25 -3
- package/dist/packages/stats/math.js +1 -1
- package/dist/packages/stats/metadataColumns.js +1 -1
- package/dist/packages/stats/patternClassification.d.ts +44 -18
- package/dist/packages/stats/patternClassification.js +1 -1
- package/dist/packages/stats/plotData.d.ts +12 -1
- package/dist/packages/stats/plotData.js +1 -1
- package/dist/packages/stats/plotSpec.d.ts +1 -1
- package/dist/packages/stats/plotSpec.js +1 -1
- package/dist/packages/stats/regions.d.ts +15 -0
- package/dist/packages/stats/regions.js +1 -1
- package/dist/packages/stats/renderSummaryReport.js +33 -33
- package/dist/packages/stats/reportHtml.d.ts +7 -6
- package/dist/packages/stats/reportHtml.js +39 -37
- package/dist/packages/stats/synthesis.d.ts +44 -17
- package/dist/packages/stats/synthesis.js +1 -1
- package/dist/packages/stats/types.d.ts +12 -0
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/dist/packages/canvas-adapter/summaryRail.d.ts +0 -7
- package/dist/packages/canvas-adapter/summaryRail.js +0 -1
|
@@ -72,7 +72,7 @@ export const USER_GUIDE_HTML=`<div class="wmap-guide">
|
|
|
72
72
|
.wmap-guide-toc{display:none!important}
|
|
73
73
|
}
|
|
74
74
|
</style>
|
|
75
|
-
<h1 id="wafer-map-user-guide">Wafer Map \u2014 User Guide<span class="wmap-guide-version" title="Built 2026-10-
|
|
75
|
+
<h1 id="wafer-map-user-guide">Wafer Map \u2014 User Guide<span class="wmap-guide-version" title="Built 2026-10-09T18:16:23.713Z">v0.35.1</span></h1>
|
|
76
76
|
<p class="wmap-guide-online-link">This is a quick reference. <a href="https://wafertools.github.io/wafermap/user-guide/" target="_blank" rel="noopener">View the full illustrated guide online \u2197</a></p>
|
|
77
77
|
<p>This guide describes the display and analysis features of the wafer map viewer.
|
|
78
78
|
It is written for users who may be semiconductor test engineers, device engineers, and yield engineers
|
|
@@ -247,6 +247,16 @@ the tester's own recorded verdict rather than a limit judgement (there is
|
|
|
247
247
|
no gradient to fall back to). <strong>Test pass/fail</strong> is also available as an
|
|
248
248
|
Overlays option on an ordinary parametric test when it carries recorded
|
|
249
249
|
verdicts, as an alternative to limit judgement.</p>
|
|
250
|
+
<h3 id="values-outside-a-limit-set">Values outside a limit set</h3>
|
|
251
|
+
<p>A tester that runs out of range records its rail instead of a reading: a current held at the compliance clamp, a voltage at the supply, an
|
|
252
|
+
open-circuit value. A test can carry <strong>validity limits</strong>, the range a real measurement lies in, and a value outside them is not a reading. It
|
|
253
|
+
is <strong>missing</strong> for that test on that die: grey on the map, and left out of the statistics and every chart, so one clamp cannot stretch the colour
|
|
254
|
+
scale or move the mean, \u03C3 and Cpk. Which limit set a value must lie inside is the host's choice. The usual one is the validity limits, which only
|
|
255
|
+
affect tests that have them; a host can instead keep only values inside the specification limits or the test limits, or filter nothing.</p>
|
|
256
|
+
<p>Nothing is hidden. Hover a grey die and the tooltip names the excluded value and the limit set. The Summary panel's Test Values table shows the
|
|
257
|
+
total beside <strong>N</strong> and an <strong>Excl.</strong> column, and the same count appears in the histogram and box plot captions, the capability tooltip and caption,
|
|
258
|
+
the Plot tab's footnote, the report and the CSV exports. The build also lists it among the data warnings. The bin map and each die's pass/fail are
|
|
259
|
+
the tester's own and do not change, so yield is the same with the filter on or off.</p>
|
|
250
260
|
<div data-wmap-demo="value-heatmap" class="wmap-demo"></div><div data-wmap-demo="spec-passfail" class="wmap-demo"></div><hr>
|
|
251
261
|
<h3 id="derived-tests">Derived tests (\u2020)</h3>
|
|
252
262
|
<p>A test name marked <strong>\u2020</strong> in front is a <em>derived</em> test: its value was calculated
|
|
@@ -357,11 +367,6 @@ shows die tooltips \u2014 a separate thing from the toolbar, which is always pre
|
|
|
357
367
|
<td>Downloads the current map view as a PNG. Captures the canvas as displayed, including all active overlays and the legend.</td>
|
|
358
368
|
</tr>
|
|
359
369
|
<tr>
|
|
360
|
-
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNOCAydjQiLz48cGF0aCBkPSJNMTIgMnY0Ii8+PHBhdGggZD0iTTE2IDJ2NCIvPjxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxOCIgeD0iNCIgeT0iNCIgcng9IjIiLz48cGF0aCBkPSJNOCAxMGg2Ii8+PHBhdGggZD0iTTggMTRoOCIvPjxwYXRoIGQ9Ik04IDE4aDUiLz48L3N2Zz4K" width="20" height="20"></td>
|
|
361
|
-
<td>Findings</td>
|
|
362
|
-
<td>Opens or closes the Summary panel (see <a href="#6-summary-panel" onclick="(function(e){e.preventDefault();var g=e.target.closest('.wmap-guide');var el=g&&g.querySelector('[id=\\'6-summary-panel\\']');if(el)el.scrollIntoView({behavior:'smooth'});})(event)">Section 6</a>).</td>
|
|
363
|
-
</tr>
|
|
364
|
-
<tr>
|
|
365
370
|
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMTAuMjkgMy44NiAxLjgyIDE4YTIgMiAwIDAgMCAxLjcxIDNoMTYuOTRhMiAyIDAgMCAwIDEuNzEtM0wxMy43MSAzLjg2YTIgMiAwIDAgMC0zLjQyIDB6Ii8+PHBhdGggZD0iTTEyIDl2NCIvPjxwYXRoIGQ9Ik0xMiAxN2guMDEiLz48L3N2Zz4K" width="20" height="20"></td>
|
|
366
371
|
<td>Data warnings</td>
|
|
367
372
|
<td>Appears <strong>only when there is something to report</strong> about the data behind the map. Click it for the details. A red \u26D4 means the map may be positionally wrong \u2014 usually that wafer geometry was guessed rather than supplied, so dies may not sit where they appear to. An amber \u26A0 means something expected is missing or was skipped, but what is drawn is correct.</td>
|
|
@@ -547,11 +552,6 @@ it as a file and send it to whoever supports this software.</p>
|
|
|
547
552
|
<td>Test Value mode with test limits only. Toggles all cards between the limit range and the data range. Leave it on the test limits when comparing wafers \u2014 the data range rescales per view.</td>
|
|
548
553
|
</tr>
|
|
549
554
|
<tr>
|
|
550
|
-
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNOCAydjQiLz48cGF0aCBkPSJNMTIgMnY0Ii8+PHBhdGggZD0iTTE2IDJ2NCIvPjxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxOCIgeD0iNCIgeT0iNCIgcng9IjIiLz48cGF0aCBkPSJNOCAxMGg2Ii8+PHBhdGggZD0iTTggMTRoOCIvPjxwYXRoIGQ9Ik04IDE4aDUiLz48L3N2Zz4K" width="20" height="20"></td>
|
|
551
|
-
<td>Summary panel</td>
|
|
552
|
-
<td>Opens or closes the Summary panel covering every wafer in the gallery.</td>
|
|
553
|
-
</tr>
|
|
554
|
-
<tr>
|
|
555
555
|
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNMTAuMjkgMy44NiAxLjgyIDE4YTIgMiAwIDAgMCAxLjcxIDNoMTYuOTRhMiAyIDAgMCAwIDEuNzEtM0wxMy43MSAzLjg2YTIgMiAwIDAgMC0zLjQyIDB6Ii8+PHBhdGggZD0iTTEyIDl2NCIvPjxwYXRoIGQ9Ik0xMiAxN2guMDEiLz48L3N2Zz4K" width="20" height="20"></td>
|
|
556
556
|
<td>Data warnings</td>
|
|
557
557
|
<td>Appears only when something is worth reporting about the wafers shown. Collected across every wafer and de-duplicated, so a problem affecting all of them is stated once rather than repeated per card.</td>
|
|
@@ -751,8 +751,10 @@ supporting detail.</p>
|
|
|
751
751
|
<h2 id="6-summary-panel">6. Summary panel</h2>
|
|
752
752
|
<p>The Summary panel docks next to the map and gives you the wafer or lot at a
|
|
753
753
|
glance, with findings sitting directly under the headline numbers so a clicked
|
|
754
|
-
finding can highlight the affected dies right there.
|
|
755
|
-
the
|
|
754
|
+
finding can highlight the affected dies right there. The <strong>Summary</strong> button in the row
|
|
755
|
+
above the map, just before Map | Insights, opens and closes it, and shows as pressed while
|
|
756
|
+
it is open. The <strong>\u25B8</strong> button at the end of the panel's title closes it too, and stays in
|
|
757
|
+
view as the panel scrolls.</p>
|
|
756
758
|
<div data-wmap-demo="summary-panel" class="wmap-demo"></div><p><em>The Summary panel open alongside a single wafer. Click any finding to
|
|
757
759
|
highlight the affected dies.</em></p>
|
|
758
760
|
<p>Sections, top to bottom:</p>
|
|
@@ -774,24 +776,36 @@ its shortfall; a test is an item when it is outside its limits (or a functional
|
|
|
774
776
|
fails) on a share of the dies that clears the same floor. Its three dots and word (High, Moderate or Low impact) say how
|
|
775
777
|
much of the lot it costs: the higher of its share of all the dies (2% moderate, 4% high)
|
|
776
778
|
and its share of the dies that fail (15% moderate, 40% high), so a small area that is most
|
|
777
|
-
of a good lot's loss still reads as high.
|
|
779
|
+
of a good lot's loss still reads as high.
|
|
780
|
+
A test is costed by the dies it fails that also fail yield: dies outside its limits but binned
|
|
781
|
+
as passing cost nothing. A test whose failures lie mostly in a region is said as part of that
|
|
782
|
+
region's item rather than listed again beside it.
|
|
783
|
+
<strong>Every item is a row, and every row shows its dies on the map</strong> \u2014 a wafer icon at its end marks
|
|
784
|
+
it. Click a region or wafer to highlight it, or a test to show the test's values with the dies it
|
|
785
|
+
fails selected; click again to clear. Under the top item's sentence, chips name its parts (its
|
|
786
|
+
failing bins, with their legend colours, the pattern, and tests failing on the same dies), and
|
|
787
|
+
each chip shows that part alone.
|
|
778
788
|
A <strong>Watch</strong> line (at most two) follows for things that cost no dies yet: a lot of five or more
|
|
779
789
|
wafers whose yield, or a test's mean, trends up or down across the wafers <em>in the order given</em>
|
|
780
|
-
(said as "input order": the order is only a physical one if you know it is),
|
|
781
|
-
Ppk against its limits is under 1.0.
|
|
790
|
+
(said as "input order": the order is only a physical one if you know it is), a test outside its
|
|
791
|
+
limits on dies that were binned as passing, and a test whose Ppk against its limits is under 1.0.
|
|
792
|
+
Watch lines are rows too.
|
|
782
793
|
A wafer or lot with nothing over a yield point says so: "Nothing stands out".
|
|
783
794
|
The reports open with the same section, and <strong>Full report</strong> at the foot of it opens the
|
|
784
795
|
report; in a report opened from the panel, clicking a finding's row shows it on the map.</li>
|
|
785
796
|
<li><strong>Findings</strong> \u2014 detected anomalies, most severe first, each group marked with
|
|
786
|
-
three dots filled by severity (Unusual, Notable, Minor).
|
|
787
|
-
|
|
788
|
-
|
|
797
|
+
three dots filled by severity (Unusual, Notable, Minor). The header says how
|
|
798
|
+
many are unusual or notable, even when the section is collapsed, and the
|
|
799
|
+
severity chips narrow the list. Click a finding to show it on the map. A spatial
|
|
800
|
+
pattern has a <strong>Show N supporting findings</strong> line under it that lists the
|
|
801
|
+
regional findings it explains.</li>
|
|
789
802
|
<li><strong>Bin breakdown</strong> \u2014 bars as a share of dies, pass bins first and then failing
|
|
790
803
|
bins by descending count, so the dominant failure mode is at the top. It
|
|
791
804
|
follows the map's plot mode: a soft-bin map gets a soft-bin breakdown. When a
|
|
792
805
|
wafer carries both bin types, a <strong>Hard / Soft</strong> selector in the section header
|
|
793
806
|
overrides that.</li>
|
|
794
|
-
<li><strong>Region yield</strong> \u2014 ring yield by default, with a <strong>Ring / Quadrant</strong> selector
|
|
807
|
+
<li><strong>Region yield</strong> \u2014 ring yield by default, with a <strong>Ring / Quadrant</strong> selector (and <strong>Reticle cell</strong>, the yield of each
|
|
808
|
+
position within the stepper field, when a reticle is set).
|
|
795
809
|
Each row prints its difference from the wafer's yield in points and is tinted
|
|
796
810
|
when it is 1, 2 or 4 or more points below it (nothing above is tinted).
|
|
797
811
|
Ring is the default because edge roll-off is the pattern that dominates real
|
|
@@ -822,8 +836,9 @@ table with Cp/Cpk/Pp/Ppk, and the findings list \u2014 and can be saved as a PDF
|
|
|
822
836
|
from your browser's print dialog. It opens with <strong>What stands out</strong>: the yield,
|
|
823
837
|
up to three regions, fail bins or wafers ranked by how many dies each costs, and a
|
|
824
838
|
line saying what was compared. An item is listed only when it costs at least one
|
|
825
|
-
yield point of the dies analysed; a lot with none says so. Each
|
|
826
|
-
row in the Findings table below
|
|
839
|
+
yield point of the dies analysed; a lot with none says so. Each item links to its
|
|
840
|
+
evidence: a finding to its row in the Findings table below, a test to the Test Values
|
|
841
|
+
or Functional Tests section. Severity is drawn as three dots and a word, so it reads in a
|
|
827
842
|
black-and-white print; yields carry a bar, and a wafer or region is tinted only when it is
|
|
828
843
|
at least a point below the rest.</p>
|
|
829
844
|
<p>A <strong>Data tables</strong> button beside it opens the same tables as Insights' Data tab (<a href="#data-tables" onclick="(function(e){e.preventDefault();var g=e.target.closest('.wmap-guide');var el=g&&g.querySelector('[id=\\'data-tables\\']');if(el)el.scrollIntoView({behavior:'smooth'});})(event)">Data tables</a>) over this wafer, or over the whole lot in a gallery: Statistics, every die, and, for a lot, one row per wafer \u2014 each with Export CSV and Copy. It does not need Insights to be switched on.</p>
|
|
@@ -946,7 +961,9 @@ picking one for you. Alongside it, headline tiles stating the population (wafers
|
|
|
946
961
|
and for a lot the mean wafer yield \u2014 an <em>unweighted</em> mean of each wafer's own
|
|
947
962
|
yield, not the die-weighted figure), a yield bar labelled with the pass bins
|
|
948
963
|
actually in use and marked with the median, a hard/soft bin pareto, and
|
|
949
|
-
ring/quadrant regional yield
|
|
964
|
+
ring/quadrant regional yield, and with a reticle set a <strong>Reticle cell yield</strong> grid: the stepper field drawn as its cells (row 0 at
|
|
965
|
+
the bottom), each filled by the yield of that position pooled over every field on every wafer and labelled with it. Hover a cell
|
|
966
|
+
for its dies, click it to chart or tabulate them. A cell that is low in all of them points at the mask rather than the wafer.</p>
|
|
950
967
|
</li>
|
|
951
968
|
<li><p><strong>Distributions</strong> \u2014 process capability (Cp/Cpk/Pp/Ppk for tests with both a
|
|
952
969
|
lower and upper limit \u2014 spec limits where given, otherwise test limits; tests
|
|
@@ -987,6 +1004,8 @@ offer one.</p>
|
|
|
987
1004
|
</li>
|
|
988
1005
|
<li><p><strong>Correlation</strong> \u2014 a test-to-test correlation matrix and a die-level scatter
|
|
989
1006
|
plot, both stating the sample size the coefficients are computed over.
|
|
1007
|
+
<strong>Max tests</strong> (5 to 100, 20 by default) sets how many tests the matrix shows, and
|
|
1008
|
+
<strong>Correlation CSV</strong> saves the matrix as a table.
|
|
990
1009
|
Clicking a matrix cell drives the scatter plot onto that pair, where <code>r</code> and
|
|
991
1010
|
<code>n</code> for that pair are printed and update as you filter the legend. Hover a
|
|
992
1011
|
point to see which wafer and die it is; <strong>click</strong> it to open that wafer on the
|
|
@@ -997,9 +1016,12 @@ selection stays ringed until you change the X or Y test or click empty space.</p
|
|
|
997
1016
|
</li>
|
|
998
1017
|
</ul>
|
|
999
1018
|
<p>In a gallery with more than one wafer, a <strong>Group by</strong> control appears whenever
|
|
1000
|
-
wafer
|
|
1019
|
+
a <em>wafer attribute</em> (lot, product, test program, temperature, split, or a custom
|
|
1001
1020
|
field) actually varies across the loaded wafers \u2014 grouping pools or restricts
|
|
1002
|
-
each panel differently depending on what makes sense for that chart type.
|
|
1021
|
+
each panel differently depending on what makes sense for that chart type. Group by
|
|
1022
|
+
separates whole wafers; to separate the dies within each wafer, a plot's own
|
|
1023
|
+
<strong>Compare by</strong> choices (see <a href="#plots" onclick="(function(e){e.preventDefault();var g=e.target.closest('.wmap-guide');var el=g&&g.querySelector('[id=\\'plots\\']');if(el)el.scrollIntoView({behavior:'smooth'});})(event)">Plots</a>) take die regions, bins, sites and
|
|
1024
|
+
pass/fail tests as well.
|
|
1003
1025
|
Histogram, correlation, and scatter also offer a <strong>Wafer</strong> picker to narrow
|
|
1004
1026
|
from "all wafers pooled" down to one wafer at a time. Clicking a yield bar or
|
|
1005
1027
|
box-plot row for one wafer opens that wafer's own map \u2014 a box-plot click opens
|
|
@@ -1083,7 +1105,7 @@ same "Group by" and "Show" scope as the charts.</p>
|
|
|
1083
1105
|
Ppk, limits and the limit yield for each test, with its N stated) and the
|
|
1084
1106
|
<strong>Functional Tests</strong> pass-rate table. With "Group by" active there is one set
|
|
1085
1107
|
per group.</li>
|
|
1086
|
-
<li><strong>Dies</strong> \u2014 one row per die: wafer, X, Y, ring, quadrant, site, bins, a column
|
|
1108
|
+
<li><strong>Dies</strong> \u2014 one row per die: wafer, X, Y, ring, quadrant (and reticle cell and shot when a reticle is set), site, bins, a column
|
|
1087
1109
|
for each test, and the wafer's metadata. Only the rows in view are drawn, so a
|
|
1088
1110
|
lot of hundreds of thousands of dies scrolls smoothly. Click a column heading
|
|
1089
1111
|
to sort by it (again to reverse; a die with no value sorts last).</li>
|
|
@@ -1155,7 +1177,15 @@ The list is grouped Tests \xB7 Die \xB7 Wafer and filters by name or test number
|
|
|
1155
1177
|
a few hundred tests you type <code>1050</code> or <code>vth</code> rather than scrolling. A field the chart
|
|
1156
1178
|
type cannot use is not offered; switching type keeps your fields where they still
|
|
1157
1179
|
apply and brings back the ones that did not when you switch back.</li>
|
|
1158
|
-
<li><strong>
|
|
1180
|
+
<li><strong>Compare by.</strong> Two controls pick what a chart compares: <strong>Colour</strong> and, on a bar or box, <strong>Categories</strong>. Either takes a
|
|
1181
|
+
<strong>wafer attribute</strong> (lot, split, temperature: it separates whole wafers) or a <strong>die region or field</strong> (ring, quadrant, reticle
|
|
1182
|
+
cell, reticle shot, bin, site: it separates the dies within each wafer). <strong>Group by</strong>, above the charts, is the other way to
|
|
1183
|
+
separate wafers: it pools whole wafers by a wafer attribute for every chart on the tab, and a plot's Colour can follow it. A
|
|
1184
|
+
die region is never a Group by choice, because a wafer is in one lot but a die is in a ring and a reticle cell at once.
|
|
1185
|
+
A <strong>pass/fail test</strong> (a functional test, or a derived one that gives a verdict) is a category too, listed under <strong>Verdicts</strong> as
|
|
1186
|
+
<code>Scan Chain (pass/fail)</code>: it separates the dies that passed from those that failed, for Colour and Categories and for splitting
|
|
1187
|
+
yield. It has no value, so it is never an axis. A die with no recorded outcome is in neither group.</li>
|
|
1188
|
+
<li><strong>Colour</strong>: a category such as wafer, split, hard bin, site, ring or, with a reticle set, reticle cell or reticle shot, or, on a
|
|
1159
1189
|
scatter, a measured value or wafer figure drawn on a gradient (a colour bar under
|
|
1160
1190
|
the title states its range). <strong>Follow Group by</strong> (the default) takes the colours from
|
|
1161
1191
|
the Group by control above, so changing it recolours every plot that follows it;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const WMAP_VERSION = "0.
|
|
2
|
-
export declare const WMAP_BUILD_TIME = "2026-10-
|
|
1
|
+
export declare const WMAP_VERSION = "0.35.1";
|
|
2
|
+
export declare const WMAP_BUILD_TIME = "2026-10-09T18:19:45.271Z";
|
|
3
3
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const WMAP_VERSION="0.
|
|
1
|
+
export const WMAP_VERSION="0.35.1",WMAP_BUILD_TIME="2026-10-09T18:19:45.271Z";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SHADOW as C,TRACKING as O,SPACE as r,RADIUS as v,FONT as y,CLR as d,Z_BASE as B}from"./toolbar.js";const E={error:0,warning:1,info:2};export function severityOf(t){return t.severity??"warning"}export function collectWarnings(t){const s=[],i=new Set,n=e=>{if(!e?.message)return;const o=`${e.code}\0${e.message}`;i.has(o)||(i.add(o),s.push(e))};for(const e of t.result?.warnings??[])n(e);for(const e of t.statsSummary?.stats.warnings??[])n(e);for(const e of t.lotStatsSummary?.perWafer??[])for(const o of e.summary.stats.warnings??[])n(o);for(const e of t.extra??[])n(e);return s.sort((e,o)=>E[severityOf(e)]-E[severityOf(o)])}function $(t){return t==="error"?{bg:d.errBg,border:d.errBorder,text:d.errText}:{bg:d.warnBg,border:d.warnBorder,text:d.warnText}}function S(t){return t==="error"?"\u26D4":t==="info"?"\
|
|
1
|
+
import{SHADOW as C,TRACKING as O,SPACE as r,RADIUS as v,FONT as y,CLR as d,Z_BASE as B}from"./toolbar.js";const E={error:0,warning:1,info:2};export function severityOf(t){return t.severity??"warning"}export function collectWarnings(t){const s=[],i=new Set,n=e=>{if(!e?.message)return;const o=`${e.code}\0${e.message}`;i.has(o)||(i.add(o),s.push(e))};for(const e of t.result?.warnings??[])n(e);for(const e of t.statsSummary?.stats.warnings??[])n(e);for(const e of t.lotStatsSummary?.perWafer??[])for(const o of e.summary.stats.warnings??[])n(o);for(const e of t.extra??[])n(e);return s.sort((e,o)=>E[severityOf(e)]-E[severityOf(o)])}function $(t){return t==="error"?{bg:d.errBg,border:d.errBorder,text:d.errText}:{bg:d.warnBg,border:d.warnBorder,text:d.warnText}}function S(t){return t==="error"?"\u26D4":t==="info"?"\u24D8":"\u26A0"}export const SHORT_LABEL={"partial-coverage":"Partial wafer coverage","geometry-conflict":"Geometry conflict","non-standard-diameter":"Non-standard wafer diameter","diameter-exceeds-die-extent":"Diameter exceeds die extent","edge-exclusion-exceeds-radius":"Edge exclusion exceeds radius","test-count-capped":"Test analysis skipped","test-def-collision":"Test definitions disagree","analysis-option-corrected":"Analysis option corrected","bin-colors-shared":"Bins share a colour","pass-bins-mixed":"Pass bins differ by wafer","ring-count-mixed":"Ring counts differ by wafer","input-field-removed":"Removed input name ignored","input-values-not-numbers":"Bins or test values are text","input-values-outside-stdf":"Values outside STDF ranges","retests-by-part-id":"Retests matched by part ID","derived-test-invalid":"Derived test not applied","values-excluded":"Values excluded by limits"};function w(t){const s=t.code?SHORT_LABEL[t.code]:void 0;if(s)return s;const i=t.message.split(/(?<=\.)\s/)[0]??t.message;return i.length>60?`${i.slice(0,57)}\u2026`:i}export function buildWarningsBanner(t,s=document){const i=s.createElement("div");Object.assign(i.style,{marginBottom:r.lg});for(const n of t){const e=severityOf(n),o=$(e),u=s.createElement("div");Object.assign(u.style,{background:o.bg,border:`1px solid ${o.border}`,borderRadius:v.control,marginBottom:r.sm,fontSize:y.body,color:o.text,lineHeight:"1.5"}),u.setAttribute("role","status");const a=s.createElement("button");a.type="button",Object.assign(a.style,{display:"flex",alignItems:"center",gap:r.sm,width:"100%",background:"none",border:"none",font:"inherit",color:"inherit",textAlign:"left",padding:`${r.sm} ${r.lg}`,cursor:"pointer"});const p=s.createElement("span");Object.assign(p.style,{flex:"1",minWidth:"0"}),p.textContent=`${S(e)} ${w(n)}`;const l=s.createElement("span");Object.assign(l.style,{flexShrink:"0"}),a.append(p,l);const g=s.createElement("div");Object.assign(g.style,{padding:`0 ${r.lg} ${r.sm}`}),g.textContent=n.message;let c=!1;const f=()=>{l.textContent=c?"\u25B4":"\u25BE",g.style.display=c?"block":"none",a.setAttribute("aria-expanded",String(c)),a.setAttribute("aria-label",`${w(n)}. ${c?"Click to collapse.":"Click to expand for detail."}`)};f(),a.addEventListener("click",()=>{c=!c,f()}),a.addEventListener("mouseenter",()=>{l.style.opacity="0.65"}),a.addEventListener("mouseleave",()=>{l.style.opacity="1"}),u.append(a,g),i.appendChild(u)}return i}export function buildWarningsMenuEl(t,s,i=window){const n=i.document,e=n.createElement("div"),o=280,a=t.left+o<=(i.innerWidth??1/0)?t.left:Math.max(4,t.right-o);Object.assign(e.style,{position:"fixed",top:`${t.bottom+4}px`,left:`${a}px`,background:d.menuBg,border:`1px solid ${d.menuBorder}`,borderRadius:v.control,boxShadow:C.menu,zIndex:B,width:`${o}px`,maxHeight:"320px",overflowY:"auto",padding:"4px 0",pointerEvents:"auto"}),e.setAttribute("role","dialog"),e.setAttribute("aria-label","Data warnings");const p=n.createElement("div");Object.assign(p.style,{padding:`${r.sm} ${r.xl} ${r.xs}`,fontSize:y.body,fontWeight:"700",letterSpacing:O,textTransform:"uppercase",color:d.label}),p.textContent=s.length===1?"1 warning":`${s.length} warnings`,e.appendChild(p);for(const l of s){const g=severityOf(l),c=$(g),f=n.createElement("div");Object.assign(f.style,{display:"flex",gap:r.md,padding:`${r.md} ${r.xl}`,fontSize:y.body,lineHeight:"1.5",color:d.text,borderTop:`1px solid ${d.menuBorder}`,alignItems:"flex-start"});const m=n.createElement("span");Object.assign(m.style,{color:c.text,flexShrink:"0"}),m.textContent=S(g),f.appendChild(m);const x=n.createElement("div"),b=n.createElement("div");Object.assign(b.style,{fontWeight:"700",color:c.text,marginBottom:r.xxs}),b.textContent=l.code,x.appendChild(b);const h=n.createElement("div");h.textContent=l.message,x.appendChild(h),f.appendChild(x),e.appendChild(f)}return e}
|
|
@@ -9,6 +9,11 @@ export interface ClassifyOptions {
|
|
|
9
9
|
/** The map's own ring count (`WaferMapResult.ringCount`). Required: there is no default ring count to classify by. */
|
|
10
10
|
ringCount: number;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* The ring (1 = innermost, `ringCount` = the edge) of a point `dx, dy` from the wafer centre: equal widths of
|
|
14
|
+
* the radius, a point on a boundary in the outer ring. The one ring rule; the edge ring is `ringCount`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ringOf(dx: number, dy: number, radius: number, ringCount: number): number;
|
|
12
17
|
/**
|
|
13
18
|
* Classify a die by its radial ring (1 = innermost) and physical wafer quadrant.
|
|
14
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requireRingCount as
|
|
1
|
+
import{requireRingCount as h}from"./ringCount.js";export function ringOf(t,n,e,r){const a=Math.sqrt(t*t+n*n)/e;return Math.min(r,Math.max(1,Math.floor(a*r)+1))}const u=["NE","NW","SW","SE"];export function classifyDie(t,n,e){const r=Math.max(1,h(e,"classifyDie")),a=t.physX-n.center.x,o=t.physY-n.center.y,i=ringOf(a,o,n.radius,r),c=(Math.atan2(o,a)+2*Math.PI)%(2*Math.PI),s=u[Math.min(3,Math.floor(c/(Math.PI/2)))];return{ring:i,quadrant:s}}export function getRingLabel(t,n){return n===1?"Full Wafer":t===1?"Ring 1 (core)":t===n?`Ring ${t} (edge)`:`Ring ${t}`}
|
|
@@ -19,6 +19,14 @@ export interface DieTable {
|
|
|
19
19
|
* with no verdicts has no `testPass`, exactly as before.
|
|
20
20
|
*/
|
|
21
21
|
readonly fields: Uint8Array;
|
|
22
|
+
/**
|
|
23
|
+
* Test number → the value that was taken out of `values` by the value filter
|
|
24
|
+
* (`WaferMapInput.valueFilter`), per row; `NaN` = nothing was excluded there.
|
|
25
|
+
* Kept so a tooltip can say what was excluded and why. Absent when nothing was.
|
|
26
|
+
*/
|
|
27
|
+
readonly excluded?: ReadonlyMap<number, Float32Array | Float64Array>;
|
|
28
|
+
/** The limit set `excluded` values were outside of (the value filter's mode). */
|
|
29
|
+
readonly excludedBy?: 'validity' | 'spec' | 'test';
|
|
22
30
|
}
|
|
23
31
|
/** What the readers need of a die. A `DieResult` qualifies. */
|
|
24
32
|
export type DieData = Pick<Die, 'testValues' | 'testPass'>;
|
|
@@ -47,6 +55,24 @@ export declare function tableFromRows(rows: readonly Row[]): DieTable;
|
|
|
47
55
|
export declare function extendTable(table: DieTable, values: ReadonlyMap<number, Float32Array | Float64Array>, verdicts: ReadonlyMap<number, Int8Array>): DieTable & {
|
|
48
56
|
fields: Uint8Array;
|
|
49
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* A copy of `table` with the value filter's outcome: `values` columns replaced
|
|
60
|
+
* (excluded entries now `NaN`) and `excluded` holding what was taken out.
|
|
61
|
+
*/
|
|
62
|
+
export declare function withExcluded(table: DieTable, values: ReadonlyMap<number, Float32Array | Float64Array>, excluded: ReadonlyMap<number, Float32Array | Float64Array>, excludedBy: 'validity' | 'spec' | 'test'): DieTable;
|
|
63
|
+
/**
|
|
64
|
+
* How many of `dies`' values the value filter excluded, per test, and the limit set it used.
|
|
65
|
+
* Counts the dies given (so a die a retest policy dropped is not counted). `undefined`
|
|
66
|
+
* when none of them has an excluded value.
|
|
67
|
+
*/
|
|
68
|
+
export declare function excludedCounts(dies: readonly DieData[]): {
|
|
69
|
+
counts: Map<number, number>;
|
|
70
|
+
by: 'validity' | 'spec' | 'test';
|
|
71
|
+
} | undefined;
|
|
72
|
+
/** The limit set the value filter excluded `die`'s values against, when it excluded any in its table. */
|
|
73
|
+
export declare function excludedBy(die: DieData): 'validity' | 'spec' | 'test' | undefined;
|
|
74
|
+
/** The value the filter excluded from `die` for `testNumber`, or `undefined` when none was. */
|
|
75
|
+
export declare function excludedValue(die: DieData, testNumber: number): number | undefined;
|
|
50
76
|
/**
|
|
51
77
|
* One reusable die-shaped view over `table`: `at(row)` points it at a row and
|
|
52
78
|
* returns it, so a rule that takes a die (`getTestPassStatus`) can be applied
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasAnyKey as
|
|
1
|
+
import{hasAnyKey as P}from"./utils.js";const O=NaN;export const VERDICT_NONE=-1,VERDICT_FAIL=0,VERDICT_PASS=1,HAS_VALUES=1,HAS_VERDICTS=2;const l=Symbol("wmap.dieTable"),a=Symbol("wmap.dieRow");export function linkDie(e,t,s){return e[l]=t,e[a]=s,e}export function dieLink(e){const t=e[l];return t===void 0?void 0:{table:t,row:e[a]}}export function tableFromRows(e){const t=e.length,s=new Map,o=new Map,r=new Uint8Array(t),n=g(s,()=>new Float64Array(t).fill(O)),c=g(o,()=>new Int8Array(t).fill(VERDICT_NONE));for(let u=0;u<t;u++){const f=e[u].testValues;if(f){r[u]|=HAS_VALUES;const d=n(f),w=Object.values(f);for(let b=0;b<d.length;b++)d[b][u]=w[b]}const i=e[u].testPass;if(i){r[u]|=HAS_VERDICTS;const d=c(i),w=Object.values(i);for(let b=0;b<d.length;b++)d[b][u]=w[b]?VERDICT_PASS:VERDICT_FAIL}}return{rows:t,values:m(s),verdicts:m(o),fields:r}}function g(e,t){let s=[],o=[];return r=>{const n=Object.keys(r);let c=n.length===s.length;for(let u=0;c&&u<n.length;u++)c=n[u]===s[u];return c||(s=n,o=n.map(u=>{let f=e.get(u);return f===void 0&&e.set(u,f=t()),f})),o}}function m(e){return new Map([...e].map(([t,s])=>[Number(t),s]).sort((t,s)=>t[0]-s[0]))}export function extendTable(e,t,s){const o=new Map(e.values),r=new Map(e.verdicts);for(const[n,c]of t)o.set(n,c);for(const[n,c]of s)r.set(n,c);return{rows:e.rows,values:new Map([...o].sort((n,c)=>n[0]-c[0])),verdicts:new Map([...r].sort((n,c)=>n[0]-c[0])),fields:e.fields.slice(),...e.excluded?{excluded:e.excluded,excludedBy:e.excludedBy}:{}}}export function withExcluded(e,t,s,o){const r=new Map(e.values);for(const[c,u]of t)r.set(c,u);const n=new Map(e.excluded??[]);for(const[c,u]of s)n.set(c,u);return{...e,values:r,excluded:n,excludedBy:o}}export function excludedCounts(e){const t=new Map;let s;for(const o of e){const r=o[l];if(r?.excluded===void 0)continue;const n=o[a];for(const[c,u]of r.excluded)Number.isNaN(u[n])||(t.set(c,(t.get(c)??0)+1),s??=r.excludedBy)}return t.size===0||s===void 0?void 0:{counts:t,by:s}}export function excludedBy(e){return e[l]?.excludedBy}export function excludedValue(e,t){const o=e[l]?.excluded?.get(t)?.[e[a]];return o===void 0||Number.isNaN(o)?void 0:o}export function rowView(e){const t=linkDie({},e,0);return s=>(t[a]=s,t)}function v(e,t){const s={},o=[...e.values];for(let r=o.length-1;r>=0;r--){const n=o[r][1][t];Number.isNaN(n)||(s[o[r][0]]=n)}return s}function x(e,t){const s={},o=[...e.verdicts];for(let r=o.length-1;r>=0;r--){const n=o[r][1][t];n!==VERDICT_NONE&&(s[o[r][0]]=n===VERDICT_PASS)}return s}function j(){return Object.freeze(v(this[l],this[a]))}function k(){return Object.freeze(x(this[l],this[a]))}function N(e){return function(){throw new TypeError(`wafermap: die.${e} is read-only on a die built by buildWaferMap (die ${this.id}). Pass the values you want to buildWaferMap, or copy the die: { ...die, ${e}: yours }.`)}}const V={get:j,set:N("testValues"),enumerable:!0,configurable:!0},y={get:k,set:N("testPass"),enumerable:!0,configurable:!0},p=e=>({value:e,writable:!0,enumerable:!1,configurable:!0});export function finaliseDie(e){const t=e[l];if(t===void 0)return e;const s=e[a],o=t.fields[s],r=e.testValues!==void 0&&!(o&HAS_VALUES)||e.testPass!==void 0&&!(o&HAS_VERDICTS),n={};for(const c of Object.keys(e))c==="testValues"&&o&HAS_VALUES||c==="testPass"&&o&HAS_VERDICTS||(n[c]=e[c]);return r?(o&HAS_VALUES&&(n.testValues=v(t,s)),o&HAS_VERDICTS&&(n.testPass=x(t,s)),n):(Object.defineProperty(n,l,p(t)),Object.defineProperty(n,a,p(s)),o&HAS_VALUES&&Object.defineProperty(n,"testValues",V),o&HAS_VERDICTS&&Object.defineProperty(n,"testPass",y),n)}export function copyDie(e,t){const s=e[l];if(s===void 0)return{...e,...t};const o=e[a],r=s.fields[o],n={};for(const c of Object.keys(e))c!=="testValues"&&c!=="testPass"&&(n[c]=e[c]);return"testValues"in t||"testPass"in t?(r&HAS_VALUES&&!("testValues"in t)&&(n.testValues=v(s,o)),r&HAS_VERDICTS&&!("testPass"in t)&&(n.testPass=x(s,o)),Object.assign(n,t)):(Object.assign(n,t),Object.defineProperty(n,l,p(s)),Object.defineProperty(n,a,p(o)),r&HAS_VALUES&&Object.defineProperty(n,"testValues",V),r&HAS_VERDICTS&&Object.defineProperty(n,"testPass",y),n)}export function detachTables(e){const t=[],s=new Map,o=e.reduce((u,f)=>u+f.length,0),r=new Int32Array(o*2);let n=0;for(const u of e)for(const f of u){const i=dieLink(f);if(i===void 0){r[n++]=-1,r[n++]=0;continue}let d=s.get(i.table);d===void 0&&(s.set(i.table,d=t.length),t.push(i.table)),r[n++]=d,r[n++]=i.row,delete f.testValues,delete f.testPass}const c=new Set;for(const u of t){for(const f of u.values.values())c.add(f.buffer);for(const f of u.verdicts.values())c.add(f.buffer);if(c.add(u.fields.buffer),u.excluded)for(const f of u.excluded.values())c.add(f.buffer)}return{tables:t,links:r,transfer:[...c]}}export function attachTables(e,t){let s=0;for(const o of e)for(const r of o){const n=t.links[s++],c=t.links[s++];if(n<0)continue;const u=t.tables[n],f=u.fields[c];Object.defineProperty(r,l,p(u)),Object.defineProperty(r,a,p(c)),f&HAS_VALUES&&Object.defineProperty(r,"testValues",V),f&HAS_VERDICTS&&Object.defineProperty(r,"testPass",y)}}export function testValue(e,t){const s=e[l];if(s===void 0)return e.testValues?.[t];const o=s.values.get(t)?.[e[a]];return o===void 0||Number.isNaN(o)?void 0:o}export function recordedVerdict(e,t){const s=e[l];if(s===void 0)return e.testPass?.[t];const o=s.verdicts.get(t)?.[e[a]];return o===void 0||o===VERDICT_NONE?void 0:o===VERDICT_PASS}export function dieHasAnyTestData(e){return dieHasValues(e)||dieHasVerdicts(e)}export function dieHasValues(e){const t=dieLink(e);if(t===void 0)return P(e.testValues);for(const s of t.table.values.values())if(!Number.isNaN(s[t.row]))return!0;return!1}export function dieHasVerdicts(e){const t=dieLink(e);if(t===void 0)return P(e.testPass);for(const s of t.table.verdicts.values())if(s[t.row]!==VERDICT_NONE)return!0;return!1}export function dieValueEntries(e){const t=dieLink(e);if(t===void 0){const o=e.testValues;return o===void 0?[]:Object.keys(o).map(r=>[Number(r),o[Number(r)]])}const s=[];for(const[o,r]of t.table.values){const n=r[t.row];Number.isNaN(n)||s.push([o,n])}return s}export function dieVerdictEntries(e){const t=dieLink(e);if(t===void 0){const o=e.testPass;return o===void 0?[]:Object.keys(o).map(r=>[Number(r),o[Number(r)]])}const s=[];for(const[o,r]of t.table.verdicts){const n=r[t.row];n!==VERDICT_NONE&&s.push([o,n===VERDICT_PASS])}return s}export function testValuesReader(e){let t,s=[];return function(r,n){const c=dieLink(r);if(c===void 0){const u=r.testValues;for(let f=0;f<e.length;f++){const i=u?.[e[f]];n[f]=i===void 0?NaN:i}return n}c.table!==t&&(t=c.table,s=e.map(u=>c.table.values.get(u)));for(let u=0;u<s.length;u++){const f=s[u];n[u]=f===void 0?NaN:f[c.row]}return n}}export function recordedVerdictsReader(e){let t,s=[];return function(r,n){const c=dieLink(r);if(c===void 0){const u=r.testPass;for(let f=0;f<e.length;f++){const i=u?.[e[f]];n[f]=i===void 0?VERDICT_NONE:i?VERDICT_PASS:VERDICT_FAIL}return n}c.table!==t&&(t=c.table,s=e.map(u=>c.table.verdicts.get(u)));for(let u=0;u<s.length;u++){const f=s[u];n[u]=f===void 0?VERDICT_NONE:f[c.row]}return n}}export function testsPresent(e,t="all"){const s=new Set,o=new Map;for(const r of e){const n=dieLink(r);if(n===void 0){if(r.testValues)for(const u in r.testValues)s.add(Number(u));if(t==="all"&&r.testPass)for(const u in r.testPass)s.add(Number(u));continue}let c=o.get(n.table);c===void 0&&o.set(n.table,c=[]),c.push(n.row)}for(const[r,n]of o){for(const[c,u]of r.values)!s.has(c)&&n.some(f=>!Number.isNaN(u[f]))&&s.add(c);if(t!=="values")for(const[c,u]of r.verdicts)!s.has(c)&&n.some(f=>u[f]!==VERDICT_NONE)&&s.add(c)}return[...s].sort((r,n)=>r-n)}
|
|
@@ -2,7 +2,7 @@ export { hasPosition, getDieKey, isYieldEligibleDie, diePassStatus } from './die
|
|
|
2
2
|
export type { Die, DieEligibilityOptions } from './dies.js';
|
|
3
3
|
export { metadataDisplayValue } from './metadata.js';
|
|
4
4
|
export type { DieMetadata, WaferMetadata } from './metadata.js';
|
|
5
|
-
export { getReticleCell } from './reticle.js';
|
|
5
|
+
export { getReticleCell, getReticleShot } from './reticle.js';
|
|
6
6
|
export type { Reticle } from './reticle.js';
|
|
7
7
|
export type { Affine, CoordFrame } from './transforms.js';
|
|
8
8
|
export type { Wafer } from './wafer.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{hasPosition,getDieKey,isYieldEligibleDie,diePassStatus}from"./dies.js";export{metadataDisplayValue}from"./metadata.js";export{getReticleCell}from"./reticle.js";
|
|
1
|
+
export{hasPosition,getDieKey,isYieldEligibleDie,diePassStatus}from"./dies.js";export{metadataDisplayValue}from"./metadata.js";export{getReticleCell,getReticleShot}from"./reticle.js";
|
|
@@ -36,6 +36,12 @@ export declare function itemPassBins(item: {
|
|
|
36
36
|
} | null | undefined, fallback?: readonly number[]): readonly number[];
|
|
37
37
|
/** Same bins, in any order. */
|
|
38
38
|
export declare function sameBins(a: readonly number[], b: readonly number[]): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether a hard or soft bin number is a pass bin. Pass bins are hard-bin numbers; they judge a soft bin only
|
|
41
|
+
* when the dies carry no hard bin, when a die's verdict is its soft bin's (`diePassStatus`). Otherwise a soft
|
|
42
|
+
* bin's verdict is not known from the pass bins, and it is not called a pass bin.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isPassBin(kind: 'hardBin' | 'softBin', bin: number, passBins: readonly number[], hasHardBins: boolean): boolean;
|
|
39
45
|
/**
|
|
40
46
|
* The pass bins every wafer is judged by, or `undefined` when they differ (or there are none to
|
|
41
47
|
* ask). For a surface that must name one set — a headline, or which bins count as failures — and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const r=[1];export function normalizePassBins(s){return[...s??r]}export function requirePassBins(s,n){const e=s?.passBins;if(!e)throw new Error(`${n}: no pass bins (WaferMapResult.passBins); a map not built by buildWaferMap must state them.`);return e}export function itemPassBins(s,n){return s?.passBins??n??requirePassBins(void 0,"itemPassBins")}export function sameBins(s,n){const e=new Set(s),t=new Set(n);return e.size===t.size&&[...e].every(i=>t.has(i))}export function commonPassBins(s){let n;for(const e of s){if(e===void 0)return;if(n===void 0)n=e;else if(!sameBins(n,e))return}return n}export function passBinsLabel(s){const n=[];for(const t of s)n.some(i=>sameBins(i,t))||n.push(t);const e=t=>t.length===0?"no bins":t.length===1?`bin ${t[0]}`:`bins ${t.join(", ")}`;return n.length===0?"no wafers":n.length===1?e(n[0]):`per wafer: ${n.map(e).join(" \xB7 ")}`}
|
|
1
|
+
const r=[1];export function normalizePassBins(s){return[...s??r]}export function requirePassBins(s,n){const e=s?.passBins;if(!e)throw new Error(`${n}: no pass bins (WaferMapResult.passBins); a map not built by buildWaferMap must state them.`);return e}export function itemPassBins(s,n){return s?.passBins??n??requirePassBins(void 0,"itemPassBins")}export function sameBins(s,n){const e=new Set(s),t=new Set(n);return e.size===t.size&&[...e].every(i=>t.has(i))}export function isPassBin(s,n,e,t){return(s==="hardBin"||!t)&&e.includes(n)}export function commonPassBins(s){let n;for(const e of s){if(e===void 0)return;if(n===void 0)n=e;else if(!sameBins(n,e))return}return n}export function passBinsLabel(s){const n=[];for(const t of s)n.some(i=>sameBins(i,t))||n.push(t);const e=t=>t.length===0?"no bins":t.length===1?`bin ${t[0]}`:`bins ${t.join(", ")}`;return n.length===0?"no wafers":n.length===1?e(n[0]):`per wafer: ${n.map(e).join(" \xB7 ")}`}
|
|
@@ -54,6 +54,26 @@ export declare function getReticleCell(die: {
|
|
|
54
54
|
column: number;
|
|
55
55
|
row: number;
|
|
56
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Which reticle shot a die was exposed in, as the shot's (column, row) on the wafer: the die's position less the anchor,
|
|
59
|
+
* divided by the field's size and rounded down. A shot is one placement of the mask on the wafer; `getReticleCell` is
|
|
60
|
+
* where the die sits inside the mask. The same phase convention as `getReticleCell`, so a die's cell and its
|
|
61
|
+
* field can never disagree about where a field starts.
|
|
62
|
+
*/
|
|
63
|
+
export declare function getReticleShot(die: {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
}, config: {
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
anchorDie?: {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
};
|
|
73
|
+
}): {
|
|
74
|
+
column: number;
|
|
75
|
+
row: number;
|
|
76
|
+
};
|
|
57
77
|
/**
|
|
58
78
|
* Generate the grid of reticle rectangles that cover the wafer area.
|
|
59
79
|
* Returns positions in wafer-local coordinates (before orientation rotation).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function x(t,
|
|
1
|
+
function x(t,o){return(t%o+o)%o}export function getReticleCell(t,o){const{width:c,height:e,anchorDie:n={x:0,y:0}}=o,s=Math.max(1,Math.floor(c)),r=Math.max(1,Math.floor(e));return{column:x(t.x-n.x,s),row:x(t.y-n.y,r)}}export function getReticleShot(t,o){const{width:c,height:e,anchorDie:n={x:0,y:0}}=o;return{column:Math.floor((t.x-n.x)/Math.max(1,Math.floor(c))),row:Math.floor((t.y-n.y)/Math.max(1,Math.floor(e)))}}export function generateReticleGrid(t,o){const{width:c,height:e,diePitchX:n,diePitchY:s,anchorDie:r={x:0,y:0},gridOrigin:g={x:0,y:0}}=o,h=c*n,i=e*s,k=x(r.x,c),p=x(r.y,e),l=g.x+(k+(c-1)/2)*n,M=g.y+(p+(e-1)/2)*s,a=t.radius+Math.max(h,i),D=Math.ceil((-a-(l-t.center.x))/h),P=Math.floor((a-(l-t.center.x))/h),R=Math.ceil((-a-(M-t.center.y))/i),b=Math.floor((a-(M-t.center.y))/i),f=[];for(let y=R;y<=b;y++){const u=M+y*i;for(let d=D;d<=P;d++){const m=l+d*h,H=Math.max(m-h/2,Math.min(t.center.x,m+h/2)),W=Math.max(u-i/2,Math.min(t.center.y,u+i/2)),X=H-t.center.x,Y=W-t.center.y;X*X+Y*Y<=t.radius*t.radius&&f.push({x:m,y:u,width:h,height:i})}}return f}
|
|
@@ -12,6 +12,15 @@ import type { WaferMetadata } from './metadata.js';
|
|
|
12
12
|
export interface WaferNotch {
|
|
13
13
|
type: 'top' | 'bottom' | 'left' | 'right';
|
|
14
14
|
}
|
|
15
|
+
/** The stepper field: how many dies one exposure covers, and which die sits at a field's min-x/min-y corner. */
|
|
16
|
+
export interface WaferReticle {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
anchorDie?: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
15
24
|
export interface WaferSpec {
|
|
16
25
|
diameter: number;
|
|
17
26
|
center?: {
|
|
@@ -21,6 +30,7 @@ export interface WaferSpec {
|
|
|
21
30
|
notch?: WaferNotch;
|
|
22
31
|
orientation?: number;
|
|
23
32
|
metadata?: WaferMetadata;
|
|
33
|
+
reticle?: WaferReticle;
|
|
24
34
|
}
|
|
25
35
|
export interface Wafer {
|
|
26
36
|
diameter: number;
|
|
@@ -39,6 +49,11 @@ export interface Wafer {
|
|
|
39
49
|
};
|
|
40
50
|
orientation: number;
|
|
41
51
|
metadata?: WaferMetadata;
|
|
52
|
+
/**
|
|
53
|
+
* The stepper field the host gave, when it did. It lives on the wafer so that everything holding a wafer (a plot, a
|
|
54
|
+
* table, a region yield) can place a die in its reticle cell and field without the config travelling beside it.
|
|
55
|
+
*/
|
|
56
|
+
reticle?: WaferReticle;
|
|
42
57
|
}
|
|
43
58
|
/** Create a wafer model from spec. Defaults: center={0,0}, orientation=0. */
|
|
44
59
|
export declare function createWafer(config: WaferSpec): Wafer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(e){return e<=100?32.5:e<=150?57.5:1.75}export function createWafer(e){if(e.diameter<=0)throw new RangeError(`createWafer: diameter must be > 0 (got ${e.diameter})`);return{diameter:e.diameter,radius:e.diameter/2,center:e.center??{x:0,y:0},notch:e.notch?{type:e.notch.type,length:t(e.diameter)}:void 0,orientation:e.orientation??0,metadata:e.metadata}}
|
|
1
|
+
function t(e){return e<=100?32.5:e<=150?57.5:1.75}export function createWafer(e){if(e.diameter<=0)throw new RangeError(`createWafer: diameter must be > 0 (got ${e.diameter})`);return{diameter:e.diameter,radius:e.diameter/2,center:e.center??{x:0,y:0},notch:e.notch?{type:e.notch.type,length:t(e.diameter)}:void 0,orientation:e.orientation??0,metadata:e.metadata,...e.reticle?{reticle:e.reticle}:{}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requirePassBins as ge}from"../core/passBins.js";import{requireRingCount as ye}from"../core/ringCount.js";import{hasPosition as be}from"../core/dies.js";import{dieValueEntries as xe,dieVerdictEntries as Me,recordedVerdict as Se,testsPresent as Ot}from"../core/dieTable.js";import{getReticleCell as ve}from"../core/reticle.js";import{metadataCategoricalValue as Be,metadataDisplayValue as ke}from"../core/metadata.js";import{affineRotation as bt,affineMirror as wt,affineCompose as st,affinePoint as G,affineVector as $e,affineSwapsAxes as Ie}from"../core/transforms.js";import{contrastTextColor as Q,SPEC_PASS_FILL as xt,SPEC_FAIL_LOW as Te,SPEC_FAIL_HIGH as Mt}from"./colorMap.js";import{resolveValueColorFn as De}from"./colorSchemes.js";import{resolveBinColors as Ce,binColorsCover as Ve}from"./binColors.js";import{NO_DATA_FILL as z}from"./colorMap.js";import{diePassStatus as Fe}from"../core/dies.js";import{compactView as Le}from"./compactView.js";import{buildXYIndicator as Re}from"./xyIndicator.js";import{getDieTestValue as L,getTestPassStatus as U,isParametricTest as St}from"./buildWaferMap.js";import{classifySpec as ot}from"./spec.js";export{ot as classifySpec};import{fmt as vt,fmtColorbarAxis as Bt,fmtAggregationMethod as qt}from"./fmt.js";import{metadataValueColor as Pe}from"./colorMap.js";import{asList as Kt,clamp01 as Wt,compareNatural as Ne,escHtml as R}from"../core/utils.js";import{prettyKey as zt}from"../core/utils.js";import{testLabel as rt,markedTestLabel as lt,derivedTestNote as jt,isDerivedTest as Ee,DERIVED_MARK as Ae,DERIVED_KEY as He}from"./testLabel.js";export function resolveTestNumber(t,e){return e?.length?{testNumber:(findTestDef(e,t)??e[0]).testNumber}:{testNumber:t}}export function collectMetadataValues(t,e){const n=new Set;for(const i of t){if(i.partial||i.edgeExcluded)continue;const s=ct(i,e);s!==void 0&&n.add(s)}return[...n].sort(Ne)}export function findTestDef(t,e){return t?.find(n=>n.testNumber===e)}export function getUniqueTestNumbers(t){return Ot(t,"values")}const _e="#d3d6db",Xt="#e8e9ea",Oe="#aab0ba";function ct(t,e){return e?Be(t.metadata?.[e]):void 0}function we(t,e,n){const{x:i,y:s}=t.center,a=bt(t.orientation,i,s),o=st(wt(e?.x??!1,e?.y??!1,i,s),bt(t.orientation,i,s)),r=st(wt(n?.flipX??!1,n?.flipY??!1,i,s),bt(n?.rotation??0,i,s));return{bakedToScreen:r,physicalToScreen:st(r,a),gridToScreen:st(r,o)}}function Y(t,e=!1){return{points:[t],closed:e}}function qe(t,e){const{center:n,radius:i,notch:s}=t;let a=n.x+i*Math.cos(e),o=n.y+i*Math.sin(e);if(!s)return{x:a,y:o};const r=Math.sqrt(i**2-(s.length/2)**2),d=s.length/2,y=a-n.x,b=o-n.y;return s.type==="bottom"&&b<-r?(o=n.y-r,a=n.x+Math.max(-d,Math.min(d,y))):s.type==="top"&&b>r?(o=n.y+r,a=n.x+Math.max(-d,Math.min(d,y))):s.type==="left"&&y<-r?(a=n.x-r,o=n.y+Math.max(-d,Math.min(d,b))):s.type==="right"&&y>r&&(a=n.x+r,o=n.y+Math.max(-d,Math.min(d,b))),{x:a,y:o}}function Yt(t,e){return t.map(e).join(" / ")}function Ke(t,e=256){const n=Array.from({length:e},(i,s)=>t(s/(e-1)));return i=>n[Math.min(e-1,Math.max(0,Math.round(i*(e-1))))]}function We(t,e){const n=Math.max(1,Math.min(t.width,t.height)),i=t.width/Math.max(e.length,1);return Math.max(8,Math.min(16,Math.round(Math.min(n*.55,i*1.8))))}function ze(t,e,n){if(e?.length){const a=e.flatMap(o=>{const r=o.testNumber;if(!St(o)){const y=U(t,r,o);return y===void 0?[]:[{key:r,label:lt(o,r),value:y?"Pass":"Fail"}]}const d=L(t,r);return d===void 0?[]:[{key:r,label:lt(o,r),value:vt(d,o.unit,n),recordedFail:Se(t,r)===!1}]});if(a.length)return a}const i=xe(t);if(i.length)return i.map(([a,o])=>({key:a,label:rt(void 0,a),value:vt(o,void 0,n)}));const s=Me(t);return s.length?s.map(([a,o])=>({key:a,label:rt(void 0,a),value:o?"Pass":"Fail"})):[]}export function buildHoverText(t,e,n={}){const{testDefs:i,hbinDefs:s,sbinDefs:a,fallbackFormat:o,aggrMethod:r,lotSize:d,activeTest:y,reticleConfig:b,metadataFields:k}=n,D=s?new Map(s.map(f=>[f.bin,f])):null,I=a?new Map(a.map(f=>[f.bin,f])):null,g=[R(`Die (${t.x}, ${t.y})`)];if(b&&be(t)){const f=ve(t,b);g.push(R(`Reticle (${f.column}, ${f.row})`))}if(e==="stackedValues"){const f=L(t,0);if(f!==void 0){const u=i?.[0],m=u?lt(u,u.testNumber):"Value",S=r?` (${r})`:"";g.push(R(`${m}${S}: ${vt(f,u?.unit,o)}`));const h=jt(u);h&&g.push(`<i>${R(h)}</i>`)}}else if(e==="stackedBins"||e==="stackedSoftBins"){const f=L(t,0),u=e==="stackedSoftBins"?t.sbin:t.hbin;if(f!==void 0){const m=e==="stackedSoftBins"?I:D,S=u!==void 0?m?.get(u)?.name?`${u} \xB7 ${m.get(u).name}`:`Bin ${u}`:"Bin";let h;if(r==="percent")h=`${f.toFixed(0)}%`;else{const C=d?` (${(f/d*100).toFixed(0)}% of stacked wafers)`:"";h=`${f}${C}`}const x=r?` [${qt(r)}]`:"";g.push(R(`${S}: ${h}${x}`))}}else{const f=ze(t,i,o);if(e==="value"&&f.length){const{testNumber:u}=resolveTestNumber(y??0,i),m=findTestDef(i,u),S=L(t,u);let h=f.findIndex(A=>A.key===u);h<0&&(h=0);const x=f[h];let C=`<b>${R(`${x.label}: ${x.value}`)}${x.recordedFail?" <i>(recorded fail)</i>":""}</b>`;if(x.key===u&&m){const A=ot(S,m);(A==="failLow"||A==="failHigh")&&(C+=" <i>(outside test limits)</i>")}g.push(C);const E=jt(findTestDef(i,x.key));E&&g.push(`<i>${R(E)}</i>`);const p=f.length-1;p>0&&g.push(`<i>+${p} more test${p===1?"":"s"}</i>`)}else if(f.length){const u=f.length;g.push(`<i>${u} test result${u===1?"":"s"} recorded</i>`)}if(t.hbin!==void 0||t.sbin!==void 0){const u=[];if(t.hbin!==void 0){const m=D?.get(t.hbin)?.name,S=m?`${t.hbin} \xB7 ${m}`:String(t.hbin);u.push(`HBin: ${S}`)}if(t.sbin!==void 0){const m=I?.get(t.sbin)?.name,S=m?`${t.sbin} \xB7 ${m}`:String(t.sbin);u.push(`SBin: ${S}`)}g.push(u.map(R).join(" \xB7 "))}}t.retestCount!==void 0&&g.push(R(`Retests: ${t.retestCount}`)),t.siteNum!==void 0&&g.push(R(`Site: ${t.siteNum}`)),t.partId!==void 0&&g.push(R(`Part ID: ${t.partId}`)),t.partial&&g.push("<i>partial die</i>"),t.probeIndex!==void 0&&g.push(R(`Probe: #${t.probeIndex}`));const B={...t.metadata??{}};for(const[f,u]of Object.entries(B)){const m=ke(u);if(m===void 0)continue;const S=k?.find(h=>h.key===f)?.label??zt(f);g.push(R(`${S}: ${m}`))}return g.join("<br>")}function kt(t){return t?.name?lt(t,t.testNumber):void 0}function $t(t){return Ee(t)?{note:`${Ae} ${He}`}:{}}export function buildMapTitle(t,e="engineering",n){const i=t.isLotStack&&t.lotSize!==void 0?`stacked (${t.lotSize} ${t.lotSize===1?"wafer":"wafers"})`:"stacked",s=a=>{const o=n?.length===1?n[0]:void 0;return o===void 0?`${a} Bin`:o.name?`${a} Bin ${o.bin} \xB7 ${o.name}`:`${a} Bin ${o.bin}`};switch(t.plotMode){case"hardBin":return{primary:"Hard Bin",secondary:""};case"softBin":return{primary:"Soft Bin",secondary:""};case"stackedBins":return{primary:s("Hard"),secondary:i};case"stackedSoftBins":return{primary:s("Soft"),secondary:i};case"metadata":{const a=t.metadataFields?.find(r=>r.key===t.activeMetadataKey),o=t.activeMetadataKey?zt(t.activeMetadataKey):"Metadata";return{primary:a?.label??o,secondary:""}}case"stackedValues":{const a=t.testDefs?.[0],o=t.valueRange[1]||t.valueRange[0]||0,{axisLabel:r}=Bt(o,kt(a),a?.unit,e),d=r||"Value",y=t.aggrMethod?` \xB7 ${qt(t.aggrMethod)}`:"";return{primary:`${d}${y}`,secondary:i,...$t(a)}}default:{const a=findTestDef(t.testDefs,t.activeTest),o=t.valueRange[1]||t.valueRange[0]||0,{axisLabel:r}=Bt(o,kt(a),a?.unit,e),d=r||kt(a);if(t.passFailDisplay!=="off"){const y=a?.testNumber??t.activeTest,b=d?`${d} \xB7 #${y}`:rt(void 0,y),k=t.passFailDisplay==="spec"?"Limit pass/fail":a!==void 0&&!St(a)?"Functional pass/fail":"Tester pass/fail";return{primary:b,secondary:k,...$t(a)}}return{primary:d??rt(void 0,t.activeTest),secondary:"",...$t(a)}}}}export function generateTextOverlay(t,e,n){const{plotMode:i,colorFns:s,normalize:a,activeTest:o,valueRange:r,testDefs:d,fallbackFormat:y,passFailDisplay:b="off",activeMetadataKey:k,metadataColorMap:D,allIntegerValues:I}=n,g=findTestDef(d,o),{tickFmt:B}=Bt(r[1],g?.name,g?.unit,y),f=I?m=>String(Math.round(m)):B,{testNumber:u}=resolveTestNumber(o,d);return t.flatMap((m,S)=>{let h="",x="#111111";if(i==="value"&&b==="test"){const p=U(m,u,g);if(p===void 0)return[];h=p?"P":"F",x=Q(p?xt:Mt)}else if(i==="value"){const p=L(m,u);if(p===void 0)return[];h=Yt([p],f),x=Q(s.forValue(a(p)))}else if(i==="hardBin"||i==="softBin"){const p=i==="softBin"?m.sbin:m.hbin;if(p===void 0)return[];h=String(p),x=Q(s.forBin(p))}else if(i==="metadata"){const p=ct(m,k);if(p===void 0)return[];h=p,x=Q(D?.get(h)??z)}else{const p=L(m,0);if(p===void 0)return[];h=Yt([p],f),x=Q(s.forValue(a(p)))}const C=e?e[S*2]:m.physX,E=e?e[S*2+1]:m.physY;return[{x:C,y:E,text:h,fontSize:We(m,h),color:x,align:"center"}]})}function Gt(t){return t==="top"?Math.PI/2:t==="bottom"?-Math.PI/2:t==="left"?Math.PI:0}function je(t,e,n=720){const{center:i,radius:s,notch:a}=t,o=B=>G(e,B.x,B.y);if(!(a!==void 0&&t.diameter>150)){const B=[];for(let f=0;f<=n;f++){const u=2*Math.PI*f/n;B.push(o(qe(t,u)))}return[{kind:"wafer-boundary",...Y(B,!0),lineColor:"#888888",lineWidth:1}]}const d=1.25,y=a.length,b=Gt(a.type),k=Math.atan2(y,s),D=s-d,I=[];let g=!1;for(let B=0;B<=n;B++){const f=2*Math.PI*B/n;let u=f-b;for(;u>Math.PI;)u-=2*Math.PI;for(;u<-Math.PI;)u+=2*Math.PI;if(Math.abs(u)<=k){if(!g){g=!0;const m={x:i.x+s*Math.cos(b-k),y:i.y+s*Math.sin(b-k)},S={x:i.x+D*Math.cos(b),y:i.y+D*Math.sin(b)},h={x:i.x+s*Math.cos(b+k),y:i.y+s*Math.sin(b+k)};I.push(o(m),o(S),o(h))}continue}I.push(o({x:i.x+s*Math.cos(f),y:i.y+s*Math.sin(f)}))}return[{kind:"wafer-boundary",...Y(I,!0),lineColor:"#888888",lineWidth:1}]}function Xe(t,e,n,i=360){const s=[],a=Math.max(1,Math.floor(n));for(let o=1;o<a;o++){const r=t.radius*o/a,d=[];for(let y=0;y<=i;y++){const b=2*Math.PI*y/i,k={x:t.center.x+r*Math.cos(b),y:t.center.y+r*Math.sin(b)};d.push(G(e,k.x,k.y))}s.push({kind:"ring-boundary",...Y(d,!0),lineColor:"rgba(255,255,255,0.7)",lineWidth:1.5})}return s}function Ye(t,e,n,i){const{x:s,y:a}=t.center,o=t.radius,r=(f,u)=>G(e,f,u),d=n-s,y=Math.sqrt(Math.max(0,o*o-d*d)),b=r(n,a-y),k=r(n,a+y),D=i-a,I=Math.sqrt(Math.max(0,o*o-D*D)),g=r(s-I,i),B=r(s+I,i);return[{kind:"quadrant-boundary",...Y([b,k]),lineColor:"rgba(255,255,255,0.7)",lineWidth:1.5},{kind:"quadrant-boundary",...Y([g,B]),lineColor:"rgba(255,255,255,0.7)",lineWidth:1.5}]}function Ge(t,e){return t.map(n=>{const i=n.width/2,s=n.height/2;return{kind:"reticle",points:[[[n.x-i,n.y-s],[n.x+i,n.y-s],[n.x+i,n.y+s],[n.x-i,n.y+s]].map(([o,r])=>G(e,o,r))],closed:!0,lineColor:"rgba(255,255,255,0.7)",lineWidth:1.5,fill:"rgba(0,0,0,0)"}})}function Qe(t){const e=t.filter(n=>n.probeIndex!==void 0).sort((n,i)=>(n.probeIndex??0)-(i.probeIndex??0));return e.length?[{kind:"probe-path",...Y(e.map(n=>({x:n.physX,y:n.physY}))),lineColor:"rgba(220,80,0,0.55)",lineWidth:1}]:[]}function Ue(t,e,n,i,s,a,o,r,d,y,b,k,D,I,g="off",B,f,u){const m=e.width-o,S=e.height-o,h=a?S:m,x=a?m:S,C=M=>s==="softBin"?M.sbin:M.hbin,E=M=>ct(M,B);if(e.partial){t.push({x:n,y:i,width:h,height:x,fill:_e,type:"stacked",metadata:e.metadata});return}if(e.edgeExcluded){t.push({x:n,y:i,width:h,height:x,fill:Oe,type:"stacked",metadata:e.metadata});return}if(d!==void 0&&(s==="hardBin"||s==="softBin")&&!d.has(C(e))){t.push({x:n,y:i,width:h,height:x,fill:Xt,type:"hardBin",metadata:e.metadata});return}if(u!==void 0&&s==="metadata"&&!u.has(E(e))){t.push({x:n,y:i,width:h,height:x,fill:Xt,type:"metadata",metadata:e.metadata});return}if(s==="value"){if(g==="test"){const q=U(e,b,I),ut=q===void 0?z:q?xt:Mt;t.push({x:n,y:i,width:h,height:x,fill:ut,type:"value",metadata:e.metadata});return}const M=L(e,b),P=ot(M,I);let w,J;M===void 0?w=z:g==="spec"?w=P==="failLow"?Te:P==="failHigh"?Mt:xt:(w=r.forValue(y(M)),(P==="failLow"||P==="failHigh")&&(J=P)),t.push({x:n,y:i,width:h,height:x,fill:w,type:"value",specMark:J,metadata:e.metadata});return}if(s==="hardBin"||s==="softBin"){const M=C(e),P=M!=null?r.forBin(M):z,w=M!=null&&Fe(e,D)===!1?!0:void 0;t.push({x:n,y:i,width:h,height:x,fill:P,type:s,binFail:w,metadata:e.metadata});return}if(s==="metadata"){const M=E(e),P=M!==void 0?f?.get(M)??z:z;t.push({x:n,y:i,width:h,height:x,fill:P,type:"metadata",metadata:e.metadata});return}const p=L(e,0),A=p!==void 0?r.forValue(y(p)):z;t.push({x:n,y:i,width:h,height:x,fill:A,type:"value",metadata:e.metadata})}function Je(t,e,n){const i=t.radius;return Re(e,i*.15,(s,a)=>({x:t.center.x+s*i*.9,y:t.center.y+a*i*.9}),n).overlays}export function buildView(t,e,n={},i){const s=n.reticles??[],{plotMode:a="value",showDieLabels:o=!1,showReticle:r=!1,showProbePath:d=!1,ringCount:y,showRingBoundaries:b=!1,showQuadrantBoundaries:k=!1,showXYIndicator:D=!1,binColorScheme:I="default",valueColorScheme:g="default",reverseValueScheme:B=!1,useDefinedBinColors:f=!0,binColors:u,passBins:m,highlightBin:S,highlightMetadataValue:h,interactiveTransform:x,valueRange:C,metadataValueOrder:E,testDefs:p,activeTest:A=0,activeMetadataKey:M,fallbackFormat:P="engineering",aggregationMethod:w,lotSize:J,dataAxisFlip:q,isLotStack:ut=!1,logScale:Qt,colorbarRangeMode:Ut="spec",passFailDisplay:Jt}=n,It=Jt??"off",ft=i?.hbinDefs,dt=i?.sbinDefs,Tt=i?.metadataFields,Zt=Tt?.find(l=>l.key===M),te={x:(q?.x??!1)!==(x?.flipX??!1),y:(q?.y??!1)!==(x?.flipY??!1)},ee=ft?new Map(ft.map(l=>[l.bin,l])):null,ne=dt?new Map(dt.map(l=>[l.bin,l])):null,ae=a==="softBin"?ne:ee,Dt=ge({passBins:m},"buildView"),ie=new Set(Dt),ht=u&&Ve(u,e)?u:Ce(e,{passBins:Dt,binColorScheme:I,hbinDefs:ft,sbinDefs:dt,useDefinedBinColors:f}),se=a==="softBin"?ht.soft:ht.hard,Ct={forValue:Ke(De(g,B)),forBin:l=>se.get(l)??z};let{testNumber:H}=resolveTestNumber(A,p);if(!p?.length&&a==="value"){const l=Ot(e,"values");!l.includes(H)&&l.length&&(H=l[0])}let Z;if(Array.isArray(C))Z=C;else if(C){const{testNumber:l}=resolveTestNumber(C.test,p);Z=l===H?C.range:void 0}const T=findTestDef(p,H),Vt=a==="value"&&T!==void 0&&!St(T),oe=T!==void 0&&(T.limitLow!==void 0||T.limitHigh!==void 0);let O="off";a==="value"&&(Vt?O="test":It==="spec"&&oe?O="spec":It==="test"&&e.some(l=>U(l,H,T)!==void 0)&&(O="test"));const Ft=O==="spec"?"spec":Ut,mt=a==="stackedValues"||a==="stackedBins"||a==="stackedSoftBins";let N,_,tt=!1;if(Z){[N,_]=Z;let l=!0,c=!1;for(const v of e){const F=mt?L(v,0):L(v,H);if(F!==void 0&&(c=!0,!Number.isInteger(F))){l=!1;break}}tt=c&&l}else{const l=!mt&&a==="value"&&Ft==="spec"&&T&&(T.limitLow!==void 0||T.limitHigh!==void 0);let c=1/0,v=-1/0,F=!0;for(const $ of e){const W=mt?L($,0):L($,H);W!==void 0&&(W<c&&(c=W),W>v&&(v=W),Number.isInteger(W)||(F=!1))}isFinite(c)||(F=!1),tt=F,l?(N=T.limitLow!==void 0?T.limitLow:isFinite(c)?c:0,_=T.limitHigh!==void 0?T.limitHigh:isFinite(v)?v:1):(N=isFinite(c)?c:0,_=isFinite(v)?v:1)}N===_&&(_=N+1);const Lt=Vt?!1:Qt??T?.logScale??!1,Rt=Lt&&N>0&&_>0,re=Rt;let et;if(Rt){const l=Math.log10(N),c=Math.log10(_)-l;et=v=>v<=0?0:Wt((Math.log10(v)-l)/c)}else et=l=>Wt((l-N)/(_-N));const V=we(t,q,x);let Pt=null;if(t.notch){const l=Gt(t.notch.type),c=$e(V.physicalToScreen,Math.cos(l)*t.radius,Math.sin(l)*t.radius),v=Math.hypot(c.x,c.y);v>0&&(Pt={x:c.x/v,y:c.y/v})}let j=1/0;for(let l=0;l<e.length;l++){const c=e[l];c.width<j&&(j=c.width),c.height<j&&(j=c.height)}const Nt=1,le=j!==1/0?Math.min(Nt,j*.12):Nt,Et=[],pt=[],ce=V.bakedToScreen.a===1&&V.bakedToScreen.b===0&&V.bakedToScreen.c===0&&V.bakedToScreen.d===1&&V.bakedToScreen.e===0&&V.bakedToScreen.f===0;let K=null;if(!ce){K=new Float64Array(e.length*2);for(let l=0;l<e.length;l++){const c=G(V.bakedToScreen,e[l].physX,e[l].physY);K[l*2]=c.x,K[l*2+1]=c.y}}const ue=Ie(V.gridToScreen),fe=a==="hardBin"||a==="softBin"||a==="stackedBins"||a==="stackedSoftBins",de=a==="softBin"||a==="stackedSoftBins";let nt=fe?new Map:void 0;const gt=a==="value"&&O==="spec"?{pass:0,failHigh:0,failLow:0}:void 0,yt=a==="value"&&O==="test"?{pass:0,fail:0}:void 0,At=a==="metadata";let at=At?new Map:void 0,it=null;if(At&&M){const l=collectMetadataValues(e,M),c=E?.key===M?E.values:void 0,v=c?[...c,...l.filter(F=>!c.includes(F))]:l;it=new Map(v.map((F,$)=>[F,Zt?.values?.find(W=>W.value===F)?.color??Pe($)]))}const he=S===void 0?void 0:new Set(Kt(S)),me=h===void 0?void 0:new Set(Kt(h));for(let l=0;l<e.length;l++){const c=e[l],v=K?K[l*2]:c.physX,F=K?K[l*2+1]:c.physY;if(pt.push({x:v,y:F}),nt&&!c.partial&&!c.edgeExcluded){const $=de?c.sbin:c.hbin;$!=null&&nt.set($,(nt.get($)??0)+1)}if(gt&&!c.partial&&!c.edgeExcluded){const $=ot(L(c,H),T);$&>[$]++}if(yt&&!c.partial&&!c.edgeExcluded){const $=U(c,H,T);$!==void 0&&yt[$?"pass":"fail"]++}if(at&&!c.partial&&!c.edgeExcluded){const $=ct(c,M);$!==void 0&&at.set($,(at.get($)??0)+1)}Ue(Et,c,v,F,a,ue,le,Ct,he,et,H,ae,ie,T,O,M,it,me)}const Ht=o?generateTextOverlay(e,K,{plotMode:a,colorFns:Ct,normalize:et,activeTest:A,valueRange:[N,_],testDefs:p,fallbackFormat:P,passFailDisplay:O,activeMetadataKey:M,metadataColorMap:it,allIntegerValues:tt}):[],X=je(t,V.physicalToScreen);b&&X.push(...Xe(t,V.physicalToScreen,ye({ringCount:y},"buildView"))),k&&X.push(...Ye(t,V.physicalToScreen,t.center.x,t.center.y)),r&&X.push(...Ge(s,V.gridToScreen)),d&&X.push(...Qe(e)),D&&X.push(...Je(t,V.gridToScreen,Ht));const pe=pt.length>0?{minX:t.center.x-t.radius,maxX:t.center.x+t.radius,minY:t.center.y-t.radius,maxY:t.center.y+t.radius}:null,_t={rectangles:Et,hoverPoints:pt,texts:Ht,overlays:X,plotMode:a,binColorScheme:I,valueColorScheme:g,reverseValueScheme:B,binColors:ht,metadata:t.metadata??null,dies:e,valueRange:[N,_],allIntegerValues:tt,testDefs:p,activeTest:A,logScale:re,logScaleRequested:Lt,aggrMethod:w,lotSize:J,axisFlip:te,dataAxisFlip:{x:q?.x??!1,y:q?.y??!1},gridToScreen:V.gridToScreen,rotation:((t.orientation+(x?.rotation??0))%360+360)%360,hasReticle:s.length>0,isLotStack:ut,passFailDisplay:O,colorbarRangeMode:Ft,waferCenter:t.center,waferRadius:t.radius,notchDir:Pt,binCounts:nt,metadataCounts:at,metadataColorMap:it,activeMetadataKey:M,metadataFields:Tt,specCounts:gt,passFailCounts:yt,dieBounds:pe};return n.compact?Le(_t,n.compact,{showXYIndicator:D}):_t}export{getDieKey}from"../core/dies.js";
|
|
1
|
+
import{requirePassBins as ge}from"../core/passBins.js";import{requireRingCount as ye}from"../core/ringCount.js";import{hasPosition as be}from"../core/dies.js";import{dieValueEntries as xe,dieVerdictEntries as Me,excludedBy as Se,excludedValue as ve,recordedVerdict as Be,testsPresent as Ot}from"../core/dieTable.js";import{limitSetName as $e}from"./valueFilter.js";import{getReticleCell as ke}from"../core/reticle.js";import{metadataCategoricalValue as Ie,metadataDisplayValue as Te}from"../core/metadata.js";import{affineRotation as xt,affineMirror as wt,affineCompose as ot,affinePoint as G,affineVector as De,affineSwapsAxes as Ve}from"../core/transforms.js";import{contrastTextColor as Q,SPEC_PASS_FILL as Mt,SPEC_FAIL_LOW as Ce,SPEC_FAIL_HIGH as St}from"./colorMap.js";import{resolveValueColorFn as Fe}from"./colorSchemes.js";import{resolveBinColors as Le,binColorsCover as Re}from"./binColors.js";import{NO_DATA_FILL as z}from"./colorMap.js";import{diePassStatus as Pe}from"../core/dies.js";import{compactView as Ne}from"./compactView.js";import{buildXYIndicator as Ee}from"./xyIndicator.js";import{getDieTestValue as L,getTestPassStatus as U,isParametricTest as vt}from"./buildWaferMap.js";import{classifySpec as rt}from"./spec.js";export{rt as classifySpec};import{fmt as lt,fmtColorbarAxis as Bt,fmtAggregationMethod as qt}from"./fmt.js";import{metadataValueColor as Ae}from"./colorMap.js";import{asList as Kt,clamp01 as Wt,compareNatural as He,escHtml as R}from"../core/utils.js";import{prettyKey as zt}from"../core/utils.js";import{testLabel as ct,markedTestLabel as J,derivedTestNote as jt,isDerivedTest as _e,DERIVED_MARK as Oe,DERIVED_KEY as we}from"./testLabel.js";export function resolveTestNumber(t,e){return e?.length?{testNumber:(findTestDef(e,t)??e[0]).testNumber}:{testNumber:t}}export function collectMetadataValues(t,e){const n=new Set;for(const i of t){if(i.partial||i.edgeExcluded)continue;const s=ut(i,e);s!==void 0&&n.add(s)}return[...n].sort(He)}export function findTestDef(t,e){return t?.find(n=>n.testNumber===e)}export function getUniqueTestNumbers(t){return Ot(t,"values")}const qe="#d3d6db",Xt="#e8e9ea",Ke="#aab0ba";function ut(t,e){return e?Ie(t.metadata?.[e]):void 0}function We(t,e,n){const{x:i,y:s}=t.center,a=xt(t.orientation,i,s),o=ot(wt(e?.x??!1,e?.y??!1,i,s),xt(t.orientation,i,s)),r=ot(wt(n?.flipX??!1,n?.flipY??!1,i,s),xt(n?.rotation??0,i,s));return{bakedToScreen:r,physicalToScreen:ot(r,a),gridToScreen:ot(r,o)}}function Y(t,e=!1){return{points:[t],closed:e}}function ze(t,e){const{center:n,radius:i,notch:s}=t;let a=n.x+i*Math.cos(e),o=n.y+i*Math.sin(e);if(!s)return{x:a,y:o};const r=Math.sqrt(i**2-(s.length/2)**2),d=s.length/2,p=a-n.x,x=o-n.y;return s.type==="bottom"&&x<-r?(o=n.y-r,a=n.x+Math.max(-d,Math.min(d,p))):s.type==="top"&&x>r?(o=n.y+r,a=n.x+Math.max(-d,Math.min(d,p))):s.type==="left"&&p<-r?(a=n.x-r,o=n.y+Math.max(-d,Math.min(d,x))):s.type==="right"&&p>r&&(a=n.x+r,o=n.y+Math.max(-d,Math.min(d,x))),{x:a,y:o}}function Yt(t,e){return t.map(e).join(" / ")}function je(t,e=256){const n=Array.from({length:e},(i,s)=>t(s/(e-1)));return i=>n[Math.min(e-1,Math.max(0,Math.round(i*(e-1))))]}function Xe(t,e){const n=Math.max(1,Math.min(t.width,t.height)),i=t.width/Math.max(e.length,1);return Math.max(8,Math.min(16,Math.round(Math.min(n*.55,i*1.8))))}function Ye(t,e,n){if(e?.length){const a=e.flatMap(o=>{const r=o.testNumber;if(!vt(o)){const p=U(t,r,o);return p===void 0?[]:[{key:r,label:J(o,r),value:p?"Pass":"Fail"}]}const d=L(t,r);if(d===void 0){const p=ve(t,r);return p===void 0?[]:[{key:r,label:J(o,r),value:lt(p,o.unit,n),excludedBy:Se(t)}]}return[{key:r,label:J(o,r),value:lt(d,o.unit,n),recordedFail:Be(t,r)===!1}]});if(a.length)return a}const i=xe(t);if(i.length)return i.map(([a,o])=>({key:a,label:ct(void 0,a),value:lt(o,void 0,n)}));const s=Me(t);return s.length?s.map(([a,o])=>({key:a,label:ct(void 0,a),value:o?"Pass":"Fail"})):[]}export function buildHoverText(t,e,n={}){const{testDefs:i,hbinDefs:s,sbinDefs:a,fallbackFormat:o,aggrMethod:r,lotSize:d,activeTest:p,reticleConfig:x,metadataFields:$}=n,V=s?new Map(s.map(f=>[f.bin,f])):null,I=a?new Map(a.map(f=>[f.bin,f])):null,y=[R(`Die (${t.x}, ${t.y})`)];if(x&&be(t)){const f=ke(t,x);y.push(R(`Reticle (${f.column}, ${f.row})`))}if(e==="stackedValues"){const f=L(t,0);if(f!==void 0){const u=i?.[0],m=u?J(u,u.testNumber):"Value",S=r?` (${r})`:"";y.push(R(`${m}${S}: ${lt(f,u?.unit,o)}`));const h=jt(u);h&&y.push(`<i>${R(h)}</i>`)}}else if(e==="stackedBins"||e==="stackedSoftBins"){const f=L(t,0),u=e==="stackedSoftBins"?t.sbin:t.hbin;if(f!==void 0){const m=e==="stackedSoftBins"?I:V,S=u!==void 0?m?.get(u)?.name?`${u} \xB7 ${m.get(u).name}`:`Bin ${u}`:"Bin";let h;if(r==="percent")h=`${f.toFixed(0)}%`;else{const D=d?` (${(f/d*100).toFixed(0)}% of stacked wafers)`:"";h=`${f}${D}`}const b=r?` [${qt(r)}]`:"";y.push(R(`${S}: ${h}${b}`))}}else{const f=Ye(t,i,o);if(e==="value"&&f.length){const{testNumber:u}=resolveTestNumber(p??0,i),m=findTestDef(i,u),S=L(t,u);let h=f.findIndex(A=>A.key===u);h<0&&(h=0);const b=f[h];let D=`<b>${R(`${b.label}: ${b.value}`)}${b.recordedFail?" <i>(recorded fail)</i>":""}</b>`;if(b.key===u&&m){const A=rt(S,m);(A==="failLow"||A==="failHigh")&&(D+=" <i>(outside test limits)</i>")}b.excludedBy&&(D+=` <i>(outside ${$e(b.excludedBy)}, excluded)</i>`),y.push(D);const E=jt(findTestDef(i,b.key));E&&y.push(`<i>${R(E)}</i>`);const g=f.length-1;g>0&&y.push(`<i>+${g} more test${g===1?"":"s"}</i>`)}else if(f.length){const u=f.length;y.push(`<i>${u} test result${u===1?"":"s"} recorded</i>`)}if(t.hbin!==void 0||t.sbin!==void 0){const u=[];if(t.hbin!==void 0){const m=V?.get(t.hbin)?.name,S=m?`${t.hbin} \xB7 ${m}`:String(t.hbin);u.push(`HBin: ${S}`)}if(t.sbin!==void 0){const m=I?.get(t.sbin)?.name,S=m?`${t.sbin} \xB7 ${m}`:String(t.sbin);u.push(`SBin: ${S}`)}y.push(u.map(R).join(" \xB7 "))}}t.retestCount!==void 0&&y.push(R(`Retests: ${t.retestCount}`)),t.siteNum!==void 0&&y.push(R(`Site: ${t.siteNum}`)),t.partId!==void 0&&y.push(R(`Part ID: ${t.partId}`)),t.partial&&y.push("<i>partial die</i>"),t.probeIndex!==void 0&&y.push(R(`Probe: #${t.probeIndex}`));const B={...t.metadata??{}};for(const[f,u]of Object.entries(B)){const m=Te(u);if(m===void 0)continue;const S=$?.find(h=>h.key===f)?.label??zt(f);y.push(R(`${S}: ${m}`))}return y.join("<br>")}function $t(t){return t?.name?J(t,t.testNumber):void 0}function kt(t){return _e(t)?{note:`${Oe} ${we}`}:{}}export function buildMapTitle(t,e="engineering",n){const i=t.isLotStack&&t.lotSize!==void 0?`stacked (${t.lotSize} ${t.lotSize===1?"wafer":"wafers"})`:"stacked",s=a=>{const o=n?.length===1?n[0]:void 0;return o===void 0?`${a} Bin`:o.name?`${a} Bin ${o.bin} \xB7 ${o.name}`:`${a} Bin ${o.bin}`};switch(t.plotMode){case"hardBin":return{primary:"Hard Bin",secondary:""};case"softBin":return{primary:"Soft Bin",secondary:""};case"stackedBins":return{primary:s("Hard"),secondary:i};case"stackedSoftBins":return{primary:s("Soft"),secondary:i};case"metadata":{const a=t.metadataFields?.find(r=>r.key===t.activeMetadataKey),o=t.activeMetadataKey?zt(t.activeMetadataKey):"Metadata";return{primary:a?.label??o,secondary:""}}case"stackedValues":{const a=t.testDefs?.[0],o=t.valueRange[1]||t.valueRange[0]||0,{axisLabel:r}=Bt(o,$t(a),a?.unit,e),d=r||"Value",p=t.aggrMethod?` \xB7 ${qt(t.aggrMethod)}`:"";return{primary:`${d}${p}`,secondary:i,...kt(a)}}default:{const a=findTestDef(t.testDefs,t.activeTest),o=t.valueRange[1]||t.valueRange[0]||0,{axisLabel:r}=Bt(o,$t(a),a?.unit,e),d=r||$t(a);if(t.passFailDisplay!=="off"){const p=a?.testNumber??t.activeTest,x=d?`${d} \xB7 #${p}`:ct(void 0,p),$=t.passFailDisplay==="spec"?"Limit pass/fail":a!==void 0&&!vt(a)?"Functional pass/fail":"Tester pass/fail";return{primary:x,secondary:$,...kt(a)}}return{primary:d??ct(void 0,t.activeTest),secondary:"",...kt(a)}}}}export function generateTextOverlay(t,e,n){const{plotMode:i,colorFns:s,normalize:a,activeTest:o,valueRange:r,testDefs:d,fallbackFormat:p,passFailDisplay:x="off",activeMetadataKey:$,metadataColorMap:V,allIntegerValues:I}=n,y=findTestDef(d,o),{tickFmt:B}=Bt(r[1],y?.name,y?.unit,p),f=I?m=>String(Math.round(m)):B,{testNumber:u}=resolveTestNumber(o,d);return t.flatMap((m,S)=>{let h="",b="#111111";if(i==="value"&&x==="test"){const g=U(m,u,y);if(g===void 0)return[];h=g?"P":"F",b=Q(g?Mt:St)}else if(i==="value"){const g=L(m,u);if(g===void 0)return[];h=Yt([g],f),b=Q(s.forValue(a(g)))}else if(i==="hardBin"||i==="softBin"){const g=i==="softBin"?m.sbin:m.hbin;if(g===void 0)return[];h=String(g),b=Q(s.forBin(g))}else if(i==="metadata"){const g=ut(m,$);if(g===void 0)return[];h=g,b=Q(V?.get(h)??z)}else{const g=L(m,0);if(g===void 0)return[];h=Yt([g],f),b=Q(s.forValue(a(g)))}const D=e?e[S*2]:m.physX,E=e?e[S*2+1]:m.physY;return[{x:D,y:E,text:h,fontSize:Xe(m,h),color:b,align:"center"}]})}function Gt(t){return t==="top"?Math.PI/2:t==="bottom"?-Math.PI/2:t==="left"?Math.PI:0}function Ge(t,e,n=720){const{center:i,radius:s,notch:a}=t,o=B=>G(e,B.x,B.y);if(!(a!==void 0&&t.diameter>150)){const B=[];for(let f=0;f<=n;f++){const u=2*Math.PI*f/n;B.push(o(ze(t,u)))}return[{kind:"wafer-boundary",...Y(B,!0),lineColor:"#888888",lineWidth:1}]}const d=1.25,p=a.length,x=Gt(a.type),$=Math.atan2(p,s),V=s-d,I=[];let y=!1;for(let B=0;B<=n;B++){const f=2*Math.PI*B/n;let u=f-x;for(;u>Math.PI;)u-=2*Math.PI;for(;u<-Math.PI;)u+=2*Math.PI;if(Math.abs(u)<=$){if(!y){y=!0;const m={x:i.x+s*Math.cos(x-$),y:i.y+s*Math.sin(x-$)},S={x:i.x+V*Math.cos(x),y:i.y+V*Math.sin(x)},h={x:i.x+s*Math.cos(x+$),y:i.y+s*Math.sin(x+$)};I.push(o(m),o(S),o(h))}continue}I.push(o({x:i.x+s*Math.cos(f),y:i.y+s*Math.sin(f)}))}return[{kind:"wafer-boundary",...Y(I,!0),lineColor:"#888888",lineWidth:1}]}function Qe(t,e,n,i=360){const s=[],a=Math.max(1,Math.floor(n));for(let o=1;o<a;o++){const r=t.radius*o/a,d=[];for(let p=0;p<=i;p++){const x=2*Math.PI*p/i,$={x:t.center.x+r*Math.cos(x),y:t.center.y+r*Math.sin(x)};d.push(G(e,$.x,$.y))}s.push({kind:"ring-boundary",...Y(d,!0),lineColor:"rgba(255,255,255,0.7)",lineWidth:1.5})}return s}function Ue(t,e,n,i){const{x:s,y:a}=t.center,o=t.radius,r=(f,u)=>G(e,f,u),d=n-s,p=Math.sqrt(Math.max(0,o*o-d*d)),x=r(n,a-p),$=r(n,a+p),V=i-a,I=Math.sqrt(Math.max(0,o*o-V*V)),y=r(s-I,i),B=r(s+I,i);return[{kind:"quadrant-boundary",...Y([x,$]),lineColor:"rgba(255,255,255,0.7)",lineWidth:1.5},{kind:"quadrant-boundary",...Y([y,B]),lineColor:"rgba(255,255,255,0.7)",lineWidth:1.5}]}function Je(t,e){return t.map(n=>{const i=n.width/2,s=n.height/2;return{kind:"reticle",points:[[[n.x-i,n.y-s],[n.x+i,n.y-s],[n.x+i,n.y+s],[n.x-i,n.y+s]].map(([o,r])=>G(e,o,r))],closed:!0,lineColor:"rgba(255,255,255,0.7)",lineWidth:1.5,fill:"rgba(0,0,0,0)"}})}function Ze(t){const e=t.filter(n=>n.probeIndex!==void 0).sort((n,i)=>(n.probeIndex??0)-(i.probeIndex??0));return e.length?[{kind:"probe-path",...Y(e.map(n=>({x:n.physX,y:n.physY}))),lineColor:"rgba(220,80,0,0.55)",lineWidth:1}]:[]}function tn(t,e,n,i,s,a,o,r,d,p,x,$,V,I,y="off",B,f,u){const m=e.width-o,S=e.height-o,h=a?S:m,b=a?m:S,D=M=>s==="softBin"?M.sbin:M.hbin,E=M=>ut(M,B);if(e.partial){t.push({x:n,y:i,width:h,height:b,fill:qe,type:"stacked",metadata:e.metadata});return}if(e.edgeExcluded){t.push({x:n,y:i,width:h,height:b,fill:Ke,type:"stacked",metadata:e.metadata});return}if(d!==void 0&&(s==="hardBin"||s==="softBin")&&!d.has(D(e))){t.push({x:n,y:i,width:h,height:b,fill:Xt,type:"hardBin",metadata:e.metadata});return}if(u!==void 0&&s==="metadata"&&!u.has(E(e))){t.push({x:n,y:i,width:h,height:b,fill:Xt,type:"metadata",metadata:e.metadata});return}if(s==="value"){if(y==="test"){const q=U(e,x,I),ft=q===void 0?z:q?Mt:St;t.push({x:n,y:i,width:h,height:b,fill:ft,type:"value",metadata:e.metadata});return}const M=L(e,x),P=rt(M,I);let w,Z;M===void 0?w=z:y==="spec"?w=P==="failLow"?Ce:P==="failHigh"?St:Mt:(w=r.forValue(p(M)),(P==="failLow"||P==="failHigh")&&(Z=P)),t.push({x:n,y:i,width:h,height:b,fill:w,type:"value",specMark:Z,metadata:e.metadata});return}if(s==="hardBin"||s==="softBin"){const M=D(e),P=M!=null?r.forBin(M):z,w=M!=null&&Pe(e,V)===!1?!0:void 0;t.push({x:n,y:i,width:h,height:b,fill:P,type:s,binFail:w,metadata:e.metadata});return}if(s==="metadata"){const M=E(e),P=M!==void 0?f?.get(M)??z:z;t.push({x:n,y:i,width:h,height:b,fill:P,type:"metadata",metadata:e.metadata});return}const g=L(e,0),A=g!==void 0?r.forValue(p(g)):z;t.push({x:n,y:i,width:h,height:b,fill:A,type:"value",metadata:e.metadata})}function en(t,e,n){const i=t.radius;return Ee(e,i*.15,(s,a)=>({x:t.center.x+s*i*.9,y:t.center.y+a*i*.9}),n).overlays}export function buildView(t,e,n={},i){const s=n.reticles??[],{plotMode:a="value",showDieLabels:o=!1,showReticle:r=!1,showProbePath:d=!1,ringCount:p,showRingBoundaries:x=!1,showQuadrantBoundaries:$=!1,showXYIndicator:V=!1,binColorScheme:I="default",valueColorScheme:y="default",reverseValueScheme:B=!1,useDefinedBinColors:f=!0,binColors:u,passBins:m,highlightBin:S,highlightMetadataValue:h,interactiveTransform:b,valueRange:D,metadataValueOrder:E,testDefs:g,activeTest:A=0,activeMetadataKey:M,fallbackFormat:P="engineering",aggregationMethod:w,lotSize:Z,dataAxisFlip:q,isLotStack:ft=!1,logScale:Qt,colorbarRangeMode:Ut="spec",passFailDisplay:Jt}=n,It=Jt??"off",dt=i?.hbinDefs,ht=i?.sbinDefs,Tt=i?.metadataFields,Zt=Tt?.find(l=>l.key===M),te={x:(q?.x??!1)!==(b?.flipX??!1),y:(q?.y??!1)!==(b?.flipY??!1)},ee=dt?new Map(dt.map(l=>[l.bin,l])):null,ne=ht?new Map(ht.map(l=>[l.bin,l])):null,ae=a==="softBin"?ne:ee,Dt=ge({passBins:m},"buildView"),ie=new Set(Dt),mt=u&&Re(u,e)?u:Le(e,{passBins:Dt,binColorScheme:I,hbinDefs:dt,sbinDefs:ht,useDefinedBinColors:f}),se=a==="softBin"?mt.soft:mt.hard,Vt={forValue:je(Fe(y,B)),forBin:l=>se.get(l)??z};let{testNumber:H}=resolveTestNumber(A,g);if(!g?.length&&a==="value"){const l=Ot(e,"values");!l.includes(H)&&l.length&&(H=l[0])}let tt;if(Array.isArray(D))tt=D;else if(D){const{testNumber:l}=resolveTestNumber(D.test,g);tt=l===H?D.range:void 0}const T=findTestDef(g,H),Ct=a==="value"&&T!==void 0&&!vt(T),oe=T!==void 0&&(T.limitLow!==void 0||T.limitHigh!==void 0);let O="off";a==="value"&&(Ct?O="test":It==="spec"&&oe?O="spec":It==="test"&&e.some(l=>U(l,H,T)!==void 0)&&(O="test"));const Ft=O==="spec"?"spec":Ut,pt=a==="stackedValues"||a==="stackedBins"||a==="stackedSoftBins";let N,_,et=!1;if(tt){[N,_]=tt;let l=!0,c=!1;for(const v of e){const F=pt?L(v,0):L(v,H);if(F!==void 0&&(c=!0,!Number.isInteger(F))){l=!1;break}}et=c&&l}else{const l=!pt&&a==="value"&&Ft==="spec"&&T&&(T.limitLow!==void 0||T.limitHigh!==void 0);let c=1/0,v=-1/0,F=!0;for(const k of e){const W=pt?L(k,0):L(k,H);W!==void 0&&(W<c&&(c=W),W>v&&(v=W),Number.isInteger(W)||(F=!1))}isFinite(c)||(F=!1),et=F,l?(N=T.limitLow!==void 0?T.limitLow:isFinite(c)?c:0,_=T.limitHigh!==void 0?T.limitHigh:isFinite(v)?v:1):(N=isFinite(c)?c:0,_=isFinite(v)?v:1)}N===_&&(_=N+1);const Lt=Ct?!1:Qt??T?.logScale??!1,Rt=Lt&&N>0&&_>0,re=Rt;let nt;if(Rt){const l=Math.log10(N),c=Math.log10(_)-l;nt=v=>v<=0?0:Wt((Math.log10(v)-l)/c)}else nt=l=>Wt((l-N)/(_-N));const C=We(t,q,b);let Pt=null;if(t.notch){const l=Gt(t.notch.type),c=De(C.physicalToScreen,Math.cos(l)*t.radius,Math.sin(l)*t.radius),v=Math.hypot(c.x,c.y);v>0&&(Pt={x:c.x/v,y:c.y/v})}let j=1/0;for(let l=0;l<e.length;l++){const c=e[l];c.width<j&&(j=c.width),c.height<j&&(j=c.height)}const Nt=1,le=j!==1/0?Math.min(Nt,j*.12):Nt,Et=[],gt=[],ce=C.bakedToScreen.a===1&&C.bakedToScreen.b===0&&C.bakedToScreen.c===0&&C.bakedToScreen.d===1&&C.bakedToScreen.e===0&&C.bakedToScreen.f===0;let K=null;if(!ce){K=new Float64Array(e.length*2);for(let l=0;l<e.length;l++){const c=G(C.bakedToScreen,e[l].physX,e[l].physY);K[l*2]=c.x,K[l*2+1]=c.y}}const ue=Ve(C.gridToScreen),fe=a==="hardBin"||a==="softBin"||a==="stackedBins"||a==="stackedSoftBins",de=a==="softBin"||a==="stackedSoftBins";let at=fe?new Map:void 0;const yt=a==="value"&&O==="spec"?{pass:0,failHigh:0,failLow:0}:void 0,bt=a==="value"&&O==="test"?{pass:0,fail:0}:void 0,At=a==="metadata";let it=At?new Map:void 0,st=null;if(At&&M){const l=collectMetadataValues(e,M),c=E?.key===M?E.values:void 0,v=c?[...c,...l.filter(F=>!c.includes(F))]:l;st=new Map(v.map((F,k)=>[F,Zt?.values?.find(W=>W.value===F)?.color??Ae(k)]))}const he=S===void 0?void 0:new Set(Kt(S)),me=h===void 0?void 0:new Set(Kt(h));for(let l=0;l<e.length;l++){const c=e[l],v=K?K[l*2]:c.physX,F=K?K[l*2+1]:c.physY;if(gt.push({x:v,y:F}),at&&!c.partial&&!c.edgeExcluded){const k=de?c.sbin:c.hbin;k!=null&&at.set(k,(at.get(k)??0)+1)}if(yt&&!c.partial&&!c.edgeExcluded){const k=rt(L(c,H),T);k&&yt[k]++}if(bt&&!c.partial&&!c.edgeExcluded){const k=U(c,H,T);k!==void 0&&bt[k?"pass":"fail"]++}if(it&&!c.partial&&!c.edgeExcluded){const k=ut(c,M);k!==void 0&&it.set(k,(it.get(k)??0)+1)}tn(Et,c,v,F,a,ue,le,Vt,he,nt,H,ae,ie,T,O,M,st,me)}const Ht=o?generateTextOverlay(e,K,{plotMode:a,colorFns:Vt,normalize:nt,activeTest:A,valueRange:[N,_],testDefs:g,fallbackFormat:P,passFailDisplay:O,activeMetadataKey:M,metadataColorMap:st,allIntegerValues:et}):[],X=Ge(t,C.physicalToScreen);x&&X.push(...Qe(t,C.physicalToScreen,ye({ringCount:p},"buildView"))),$&&X.push(...Ue(t,C.physicalToScreen,t.center.x,t.center.y)),r&&X.push(...Je(s,C.gridToScreen)),d&&X.push(...Ze(e)),V&&X.push(...en(t,C.gridToScreen,Ht));const pe=gt.length>0?{minX:t.center.x-t.radius,maxX:t.center.x+t.radius,minY:t.center.y-t.radius,maxY:t.center.y+t.radius}:null,_t={rectangles:Et,hoverPoints:gt,texts:Ht,overlays:X,plotMode:a,binColorScheme:I,valueColorScheme:y,reverseValueScheme:B,binColors:mt,metadata:t.metadata??null,dies:e,valueRange:[N,_],allIntegerValues:et,testDefs:g,activeTest:A,logScale:re,logScaleRequested:Lt,aggrMethod:w,lotSize:Z,axisFlip:te,dataAxisFlip:{x:q?.x??!1,y:q?.y??!1},gridToScreen:C.gridToScreen,rotation:((t.orientation+(b?.rotation??0))%360+360)%360,hasReticle:s.length>0,isLotStack:ft,passFailDisplay:O,colorbarRangeMode:Ft,waferCenter:t.center,waferRadius:t.radius,notchDir:Pt,binCounts:at,metadataCounts:it,metadataColorMap:st,activeMetadataKey:M,metadataFields:Tt,specCounts:yt,passFailCounts:bt,dieBounds:pe};return n.compact?Ne(_t,n.compact,{showXYIndicator:V}):_t}export{getDieKey}from"../core/dies.js";
|