@wafertools/wafermap 0.38.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -3
- package/README.md +4 -3
- package/dist/packages/canvas-adapter/cellShade.d.ts +21 -0
- package/dist/packages/canvas-adapter/cellShade.js +1 -0
- package/dist/packages/canvas-adapter/charts/chartShell.d.ts +19 -3
- package/dist/packages/canvas-adapter/charts/chartShell.js +1 -1
- package/dist/packages/canvas-adapter/charts/commonality.js +4 -1
- package/dist/packages/canvas-adapter/charts/correlation.d.ts +11 -0
- package/dist/packages/canvas-adapter/charts/correlation.js +1 -1
- package/dist/packages/canvas-adapter/charts/divergingScale.d.ts +23 -0
- package/dist/packages/canvas-adapter/charts/divergingScale.js +1 -0
- package/dist/packages/canvas-adapter/charts/groupComparison.js +1 -1
- package/dist/packages/canvas-adapter/charts/palette.d.ts +10 -3
- package/dist/packages/canvas-adapter/charts/palette.js +1 -1
- package/dist/packages/canvas-adapter/charts/plotChart.d.ts +8 -0
- package/dist/packages/canvas-adapter/charts/plotChart.js +1 -1
- package/dist/packages/canvas-adapter/charts/regionYieldDiagram.js +1 -1
- package/dist/packages/canvas-adapter/charts/sweep.js +1 -1
- package/dist/packages/canvas-adapter/dataTab.js +1 -1
- package/dist/packages/canvas-adapter/differenceMapPanel.d.ts +1 -0
- package/dist/packages/canvas-adapter/differenceMapPanel.js +1 -1
- package/dist/packages/canvas-adapter/filterJson.d.ts +25 -0
- package/dist/packages/canvas-adapter/filterJson.js +5 -0
- package/dist/packages/canvas-adapter/insightsTab.js +1 -1
- package/dist/packages/canvas-adapter/pageFilter.js +2 -2
- package/dist/packages/canvas-adapter/plotEditor.js +10 -1
- package/dist/packages/canvas-adapter/plotJsonComplete.d.ts +46 -0
- package/dist/packages/canvas-adapter/plotJsonComplete.js +4 -0
- package/dist/packages/canvas-adapter/plotJsonHistory.d.ts +12 -0
- package/dist/packages/canvas-adapter/plotJsonHistory.js +1 -0
- package/dist/packages/canvas-adapter/plotJsonSuggest.d.ts +16 -0
- package/dist/packages/canvas-adapter/plotJsonSuggest.js +1 -0
- package/dist/packages/canvas-adapter/plotModal.js +1 -1
- package/dist/packages/canvas-adapter/plotTab.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/summaryPanel.js +4 -4
- package/dist/packages/canvas-adapter/sweepEditor.js +1 -1
- package/dist/packages/canvas-adapter/toCanvas.d.ts +1 -0
- package/dist/packages/canvas-adapter/toCanvas.js +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.d.ts +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.js +81 -43
- package/dist/packages/canvas-adapter/version.d.ts +2 -2
- package/dist/packages/canvas-adapter/version.js +1 -1
- package/dist/packages/canvas-adapter/virtualTable.d.ts +2 -0
- package/dist/packages/canvas-adapter/virtualTable.js +1 -1
- package/dist/packages/core/compact.js +2 -2
- package/dist/packages/core/dieTable.js +1 -1
- package/dist/packages/core/utils.d.ts +6 -0
- package/dist/packages/core/utils.js +1 -1
- package/dist/packages/renderer/fmt.js +1 -1
- package/dist/packages/stats/chartCatalogue.js +1 -1
- package/dist/packages/stats/coFailure.d.ts +11 -0
- package/dist/packages/stats/coFailure.js +1 -0
- package/dist/packages/stats/commonality.d.ts +37 -4
- package/dist/packages/stats/commonality.js +1 -1
- package/dist/packages/stats/correlation.d.ts +7 -0
- package/dist/packages/stats/correlation.js +1 -1
- package/dist/packages/stats/dieRegions.d.ts +2 -0
- package/dist/packages/stats/dieRegions.js +1 -1
- package/dist/packages/stats/differenceMap.d.ts +2 -0
- package/dist/packages/stats/differenceMap.js +1 -1
- package/dist/packages/stats/examplePicks.d.ts +6 -0
- package/dist/packages/stats/examplePicks.js +1 -1
- package/dist/packages/stats/groupEffects.d.ts +66 -0
- package/dist/packages/stats/groupEffects.js +1 -0
- package/dist/packages/stats/plotData.d.ts +11 -2
- package/dist/packages/stats/plotData.js +1 -1
- package/dist/packages/stats/plotSpec.d.ts +31 -2
- package/dist/packages/stats/plotSpec.js +4 -4
- package/dist/packages/stats/plotTable.d.ts +18 -0
- package/dist/packages/stats/plotTable.js +1 -0
- package/dist/packages/stats/renderFindingsReport.js +1 -1
- package/dist/packages/stats/renderSummaryReport.js +7 -7
- package/dist/packages/stats/reportHtml.js +18 -13
- package/dist/packages/stats/sweep.d.ts +3 -3
- package/dist/packages/stats/sweepXFromName.js +1 -1
- package/dist/packages/stats/synthesis.d.ts +19 -0
- package/dist/packages/stats/synthesis.js +1 -1
- package/dist/packages/stats/testsByWafer.d.ts +11 -0
- package/dist/packages/stats/testsByWafer.js +1 -0
- package/package.json +1 -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="wmap-wafer-map-user-guide">Wafer Map \u2014 User Guide<span class="wmap-guide-version" title="Built 2026-
|
|
75
|
+
<h1 id="wmap-wafer-map-user-guide">Wafer Map \u2014 User Guide<span class="wmap-guide-version" title="Built 2026-11-06T15:52:39.996Z">v0.40.0</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
|
|
@@ -163,7 +163,7 @@ results with no X/Y coordinates at all, for some or every die on a wafer.</p>
|
|
|
163
163
|
fabricated positions would risk being misread as real spatial layout. Instead the card shows a
|
|
164
164
|
compact summary matching the active plot mode: a <strong>bin breakdown</strong> (coloured the same as a
|
|
165
165
|
positioned card's own bin legend) for hard/soft-bin modes, or a <strong>histogram</strong> for value mode \u2014
|
|
166
|
-
coloured through the same colour scheme, log-scale, and
|
|
166
|
+
coloured through the same colour scheme, log-scale, and limit/data-range settings the map itself
|
|
167
167
|
uses, so switching those in the toolbar updates the chart the same way it would a real map. A
|
|
168
168
|
<strong>View die list</strong> toggle switches to the full per-die table (position/site, hard bin, soft bin,
|
|
169
169
|
every test value) with its own CSV export; <strong>View chart</strong> switches back.</p>
|
|
@@ -415,10 +415,11 @@ highlighting one bin at a time.</p>
|
|
|
415
415
|
<p>Use the <strong>Overlays</strong> menu to toggle optional display layers on and off:</p>
|
|
416
416
|
<ul>
|
|
417
417
|
<li><strong>Axis labels</strong> \u2014 the die coordinates along the bottom and left edges. They appear when you zoom; this row shows
|
|
418
|
-
them all the time, or hides them. <strong>Clear overlays</strong> returns to showing them on zoom
|
|
419
|
-
|
|
418
|
+
them all the time, or hides them. <strong>Clear overlays</strong> returns to showing them on zoom. Labels run across the dies
|
|
419
|
+
and no further, and sit clear of the legend wherever it is placed</li>
|
|
420
|
+
<li><strong>XY axis indicator</strong> \u2014 arrows showing which way the X and Y die coordinates run</li>
|
|
420
421
|
<li><strong>Ring boundaries</strong> \u2014 concentric ring divisions that match the spatial analysis zones</li>
|
|
421
|
-
<li><strong>Quadrant lines</strong> \u2014 divides the wafer into
|
|
422
|
+
<li><strong>Quadrant lines</strong> \u2014 divides the wafer into NE, NW, SE and SW quadrants</li>
|
|
422
423
|
<li><strong>Die coordinate labels</strong> \u2014 draws the (x, y) grid position inside each die (useful at high zoom)</li>
|
|
423
424
|
<li><strong>Reticle grid</strong> \u2014 stepper field grid (only shown when reticle geometry is configured)</li>
|
|
424
425
|
<li><strong>Limit pass/fail</strong> \u2014 pass/fail colouring for Test Value mode, judged against the test limits, when the active test defines them</li>
|
|
@@ -538,7 +539,7 @@ it as a file and send it to whoever supports this software.</p>
|
|
|
538
539
|
<tr>
|
|
539
540
|
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMS44IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPgogIDxyZWN0IHg9IjMiIHk9IjMiIHdpZHRoPSI0IiBoZWlnaHQ9IjE4IiByeD0iMSIvPgogIDxyZWN0IHg9IjEwIiB5PSIzIiB3aWR0aD0iNCIgaGVpZ2h0PSIxOCIgcng9IjEiLz4KICA8cmVjdCB4PSIxNyIgeT0iMyIgd2lkdGg9IjQiIGhlaWdodD0iMTgiIHJ4PSIxIi8+Cjwvc3ZnPgo=" width="20" height="20"></td>
|
|
540
541
|
<td>Columns</td>
|
|
541
|
-
<td>Sets the number of columns, or press <strong>1</strong> to <strong>5</strong>, or <strong>0</strong> for Auto, while the pointer is over the gallery or focus is in it. <strong>Auto</strong> fits as many cards as keep each die at least 6 px across, so a dense wafer gets a wider card and a window that cannot hold another column at that width keeps the columns it has; a number divides the full width between that many columns.</td>
|
|
542
|
+
<td>Sets the number of columns, or press <strong>1</strong> to <strong>5</strong>, or <strong>0</strong> for Auto, while the pointer is over the gallery or focus is in it; it offers no more columns than there are cards. <strong>Auto</strong> fits as many cards as keep each die at least 6 px across, so a dense wafer gets a wider card and a window that cannot hold another column at that width keeps the columns it has; a number divides the full width between that many columns.</td>
|
|
542
543
|
</tr>
|
|
543
544
|
<tr>
|
|
544
545
|
<td><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJub25lIiBzdHJva2U9IiMzNzQxNTEiIHN0cm9rZS13aWR0aD0iMS44IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik01IDNhMiAyIDAgMCAwLTIgMiIvPjxwYXRoIGQ9Ik0xOSAzYTIgMiAwIDAgMSAyIDIiLz48cGF0aCBkPSJNMjEgMTlhMiAyIDAgMCAxLTIgMiIvPjxwYXRoIGQ9Ik01IDIxYTIgMiAwIDAgMS0yLTIiLz48cGF0aCBkPSJNOSAzaDEiLz48cGF0aCBkPSJNOSAyMWgxIi8+PHBhdGggZD0iTTE0IDNoMSIvPjxwYXRoIGQ9Ik0xNCAyMWgxIi8+PHBhdGggZD0iTTMgOXYxIi8+PHBhdGggZD0iTTIxIDl2MSIvPjxwYXRoIGQ9Ik0zIDE0djEiLz48cGF0aCBkPSJNMjEgMTR2MSIvPjwvc3ZnPgo=" width="20" height="20"></td>
|
|
@@ -618,6 +619,13 @@ losing it, and the line stays, saying the filter is off, until you remove it. A
|
|
|
618
619
|
not have (a test this lot lacks) filters nothing, and the line says so.</p>
|
|
619
620
|
<p>The filter is view state, like <strong>Group by</strong>: it is not part of any plot or plots file, and a host application can remember
|
|
620
621
|
it for the next lot.</p>
|
|
622
|
+
<h4 id="wmap-filter-as-json">Filter as JSON</h4>
|
|
623
|
+
<p>The Filter window has a <strong>Conditions | JSON</strong> switch. JSON shows the same filter as text, which you can edit, paste into or
|
|
624
|
+
copy out of. The text is read as you type: the preview follows it, and <strong>Apply</strong> is held, with the reason under the text,
|
|
625
|
+
while it cannot be read. Suggestions list the filter's keys, the lot's own wafer fields and tests, and the values a field
|
|
626
|
+
takes (<strong>Suggest</strong> or Ctrl/Cmd+Space opens them by hand), and Ctrl/Cmd+Z steps back through the text. Pasting a saved
|
|
627
|
+
filters file with several filters offers each to choose from; anything the reader leaves out is named under the text.
|
|
628
|
+
Switching back to <strong>Conditions</strong> drops text that could not be read.</p>
|
|
621
629
|
<h4 id="wmap-saved-filters">Saved filters</h4>
|
|
622
630
|
<p>Conditions you use again can be saved. In the Filter window, type a name and press <strong>Save</strong> to keep the conditions you
|
|
623
631
|
have set; saving under a name already used updates that filter. <strong>Load</strong> puts a saved filter's conditions in the window
|
|
@@ -769,8 +777,8 @@ than measured dies.</li>
|
|
|
769
777
|
<strong>Dies</strong>: the selected dies, or the whole wafer, as a table.</p>
|
|
770
778
|
<hr>
|
|
771
779
|
<h2 id="wmap-findings-panel">5. Findings panel</h2>
|
|
772
|
-
<p>When spatial analysis has been run, the <strong>Findings</strong> panel lists statistically
|
|
773
|
-
detected patterns on the wafer. Open
|
|
780
|
+
<p>When spatial analysis has been run, the <strong>Findings</strong> section of the Summary panel lists statistically
|
|
781
|
+
detected patterns on the wafer. Open the panel with the toolbar's <strong>Summary</strong> button.</p>
|
|
774
782
|
<p>Each finding shows:</p>
|
|
775
783
|
<ul>
|
|
776
784
|
<li><strong>Severity</strong> \u2014 Unusual, Notable, or Minor (ordered most to least significant)</li>
|
|
@@ -783,7 +791,7 @@ filter. Changing the selection or the legend filter yourself releases the findin
|
|
|
783
791
|
<p><strong>Severity</strong> reflects how strong the statistical evidence is. <em>Unusual</em> findings
|
|
784
792
|
have both a very low adjusted p-value and a large effect size \u2014 they are reliably
|
|
785
793
|
important. <em>Notable</em> findings are statistically significant with a meaningful
|
|
786
|
-
effect but not as extreme. <em>
|
|
794
|
+
effect but not as extreme. <em>Minor</em> findings pass the significance threshold at
|
|
787
795
|
lower strength and are worth reviewing but may reflect smaller or noisier patterns.</p>
|
|
788
796
|
<p><strong>Test-value findings</strong> (a region reading high or low on a test) take the longest to compute, so
|
|
789
797
|
they are included automatically only when the data is small enough to take about a second. On
|
|
@@ -808,7 +816,7 @@ next to other failures (a spot touching a failing edge, say) is still reported a
|
|
|
808
816
|
</tr>
|
|
809
817
|
<tr>
|
|
810
818
|
<td><strong>Quadrant</strong></td>
|
|
811
|
-
<td>Yield or value difference between
|
|
819
|
+
<td>Yield or value difference between NE, NW, SE or SW quadrants</td>
|
|
812
820
|
</tr>
|
|
813
821
|
<tr>
|
|
814
822
|
<td><strong>Sector</strong></td>
|
|
@@ -880,7 +888,7 @@ field Group by offers (a process split, a lot, a test program). A group is judge
|
|
|
880
888
|
one value, the way Insights compares groups, adjusted over every field and test compared, and its size
|
|
881
889
|
is the shift in the test's within-wafer standard deviations, the scale a region's shift is measured on.
|
|
882
890
|
A field is one item however many tests it moves ("34 tests differ by Split. Largest: \u2026; next: \u2026"), with the tests
|
|
883
|
-
that moved most as its chips, so a corner lot does not fill the list with one split. Both are ranked on one scale, the share of the dies an item
|
|
891
|
+
that moved most as its chips, so a corner lot does not fill the list with one split. The same comparison is made on the wafers' yield and on the pass rate of the lot's weakest ring ("Yield is 4.7 points lower on probe card PC-B than on PC-A"); each set of groups is read after allowing for the strongest other one, and says so, and fields that group the wafers identically are one item that names them together. Groups that differ on two or more measures with no overlap but that the sample is too small to confirm are listed apart, under <em>Possible, not confirmed</em>. Its chart is a grid of the field's values by those tests, in z-scores (and a card that shows a bar per wafer draws the wafers under their group, in the group's colour, when Group by is on): blue where a group sits below the lot's average on a test, red where it sits above, so a process corner reads as a pattern of cells. Both are ranked on one scale, the share of the dies an item
|
|
884
892
|
affects: a loss by the dies it cost; a shift by its dies, counted in full from two standard deviations
|
|
885
893
|
and by the square of its size below that (a one-sigma shift counts a quarter of its dies); a trend by
|
|
886
894
|
how far it moved; a group's shift by the dies of the wafers that moved, weighted as a shift is; a Ppk under 1.0 by
|
|
@@ -1047,15 +1055,15 @@ bin 1 (Pass) or bin 2 (Fail) at that location.</em></p>
|
|
|
1047
1055
|
<h2 id="wmap-insights-tab">8. Insights tab</h2>
|
|
1048
1056
|
<p>The <strong>Insights</strong> side of the <strong>Maps | Insights</strong> switch (at the far right of the toolbar row, single map or
|
|
1049
1057
|
gallery) swaps the wafer view for a chart suite computed from the same die data \u2014 without leaving the
|
|
1050
|
-
toolbar. Choose <strong>Maps</strong> to return to the map; the switch stays where it is.
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
against once the map is replaced.</p>
|
|
1058
|
+
toolbar. Choose <strong>Maps</strong> to return to the map; the switch stays where it is. While Insights is open the
|
|
1059
|
+
buttons that act on the map, the <strong>Summary</strong> button among them, are hidden, since there is no map for the
|
|
1060
|
+
<a href="#wmap-summary-panel" onclick="(function(e){e.preventDefault();var g=e.target.closest('.wmap-guide');var el=g&&g.querySelector('[id=\\'wmap-summary-panel\\']');if(el)el.scrollIntoView({behavior:'smooth'});})(event)">Summary panel</a> to highlight; <strong>Maps</strong> brings them back.</p>
|
|
1054
1061
|
<p>The <a href="https://wafertools.github.io/wafermap/charts/">Chart reference</a> describes every chart, plot and table: what it
|
|
1055
1062
|
shows, how to read it, when to reach for it and where to find it. This section covers how the tab works.</p>
|
|
1056
1063
|
<p>The <strong>Columns</strong> control beside <strong>Group by</strong> and <strong>Show</strong>, or the keys <strong>1</strong> to <strong>5</strong> (and <strong>0</strong> for Auto), sets how many columns of
|
|
1057
|
-
cards every section of the tab uses. <strong>Auto</strong> fits as many as the width holds at 420 px or more; a number
|
|
1058
|
-
and the choice stays while you move between the tabs
|
|
1064
|
+
cards every section of the tab uses. <strong>Auto</strong> fits as many as the width holds at 420 px or more; a number is the most columns a section uses, dividing the width that many ways,
|
|
1065
|
+
and the choice stays while you move between the tabs. A tab uses the smaller of that number and the cards in its fullest section, so a tab
|
|
1066
|
+
of two cards is two columns even with 4 chosen.</p>
|
|
1059
1067
|
<p>Any chart mark that stands for one wafer \u2014 a bar in <em>Yield by wafer</em>, a box in
|
|
1060
1068
|
<em>Test value distribution</em>, a point in <em>Wafer-to-wafer trend</em> \u2014 can be
|
|
1061
1069
|
right-clicked to chart that wafer on its own (see
|
|
@@ -1069,7 +1077,7 @@ own charts and sweeps (see <em>Plots</em> and <em>Sweep cards</em> below):</p>
|
|
|
1069
1077
|
<a href="https://wafertools.github.io/wafermap/charts/#reticle-cell-yield">Reticle cell yield</a>. With four or more wafers and wafer fields to compare, <a href="https://wafertools.github.io/wafermap/charts/#what-divides-yield">What divides yield</a>
|
|
1070
1078
|
ranks the fields by how clearly their groups differ; <strong>Group by</strong> on its row groups the whole tab by that field. With
|
|
1071
1079
|
Group by on, the yield bar and the pareto draw a bar per group (click a group's bar to see its wafers, <strong>Back</strong> to return). The
|
|
1072
|
-
pass-rate card offers up to three ways of judging, whichever the data supports: <strong>
|
|
1080
|
+
pass-rate card offers up to three ways of judging, whichever the data supports: <strong>Test limits</strong>, <strong>Tester flag</strong> and
|
|
1073
1081
|
<strong>Functional</strong>; when the first two disagree it says how many dies they judged differently. The card is the size of the
|
|
1074
1082
|
others whatever the number of tests: more than fit scroll. With nothing to judge it is left out.</p>
|
|
1075
1083
|
</li>
|
|
@@ -1159,12 +1167,12 @@ yield/box-plot rows.</em></p>
|
|
|
1159
1167
|
orange marginal, red poor; tests without limits are muted and dashed), a
|
|
1160
1168
|
per-wafer test-value box plot, and a value histogram. Clicking a capability
|
|
1161
1169
|
box drives the box plot and histogram onto that test.</em></p>
|
|
1162
|
-
<p><em>Correlation sub-tab: test-to-test Pearson correlation matrix (
|
|
1163
|
-
positive,
|
|
1170
|
+
<p><em>Correlation sub-tab: test-to-test Pearson correlation matrix (orange =
|
|
1171
|
+
positive, blue = negative; intensity = strength) and a die-level scatter
|
|
1164
1172
|
plot coloured by hard bin. Clicking a matrix cell drives the scatter plot
|
|
1165
1173
|
onto that pair.</em></p>
|
|
1166
1174
|
<h3 id="wmap-what-a-click-does">What a click does</h3>
|
|
1167
|
-
<p>Every mark on an Insights chart stands for something, and a click opens it
|
|
1175
|
+
<p>Every mark on an Insights chart stands for something, and a click opens it. A <strong>right-click</strong> on any mark opens the menu on what it counts, so on a mark that stands for dies a click and a right-click do the same; on a wafer's own mark, a click opens the wafer's map and a right-click its menu. The tooltip says which.</p>
|
|
1168
1176
|
<table>
|
|
1169
1177
|
<thead>
|
|
1170
1178
|
<tr>
|
|
@@ -1201,6 +1209,14 @@ onto that pair.</em></p>
|
|
|
1201
1209
|
<td>the menu on the dies it counts</td>
|
|
1202
1210
|
</tr>
|
|
1203
1211
|
<tr>
|
|
1212
|
+
<td>A cell of a <strong>heatmap</strong> (yield by ring or quadrant and wafer, re-probed dies, tests by wafer), or a bar of <strong>Yield by site</strong></td>
|
|
1213
|
+
<td>the menu on the dies the cell or bar counts (on every die of the wafer, for a cell of tests by wafer)</td>
|
|
1214
|
+
</tr>
|
|
1215
|
+
<tr>
|
|
1216
|
+
<td>The chart on a <strong>Worth a look</strong> card</td>
|
|
1217
|
+
<td>as the same chart anywhere else in Insights</td>
|
|
1218
|
+
</tr>
|
|
1219
|
+
<tr>
|
|
1204
1220
|
<td>A cell of the correlation matrix</td>
|
|
1205
1221
|
<td>that pair in the scatter</td>
|
|
1206
1222
|
</tr>
|
|
@@ -1219,7 +1235,7 @@ onto that pair.</em></p>
|
|
|
1219
1235
|
</tbody></table>
|
|
1220
1236
|
<p>The menu offers the charts and tables for just those dies (and your own plots), and its heading names
|
|
1221
1237
|
them, for example "412 dies in hard bin 3, across 13 wafers". A mark that has no dies behind it does nothing.
|
|
1222
|
-
Right-click on any wafer's bar, box or point opens the same menu for the whole wafer.</p>
|
|
1238
|
+
Right-click on any wafer's bar, box or point opens the same menu for the whole wafer. The exceptions only move within Insights and have no menu: a test in the process-capability chart and a cell of the correlation matrix.</p>
|
|
1223
1239
|
<h3 id="wmap-data-tables">Data tables</h3>
|
|
1224
1240
|
<p>The <strong>Data</strong> sub-tab shows the wafers Insights is scoped to as tables, one at a
|
|
1225
1241
|
time, chosen with the <strong>Statistics | Wafers | Dies</strong> control. It follows the
|
|
@@ -1228,15 +1244,24 @@ same "Group by" and "Show" scope as the charts.</p>
|
|
|
1228
1244
|
<li><strong>Statistics</strong> \u2014 the <strong>Test Values</strong> table (count, min, quartiles, mean, \u03C3,
|
|
1229
1245
|
Ppk, limits and the limit yield for each test, with its N stated) and the
|
|
1230
1246
|
<strong>Functional Tests</strong> pass-rate table. With "Group by" active there is one set
|
|
1231
|
-
per group
|
|
1247
|
+
per group, below one table that compares every test across the groups (a
|
|
1248
|
+
test's groups side by side, with its own CSV).</li>
|
|
1232
1249
|
<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
|
|
1233
1250
|
for each test, and the wafer's metadata. Only the rows in view are drawn, so a
|
|
1234
1251
|
lot of hundreds of thousands of dies scrolls smoothly. Click a column heading
|
|
1235
1252
|
to sort by it (again to reverse; a die with no value sorts last).</li>
|
|
1236
|
-
<li><strong>Wafers</strong> \u2014 one row per wafer:
|
|
1237
|
-
counts, the yield (the same figure as the yield chart),
|
|
1238
|
-
|
|
1253
|
+
<li><strong>Wafers</strong> \u2014 one row per wafer: the wafer, the field Group by divides it by, the die
|
|
1254
|
+
counts, the yield (the same figure as the yield chart), the mean of each test (the first
|
|
1255
|
+
50), then the other attributes that differ between wafers. Attributes the same on every
|
|
1256
|
+
wafer (lot, part type, tester\u2026) are named in a line above the table and kept in the export.</li>
|
|
1239
1257
|
</ul>
|
|
1258
|
+
<p><strong>Shading.</strong> Where a table compares values, a pale colour sits behind the number and the number is always
|
|
1259
|
+
printed: a group's or wafer's mean is blue below the average of its peers and warm above (the same two hues as the
|
|
1260
|
+
correlation matrix), a yield (or a share inside limits) is tinted red only when it falls a point or more short of its reference, as in the
|
|
1261
|
+
summary report: a wafer short of the lot's mean per-wafer yield, a group short of the best group's share inside limits, and
|
|
1262
|
+
nothing at all on a lot with nothing wrong. A Ppk is capable, marginal or poor, and in the Dies table a reading outside its
|
|
1263
|
+
test's limits is tinted warm. The <strong>Comparison by</strong>
|
|
1264
|
+
table in Distributions shades each group's mean among the groups the same way.</p>
|
|
1240
1265
|
<p>In the Dies table, <strong>click a row</strong> to show that die on its map: the table steps
|
|
1241
1266
|
aside (or Insights closes) and the die is ringed, on its own card in a gallery. The
|
|
1242
1267
|
ring goes with the next click on the map, or Esc.</p>
|
|
@@ -1253,18 +1278,18 @@ warns when that is more than a spreadsheet can open (1,048,576).</p>
|
|
|
1253
1278
|
<p>The <strong>My plots</strong> sub-tab is where you build your own charts. <strong>+ New plot</strong> starts one,
|
|
1254
1279
|
already filled in with the first two tests of the lot, and opens it beside a large
|
|
1255
1280
|
copy of the chart. <strong>Edit as plot</strong>, in the \u22EF menu of an Insights chart, opens that chart as a plot of your own (see
|
|
1256
|
-
<em>A chart's buttons</em> below). <strong>
|
|
1257
|
-
setting is for. They are chosen from the lot in view: the <em>lead</em> test is the one that varies most from wafer to
|
|
1281
|
+
<em>A chart's buttons</em> below). The <strong>My plots | Examples</strong> switch above the list shows one or the other, never both: <strong>Examples</strong> shows plots to start from, or to see what each chart and
|
|
1282
|
+
setting is for, each marked as an example; none is saved until you add it. They are chosen from the lot in view: the <em>lead</em> test is the one that varies most from wafer to
|
|
1258
1283
|
wafer (for a single wafer, the one that follows distance from the centre most), its partner the test that tracks it
|
|
1259
|
-
best, and the split is the lot field that best explains the lead test. The examples are a scatter of the lead
|
|
1284
|
+
best, and the split is the lot field that best explains the lead test. Each other lot field that divides the wafers' yield (a probe card, a tester) gets a bar of yield by its groups too; fields that group the wafers identically, such as a tester and the handler docked to it, each get one, so you can follow either. The examples are a scatter of the lead
|
|
1260
1285
|
test against its partner with a fitted line, a histogram with its
|
|
1261
|
-
normal curve, a box of the lead test by wafer, a bar of yield by the split, a line over wafer order with a \xB11 SD band, and a probability plot.
|
|
1286
|
+
normal curve, a box of the lead test by wafer, a bar of yield by the split, a line over wafer order with a \xB11 SD band, and a probability plot. The examples also show one of each newer
|
|
1262
1287
|
feature the lot can show: the most telling tests as one set rescaled to z-scores (a box per test, and a heatmap of
|
|
1263
1288
|
tests by wafer), the lead test by split and by wafer nested in split, panels by ring, the lead test by ranges of its
|
|
1264
1289
|
partner and of the distance from the centre, a pareto of the hard bins and each wafer's bin mix, the
|
|
1265
1290
|
lead test by PAT verdict, an individuals control chart (five or more wafers), a capability goal plot and a
|
|
1266
1291
|
pass-rate bar when tests have limits, and a sweep of the first
|
|
1267
|
-
tests in test order.
|
|
1292
|
+
tests in test order. Each example has <strong>Add to my plots</strong>, and <strong>Add all</strong> adds the ones you do not have yet and shows My plots, with an <strong>Undo</strong>; edit a plot to see how it is set. Every change you make there is drawn at once; there is no Apply
|
|
1268
1293
|
button, and the plot is kept as you go.</p>
|
|
1269
1294
|
<p>In <strong>Setup</strong>, choose the <strong>chart type</strong>, then the field for each role:</p>
|
|
1270
1295
|
<table>
|
|
@@ -1320,6 +1345,11 @@ button, and the plot is kept as you go.</p>
|
|
|
1320
1345
|
<td>every test with both limits as a point: how far off centre and how wide</td>
|
|
1321
1346
|
<td>the tests (all by default)</td>
|
|
1322
1347
|
</tr>
|
|
1348
|
+
<tr>
|
|
1349
|
+
<td><strong>Sweep</strong></td>
|
|
1350
|
+
<td>a run of tests read as one response curve, and the pair of curves measured against each other (see <a href="#wmap-sweep-cards" onclick="(function(e){e.preventDefault();var g=e.target.closest('.wmap-guide');var el=g&&g.querySelector('[id=\\'wmap-sweep-cards\\']');if(el)el.scrollIntoView({behavior:'smooth'});})(event)">Sweep cards</a>)</td>
|
|
1351
|
+
<td>the series of tests and where each one's X comes from</td>
|
|
1352
|
+
</tr>
|
|
1323
1353
|
</tbody></table>
|
|
1324
1354
|
<ul>
|
|
1325
1355
|
<li><strong>X axis</strong> and <strong>Y axis</strong> (a histogram has one <strong>Values</strong> field; a box or bar has
|
|
@@ -1488,6 +1518,11 @@ scatter or histogram of yield cannot, and says why.</li>
|
|
|
1488
1518
|
<p>When fields do not go together, the list says so before you choose: a field that would leave a plot that cannot be
|
|
1489
1519
|
drawn is dimmed in the <strong>X</strong>, <strong>Y</strong> and <strong>Colour</strong> lists with the reason after it, and does nothing when picked. A plot
|
|
1490
1520
|
that cannot be drawn says in words what is wrong and what to use instead.</p>
|
|
1521
|
+
<p>The <strong>JSON</strong> tab shows the plot as text, in the format of a saved plots file, for when a plot is easier to copy, share or
|
|
1522
|
+
paste in than to rebuild with the controls. Edit the text and choose <strong>Apply</strong>; the plot changes only then, and the tab says
|
|
1523
|
+
beforehand if a setting would be left out or the text is not a plot. Suggestions appear as you type inside a key or a string and after a comma, brace, colon or bracket, or on demand from the <strong>Suggest</strong> button or <strong>Ctrl/Cmd+Space</strong>: the plot's settings, the words a setting can take, your lot's test numbers and wafer fields. Use <strong>Up</strong> and <strong>Down</strong>, then <strong>Tab</strong> or <strong>Enter</strong> to accept, or <strong>Esc</strong> to close the list. A list that opened by itself leaves <strong>Enter</strong> as a new line until you type a letter or use the arrow keys; <strong>Tab</strong> always accepts. <strong>Discard edits</strong> drops text not yet applied;
|
|
1524
|
+
<strong>Ctrl/Cmd+Z</strong> (and <strong>Shift+Ctrl/Cmd+Z</strong>) step back and forward through the text you have typed, accepted or discarded and then through what you have applied, and the window's <strong>Reset</strong> and <strong>Cancel</strong> go back to the plot as it was when the window opened. <strong>Copy</strong> puts the text on the clipboard. The id is not part of the text, and a plots file can be pasted too, and when it holds several plots the tab lists them to choose one.</p>
|
|
1525
|
+
<p>A heatmap, or a scatter coloured by a number, also has <strong>Colours</strong> in Customise: blue to orange around zero (the automatic choice for values rescaled to a z-score), orange-red to blue for a yield or pass rate (bad to good), or any of the map's gradients (Viridis, Cividis, Plasma, Traffic and the rest), with <strong>Reverse colours</strong> to flip the direction. Blue to orange, orange-red to blue and Cividis stay distinguishable for the common kinds of colour blindness; Traffic and Jet do not, so they are offered by choice and never the automatic one. A gradient is stretched over the plot's own lowest and highest values, so it says "relative to this plot", not "above a target".</p>
|
|
1491
1526
|
<p>In <strong>Customise</strong>, the <strong>title</strong> and each <strong>axis title</strong> are written for you until
|
|
1492
1527
|
you type your own (the box shows what it would say, and clearing it brings that
|
|
1493
1528
|
back). If you type a title and later change the fields, the plot says when the title
|
|
@@ -1564,8 +1599,7 @@ questions:</p>
|
|
|
1564
1599
|
<p><strong>Plots in the right-click menu.</strong> Every saved plot is also a row in the menu that
|
|
1565
1600
|
opens on a selection or a wafer (<strong>Plots</strong> section), drawn over just those dies and
|
|
1566
1601
|
captioned with them.</p>
|
|
1567
|
-
<p
|
|
1568
|
-
a draft is kept only if you press <strong>Add to my plots</strong>.</p>
|
|
1602
|
+
<p>.</p>
|
|
1569
1603
|
<p>Every change is kept as you make it. If you make a mistake, <strong>Reset</strong> (under the settings) puts the plot back as it was
|
|
1570
1604
|
when you opened the editor, and <strong>Cancel</strong> does the same and closes it. Closing the window with its own button keeps what
|
|
1571
1605
|
you changed.</p>
|
|
@@ -1607,14 +1641,14 @@ test numbers and ranges, such as <code>1010, 1011, 1020..1030</code> (a range me
|
|
|
1607
1641
|
tests declared between its ends). Then choose where each test's X comes from:
|
|
1608
1642
|
<strong>Test order</strong> (the position in the run, labelled by test), <strong>Values</strong> (one
|
|
1609
1643
|
number per test, in the same order) or <strong>From test name</strong> (a pattern such as
|
|
1610
|
-
<code>
|
|
1644
|
+
<code>LEVEL_{x}</code>, for programs that record the swept value only in the test
|
|
1611
1645
|
text). The editor lists the first few test names with what your pattern reads
|
|
1612
1646
|
from each as you type, and <strong>Pattern examples</strong> shows worked ones: <code>@ {x}</code>
|
|
1613
1647
|
reads 0.55 from <code>Fmax @ 0.55 V</code>, and <code>-{x}</code> reads 5 from <code>1234-5</code>). Text that is not a test number or a range is flagged under the box,
|
|
1614
1648
|
naming the word, and is not applied, so the curve beside it never shows
|
|
1615
1649
|
something you did not mean. <strong>+ Add series</strong> adds a curve and <strong>Remove</strong> drops
|
|
1616
1650
|
one; the crossing and widths appear once there are two.</p>
|
|
1617
|
-
<p><strong>A sweep remembers what its tests were called.</strong> The editor
|
|
1651
|
+
<p><strong>A sweep remembers what its tests were called.</strong> The editor records each test's name
|
|
1618
1652
|
alongside its number. Open the sweep on a lot where a number now carries a different name (a test program that
|
|
1619
1653
|
reuses numbers for other measurements) and that test is not drawn: the card names it, and the crossing and widths
|
|
1620
1654
|
are not measured, rather than presenting another quantity as the original curve. Renaming a test in the selector
|
|
@@ -1673,7 +1707,7 @@ point to open this wafer") are left out. A chart on the <strong>My plots</s
|
|
|
1673
1707
|
its wafers and dies in the same place. The image takes the card's own background, so a dark
|
|
1674
1708
|
theme saves a dark chart. The file name identifies the lot, wafers and chart (see below).</p>
|
|
1675
1709
|
<p><strong>Printing.</strong> The dropdowns, toggles and buttons (Expand, the \u22EF menu button and, on the My plots tab, New
|
|
1676
|
-
plot,
|
|
1710
|
+
plot, Examples, Import, Export, Delete all, Edit, Duplicate and Delete) are left off the printed page.
|
|
1677
1711
|
In their place each chart prints a small block under its title giving the same settings and
|
|
1678
1712
|
lines as the saved image, so a printed histogram says which test it is of.</p>
|
|
1679
1713
|
<h3 id="wmap-names-of-saved-files">Names of saved files</h3>
|
|
@@ -1691,7 +1725,7 @@ exposure field from the lithography stepper \u2014 the group of dies exposed in
|
|
|
1691
1725
|
single step. This lets you correlate failure patterns with specific reticle
|
|
1692
1726
|
positions \u2014 useful for identifying stepper field signatures, alignment drift, or
|
|
1693
1727
|
mask defects.</p>
|
|
1694
|
-
<div data-wmap-demo="reticle" class="wmap-demo"></div><p>Reticle-position findings in the
|
|
1728
|
+
<div data-wmap-demo="reticle" class="wmap-demo"></div><p>Reticle-position findings in the Summary panel's Findings section highlight the specific field
|
|
1695
1729
|
positions that show elevated failure rates. Hovering any die also shows its
|
|
1696
1730
|
<strong>Reticle (column, row)</strong> position \u2014 its location within its own stepper
|
|
1697
1731
|
field \u2014 just below the die's coordinate in the tooltip.</p>
|
|
@@ -1728,10 +1762,14 @@ symmetric; the rank p is the check. Nothing here says <em>why</em> groups differ
|
|
|
1728
1762
|
</ul>
|
|
1729
1763
|
<h3 id="wmap-what-divides-yield">10.3 What divides yield</h3>
|
|
1730
1764
|
<p>The <strong>What divides yield</strong> card makes the comparison <a href="#wmap-comparing-groups-of-wafers" onclick="(function(e){e.preventDefault();var g=e.target.closest('.wmap-guide');var el=g&&g.querySelector('[id=\\'wmap-comparing-groups-of-wafers\\']');if(el)el.scrollIntoView({behavior:'smooth'});})(event)">Comparing groups of wafers</a> describes for every wafer field at once, for yield and for each of the five most
|
|
1731
|
-
common fail bins (a bin's value is its share of a wafer's judged dies).
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1765
|
+
common fail bins (a bin's value is its share of a wafer's judged dies). It has one row per field, showing its yield,
|
|
1766
|
+
or a fail bin when that differs more clearly. The <strong>Effect</strong> column draws the worst and the best group as two bars on a
|
|
1767
|
+
scale of 0 to 100%, each with its mean, with a sentence giving the gap in percentage points; hover a bar for the group's median,
|
|
1768
|
+
spread and wafer count. <strong>Confidence</strong> is <strong>Clear</strong> (q under 0.05),
|
|
1769
|
+
<strong>Possible</strong> (under 0.2) or <strong>Not clear</strong>, so the fields at the top separate the wafers more clearly than wafer-to-wafer
|
|
1770
|
+
noise would; hover it for q, Welch's p and the rank p. A button on a field opens its other measures. The <strong>Group by</strong>
|
|
1771
|
+
button regroups every chart by that field. Each field is read after allowing for the strongest other field that explains the same measure (and does not contain it): a probe card on wafers that also differ by recipe is ranked by what the recipe leaves, and its row says "allowing for" that field, with the degrees of freedom the removed means used charged to the p. Two limits are stated on the card itself: a field that gives every wafer its own value cannot be tested, and
|
|
1772
|
+
fields that change together (a lot and its start date, or a tester and the handler docked to it) cannot be told apart by the wafers; the card names each set of them, and names fields that nearly match (most wafers in matching groups) with how many wafers agree. A low q points to where
|
|
1735
1773
|
to look; it is not a cause. Tool, chamber and probe-card fields appear only when the host supplies them as wafer
|
|
1736
1774
|
attributes.</p>
|
|
1737
1775
|
<h3 id="wmap-the-cumulative-probability-plot">10.4 The cumulative probability plot</h3>
|
|
@@ -1839,14 +1877,14 @@ wafers; it does not change their limits, and it sees the body of the distributio
|
|
|
1839
1877
|
outlier analysis, and lists tests that shall use PAT limits at test (pin leakage, standby supply current, IDDQ, output
|
|
1840
1878
|
levels, propagation delays and others, in its Appendix 2). Nothing here checks a test's distribution or matches tests
|
|
1841
1879
|
to that list.</li>
|
|
1842
|
-
<li><strong>A floor of 30 passing values per wafer.</strong> That floor is
|
|
1880
|
+
<li><strong>A floor of 30 passing values per wafer.</strong> That floor is this library's own choice. The guideline's 1.35 is inexact for under 20 values,
|
|
1843
1881
|
and sets sample sizes only for static limits.</li>
|
|
1844
1882
|
<li><strong>Quartiles</strong> are found by interpolation between the ranked values, which the guideline does not specify.</li>
|
|
1845
1883
|
</ul>
|
|
1846
1884
|
<p>Neighbourhood screens (good die in a bad neighbourhood) are not part of AEC-Q001 and are not in this card.
|
|
1847
1885
|
Treat the counts as a way to find out where PAT would matter and which tests drive it.</p>
|
|
1848
1886
|
<h3 id="wmap-example-plots">10.13 Example plots</h3>
|
|
1849
|
-
<p><strong>
|
|
1887
|
+
<p><strong>Examples</strong> chooses its tests from the data in view rather than the order they are listed in. The <strong>lead test</strong>
|
|
1850
1888
|
is the one with the largest share of its variation lying between wafers (for a single wafer, the one most tied to
|
|
1851
1889
|
distance from the centre); its <strong>partner</strong> is the test that follows it most closely over a sample of dies (correlation
|
|
1852
1890
|
above 0.3); the <strong>split</strong> is the lot field whose groups explain most of the lead test's variation between wafers,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const WMAP_VERSION = "0.
|
|
2
|
-
export declare const WMAP_BUILD_TIME = "2026-
|
|
1
|
+
export declare const WMAP_VERSION = "0.40.0";
|
|
2
|
+
export declare const WMAP_BUILD_TIME = "2026-11-06T15:57:00.349Z";
|
|
3
3
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const WMAP_VERSION="0.
|
|
1
|
+
export const WMAP_VERSION="0.40.0",WMAP_BUILD_TIME="2026-11-06T15:57:00.349Z";
|
|
@@ -6,6 +6,8 @@ export interface VirtualColumn<R> {
|
|
|
6
6
|
sortKey?: (row: R) => number | string | undefined;
|
|
7
7
|
/** Right-align (numbers). */
|
|
8
8
|
numeric?: boolean;
|
|
9
|
+
/** A colour behind the cell (see cellShade.ts), or undefined for none. */
|
|
10
|
+
shade?: (row: R) => string | undefined;
|
|
9
11
|
}
|
|
10
12
|
export interface VirtualTableOptions<R> {
|
|
11
13
|
columns: VirtualColumn<R>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ensureStylesInjected as
|
|
1
|
+
import{ensureStylesInjected as _}from"./dieList.js";import{CLR as K,RADIUS as X}from"./toolbar.js";const G=64,J=260,P=7.4;export function createVirtualTable(u){const l=u.ownerDocument??document;_(l);const b=u.rowHeight??24,L=u.overscan??10,w=u.columns;let c=u.rows,y=null,C=-1,x=1,k=0,M=-1;const i=l.createElement("div");Object.assign(i.style,{overflow:"auto",flex:"1",minHeight:"0",minWidth:"0",border:`1px solid ${K.menuBorder}`,borderRadius:X.control}),i.tabIndex=0,i.setAttribute("role","region"),i.setAttribute("aria-label",u.ariaLabel);const d=l.createElement("table");d.className="wmap-dielist-table",d.setAttribute("aria-label",u.ariaLabel),d.style.tableLayout="fixed";const N=l.createElement("colgroup"),q=Math.min(c.length,50);let H=0;w.forEach(t=>{let n=t.header.length+2;for(let o=0;o<q;o++)n=Math.max(n,t.get(c[o]).length);const e=Math.max(G,Math.min(J,Math.round(n*P+20)));H+=e;const a=l.createElement("col");a.style.width=`${e}px`,N.appendChild(a)}),d.style.width=`${H}px`,d.style.minWidth="100%",d.appendChild(N);const R=l.createElement("thead"),O=l.createElement("tr"),S=[];w.forEach((t,n)=>{const e=l.createElement("th");e.className="wmap-dielist-th",e.scope="col",e.textContent=t.header,e.style.cursor="pointer",e.style.overflow="hidden",e.style.textOverflow="ellipsis",t.numeric&&(e.style.textAlign="right"),e.setAttribute("aria-sort","none"),e.tabIndex=0;const a=()=>U(n);e.addEventListener("click",a),e.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),a())}),S.push(e),O.appendChild(e)}),R.appendChild(O),d.appendChild(R);const $=l.createElement("tbody");d.appendChild($),i.appendChild(d);const D=()=>{const t=l.createElement("tr");t.setAttribute("aria-hidden","true");const n=l.createElement("td");return n.colSpan=w.length,n.style.padding="0",n.style.border="none",t.appendChild(n),t},F=D(),I=D(),z=t=>c[y?y[t]:t];function B(){return i.clientHeight>0?i.clientHeight:u.fallbackViewportHeight??480}function E(t=!1){const n=c.length,e=R.offsetHeight||b,a=Math.max(0,i.scrollTop-e),o=Math.max(0,Math.floor(a/b)-L),r=Math.min(n-1,Math.ceil((a+B())/b)+L);if(!t&&o===k&&r===M)return;k=o,M=r;const p=l.createDocumentFragment();F.firstElementChild.style.height=`${o*b}px`,I.firstElementChild.style.height=`${Math.max(0,n-1-r)*b}px`,p.appendChild(F);for(let s=o;s<=r;s++){const h=z(s),m=l.createElement("tr");m.style.height=`${b}px`,m.setAttribute("aria-rowindex",String(s+2));for(const g of w){const f=l.createElement("td");f.className="wmap-dielist-td",f.textContent=g.get(h),f.style.overflow="hidden",f.style.textOverflow="ellipsis",g.numeric&&(f.style.textAlign="right");const j=g.shade?.(h);j&&(f.style.background=j),m.appendChild(f)}if(u.onRowClick){m.style.cursor="pointer";const g=y?y[s]:s;m.addEventListener("click",()=>u.onRowClick(h,g))}p.appendChild(m)}p.appendChild(I),$.replaceChildren(p)}function U(t){C===t?x=x===1?-1:1:(C=t,x=1),S.forEach((n,e)=>n.setAttribute("aria-sort",e!==C?"none":x===1?"ascending":"descending")),S.forEach((n,e)=>{n.textContent=w[e].header+(e===C?x===1?" \u25B2":" \u25BC":"")}),T(),i.scrollTop=0,E(!0)}function T(){const t=c.length;if(C<0||t===0){y=null;return}const n=w[C],e=n.sortKey??n.get,a=new Array(t);for(let r=0;r<t;r++)a[r]=e(c[r]);const o=new Uint32Array(t);for(let r=0;r<t;r++)o[r]=r;o.sort((r,p)=>{const s=a[r],h=a[p],m=s===void 0||s===""||typeof s=="number"&&Number.isNaN(s),g=h===void 0||h===""||typeof h=="number"&&Number.isNaN(h);if(m||g)return m===g?r-p:m?1:-1;const f=typeof s=="number"&&typeof h=="number"?s-h:String(s).localeCompare(String(h),void 0,{numeric:!0});return f!==0?f*x:r-p}),y=o}let v=0;const A=l.defaultView,V=()=>{v||(A&&typeof A.requestAnimationFrame=="function"?v=A.requestAnimationFrame(()=>{v=0,E()}):E())};i.addEventListener("scroll",V);const W=typeof ResizeObserver<"u"?new ResizeObserver(()=>E()):null;return W?.observe(i),d.setAttribute("aria-rowcount",String(c.length+1)),E(!0),{el:i,get length(){return c.length},orderedRows(){const t=c,n=y;return(function*(){for(let e=0;e<t.length;e++)yield t[n?n[e]:e]})()},setRows(t){c=t,d.setAttribute("aria-rowcount",String(c.length+1)),T(),i.scrollTop=0,E(!0)},drawnRange:()=>({first:k,last:M}),destroy(){i.removeEventListener("scroll",V),W?.disconnect(),v&&A&&A.cancelAnimationFrame(v),i.remove()}}}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{hasPosition as a}from"./dies.js";const h={minRepeats:3,minScore:.75,maxDensity:.8};function
|
|
2
|
-
best periods: ${e.bestPeriods.map(n=>`${n.period} (${n.score.toFixed(3)})`).join(", ")}`:"";return`${t}: ${e.occupied} occupied of ${e.span}${s}, ${e.runs} runs; ${r}${o}`}export function formatMpwDiagnostics(t,e){return["
|
|
1
|
+
import{hasPosition as a}from"./dies.js";const h={minRepeats:3,minScore:.75,maxDensity:.8};function x(t,e){const s=t.length-e;if(s<2)return 0;let r=0,o=0,n=0,i=0,d=0;for(let u=0;u<s;u++){const p=t[u],l=t[u+e];r+=p,o+=l,n+=p*p,i+=l*l,d+=p*l}const f=n-r*r/s,c=i-o*o/s;return f<=0||c<=0?0:(d-r*o/s)/Math.sqrt(f*c)}function w(t,e,s){const r=Math.floor(t/e),o=[];if(s!==void 0&&s>=1){const n=Math.floor(s);for(let i=n;i<=r;i+=n)i>=2&&o.push(i)}else for(let n=2;n<=r;n++)o.push(n);return o}function g(t){if(t.length===0)return null;let e=1/0,s=-1/0;for(const n of t)n<e&&(e=n),n>s&&(s=n);const r=new Uint8Array(s-e+1);let o=0;for(const n of t)r[n-e]||(r[n-e]=1,o++);return{signal:r,count:o}}export function detectMpwPeriod(t,e={}){const{minRepeats:s,minScore:r,maxDensity:o}={...h,...e},{expectedPeriod:n}=e,i=g(t);if(!i)return null;const d=i.signal.length,f=i.count/d;if(f>o)return null;for(const c of w(d,s,n)){const u=x(i.signal,c);if(u>=r)return{period:c,score:u,repeats:Math.floor(d/c),occupiedFraction:f}}return null}function m(t,e){const{minRepeats:s,maxDensity:r}={...h,...e},o=detectMpwPeriod(t,e);if(o)return{kind:"periodic",...o};const n=g(t);return n&&n.count>=s&&n.count/n.signal.length>r?{kind:"dense",occupiedFraction:n.count/n.signal.length}:{kind:"none"}}export function detectMpwLayout(t,e={}){const{reticle:s,...r}=e,o=new Set,n=new Set;for(const c of t)a(c)&&(o.add(c.x),n.add(c.y));const i=m([...o],{...r,expectedPeriod:s?.width}),d=m([...n],{...r,expectedPeriod:s?.height}),f=i.kind==="periodic"&&(d.kind==="periodic"||d.kind==="dense")||d.kind==="periodic"&&i.kind==="dense";return{x:i,y:d,offered:f}}function y(t,e){const s=[0,...e,t],r=new Int32Array(t);for(let o=0;o+1<s.length;o++)r.fill(o,s[o],s[o+1]);return{ids:r,bounds:s}}function $(t){const e=[...t].sort((o,n)=>o-n),s=[],r=new Map;return e.forEach((o,n)=>{r.set(o,n),n>0&&o-e[n-1]>1&&s.push(n)}),{sorted:e,breaks:s,indexOf:r}}export function buildCompactMap(t){const e=new Set,s=new Set;for(const c of t)a(c)&&(e.add(c.x),s.add(c.y));const r=$(e),o=$(s),n=y(r.sorted.length,r.breaks),i=y(o.sorted.length,o.breaks),d=new Set;for(const c of t)a(c)&&d.add(n.ids[r.indexOf.get(c.x)]*i.bounds.length+i.ids[o.indexOf.get(c.y)]);return{groups:[...d].sort((c,u)=>c-u).map(c=>{const u=Math.floor(c/i.bounds.length),p=c%i.bounds.length;return{columns:[n.bounds[u],n.bounds[u+1]],rows:[i.bounds[p],i.bounds[p+1]]}}),columns:r.sorted,rows:o.sorted,columnBreaks:r.breaks,rowBreaks:o.breaks,columnOf:c=>r.indexOf.get(c),rowOf:c=>o.indexOf.get(c)}}export function compactDies(t,e){const s=e&&"columnOf"in e?e:buildCompactMap(e??t),r=[];for(const o of t){if(!a(o))continue;const n=s.columnOf(o.x),i=s.rowOf(o.y);if(n===void 0||i===void 0)throw new RangeError(`compactDies: die (${o.x}, ${o.y}) is outside the compact layout`);r.push({die:o,column:n,row:i})}return{placements:r,map:s}}export function compactLayoutOffered(t,e,s={}){return detectMpwLayout(t,{...s,reticle:b(e)}).offered}function b(t){const e=t[0];return e&&t.every(s=>s&&s.width===e.width&&s.height===e.height)?{width:e.width,height:e.height}:void 0}function k(t,e){const{minRepeats:s}={...h,...e},r=g(t);if(!r)return{occupied:0,span:0,runs:0,pattern:{kind:"none"},bestPeriods:[]};let o=0;r.signal.forEach((i,d)=>{i&&!r.signal[d-1]&&o++});const n=[];for(const i of w(r.signal.length,s,e.expectedPeriod))n.push({period:i,score:x(r.signal,i)});return n.sort((i,d)=>d.score-i.score||i.period-d.period),{occupied:r.count,span:r.signal.length,runs:o,pattern:m(t,e),bestPeriods:n.slice(0,5)}}export function diagnoseMpwLayout(t,e,s={}){const r=b(e),o=new Set,n=new Set;let i=0;for(const d of t)a(d)&&(i++,o.add(d.x),n.add(d.y));return{wafers:e.length,positionedDies:i,unpositionedDies:t.length-i,groups:buildCompactMap(t).groups.length,reticle:r,offered:detectMpwLayout(t,{...s,reticle:r}).offered,thresholds:{...h,...s},columns:k([...o],{...s,expectedPeriod:r?.width}),rows:k([...n],{...s,expectedPeriod:r?.height})}}function D(t,e){const s=e.span>0?` (${(100*e.occupied/e.span).toFixed(1)}%)`:"",r=e.pattern.kind==="periodic"?`periodic, period ${e.pattern.period}, score ${e.pattern.score.toFixed(3)}, ${e.pattern.repeats} repeats`:e.pattern.kind==="dense"?"dense, nothing to compact":"no repeating pattern found",o=e.bestPeriods.length?`
|
|
2
|
+
best periods: ${e.bestPeriods.map(n=>`${n.period} (${n.score.toFixed(3)})`).join(", ")}`:"";return`${t}: ${e.occupied} occupied of ${e.span}${s}, ${e.runs} runs; ${r}${o}`}export function formatMpwDiagnostics(t,e){return["compact-layout diagnostics (format 1)",`library: ${e}`,"Counts and scores only: no die coordinates, bins, test values or wafer identity.",`wafers: ${t.wafers}`,`dies: ${t.positionedDies} positioned, ${t.unpositionedDies} without a position`,`reticle size: ${t.reticle?`${t.reticle.width} x ${t.reticle.height} (supplied by every wafer)`:"not supplied"}`,`compact layout offered: ${t.offered?"yes":"no"}`,`groups of dies: ${t.groups}`,`thresholds: minRepeats ${t.thresholds.minRepeats}, minScore ${t.thresholds.minScore}, maxDensity ${t.thresholds.maxDensity}`,D("columns",t.columns),D("rows",t.rows)].join(`
|
|
3
3
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasAnyKey as N}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"),
|
|
1
|
+
import{hasAnyKey as N}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"),d=Symbol("wmap.dieRow");export function linkDie(e,t,s){return e[l]=t,e[d]=s,e}export function dieLink(e){const t=e[l];return t===void 0?void 0:{table:t,row:e[d]}}export function tableFromRows(e){const t=e.length,s=new Map,o=new Map,r=new Uint8Array(t),n=P(s,()=>new Float64Array(t).fill(O)),c=P(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 a=n(f),x=Object.values(f);for(let b=0;b<a.length;b++)a[b][u]=x[b]}const i=e[u].testPass;if(i){r[u]|=HAS_VERDICTS;const a=c(i),x=Object.values(i);for(let b=0;b<a.length;b++)a[b][u]=x[b]?VERDICT_PASS:VERDICT_FAIL}}return{rows:t,values:g(s),verdicts:g(o),fields:r}}function P(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 g(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[d];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 excludedCountFor(e,t){let s=0,o;for(const r of e){const n=r[l],c=n?.excluded?.get(t);c===void 0||Number.isNaN(c[r[d]])||(s++,o??=n.excludedBy)}return s>0&&o!==void 0?{count:s,by:o}:void 0}export function excludedBy(e){return e[l]?.excludedBy}export function excludedValue(e,t){const o=e[l]?.excluded?.get(t)?.[e[d]];return o===void 0||Number.isNaN(o)?void 0:o}export function rowView(e){const t=linkDie({},e,0);return s=>(t[d]=s,t)}function w(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 v(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(w(this[l],this[d]))}function k(){return Object.freeze(v(this[l],this[d]))}function m(e){return function(){throw new TypeError(`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 y={get:j,set:m("testValues"),enumerable:!0,configurable:!0},V={get:k,set:m("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[d],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=w(t,s)),o&HAS_VERDICTS&&(n.testPass=v(t,s)),n):(Object.defineProperty(n,l,p(t)),Object.defineProperty(n,d,p(s)),o&HAS_VALUES&&Object.defineProperty(n,"testValues",y),o&HAS_VERDICTS&&Object.defineProperty(n,"testPass",V),n)}export function copyDie(e,t){const s=e[l];if(s===void 0)return{...e,...t};const o=e[d],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=w(s,o)),r&HAS_VERDICTS&&!("testPass"in t)&&(n.testPass=v(s,o)),Object.assign(n,t)):(Object.assign(n,t),Object.defineProperty(n,l,p(s)),Object.defineProperty(n,d,p(o)),r&HAS_VALUES&&Object.defineProperty(n,"testValues",y),r&HAS_VERDICTS&&Object.defineProperty(n,"testPass",V),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 a=s.get(i.table);a===void 0&&(s.set(i.table,a=t.length),t.push(i.table)),r[n++]=a,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,d,p(c)),f&HAS_VALUES&&Object.defineProperty(r,"testValues",y),f&HAS_VERDICTS&&Object.defineProperty(r,"testPass",V)}}export function testValue(e,t){const s=e[l];if(s===void 0)return e.testValues?.[t];const o=s.values.get(t)?.[e[d]];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[d]];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 N(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 N(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)}
|
|
@@ -44,6 +44,12 @@ export declare function hasAnyKey<T extends object>(obj: T | null | undefined):
|
|
|
44
44
|
* Returns 0 for an empty array, matching the callers that treat "no values" as no
|
|
45
45
|
* extent rather than as ±Infinity.
|
|
46
46
|
*/
|
|
47
|
+
/**
|
|
48
|
+
* A spread this small, as a share of the level it sits on, is noise to colour: a scale stretched over it would make a
|
|
49
|
+
* hundredth of a percent look as large as any other difference. Colour scales are widened to at least this share of the
|
|
50
|
+
* mean, and a set of means within it is left unshaded.
|
|
51
|
+
*/
|
|
52
|
+
export declare const NEGLIGIBLE_SPREAD = 0.01;
|
|
47
53
|
export declare function minOf(values: readonly number[]): number;
|
|
48
54
|
export declare function maxOf(values: readonly number[]): number;
|
|
49
55
|
export declare function clamp01(v: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function compareNatural(t,r){return t.localeCompare(r,"en",{numeric:!0})}export function prettyKey(t){return t.replace(/([A-Z])/g," $1").replace(/_/g," ").trim().replace(/^./,r=>r.toUpperCase())}export function hasAnyKey(t){if(t==null)return!1;for(const r in t)if(Object.hasOwn(t,r))return!0;return!1}export function minOf(t){if(t.length===0)return 0;let r=t[0];for(let e=1;e<t.length;e++)t[e]<r&&(r=t[e]);return r}export function maxOf(t){if(t.length===0)return 0;let r=t[0];for(let e=1;e<t.length;e++)t[e]>r&&(r=t[e]);return r}export function clamp01(t){return Math.max(0,Math.min(1,t))}export function mean(t){if(t.length===0)return NaN;let r=0;for(const e of t)r+=e;return r/t.length}export function medianOfSorted(t){const r=t.length;if(r===0)return 0;const e=Math.floor(r/2);return r%2===1?t[e]:(t[e-1]+t[e])/2}export function median(t){return medianOfSorted([...t].sort((r,e)=>r-e))}export function percentile98(t){if(t.length===0)return 0;const r=Float64Array.from(t);r.sort();const e=Math.floor(r.length*.98);return r[Math.min(e,r.length-1)]}export function modeOf(t){if(!t.length)return null;const r=new Map;for(const o of t)r.set(o,(r.get(o)??0)+1);let e=0,n=t[0];for(const[o,f]of r)f>e&&(e=f,n=o);return n}const i=/^[=+\-@]/;export function csvField(t){const r=i.test(t)&&Number.isNaN(Number(t))?`'${t}`:t;return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r}export function escHtml(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}export function arrayEqual(t,r){if(t===r)return!0;if(!t||!r||t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==r[e])return!1;return!0}export function mapEqual(t,r){if(t===r)return!0;if(!t||!r||t.size!==r.size)return!1;for(const[e,n]of t)if(!r.has(e)||r.get(e)!==n)return!1;return!0}export function setEqual(t,r){if(t===r)return!0;if(!t||!r||t.size!==r.size)return!1;for(const e of t)if(!r.has(e))return!1;return!0}export function drain(t){let r=t.next();for(;!r.done;)r=t.next();return r.value}export function asList(t){return t===void 0?[]:Array.isArray(t)?t:[t]}export function toggleHighlight(t,r,e){const n=asList(t),o=e?n.includes(r)?n.filter(f=>f!==r):[...n,r]:n.length===1&&n[0]===r?[]:[r];return o.length===0?void 0:o.length===1?o[0]:o}
|
|
1
|
+
export function compareNatural(t,r){return t.localeCompare(r,"en",{numeric:!0})}export function prettyKey(t){return t.replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/_/g," ").trim().replace(/^./,r=>r.toUpperCase())}export function hasAnyKey(t){if(t==null)return!1;for(const r in t)if(Object.hasOwn(t,r))return!0;return!1}export const NEGLIGIBLE_SPREAD=.01;export function minOf(t){if(t.length===0)return 0;let r=t[0];for(let e=1;e<t.length;e++)t[e]<r&&(r=t[e]);return r}export function maxOf(t){if(t.length===0)return 0;let r=t[0];for(let e=1;e<t.length;e++)t[e]>r&&(r=t[e]);return r}export function clamp01(t){return Math.max(0,Math.min(1,t))}export function mean(t){if(t.length===0)return NaN;let r=0;for(const e of t)r+=e;return r/t.length}export function medianOfSorted(t){const r=t.length;if(r===0)return 0;const e=Math.floor(r/2);return r%2===1?t[e]:(t[e-1]+t[e])/2}export function median(t){return medianOfSorted([...t].sort((r,e)=>r-e))}export function percentile98(t){if(t.length===0)return 0;const r=Float64Array.from(t);r.sort();const e=Math.floor(r.length*.98);return r[Math.min(e,r.length-1)]}export function modeOf(t){if(!t.length)return null;const r=new Map;for(const o of t)r.set(o,(r.get(o)??0)+1);let e=0,n=t[0];for(const[o,f]of r)f>e&&(e=f,n=o);return n}const i=/^[=+\-@]/;export function csvField(t){const r=i.test(t)&&Number.isNaN(Number(t))?`'${t}`:t;return/[",\n\r]/.test(r)?`"${r.replace(/"/g,'""')}"`:r}export function escHtml(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}export function arrayEqual(t,r){if(t===r)return!0;if(!t||!r||t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==r[e])return!1;return!0}export function mapEqual(t,r){if(t===r)return!0;if(!t||!r||t.size!==r.size)return!1;for(const[e,n]of t)if(!r.has(e)||r.get(e)!==n)return!1;return!0}export function setEqual(t,r){if(t===r)return!0;if(!t||!r||t.size!==r.size)return!1;for(const e of t)if(!r.has(e))return!1;return!0}export function drain(t){let r=t.next();for(;!r.done;)r=t.next();return r.value}export function asList(t){return t===void 0?[]:Array.isArray(t)?t:[t]}export function toggleHighlight(t,r,e){const n=asList(t),o=e?n.includes(r)?n.filter(f=>f!==r):[...n,r]:n.length===1&&n[0]===r?[]:[r];return o.length===0?void 0:o.length===1?o[0]:o}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{stepDecimals as m}from"./axisTicks.js";const M=[[1e12,"T"],[1e9,"G"],[1e6,"M"],[1e3,"k"],[1,""],[.001,"m"],[1e-6,"\xB5"],[1e-9,"n"],[1e-12,"p"],[1e-15,"f"]];export const SI_PREFIX_SCALE={T:1e12,G:1e9,M:1e6,k:1e3,m:.001,\u00B5:1e-6,u:1e-6,n:1e-9,p:1e-12,f:1e-15},KNOWN_BASE_UNITS=["Hz","V","A","W","F","\u03A9","Ohm","ohm","S","H","J","C","s"];function p(
|
|
1
|
+
import{stepDecimals as m}from"./axisTicks.js";const M=[[1e12,"T"],[1e9,"G"],[1e6,"M"],[1e3,"k"],[1,""],[.001,"m"],[1e-6,"\xB5"],[1e-9,"n"],[1e-12,"p"],[1e-15,"f"]];export const SI_PREFIX_SCALE={T:1e12,G:1e9,M:1e6,k:1e3,m:.001,\u00B5:1e-6,u:1e-6,n:1e-9,p:1e-12,f:1e-15},KNOWN_BASE_UNITS=["Hz","V","A","W","F","\u03A9","Ohm","ohm","S","H","J","C","s"];function p(e){for(const t of KNOWN_BASE_UNITS)if(e.length===t.length+1&&e.endsWith(t)){const n=e[0];if(n in SI_PREFIX_SCALE)return{preScale:SI_PREFIX_SCALE[n],base:t}}return{preScale:1,base:e}}export function nameStatesUnit(e,t){if(!e||!t)return!1;let n=e.trimEnd();if((n.endsWith(")")||n.endsWith("]"))&&(n=n.slice(0,-1)),!n.endsWith(t))return!1;const r=n.length===t.length?"":n[n.length-t.length-1];return r===""||/[\s_\-/([]/.test(r)}function S(e,t){const{preScale:n,base:r}=p(t),i=e*n,o=Math.abs(i),[c,u]=M.find(([s])=>o>=s*.9999)??[1e-15,"f"],h=i/c,g=Math.abs(h),a=g>=100?0:g>=10?1:2;return`${h.toFixed(a)} ${u}${r}`}function E(e){const t=Math.abs(e);if(t===0)return"0%";const n=t>=100?0:t>=10?1:t>=1?2:Math.min(6,1-Math.floor(Math.log10(t)));return`${e.toFixed(n)}%`}function A(e){const t=Math.abs(e),n=Math.floor(Math.log10(t)/3)*3,r=Math.max(-15,Math.min(12,n)),i=e/Math.pow(10,r),o=Math.abs(i),c=o>=100?0:o>=10?1:2,u=r===0?"":`E${r>0?"+":""}${r}`;return`${i.toFixed(c)}${u}`}export const AGGREGATION_METHOD_LABELS={mean:"mean",median:"median",stddev:"std dev",min:"min",max:"max",count:"count",countBin:"occurrence count",percent:"occurrence %"};export function fmtAggregationMethod(e){return AGGREGATION_METHOD_LABELS[e??""]??e??"aggregated"}export function plainBinTerms(e){return e.replace(/\bHBin\b/g,"hard bin").replace(/\bSBin\b/g,"soft bin")}export function fmtExact(e){if(!Number.isFinite(e)||Math.fround(e)!==e)return String(e);for(let t=1;t<=9;t++){const n=Number(e.toPrecision(t));if(Math.fround(n)===e)return String(n)}return String(e)}export function fmt(e,t,n){if(!isFinite(e))return String(e);if(t==="%")return E(e);const r=Math.abs(e);return r===0?t?`0 ${t}`:"0":t!==void 0?S(e,t):n==="si"?S(e,""):r>=.1&&r<1e4?r>=1e3?e.toFixed(0):r>=100?e.toFixed(1):r>=10?e.toFixed(2):e.toFixed(3):A(e)}function T(e,t){const n=t!==void 0&&t>0?m(t/e):void 0;return r=>{if(!isFinite(r))return String(r);if(r===0)return"0";const i=r/e;if(n!==void 0)return i.toFixed(n);const o=Math.abs(i),c=o>=100?0:o>=10?1:2;return i.toFixed(c)}}function _(e,t,n){if(t===void 0||!(t>0))return n;const r=m(t/e)+1;return i=>{if(!isFinite(i))return String(i);if(i===0)return"0";const o=(i/e).toFixed(r);return o.endsWith("0")?o.slice(0,r===1?-2:-1):o}}const I={"-":"\u207B",0:"\u2070",1:"\xB9",2:"\xB2",3:"\xB3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079"},F=e=>e===0?"":`\xD710${[...String(e)].map(t=>I[t]).join("")}`;export function fmtColorbarAxis(e,t,n,r="engineering",i){const o=Math.abs(e),c=(s,l,f,d)=>{const x=d&&i===void 0?d:T(s,i);return{tickFmt:x,edgeFmt:_(s,i,x),axisLabel:l,scaledUnit:f}};if(n==="%")return c(1,t?`${t} (%)`:"%","%");if(n&&nameStatesUnit(t,n)){const s=o===0||o>=.1&&o<1e4;return p(n).preScale!==1||s?c(1,t,n):fmtColorbarAxis(e,t,void 0,r,i)}if(n){const{preScale:s,base:l}=p(n),f=o*s,[d,x]=f===0?[1,""]:M.find(([$])=>f>=$*.9999)??[1e-15,"f"],b=`${x}${l}`;return c(d/s,t?`${t} (${b})`:b,b)}if(o===0||o>=.1&&o<1e4)return c(1,t??"","",s=>fmt(s,void 0,r));if(r==="si"){const[s]=M.find(([d])=>o>=d*.9999)??[1e-15,"f"],l=Math.round(Math.log10(s)),f=F(l);return c(s,t?f?`${t} (${f})`:t:f,f)}const u=Math.floor(Math.log10(o)/3)*3,h=Math.max(-15,Math.min(12,u)),g=Math.pow(10,h),a=F(h);return c(g,t?a?`${t} (${a})`:t:a,a)}
|