@wafertools/wafermap 0.35.1 → 0.37.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/AGENTS.md +13 -10
- package/CHANGELOG.md +474 -0
- package/README.md +7 -7
- package/dist/packages/canvas-adapter/chartPrefs.d.ts +16 -0
- package/dist/packages/canvas-adapter/chartPrefs.js +1 -0
- package/dist/packages/canvas-adapter/charts/capability.js +1 -1
- package/dist/packages/canvas-adapter/charts/cardAbout.d.ts +21 -0
- package/dist/packages/canvas-adapter/charts/cardAbout.js +1 -0
- package/dist/packages/canvas-adapter/charts/chartShell.d.ts +65 -12
- package/dist/packages/canvas-adapter/charts/chartShell.js +1 -1
- package/dist/packages/canvas-adapter/charts/commonality.d.ts +18 -0
- package/dist/packages/canvas-adapter/charts/commonality.js +1 -0
- package/dist/packages/canvas-adapter/charts/correlation.js +1 -1
- package/dist/packages/canvas-adapter/charts/groupComparison.d.ts +31 -0
- package/dist/packages/canvas-adapter/charts/groupComparison.js +1 -0
- package/dist/packages/canvas-adapter/charts/index.d.ts +0 -10
- package/dist/packages/canvas-adapter/charts/index.js +1 -1
- package/dist/packages/canvas-adapter/charts/patCard.d.ts +21 -0
- package/dist/packages/canvas-adapter/charts/patCard.js +1 -0
- package/dist/packages/canvas-adapter/charts/plotChart.d.ts +56 -2
- package/dist/packages/canvas-adapter/charts/plotChart.js +1 -1
- package/dist/packages/canvas-adapter/charts/pointInteractions.d.ts +2 -0
- package/dist/packages/canvas-adapter/charts/pointInteractions.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.d.ts +3 -0
- package/dist/packages/canvas-adapter/dataTab.js +1 -1
- package/dist/packages/canvas-adapter/dieList.d.ts +12 -0
- package/dist/packages/canvas-adapter/dieList.js +2 -2
- package/dist/packages/canvas-adapter/differenceMapPanel.d.ts +26 -0
- package/dist/packages/canvas-adapter/differenceMapPanel.js +1 -0
- package/dist/packages/canvas-adapter/drilldown.d.ts +3 -0
- package/dist/packages/canvas-adapter/drilldown.js +1 -1
- package/dist/packages/canvas-adapter/filterButton.d.ts +3 -0
- package/dist/packages/canvas-adapter/filterButton.js +1 -0
- package/dist/packages/canvas-adapter/filterEditor.d.ts +53 -0
- package/dist/packages/canvas-adapter/filterEditor.js +1 -0
- package/dist/packages/canvas-adapter/guideWindow.d.ts +9 -1
- package/dist/packages/canvas-adapter/guideWindow.js +1 -1
- package/dist/packages/canvas-adapter/icons.js +1 -1
- package/dist/packages/canvas-adapter/index.d.ts +1 -0
- package/dist/packages/canvas-adapter/index.js +1 -1
- package/dist/packages/canvas-adapter/insightsTab.d.ts +57 -2
- package/dist/packages/canvas-adapter/insightsTab.js +1 -1
- package/dist/packages/canvas-adapter/pageFilter.d.ts +84 -0
- package/dist/packages/canvas-adapter/pageFilter.js +2 -0
- package/dist/packages/canvas-adapter/patMaps.d.ts +26 -0
- package/dist/packages/canvas-adapter/patMaps.js +1 -0
- package/dist/packages/canvas-adapter/plotCard.d.ts +67 -0
- package/dist/packages/canvas-adapter/plotCard.js +1 -0
- package/dist/packages/canvas-adapter/plotEditor.d.ts +13 -2
- package/dist/packages/canvas-adapter/plotEditor.js +1 -1
- package/dist/packages/canvas-adapter/plotModal.js +1 -1
- package/dist/packages/canvas-adapter/plotStore.js +1 -1
- package/dist/packages/canvas-adapter/plotTab.d.ts +6 -0
- package/dist/packages/canvas-adapter/plotTab.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferGallery.d.ts +20 -5
- package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferMap.d.ts +71 -37
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/summaryPanel.d.ts +22 -9
- package/dist/packages/canvas-adapter/summaryPanel.js +4 -4
- package/dist/packages/canvas-adapter/testValueOffer.d.ts +14 -0
- package/dist/packages/canvas-adapter/testValueOffer.js +1 -0
- package/dist/packages/canvas-adapter/toCanvas.js +1 -1
- package/dist/packages/canvas-adapter/toolbar.d.ts +12 -6
- 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 +607 -117
- 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/aggregates.d.ts +10 -0
- package/dist/packages/core/aggregates.js +1 -1
- package/dist/packages/core/classify.d.ts +11 -0
- package/dist/packages/core/classify.js +1 -1
- package/dist/packages/core/dieTable.d.ts +5 -0
- package/dist/packages/core/dieTable.js +1 -1
- package/dist/packages/core/dies.d.ts +2 -0
- package/dist/packages/core/dies.js +1 -1
- package/dist/packages/core/wafer.d.ts +10 -1
- package/dist/packages/core/wafer.js +1 -1
- package/dist/packages/renderer/buildView.d.ts +5 -0
- package/dist/packages/renderer/buildView.js +1 -1
- package/dist/packages/renderer/buildWaferMap.d.ts +21 -4
- package/dist/packages/renderer/buildWaferMap.js +1 -1
- package/dist/packages/renderer/deprecate.d.ts +2 -8
- package/dist/packages/renderer/deprecate.js +1 -1
- package/dist/packages/renderer/derivedTests/parser.js +1 -1
- package/dist/packages/renderer/fmt.d.ts +10 -0
- package/dist/packages/renderer/fmt.js +1 -1
- package/dist/packages/renderer/index.d.ts +1 -0
- package/dist/packages/renderer/index.js +1 -1
- package/dist/packages/renderer/testLabel.d.ts +0 -11
- package/dist/packages/renderer/testLabel.js +1 -1
- package/dist/packages/renderer/valueFilter.d.ts +1 -1
- package/dist/packages/renderer/valueFilter.js +1 -1
- package/dist/packages/stats/analyzeWaferLot.d.ts +22 -0
- package/dist/packages/stats/analyzeWaferLot.js +1 -1
- package/dist/packages/stats/analyzeWaferMap.d.ts +26 -1
- package/dist/packages/stats/analyzeWaferMap.js +1 -1
- package/dist/packages/stats/binPareto.d.ts +2 -54
- package/dist/packages/stats/binPareto.js +1 -1
- package/dist/packages/stats/binRows.js +1 -1
- package/dist/packages/stats/capability.d.ts +10 -0
- package/dist/packages/stats/capability.js +1 -1
- package/dist/packages/stats/cardSpec.d.ts +53 -0
- package/dist/packages/stats/cardSpec.js +1 -0
- package/dist/packages/stats/chartCatalogue.d.ts +37 -0
- package/dist/packages/stats/chartCatalogue.js +1 -0
- package/dist/packages/stats/clusterDetection.d.ts +9 -0
- package/dist/packages/stats/clusterDetection.js +1 -1
- package/dist/packages/stats/commonality.d.ts +62 -0
- package/dist/packages/stats/commonality.js +1 -0
- package/dist/packages/stats/connectedComponents.js +1 -1
- package/dist/packages/stats/control.d.ts +21 -0
- package/dist/packages/stats/control.js +1 -0
- package/dist/packages/stats/correlation.d.ts +42 -4
- package/dist/packages/stats/correlation.js +1 -1
- package/dist/packages/stats/dieRegions.d.ts +4 -1
- package/dist/packages/stats/dieRegions.js +1 -1
- package/dist/packages/stats/differenceMap.d.ts +22 -0
- package/dist/packages/stats/differenceMap.js +1 -0
- package/dist/packages/stats/examplePicks.d.ts +22 -0
- package/dist/packages/stats/examplePicks.js +1 -0
- package/dist/packages/stats/filterFile.d.ts +41 -0
- package/dist/packages/stats/filterFile.js +2 -0
- package/dist/packages/stats/filterFindings.d.ts +21 -6
- package/dist/packages/stats/filterFindings.js +1 -1
- package/dist/packages/stats/findingText.d.ts +8 -0
- package/dist/packages/stats/findingText.js +2 -2
- package/dist/packages/stats/groupCompare.d.ts +87 -0
- package/dist/packages/stats/groupCompare.js +1 -0
- package/dist/packages/stats/guideSections.d.ts +55 -0
- package/dist/packages/stats/guideSections.js +1 -0
- package/dist/packages/stats/index.d.ts +5 -2
- package/dist/packages/stats/index.js +1 -1
- package/dist/packages/stats/lotDrift.js +1 -1
- package/dist/packages/stats/math.d.ts +29 -4
- package/dist/packages/stats/math.js +1 -1
- package/dist/packages/stats/mergeTestDefs.js +1 -1
- package/dist/packages/stats/metadataColumns.d.ts +3 -0
- package/dist/packages/stats/metadataColumns.js +1 -1
- package/dist/packages/stats/pat.d.ts +58 -0
- package/dist/packages/stats/pat.js +1 -0
- package/dist/packages/stats/patSummary.d.ts +45 -0
- package/dist/packages/stats/patSummary.js +1 -0
- package/dist/packages/stats/patternClassification.d.ts +3 -3
- package/dist/packages/stats/patternClassification.js +1 -1
- package/dist/packages/stats/plotData.d.ts +294 -17
- package/dist/packages/stats/plotData.js +1 -1
- package/dist/packages/stats/plotId.d.ts +2 -0
- package/dist/packages/stats/plotId.js +1 -1
- package/dist/packages/stats/plotReferences.d.ts +17 -0
- package/dist/packages/stats/plotReferences.js +1 -0
- package/dist/packages/stats/plotSpec.d.ts +239 -3
- package/dist/packages/stats/plotSpec.js +4 -4
- package/dist/packages/stats/regions.js +1 -1
- package/dist/packages/stats/renderSummaryReport.js +33 -33
- package/dist/packages/stats/reportHtml.d.ts +5 -12
- package/dist/packages/stats/reportHtml.js +98 -40
- package/dist/packages/stats/synthesis.d.ts +48 -16
- package/dist/packages/stats/synthesis.js +1 -1
- package/dist/packages/stats/testPassRate.d.ts +7 -0
- package/dist/packages/stats/testPassRate.js +1 -1
- package/dist/packages/stats/testValueBudget.d.ts +15 -0
- package/dist/packages/stats/testValueBudget.js +1 -0
- package/dist/packages/stats/types.d.ts +90 -30
- package/dist/packages/stats/yield.d.ts +3 -11
- package/dist/packages/stats/yield.js +1 -1
- package/llms.txt +1 -1
- package/package.json +2 -1
- package/dist/packages/canvas-adapter/charts/barPanel.d.ts +0 -83
- package/dist/packages/canvas-adapter/charts/barPanel.js +0 -1
- package/dist/packages/canvas-adapter/charts/binCluster.d.ts +0 -27
- package/dist/packages/canvas-adapter/charts/binCluster.js +0 -1
- package/dist/packages/canvas-adapter/charts/boxplot.d.ts +0 -72
- package/dist/packages/canvas-adapter/charts/boxplot.js +0 -1
- package/dist/packages/canvas-adapter/charts/groupedBarPlot.d.ts +0 -53
- package/dist/packages/canvas-adapter/charts/groupedBarPlot.js +0 -1
- package/dist/packages/canvas-adapter/charts/histogram.d.ts +0 -61
- package/dist/packages/canvas-adapter/charts/histogram.js +0 -1
- package/dist/packages/canvas-adapter/charts/scatter.d.ts +0 -80
- package/dist/packages/canvas-adapter/charts/scatter.js +0 -1
- package/dist/packages/canvas-adapter/charts/testPassRate.d.ts +0 -27
- package/dist/packages/canvas-adapter/charts/testPassRate.js +0 -1
- package/dist/packages/canvas-adapter/charts/trend.d.ts +0 -50
- package/dist/packages/canvas-adapter/charts/trend.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{newPlotId as p}from"./plotId.js";export{p as newPlotId};export const PLOTS_FORMAT="wafermap-plots",PLOTS_VERSION=1,SWEEPS_FORMAT="tsmap-sweeps",PLOT_CHARTS=["scatter","histogram","box","bar","line","sweep"],PLOT_BUILTINS=["wafer","x","y","ring","quadrant","reticleCell","reticleShot","hbin","sbin","site","yield","dieCount","waferOrder"],PLOT_AGGREGATES=["mean","median","min","max","sum","count","yield"],PLOT_LIMITS=["both","test","spec","none"];const u=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),c=e=>typeof e=="number"&&Number.isFinite(e);export function sameField(e,t){return!e||!t?e===t:"test"in e?"test"in t&&e.test===t.test:"builtin"in e?"builtin"in t&&e.builtin===t.builtin:"meta"in t&&e.meta===t.meta}export function isField(e){return u(e)?"test"in e?Number.isInteger(e.test):"builtin"in e?PLOT_BUILTINS.includes(e.builtin):"meta"in e?typeof e.meta=="string"&&e.meta!=="":!1:!1}function a(e,t,i){if(e!==void 0){if(!u(e)){i.push(`${t}: not a field, left out`);return}if("test"in e){if(!Number.isInteger(e.test)){i.push(`${t}: test number ${JSON.stringify(e.test)} is not an integer, left out`);return}const s={...e,test:e.test};return typeof e.name=="string"&&e.name!==""?s.name=e.name:delete s.name,s}if("builtin"in e)return PLOT_BUILTINS.includes(e.builtin)?{...e,builtin:e.builtin}:e;if("meta"in e){if(typeof e.meta!="string"||e.meta===""){i.push(`${t}: metadata key is empty, left out`);return}return{...e,meta:e.meta}}return e}}function y(e,t,i){if(e===void 0)return;if(!u(e)){i.push(`${t}: not an object, left out`);return}const s={...e};"label"in e&&typeof e.label!="string"&&(i.push(`${t}.label: not text, left out`),delete s.label),"scale"in e&&e.scale!=="linear"&&e.scale!=="log"&&(i.push(`${t}.scale: "${String(e.scale)}" is not linear or log, left out`),delete s.scale);for(const o of["min","max"])o in e&&!c(e[o])&&(i.push(`${t}.${o}: not a number, left out`),delete s[o]);return"reverse"in e&&typeof e.reverse!="boolean"&&(i.push(`${t}.reverse: not true or false, left out`),delete s.reverse),s}const x=/^\s*\d+\s*(\.\.\s*\d+\s*)?$/,$=e=>typeof e=="number"&&Number.isInteger(e)||typeof e=="string"&&x.test(e);export function readSweepPayload(e,t,i){if(!u(e))return i.push(`${t}: no sweep definition, left empty`),{series:[]};const s={...e};delete s.id,delete s.title;const o=Array.isArray(e.series)?e.series:[];Array.isArray(e.series)||i.push(`${t}.series: not a list, left empty`);const l=[];o.forEach((n,r)=>{const f=`${t}.series ${r+1}`;if(!u(n)){i.push(`${f}: not an object, skipped`);return}const d={...n};if((typeof n.label!="string"||n.label.trim()==="")&&(d.label=`Series ${r+1}`),!Array.isArray(n.tests)||!n.tests.every($)){i.push(`${f}: its tests must be test numbers or ranges such as "1010..1030", skipped`);return}"xValues"in n&&!(Array.isArray(n.xValues)&&n.xValues.every(c))&&(i.push(`${f}.xValues: not a list of numbers, left out`),delete d.xValues),"xFromName"in n&&typeof n.xFromName!="string"&&(i.push(`${f}.xFromName: not text, left out`),delete d.xFromName),"color"in n&&typeof n.color!="string"&&delete d.color,"testNames"in n&&!(u(n.testNames)&&Object.values(n.testNames).every(m=>typeof m=="string"))&&(i.push(`${f}.testNames: not a list of names, left out`),delete d.testNames),l.push(d)}),s.series=l;for(const n of["xLabel","xUnit","yLabel"])n in e&&typeof e[n]!="string"&&(i.push(`${t}.${n}: not text, left out`),delete s[n]);return"xScale"in e&&e.xScale!=="linear"&&e.xScale!=="log"&&(i.push(`${t}.xScale: "${String(e.xScale)}" is not linear or log, left out`),delete s.xScale),"crossing"in e&&typeof e.crossing!="boolean"&&(i.push(`${t}.crossing: not true or false, left out`),delete s.crossing),"separationAt"in e&&!(Array.isArray(e.separationAt)&&e.separationAt.every(c))&&(i.push(`${t}.separationAt: not a list of numbers, left out`),delete s.separationAt),s}export function sweepToPlot(e){const{id:t,title:i,...s}=e;return{id:t,...i?{title:i}:{},chart:"sweep",sweep:s}}export function plotToSweep(e){if(e.chart==="sweep")return{...e.sweep??{series:[]},id:e.id,title:e.title??"Sweep"}}export function readPlot(e,t,i){if(!u(e))return i.push(`${t}: not an object, skipped`),null;const s=e.chart;if(typeof s!="string"||s==="")return i.push(`${t}: no chart, skipped`),null;const o={...e};(typeof e.id!="string"||e.id==="")&&(o.id=p(),i.push(`${t}: no id, given a new one`)),"title"in e&&typeof e.title!="string"?(i.push(`${t}.title: not text, left out`),delete o.title):typeof e.title=="string"&&e.title.trim()===""&&delete o.title;const l=u(e.fields)?e.fields:{};e.fields!==void 0&&!u(e.fields)&&i.push(`${t}.fields: not an object, left empty`);const n={...l};for(const r of["x","y"]){const f=a(l[r],`${t}.fields.${r}`,i);f?n[r]=f:delete n[r]}if(l.color!==void 0){const r=l.color;if(u(r)&&"follow"in r)r.follow==="groupBy"?n.color={follow:"groupBy"}:n.color=r;else if(u(r)&&"none"in r)n.color={none:!0};else{const f=a(r,`${t}.fields.color`,i);f?n.color=f:delete n.color}}if(s==="sweep"&&Object.keys(n).length===0?delete o.fields:o.fields=n,"level"in e&&e.level!=="die"&&e.level!=="wafer"&&(i.push(`${t}.level: "${String(e.level)}" is not die or wafer, left out`),delete o.level),"aggregate"in e&&!PLOT_AGGREGATES.includes(e.aggregate)&&(i.push(`${t}.aggregate: "${String(e.aggregate)}" is not known to this version, left out`),delete o.aggregate),"limits"in e&&!PLOT_LIMITS.includes(e.limits)&&(i.push(`${t}.limits: "${String(e.limits)}" is not both, test, spec or none, left out`),delete o.limits),"bins"in e&&!(Number.isInteger(e.bins)&&e.bins>=1)&&(i.push(`${t}.bins: not a whole number of at least 1, left out`),delete o.bins),s==="sweep"&&(o.sweep=readSweepPayload(e.sweep,`${t}.sweep`,i)),e.axes!==void 0)if(!u(e.axes))i.push(`${t}.axes: not an object, left out`),delete o.axes;else{const r={...e.axes};for(const f of["x","y"]){const d=y(e.axes[f],`${t}.axes.${f}`,i);d?r[f]=d:delete r[f]}o.axes=r}return o}function b(e,t){const i=/position (\d+)/.exec(t);if(!i)return t;const s=Math.min(Number(i[1]),e.length),o=e.slice(0,s),l=o.split(`
|
|
2
|
-
`).length,
|
|
3
|
-
`)+1)+1;return`${t} (line ${
|
|
4
|
-
`}export function addPlots(e,t){const i=new Set(e.map(l=>l.id)),
|
|
1
|
+
import{newPlotId as m}from"./plotId.js";export{m as newPlotId};export const PLOTS_FORMAT="wafermap-plots",PLOTS_VERSION=1,SWEEPS_FORMAT="tsmap-sweeps",PLOT_CHARTS=["scatter","histogram","box","bar","line","sweep","probability","control","goal","heatmap"],PLOT_BUILTINS=["wafer","x","y","ring","quadrant","reticleCell","reticleShot","hbin","sbin","site","yield","dieCount","waferOrder","test","pat","radius"],PLOT_JUDGES=["limits","flag"],isPassRateSet=e=>isTestSet(e)&&e.passRate===!0,PLOT_BIN_BY=["count","width"],PLOT_BINS_MIN=2,PLOT_BINS_MAX=20,PLOT_BINS_DEFAULT=5,isBinned=e=>r(e)&&"binned"in e,PLOT_REFERENCES_MAX=8,PLOT_REFERENCE_STATS=["median","mean"],isStatReference=e=>"stat"in e,PLOT_AGGREGATES=["mean","median","min","max","sum","count","yield"],PLOT_LIMITS=["both","test","spec","none"],PLOT_NORMALIZE=["limits","zscore","robust"];export function plotConditions(e){const t=e.where;return t&&!t.off?t.conditions:[]}const r=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),p=e=>typeof e=="number"&&Number.isFinite(e),A=/^\s*\d+\s*(\.\.\s*\d+\s*)?$/,b=e=>typeof e=="number"&&Number.isInteger(e)||typeof e=="string"&&A.test(e);export const PLOT_FACET_LIMIT=24,PLOT_X_LEVELS=3,xFieldsOf=e=>e===void 0?[]:Array.isArray(e)?e:[e];export function sameField(e,t){return!e||!t?e===t:isBinned(e)||isBinned(t)?isBinned(e)&&isBinned(t)&&sameField(e.binned,t.binned):"test"in e?"test"in t&&e.test===t.test:"builtin"in e?"builtin"in t&&e.builtin===t.builtin:"tests"in e?"tests"in t&&!!e.passRate==!!t.passRate&&(e.judge??"limits")===(t.judge??"limits")&&e.tests.length===t.tests.length&&e.tests.every((i,o)=>String(i)===String(t.tests[o])):"passRate"in e?"passRate"in t&&!("tests"in t)&&e.passRate===t.passRate&&(e.judge??"limits")===(t.judge??"limits"):"meta"in t&&e.meta===t.meta}export const isTestSet=e=>r(e)&&"tests"in e&&Array.isArray(e.tests);export function isField(e){return r(e)?"binned"in e?isField(e.binned)&&!isBinned(e.binned)&&!isTestSet(e.binned)&&!("passRate"in e.binned):"test"in e?Number.isInteger(e.test):"builtin"in e?PLOT_BUILTINS.includes(e.builtin):"meta"in e?typeof e.meta=="string"&&e.meta!=="":"tests"in e?Array.isArray(e.tests)&&e.tests.length>0&&e.tests.every(b):"passRate"in e?Number.isInteger(e.passRate)&&(e.judge===void 0||PLOT_JUDGES.includes(e.judge)):!1:!1}function x(e,t,i){"judge"in e&&!PLOT_JUDGES.includes(e.judge)&&(i.push(`${t}.judge: "${String(e.judge)}" is not limits or flag, left out`),delete e.judge)}function a(e,t,i){if(e!==void 0){if(!r(e)){i.push(`${t}: not a field, left out`);return}if("binned"in e){const o=a(e.binned,`${t}.binned`,i);if(!o||isBinned(o)||isTestSet(o)||"passRate"in o){o&&i.push(`${t}: only one test or value can be binned, left out`);return}const n={...e,binned:o};return"bins"in e&&!(Number.isInteger(e.bins)&&e.bins>=PLOT_BINS_MIN&&e.bins<=PLOT_BINS_MAX)&&(i.push(`${t}.bins: ${JSON.stringify(e.bins)} is not a whole number from ${PLOT_BINS_MIN} to ${PLOT_BINS_MAX}, left out`),delete n.bins),"by"in e&&!PLOT_BIN_BY.includes(e.by)&&(i.push(`${t}.by: "${String(e.by)}" is not count or width, left out`),delete n.by),n}if("test"in e){if(!Number.isInteger(e.test)){i.push(`${t}: test number ${JSON.stringify(e.test)} is not an integer, left out`);return}const o={...e,test:e.test};return typeof e.name=="string"&&e.name!==""?o.name=e.name:delete o.name,o}if("builtin"in e)return PLOT_BUILTINS.includes(e.builtin)?{...e,builtin:e.builtin}:e;if("meta"in e){if(typeof e.meta!="string"||e.meta===""){i.push(`${t}: metadata key is empty, left out`);return}return{...e,meta:e.meta}}if("passRate"in e&&!("tests"in e)){if(!Number.isInteger(e.passRate)){i.push(`${t}: pass-rate test ${JSON.stringify(e.passRate)} is not an integer, left out`);return}const o={...e};return typeof e.name=="string"&&e.name!==""||delete o.name,x(o,t,i),o}if("tests"in e){if(!Array.isArray(e.tests)||e.tests.length===0||!e.tests.every(b)){i.push(`${t}: its tests must be test numbers or ranges such as "1010..1030", left out`);return}const o={...e,tests:e.tests};return"passRate"in e&&e.passRate!==!0&&(i.push(`${t}.passRate: not true, left out`),delete o.passRate),x(o,t,i),"names"in e&&!(r(e.names)&&Object.values(e.names).every(n=>typeof n=="string"))&&(i.push(`${t}.names: not a list of names, left out`),delete o.names),o}return e}}export function readFilter(e,t,i){const o=Array.isArray(e.conditions)?e.conditions:"field"in e?[{field:e.field,values:e.values}]:[],n=[];if(o.forEach((c,$)=>{const h=Array.isArray(e.conditions)?`${t}.conditions[${$}]`:t,y=S(c,h,i);y&&n.push(y)}),n.length===0)return;const{field:f,values:s,conditions:l,...u}=e,d={...u,conditions:n};return"off"in e&&typeof e.off!="boolean"&&(i.push(`${t}.off: not true or false, left out`),delete d.off),d}function S(e,t,i){if(!r(e)){i.push(`${t}: not a condition, left out`);return}const o=a(e.field,`${t}.field`,i);if(!o)return;const n={...e,field:o};if("values"in e){const f=Array.isArray(e.values)?e.values.filter(s=>typeof s=="string"):[];f.length?n.values=f:(i.push(`${t}.values: not a list of values, left out`),delete n.values)}for(const f of["min","max"])f in e&&!p(e[f])&&(i.push(`${t}.${f}: not a number, left out`),delete n[f]);if(n.min!==void 0&&n.max!==void 0&&n.min>n.max&&(i.push(`${t}: min is above max, the range left out`),delete n.min,delete n.max),"not"in e&&typeof e.not!="boolean"&&(i.push(`${t}.not: not true or false, left out`),delete n.not),!n.values&&n.min===void 0&&n.max===void 0){i.push(`${t}: needs values or a range, left out`);return}return n}function g(e,t,i){if(e===void 0)return;if(!r(e)){i.push(`${t}: not an object, left out`);return}const o={...e};"label"in e&&typeof e.label!="string"&&(i.push(`${t}.label: not text, left out`),delete o.label),"scale"in e&&e.scale!=="linear"&&e.scale!=="log"&&(i.push(`${t}.scale: "${String(e.scale)}" is not linear or log, left out`),delete o.scale);for(const n of["min","max"])n in e&&!p(e[n])&&(i.push(`${t}.${n}: not a number, left out`),delete o[n]);for(const n of["reverse","includeLimits","clip"])n in e&&typeof e[n]!="boolean"&&(i.push(`${t}.${n}: not true or false, left out`),delete o[n]);if("references"in e){const n=[],f=Array.isArray(e.references)?e.references:[];Array.isArray(e.references)||i.push(`${t}.references: not a list, left out`),f.forEach((s,l)=>{const u=r(s)&&(s.label===void 0||typeof s.label=="string"),d=u&&p(s.at)&&(s.to===void 0||p(s.to)&&s.to!==s.at),c=u&&!d&&PLOT_REFERENCE_STATS.includes(s.stat);d||c?n.length<PLOT_REFERENCES_MAX?n.push(d?{...s,at:s.at,...s.to!==void 0?{to:s.to}:{}}:{...s}):i.push(`${t}.references[${l}]: more than ${PLOT_REFERENCES_MAX}, left out`):i.push(`${t}.references[${l}]: needs a number (and a different number for a band), or median or mean, left out`)}),n.length?o.references=n:delete o.references}return o}export function readSweepPayload(e,t,i){if(!r(e))return i.push(`${t}: no sweep definition, left empty`),{series:[]};const o={...e};delete o.id,delete o.title;const n=Array.isArray(e.series)?e.series:[];Array.isArray(e.series)||i.push(`${t}.series: not a list, left empty`);const f=[];n.forEach((s,l)=>{const u=`${t}.series ${l+1}`;if(!r(s)){i.push(`${u}: not an object, skipped`);return}const d={...s};if((typeof s.label!="string"||s.label.trim()==="")&&(d.label=`Series ${l+1}`),!Array.isArray(s.tests)||!s.tests.every(b)){i.push(`${u}: its tests must be test numbers or ranges such as "1010..1030", skipped`);return}"xValues"in s&&!(Array.isArray(s.xValues)&&s.xValues.every(p))&&(i.push(`${u}.xValues: not a list of numbers, left out`),delete d.xValues),"xFromName"in s&&typeof s.xFromName!="string"&&(i.push(`${u}.xFromName: not text, left out`),delete d.xFromName),"color"in s&&typeof s.color!="string"&&delete d.color,"testNames"in s&&!(r(s.testNames)&&Object.values(s.testNames).every(c=>typeof c=="string"))&&(i.push(`${u}.testNames: not a list of names, left out`),delete d.testNames),f.push(d)}),o.series=f;for(const s of["xLabel","xUnit","yLabel"])s in e&&typeof e[s]!="string"&&(i.push(`${t}.${s}: not text, left out`),delete o[s]);return"xScale"in e&&e.xScale!=="linear"&&e.xScale!=="log"&&(i.push(`${t}.xScale: "${String(e.xScale)}" is not linear or log, left out`),delete o.xScale),"crossing"in e&&typeof e.crossing!="boolean"&&(i.push(`${t}.crossing: not true or false, left out`),delete o.crossing),"separationAt"in e&&!(Array.isArray(e.separationAt)&&e.separationAt.every(p))&&(i.push(`${t}.separationAt: not a list of numbers, left out`),delete o.separationAt),o}export function sweepToPlot(e){const{id:t,title:i,...o}=e;return{id:t,...i?{title:i}:{},chart:"sweep",sweep:o}}export function plotToSweep(e){if(e.chart==="sweep")return{...e.sweep??{series:[]},id:e.id,title:e.title??"Sweep"}}export function readPlot(e,t,i){if(!r(e))return i.push(`${t}: not an object, skipped`),null;const o=e.chart;if(typeof o!="string"||o==="")return i.push(`${t}: no chart, skipped`),null;const n={...e};(typeof e.id!="string"||e.id==="")&&(n.id=m(),i.push(`${t}: no id, given a new one`)),"title"in e&&typeof e.title!="string"?(i.push(`${t}.title: not text, left out`),delete n.title):typeof e.title=="string"&&e.title.trim()===""&&delete n.title;const f=r(e.fields)?e.fields:{};e.fields!==void 0&&!r(e.fields)&&i.push(`${t}.fields: not an object, left empty`);const s={...f};for(const l of["x","y"]){if(l==="x"&&Array.isArray(f.x)){const d=f.x.map((c,$)=>a(c,`${t}.fields.x ${$+1}`,i)).filter(c=>!!c);d.length?s.x=d:delete s.x;continue}const u=a(f[l],`${t}.fields.${l}`,i);u?s[l]=u:delete s[l]}if(f.rows!==void 0){const l=a(f.rows,`${t}.fields.rows`,i);l?s.rows=l:delete s.rows}if(f.facet!==void 0){const l=a(f.facet,`${t}.fields.facet`,i);l?s.facet=l:delete s.facet}if(f.color!==void 0){const l=f.color;if(r(l)&&"follow"in l)l.follow==="groupBy"?s.color={follow:"groupBy"}:s.color=l;else if(r(l)&&"none"in l)s.color={none:!0};else{const u=a(l,`${t}.fields.color`,i);u?s.color=u:delete s.color}}if(o==="sweep"&&Object.keys(s).length===0?delete n.fields:n.fields=s,"level"in e&&e.level!=="die"&&e.level!=="wafer"&&(i.push(`${t}.level: "${String(e.level)}" is not die or wafer, left out`),delete n.level),"aggregate"in e&&!PLOT_AGGREGATES.includes(e.aggregate)&&(i.push(`${t}.aggregate: "${String(e.aggregate)}" is not known to this version, left out`),delete n.aggregate),"where"in e){const l=e.where,u=r(l)?readFilter(l,`${t}.where`,i):void 0;u?n.where=u:(i.push(`${t}.where: needs at least one condition, left out`),delete n.where)}"stack"in e&&e.stack!=="stack"&&e.stack!=="percent"&&(i.push(`${t}.stack: "${String(e.stack)}" is not stack or percent, left out`),delete n.stack),"sort"in e&&e.sort!=="value"&&e.sort!=="ascending"&&(i.push(`${t}.sort: "${String(e.sort)}" is not known to this version, left out`),delete n.sort),"top"in e&&!(Number.isInteger(e.top)&&e.top>=1)&&(i.push(`${t}.top: not a whole number of at least 1, left out`),delete n.top),"baseline"in e&&!(Number.isInteger(e.baseline)&&e.baseline>=3)&&(i.push(`${t}.baseline: not a whole number of at least 3, left out`),delete n.baseline),"fit"in e&&e.fit!=="linear"&&e.fit!=="orthogonal"&&(i.push(`${t}.fit: "${String(e.fit)}" is not linear or orthogonal, left out`),delete n.fit);for(const l of["identity","normalCurve","valueLabels"])l in e&&typeof e[l]!="boolean"&&(i.push(`${t}.${l}: not true or false, left out`),delete n[l]);if("orientation"in e&&e.orientation!=="vertical"&&e.orientation!=="horizontal"&&(i.push(`${t}.orientation: "${String(e.orientation)}" is not vertical or horizontal, left out`),delete n.orientation),"barNorm"in e&&e.barNorm!=="count"&&e.barNorm!=="percent"&&(i.push(`${t}.barNorm: "${String(e.barNorm)}" is not count or percent, left out`),delete n.barNorm),"histNorm"in e&&e.histNorm!=="count"&&e.histNorm!=="percent"&&(i.push(`${t}.histNorm: "${String(e.histNorm)}" is not count or percent, left out`),delete n.histNorm),"whatIf"in e){const l=e.whatIf,u=r(l)&&p(l.lo)?l.lo:void 0,d=r(l)&&p(l.hi)?l.hi:void 0;u===void 0&&d===void 0?(i.push(`${t}.whatIf: needs a low or a high limit, left out`),delete n.whatIf):n.whatIf={...u!==void 0?{lo:u}:{},...d!==void 0?{hi:d}:{}}}if("spread"in e&&!["sd","ci95","iqr","minmax"].includes(e.spread)&&(i.push(`${t}.spread: "${String(e.spread)}" is not known to this version, left out`),delete n.spread),"cumulative"in e&&typeof e.cumulative!="boolean"&&(i.push(`${t}.cumulative: not true or false, left out`),delete n.cumulative),"probabilityAxis"in e&&e.probabilityAxis!=="normal"&&e.probabilityAxis!=="linear"&&(i.push(`${t}.probabilityAxis: "${String(e.probabilityAxis)}" is not normal or linear, left out`),delete n.probabilityAxis),"normalize"in e&&!PLOT_NORMALIZE.includes(e.normalize)&&(i.push(`${t}.normalize: "${String(e.normalize)}" is not known to this version, left out`),delete n.normalize),"limits"in e&&!PLOT_LIMITS.includes(e.limits)&&(i.push(`${t}.limits: "${String(e.limits)}" is not both, test, spec or none, left out`),delete n.limits),"bins"in e&&!(Number.isInteger(e.bins)&&e.bins>=1)&&(i.push(`${t}.bins: not a whole number of at least 1, left out`),delete n.bins),o==="sweep"&&(n.sweep=readSweepPayload(e.sweep,`${t}.sweep`,i)),e.axes!==void 0)if(!r(e.axes))i.push(`${t}.axes: not an object, left out`),delete n.axes;else{const l={...e.axes};for(const u of["x","y"]){const d=g(e.axes[u],`${t}.axes.${u}`,i);d?l[u]=d:delete l[u]}n.axes=l}return n}export function syntaxErrorAt(e,t){const i=/position (\d+)/.exec(t);if(!i)return t;const o=Math.min(Number(i[1]),e.length),n=e.slice(0,o),f=n.split(`
|
|
2
|
+
`).length,s=o-(n.lastIndexOf(`
|
|
3
|
+
`)+1)+1;return`${t} (line ${f}, column ${s})`}export function readIdentified(e,t,i){const o=[],n=new Set;return e.forEach((f,s)=>{const l=i.labelOf(f,s),u=i.read(f,l,t);u&&(n.has(u.id)&&(u.id=i.newId(),t.push(`${l}: its id was already used, given a new one`)),n.add(u.id),o.push(u))}),o}export function unwrapListFile(e,t){let i;try{i=JSON.parse(e)}catch(f){return{error:`Not valid JSON: ${syntaxErrorAt(e,f instanceof Error?f.message:String(f))}`}}let o;if(Array.isArray(i))o=i;else if(r(i)){const f=t.legacy?.(i);if(typeof f=="string")return{error:f};if(f)o=f;else{if(i.format!==t.format)return{error:`This is not a ${t.noun} file (expected "format": "${t.format}")`};o=i[t.key]}}else return{error:`This is not a ${t.noun} file`};if(!Array.isArray(o))return{error:`The file has no "${t.key}" list`};const n=[];return r(i)&&p(i.version)&&i.version>t.version&&n.push(`Written by a newer version (${i.version}); settings this version does not know are kept but not used`),{list:o,warnings:n}}export function readPlotsFile(e){const t=unwrapListFile(e,{format:PLOTS_FORMAT,noun:"plots",key:"plots",version:PLOTS_VERSION,legacy:f=>{if(f.format===SWEEPS_FORMAT)return Array.isArray(f.sweeps)?f.sweeps.map(s=>r(s)?{id:s.id,title:s.title,chart:"sweep",sweep:s}:s):'The file has no "sweeps" list'}});if("error"in t)return{plots:[],warnings:[],error:t.error};const{list:i,warnings:o}=t,n=readIdentified(i,o,{labelOf:(f,s)=>r(f)&&typeof f.title=="string"&&f.title?`"${f.title}"`:`plot ${s+1}`,read:readPlot,newId:m});return n.length===0&&i.length>0?{plots:n,warnings:o,error:"No plot in the file could be read"}:{plots:n,warnings:o}}export function writePlotsFile(e){return JSON.stringify({format:PLOTS_FORMAT,version:PLOTS_VERSION,plots:e},null,2)+`
|
|
4
|
+
`}export function addPlots(e,t){const{items:i,copies:o}=addIdentified(e,t,n=>n.title??n.id,m);return{plots:i,copies:o}}export function addIdentified(e,t,i,o){const n=new Set(e.map(l=>l.id)),f=[],s=t.map(l=>{if(!n.has(l.id))return n.add(l.id),l;const u=o();return n.add(u),f.push(i(l)),{...l,id:u}});return{items:[...e,...s],copies:f}}export function plotIssue(e){if(!PLOT_CHARTS.includes(e.chart))return"Needs a newer version of this tool";const t=e.fields??{};for(const i of[...xFieldsOf(t.x),t.y,t.color,t.facet,t.rows,...e.where?.conditions.map(o=>o.field)??[]])if(!(i===void 0||r(i)&&("follow"in i||"none"in i))&&!isField(i))return"Needs a newer version of this tool"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DIE_REGIONS as
|
|
1
|
+
import{DIE_REGIONS as b}from"./dieRegions.js";import{isYieldEligibleDie as E,isPositionedDie as h,diePassStatus as W,getDieKey as x}from"../core/dies.js";function N(e){return x(e)}export function buildRegionYieldData(e,t,o,n,s){const r=new Map,i=[];for(let c=0;c<t.length;c++){const u=e[c];if(!u?.length)continue;const l=new Set(typeof n=="function"?n(c):n),f=s(u.filter(h),t[c],o);for(const a of f){i.includes(a.key)||i.push(a.key);const S=r.get(a.key)??{label:a.label,pass:0,total:0};for(const g of a.dies){if(!E(g))continue;const d=W(g,l);d!==void 0&&(S.total++,d&&S.pass++)}r.set(a.key,S)}}return i.map(c=>{const u=r.get(c);return u.total===0?null:{key:c,label:u.label,n:u.total,passDies:u.pass,yieldPercent:u.pass/u.total*100}}).filter(c=>c!==null)}export function diesInRegion(e,t,o,n,s){const r=s(e.filter(h),t,o).find(i=>i.key===n);return r?r.dies.filter(i=>E(i)&&(i.hbin??i.sbin)!==void 0):[]}const R=["E","ENE","NE","NNE","N","NNW","NW","WNW","W","WSW","SW","SSW","S","SSE","SE","ESE"],M=["E","NE","N","NW","W","SW","S","SE"],A=["E","N","W","S"];export function compassBucket(e,t,o){const n=Math.PI/o,s=(Math.atan2(t,e)+2*Math.PI+n)%(2*Math.PI);return Math.floor(s/(2*Math.PI)*o)%o}export function sectorCompassNames(e){const t=[4,8,16].includes(e)?e:16;return t===4?A:t===8?M:R}export const QUADRANT_CYCLE=["NE","NW","SW","SE"];const D={NE:["NW","SE"],NW:["NE","SW"],SE:["NE","SW"],SW:["NW","SE"]};export function areQuadrantsAdjacent(e,t){return D[e]?.includes(t)??!1}const p=1440;export function regionAngleBins(e,t){const o=parseRegionKey(e);let n,s;if(o.family==="quadrant"){const i=QUADRANT_CYCLE.indexOf(o.quadrant);if(i<0)return;n=i*p/4,s=p/4}else if(o.family==="sector"){const i=[4,8,16].includes(t)?t:void 0,c=i?sectorCompassNames(i).indexOf(o.sector??""):-1;if(!i||c<0)return;s=p/i,n=c*s-s/2}else return;const r=new Set;for(let i=0;i<s;i++)r.add(((n+i)%p+p)%p);return r}export function parseReticleCellKey(e){const t=/^reticle-position:cell:(-?\d+),(-?\d+)$/.exec(e);return t?{column:Number(t[1]),row:Number(t[2])}:void 0}export function parseRegionKey(e){return e.startsWith("ring:")?{family:"ring",ring:Number(e.slice(5))}:e.startsWith("quadrant:")?{family:"quadrant",quadrant:e.slice(9)}:e.startsWith("sector:")?{family:"sector",sector:e.slice(7)}:{family:"unknown"}}function m(e,t,o){const n=b[t].grouping,s=new Map;for(const r of e){const i=n.place(r,o);if(!i)continue;const c=s.get(i.key)??{family:n.family,key:i.key,label:i.label,dieKeys:[],dies:[]};c.dieKeys.push(N(r)),c.dies.push(r),s.set(i.key,c)}return[...s.values()].sort((r,i)=>n.order(r.key,i.key))}export function buildRingRegions(e,t,o){return m(e,"ring",{wafer:t,ringCount:o})}export function buildQuadrantRegions(e,t,o){return m(e,"quadrant",{wafer:t,ringCount:o})}export function buildReticlePositionRegions(e,t){return t?m(e,"reticleCell",{ringCount:0,reticle:t}):[]}const I=3;export function buildTestSiteRegions(e,t=!1){const o=new Map;for(const n of e){if(n.siteNum===void 0)continue;const s=o.get(n.siteNum)??[];s.push(n),o.set(n.siteNum,s)}if(!t){let n=0;for(const s of o.values())s.length>=I&&n++;if(n<2)return[]}return[...o.entries()].sort(([n],[s])=>n-s).map(([n,s])=>({family:"test-site",key:`test-site:${n}`,label:`Site ${n}`,dieKeys:s.map(N),dies:s}))}export function buildSectorRegions(e,t,o){const n=[4,8,16].includes(o)?o:16,s=sectorCompassNames(n),r=new Map,i=t.center.x,c=t.center.y,u=t.radius;for(const l of e){const f=l.physX-i,a=l.physY-c;if(Math.hypot(f,a)/u<.2)continue;const g=s[compassBucket(f,a,n)],d=`sector:${g}`,y=r.get(d)??{family:"sector",key:d,label:`Sector ${g}`,dieKeys:[],dies:[]};y.dieKeys.push(N(l)),y.dies.push(l),r.set(d,y)}return[...r.values()].sort((l,f)=>l.key.localeCompare(f.key))}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import{waferDisplayLabel as I}from"../core/waferLabel.js";import{binPassSets as
|
|
2
|
-
`)}function
|
|
3
|
-
`)),
|
|
1
|
+
import{waferDisplayLabel as I}from"../core/waferLabel.js";import{binPassSets as Ie,binPassSetsByWafer as ke,mergeBinDefs as ee,resolveBinColors as Ee,resolveBinColorsByWafer as He}from"../renderer/binColors.js";import{commonPassBins as Ae,itemPassBins as k,passBinsLabel as je}from"../core/passBins.js";import{itemRingCount as Ge}from"../core/ringCount.js";import{stackBinsAreData as qe}from"../core/aggregates.js";import{isParametricTest as E,isBuiltMap as te}from"../renderer/buildWaferMap.js";import{buildRingRegions as ne,buildQuadrantRegions as se,buildRegionYieldData as ze}from"./regions.js";import{openHtmlReport as Oe}from"./renderFindingsReport.js";import{analyzeWaferLot as _e}from"./analyzeWaferLot.js";import{computeFunctionalYield as Qe,analyzeWaferMap as Ve}from"./analyzeWaferMap.js";import{mergeTestDefs as Ue}from"./mergeTestDefs.js";import{buildFacetTable as Ke,facetValueOf as Je,FACET_NONE_VALUE as Xe}from"./facets.js";import{visibleFindings as H}from"./filterFindings.js";import{buildYieldDataCombined as Ze}from"./yield.js";import{describeWaferPopulation as ae,populationLabel as et}from"./population.js";import{buildTestPassRateData as tt,hasJudgeableTests as nt,poolFunctionalYield as st}from"./testPassRate.js";import{buildCapabilityData as at,pooledTestStatsSteps as it}from"./capability.js";import{buildSynthesis as ot}from"./synthesis.js";import{binBreakdownRows as rt,binBreakdownTitle as lt,binCountsFrom as ct,pooledBinCounts as dt,totalOf as ut}from"./binRows.js";import{MEAN_WAFER_YIELD_LABEL as ft,shortfallLegend as A}from"./presentation.js";import{regionYieldRows as ie,waferYieldRows as mt}from"./yieldRows.js";import{describeValues as pt}from"./math.js";import{fmt as N}from"../renderer/fmt.js";import{isYieldEligibleDie as j,getDieKey as gt,isPositionedDie as ht,diePassStatus as oe}from"../core/dies.js";import{excludedCounts as bt,testValue as yt}from"../core/dieTable.js";import{limitSetName as St}from"../renderer/valueFilter.js";import{findingsTableHtml as re,findingAnchor as wt,synthesisSectionHtml as $t,reportScripts as G,barCell as M,deltaCell as q,withSectionNav as le,renderMetadataSection as ce,renderMetricGrid as de,renderSection as x,renderTable as P,reportStyles as z}from"./reportHtml.js";import{escHtml as w,drain as vt}from"../core/utils.js";function O(e,i){return i===0?"\u2014":`${(e/i*100).toFixed(1)}%`}function Dt(e){if(!e)return"";const i=e.lot??e.lotId,o=e.wafer??e.waferId,s=[i,o].filter(Boolean).map(String);return s.length?` \u2014 ${s.map(w).join(" \xB7 ")}`:""}function ue(e,i,o,s,r){if(!e.size)return"";const t=rt(e,i,s).map(a=>{const l=a.passing?"muted-row":"",c=u=>({html:w(u),className:l});return[c(String(a.bin)),c(a.name??"\u2014"),c(String(a.count)),M(a.percent,`${a.percent.toFixed(1)}%`,l,r?.get(a.bin))]});return x(lt(o,ut(e)),P(["Bin","Name","Dies","Share"],t,{className:"compact"}))}function xt(e,i,o,s,r,t){const a=Ie(e,r);return["hard","soft"].map(l=>ue(ct(e,l,l==="hard"?s.hard:s.soft),l==="hard"?i:o,l,a[l],t[l])).join(`
|
|
2
|
+
`)}function fe(e,i,o,s){const r=new Set(s),t=new Map(o.map(n=>[gt(n),n]));if(!o.some(n=>n.hbin!=null||n.sbin!=null)||!i.length)return"";const l=[];for(const n of i){let m=0,y=0;for(const v of n.dieKeys){const S=t.get(v);if(!S||!j(S))continue;const p=oe(S,r);p!==void 0&&(y++,p&&m++)}y&&l.push({label:n.label,pass:m,total:y})}if(!l.length)return"";const{rows:c}=ie(l.map(n=>({key:n.label,label:n.label,n:n.total,passDies:n.pass,yieldPercent:n.pass/n.total*100}))),u=c.map(n=>[w(n.label),String(n.passDies),String(n.n),M(n.yieldPercent,O(n.passDies,n.n)),q(n.delta)]);return x(e,P(["Region","Pass","Total","Yield","vs wafer"],u,{className:"compact"})+`<p class="report-legend">${A("the wafer")}</p>`)}function Pt(e,i){const o=new Float64Array(e.length);let s=0;for(const y of e){const v=yt(y,i);v!==void 0&&Number.isFinite(v)&&(o[s++]=v)}if(s===0)return;const{count:r,min:t,mean:a,max:l,q1:c,median:u,q3:n,stddev:m}=pt(o.subarray(0,s));return{testNumber:i,count:r,min:t,mean:a,max:l,q1:c,median:u,q3:n,stddev:m}}function me(e,i,o,s,r,t){if(!i.length)return"";const a=e.filter(d=>j(d)),l=new Map((o??[]).map(d=>[d.testNumber,d])),c=new Map((s??[]).map(d=>[d.testNumber,d.yieldPercent])),u=[];for(const d of i.filter(E)){const f=l.get(d.testNumber)??Pt(a,d.testNumber);f&&u.push({name:d.name,unit:d.unit||void 0,stats:f,limitYield:c.get(d.testNumber)})}if(!u.length)return"";const n=d=>u.every(f=>f.stats[d]!==void 0),m=n("q1")&&n("median")&&n("q3"),y=n("stddev"),v=u.some(d=>d.limitYield!==void 0&&d.limitYield!==null),S=(d,f)=>d===void 0?"\u2014":N(d,f),p=bt(a),g=p?`${[...p.counts.values()].reduce((d,f)=>d+f,0).toLocaleString("en-GB")} values outside the ${St(p.by)} are excluded (not in N): `+[...p.counts].map(([d,f])=>`${w(i.find($=>$.testNumber===d)?.name??`test ${d}`)} ${f.toLocaleString("en-GB")}`).join(", ")+". ":"",b=["Test","N","Min",...m?["Q1","Median"]:[],"Mean",...m?["Q3"]:[],"Max",...y?["StdDev"]:[],...v?["Limit yield"]:[]],D=u.map(({name:d,unit:f,stats:$,limitYield:F})=>[w(d),{html:String($.count),className:"numeric"},S($.min,f),...m?[S($.q1,f),S($.median,f)]:[],S($.mean,f),...m?[S($.q3,f)]:[],S($.max,f),...y?[S($.stddev,f)]:[],...v?[F==null?"\u2014":`${F.toFixed(1)}%`]:[]]);return x("Test Values",P(b,D,{className:"compact"})+`<p class="report-legend">${y?"StdDev is the sample standard deviation (n\u22121). ":""}${g}${r??""}</p>`,"",t)}function pe(e,i,o,s){const r=o??Qe(e,i);if(!r?.length)return"";const t=r.map(a=>[w(a.label),String(a.totalDies),String(a.passDies),String(a.failDies),a.passRatePercent!==null?`${a.passRatePercent.toFixed(1)}%`:"\u2014"]);return x("Functional Tests",P(["Test","N","Pass","Fail","Pass Rate"],t,{className:"compact"}),"",s)}function ge(e,i){const o=at(e,i);if(!o.length)return"";const s=t=>t===null?"\u2014":t.toFixed(2),r=o.map(t=>[w(t.label),t.hasSpec?t.limitBasis==="spec"?`LSL ${N(t.lsl,t.unit)} \u2013 USL ${N(t.usl,t.unit)}`:`Lo limit ${N(t.lsl,t.unit)} \u2013 Hi limit ${N(t.usl,t.unit)}`:"\u2014",N(t.mean,t.unit),s(t.cp),s(t.cpk),s(t.pp),s(t.ppk)]);return x("Process Capability",P(["Test","Limits","Mean","Cp","Cpk","Pp","Ppk"],r,{className:"compact"}))}function he(e,i,o="",s=!1){const r=H(e);return r.length?x("Findings",re(r,i,o,s)):""}const _=e=>`report-tests-${e}`,Q=e=>`report-functional-${e}`;function be(e,i,o,s){const r=new Set(H(e.findings).map(a=>a.id)),t=a=>a.kind==="finding"?r.has(a.id)?wt(a.id,o):void 0:s.get(a.testNumber);return $t(ot(e,{passBins:i?[...i]:void 0}),t)}function ye(e,i,o,s){const r=new Map;for(const t of e)(E(t)?o:s)&&r.set(t.testNumber,E(t)?_(i):Q(i));return r}export function renderSummaryReportHtml(e,i={}){const{wafer:o,dies:s,yieldSummary:r,dataCoverage:t,hbinDefs:a,sbinDefs:l,testDefs:c=[],statsSummary:u,passBins:n,ringCount:m}=e,y=e.binColors??Ee(s,{passBins:n,hbinDefs:a,sbinDefs:l}),v=o.metadata,S=Dt(v),p=i.title??`Wafer Summary${S}`,g=new Date().toLocaleString(),b=s.filter(ht),D=ne(b,o,m),d=se(b,o,m),f=qe(u?.stats.isLotStack,u?.stats.aggregationMethod),$=f?[{label:"Total dies",value:String(r.totalDies)},{label:"Filled dies",value:String(t.filledDies),hint:`${O(t.filledDies,t.totalDies)} fill`},{label:"Pass dies",value:String(r.passDies)},{label:"Fail dies",value:String(r.failDies)},...r.partialDies>0?[{label:"Partial",value:String(r.partialDies)}]:[],...r.yieldPercent!==null?[{label:`Yield (pass: ${je([n])})`,value:`${r.yieldPercent.toFixed(1)}%`}]:[],...r.edgeExcludedDies>0?[{label:"Edge excluded (outer zone)",value:String(r.edgeExcludedDies)}]:[]]:[{label:"Dies",value:String(s.length)},{label:"Filled dies",value:String(t.filledDies),hint:`${O(t.filledDies,t.totalDies)} fill`}],F=me(s,c,u?.stats.perTestStats,u?.stats.testSpecYield,void 0,_("")),B=pe(s,c,u?.stats.functionalYield,Q("")),C=[ce([{metadata:o.metadata}]),x("Summary",[de($)].filter(Boolean).join(`
|
|
3
|
+
`)),u?be(u,n,"",ye(c,"",!!F,!!B)):"",f?xt(s,a,l,{hard:u?.stats.hardBinCounts,soft:u?.stats.softBinCounts},n,y):"",f?fe("Ring Yield",D,s,n):"",f?fe("Quadrant Yield",d,s,n):"",F,B,ge([{dies:s}],c),u?he(u.findings,void 0,"",e.live):""].filter(Boolean).join(`
|
|
4
4
|
`);return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
6
6
|
<head>
|
|
7
7
|
<meta charset="UTF-8">
|
|
8
|
-
<title>${
|
|
8
|
+
<title>${w(p)}</title>
|
|
9
9
|
<style>
|
|
10
|
-
${
|
|
10
|
+
${z()}
|
|
11
11
|
</style>
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<main class="report">
|
|
15
15
|
<header class="report-header">
|
|
16
|
-
<h1>${
|
|
17
|
-
<p class="report-subtitle">Generated ${
|
|
16
|
+
<h1>${w(p)}</h1>
|
|
17
|
+
<p class="report-subtitle">Generated ${w(g)}</p>
|
|
18
18
|
</header>
|
|
19
|
-
${
|
|
20
|
-
<p class="footer">Generated ${
|
|
19
|
+
${le(C)}
|
|
20
|
+
<p class="footer">Generated ${w(g)}</p>
|
|
21
21
|
</main>
|
|
22
|
-
${e.live
|
|
22
|
+
${G(e.live)}
|
|
23
23
|
</body>
|
|
24
|
-
</html>`}function
|
|
25
|
-
`))}const
|
|
26
|
-
`)}`)}if(!
|
|
27
|
-
`)+
|
|
28
|
-
`)}function
|
|
29
|
-
`);return{lotSummary:
|
|
24
|
+
</html>`}function Ft(e,i){const o=e.perWafer.flatMap(t=>{const a=t.summary.stats.yieldPercent;return a===null?[]:[{waferIndex:t.waferIndex,yieldPercent:a}]}),s=new Map(mt(o).rows.map(t=>[t.waferIndex,t])),r=e.perWafer.map(t=>{const a=w(I(i[t.waferIndex],t.waferIndex)),l=s.get(t.waferIndex);return l?[l.outlier?`${a} \xB7 ${l.outlier} outlier`:a,M(l.yieldPercent,`${l.yieldPercent.toFixed(1)}%`),q(l.delta)]:[a,"N/A",""]});return P(["Wafer","Yield","vs lot median"],r,{className:"compact"})+`<p class="report-legend">${A("the lot median")}</p>`}function Bt(e){const i=[];for(const t of e.perWafer){const a=H(t.summary.findings);if(!a.length)continue;const l=I({wafer:{metadata:t.summary.wafer}},t.waferIndex);i.push(`<h3 class="report-subheading">${w(l)}</h3>`+re(a))}if(!i.length)return"";const o=i.length,s=e.perWafer.length,r=`<p class="report-note">${o} of ${s} wafer${s===1?"":"s"} have per-wafer findings; the rest had none.</p>`;return x("Findings by Wafer",r+i.join(`
|
|
25
|
+
`))}const Ct=3;function Tt(e,i,o){const s=e.map(c=>({metadata:c.wafer?.metadata})),r=Ke(s,{facetableOnly:!0}).filter(c=>c.splittable);if(!r.length)return"";const t=r.slice(0,Ct),a=[];for(const c of t){const u=new Map;e.forEach((g,b)=>{const D=Je(g.wafer?.metadata,c.key)??Xe;(u.get(D)??u.set(D,[]).get(D)).push(b)});const n=[...u.entries()].map(([g,b])=>({key:g,items:b.map(D=>e[D])}));if(n.length<2)continue;const m=n.map(g=>[w(g.key),w(g.items.map(b=>b.label).join(", "))]),y=Ze(n.map(g=>({key:g.key,items:g.items.map(b=>({label:b.label,dies:b.dies,passBins:k(b,o)}))}))).map(g=>[w(g.label),String(g.itemCount),`${g.percent.toFixed(1)}%`]),v=[P([c.label,"Wafers"],m,{className:"compact"}),P([c.label,"Wafers","Yield"],y,{className:"compact"})],S=e.flatMap(g=>g.dies??[]);let p=0;for(const g of["spec","testFlag","functional"]){if(!nt(i,g,S))continue;const b=tt(n.map(f=>({key:f.key,items:f.items.map($=>({dies:$.dies,testSpecYield:$.statsSummary?.stats.testSpecYield,functionalYield:$.statsSummary?.stats.functionalYield}))})),i,g);if(!b.rows.length)continue;const D=b.rows.map(f=>[w(f.label),...f.byGroup.map($=>$.passRatePercent===null?"\u2014":`${$.passRatePercent.toFixed(1)}%`),f.overall.passRatePercent===null?"\u2014":`${f.overall.passRatePercent.toFixed(1)}%`]),d=g==="spec"?"Pass rate \xB7 test limits":g==="testFlag"?"Pass rate \xB7 tester flag":"Pass rate \xB7 functional";b.disagreementDies&&(p=b.disagreementDies),v.push(`<h4 class="report-subheading">${w(d)}</h4>`+P(["Test",...b.groups,"All"],D,{className:"compact"}))}p&&v.push(`<p class="report-note">${p.toLocaleString()} dies judged differently by limits and tester flag.</p>`),a.push(`<h3 class="report-subheading">${w(c.label)}</h3>${v.join(`
|
|
26
|
+
`)}`)}if(!a.length)return"";const l=r.length>t.length?`<p class="report-note">${r.length-t.length} further wafer field(s) not shown.</p>`:"";return x("Group Comparison",a.join(`
|
|
27
|
+
`)+l)}function Yt(e,i,o,s,r,t){const a=ke(r);return["hard","soft"].map(l=>ue(dt(s,e,l),l==="hard"?i:o,l,a[l],t[l])).join(`
|
|
28
|
+
`)}function Se(e,i,o,s,r,t){const a=ze(o,s,r,c=>t[c],i);if(!a.length)return"";const l=ie(a).rows.map(c=>[w(c.label),M(c.yieldPercent,`${c.yieldPercent.toFixed(1)}%`),q(c.delta)]);return x(e,P(["Region","Yield","vs lot"],l,{className:"compact"})+`<p class="report-legend">${A("the lot")}</p>`)}function Nt(e,i,o,s,r,t){let a;if(s?.length&&s.every(c=>c.stats.perTestStats!==void 0)){const c=new Map;for(const u of s)for(const n of u.stats.perTestStats??[]){const m=c.get(n.testNumber)??{n:0,sum:0,min:1/0,max:-1/0,parts:[]};m.n+=n.count,m.sum+=n.mean*n.count,m.min=Math.min(m.min,n.min),m.max=Math.max(m.max,n.max),m.parts.push({n:n.count,mean:n.mean,sd:n.stddev}),c.set(n.testNumber,m)}a=[...c.entries()].map(([u,n])=>{const m=n.sum/n.n,y=n.parts.every(S=>S.sd!==void 0),v=y&&n.n>1?n.parts.reduce((S,p)=>S+Math.max(0,p.n-1)*p.sd**2+p.n*(p.mean-m)**2,0)/(n.n-1):y?0:void 0;return{testNumber:u,count:n.n,min:n.min,max:n.max,mean:m,...v!==void 0?{stddev:Math.sqrt(v)}:{}}})}const l=a?void 0:[...vt(it(e,o)).stats].map(([c,u])=>({testNumber:c,...u}));return me(i,o,a??l,r,a?"Quartiles are not shown for a lot: they cannot be combined from each wafer\u2019s own.":void 0,t)}function Mt(e,i,o,s){const r=st(o);return pe(e,i,r,s)}const V=["lot","product","testProgram","temperature"];function Rt(e){const i=new Map(V.map(t=>[t,new Set]));for(const t of e)for(const a of V){const l=t.wafer?.metadata?.[a];l!=null&&l!==""&&i.get(a).add(String(l))}const o=V.filter(t=>i.get(t).size>1);if(o.length===0)return[{label:"",items:e,varying:o}];const s=new Map,r=[];for(const t of e){const a=o.map(l=>String(t.wafer?.metadata?.[l]??"(none)")).join(" \xB7 ");s.has(a)||(s.set(a,[]),r.push(a)),s.get(a).push(t)}return r.map(t=>({label:t,items:s.get(t),varying:o}))}function we(e,i,o,s,r,t,a,l,c="",u=!1){const n=_e(e.map(h=>h.source??h),{perWaferSummaries:e.map(h=>h.statsSummary),...a}),m=[],y=[],v=[],S=[];for(const h of e){const T=h.dies??[];h.wafer&&(m.push(h.wafer),v.push(T),S.push(k(h,r)));for(const Y of T)y.push(Y)}const p=e.map(h=>({dies:h.dies??[],passBins:k(h,r)})),g=l??He(p,{hbinDefs:i,sbinDefs:o}).colors,b=y.some(h=>h.hbin!=null),D=y.some(h=>h.sbin!=null),d=b||D,f=n.perWafer.map(h=>h.summary.stats.yieldPercent).filter(h=>h!==null),$=f.length?f.reduce((h,T)=>h+T,0)/f.length:null;let F=0,B=0,C=0,R=0,W=0;for(const h of p){const T=new Set(h.passBins);for(const Y of h.dies){if(F++,Y.edgeExcluded&&R++,Y.partial&&W++,!j(Y))continue;const Z=oe(Y,T);Z!==void 0&&(B++,Z&&C++)}}const ve=B-C,U=B>0?C/B*100:null,De=[{label:"Wafers",value:String(n.stats.waferCount)},{label:"Total dies",value:String(F)},...d?[{label:"Good dies",value:String(C)},{label:"Bad dies",value:String(ve)}]:[],...R>0?[{label:"Edge excluded",value:String(R)}]:[],...W>0?[{label:"Partial dies",value:String(W)}]:[],...$!==null?[{label:ft,value:`${$.toFixed(1)}%`}]:[],...U!==null?[{label:"Total yield",value:`${U.toFixed(1)}%`}]:[]],xe=ae(n.perWafer.map(h=>h.summary.wafer)),Pe=x(xe.lotId!==void 0?"Lot Summary":"Summary",de(De)),Fe=ce(e.map(h=>({metadata:h.wafer?.metadata}))),Be=x("Per-Wafer Yield",Ft(n,e)),K=t??Ge(e[0]),Ce=Tt(e,s,r),L=n.perWafer.map(h=>h.summary),Te=d?Yt(y,i,o,L,p,g):"",Ye=d&&m.length?Se("Ring Yield (All Wafers)",ne,v,m,K,S):"",Ne=d&&m.length?Se("Quadrant Yield (All Wafers)",se,v,m,K,S):"",J=s.length?Nt(e,y,s,L,n.stats.testSpecYield,_(c)):"",X=s.length?Mt(y,s,L,Q(c)):"",Me=s.length?ge(e,s):"",Re=n.findings.length?he(n.findings,n.stats.waferCount,c,u):"",We=Bt(n),Le=[Pe,be(n,Ae(p.map(h=>h.passBins)),c,ye(s,c,!!J,!!X)),Fe,Be,Ce,Te,Ye,Ne,J,X,Me,Re,We].filter(Boolean).join(`
|
|
29
|
+
`);return{lotSummary:n,sections:Le}}function $e(e,i,o,s=""){return`<main class="report">
|
|
30
30
|
<header class="report-header">
|
|
31
|
-
<h1>${
|
|
32
|
-
<p class="report-subtitle">Generated ${
|
|
31
|
+
<h1>${w(e)}</h1>
|
|
32
|
+
<p class="report-subtitle">Generated ${w(o)}</p>
|
|
33
33
|
</header>
|
|
34
|
-
${
|
|
35
|
-
<p class="footer">Generated ${
|
|
36
|
-
</main>`}export function renderLotSummaryReportHtml(e,
|
|
34
|
+
${le(i,s)}
|
|
35
|
+
<p class="footer">Generated ${w(o)}</p>
|
|
36
|
+
</main>`}export function renderLotSummaryReportHtml(e,i={}){const{items:o,hbinDefs:s,sbinDefs:r,testDefs:t=[],passBins:a,ringCount:l,analyzeOptions:c}=e,u=new Date().toLocaleString(),n=Rt(o);if(n.length===1){const{lotSummary:p,sections:g}=we(n[0].items,s,r,t,a,l,c,e.binColors,"",e.live),b=ae(p.perWafer.map(d=>d.summary.wafer)),D=i.title??(b.lotId!==void 0?`Lot Summary \u2014 ${b.lotId}`:`Summary \u2014 ${et(b)}`);return`<!DOCTYPE html>
|
|
37
37
|
<html lang="en">
|
|
38
38
|
<head>
|
|
39
39
|
<meta charset="UTF-8">
|
|
40
|
-
<title>${
|
|
40
|
+
<title>${w(D)}</title>
|
|
41
41
|
<style>
|
|
42
|
-
${
|
|
42
|
+
${z()}
|
|
43
43
|
</style>
|
|
44
44
|
</head>
|
|
45
45
|
<body>
|
|
46
|
-
${
|
|
47
|
-
${e.live
|
|
46
|
+
${$e(D,g,u)}
|
|
47
|
+
${G(e.live)}
|
|
48
48
|
</body>
|
|
49
|
-
</html>`}const
|
|
50
|
-
${
|
|
49
|
+
</html>`}const m=i.title??"Summary",y=n.map((p,g)=>{const b=`g${g+1}-`,{lotSummary:D,sections:d}=we(p.items,s,r,t,a,l,c,e.binColors,b,e.live),f=p.varying.includes("lot")?void 0:D.lot?.lot??D.lot?.lotId,$=f?`${p.label} \xB7 Lot ${String(f)}`:p.label;return $e(`${m} \u2014 ${$}`,d,u,b)}),v=`<p style="max-width:1080px;margin:0 auto 8px;padding:8px 12px;background:var(--report-surface);border:1px solid var(--report-line);border-radius:4px;font-size:12px;color:var(--report-muted);">This load spans ${n.length} groups by identity \u2014 shown separately below so stats are never pooled across them.</p>`,S=y.map((p,g)=>`${g===0?"":'<hr style="max-width:1080px;margin:32px auto 0;border:none;border-top:3px solid var(--report-line-strong);">'}
|
|
50
|
+
${p}`).join(`
|
|
51
51
|
`);return`<!DOCTYPE html>
|
|
52
52
|
<html lang="en">
|
|
53
53
|
<head>
|
|
54
54
|
<meta charset="UTF-8">
|
|
55
|
-
<title>${
|
|
55
|
+
<title>${w(m)}</title>
|
|
56
56
|
<style>
|
|
57
|
-
${
|
|
57
|
+
${z()}
|
|
58
58
|
</style>
|
|
59
59
|
</head>
|
|
60
60
|
<body>
|
|
61
61
|
<div class="report" style="padding-top:24px;">
|
|
62
|
-
${S}
|
|
63
|
-
</div>
|
|
64
62
|
${v}
|
|
65
|
-
|
|
63
|
+
</div>
|
|
64
|
+
${S}
|
|
65
|
+
${G(e.live)}
|
|
66
66
|
</body>
|
|
67
|
-
</html>`}export{
|
|
67
|
+
</html>`}export{Oe as openHtmlReport};export function renderWaferReportHtml(e,i,o={}){return renderSummaryReportHtml({wafer:e.wafer,dies:e.dies,yieldSummary:e.yield,dataCoverage:e.dataCoverage,hbinDefs:e.hbinDefs,sbinDefs:e.sbinDefs,testDefs:e.testDefs,statsSummary:i??e.statsSummary??(te(e)?Ve(e):void 0),passBins:[...e.passBins],ringCount:e.ringCount,binColors:o.binColors,live:o.live},o)}export function renderLotReportHtml(e,i={}){const o=ee(e.map(t=>t.hbinDefs)),s=ee(e.map(t=>t.sbinDefs)),r=e.some(t=>t.testDefs?.length)?Ue([...e]).defs:void 0;return renderLotSummaryReportHtml({items:e.map((t,a)=>({label:I(t,a),wafer:t.wafer,dies:t.dies,passBins:[...t.passBins],statsSummary:t.statsSummary,source:te(t)?t:void 0})),hbinDefs:o.length?o:void 0,sbinDefs:s.length?s:void 0,testDefs:r,ringCount:e[0]?.ringCount,analyzeOptions:i.analyzeOptions,binColors:i.binColors,live:i.live},{title:i.title})}
|
|
@@ -52,9 +52,10 @@ export declare function renderMeter(tier: MeterTier, word: string): string;
|
|
|
52
52
|
export declare function renderSeverityMeter(severity: StatsSeverity): string;
|
|
53
53
|
export declare const severityTier: (severity: StatsSeverity) => MeterTier;
|
|
54
54
|
/**
|
|
55
|
-
* A value with a bar
|
|
55
|
+
* A value with a bar beside it, for scanning a column of yields or shares. The figure is always
|
|
56
56
|
* printed; the bar is a second way to read it, scaled 0–100 (so a yield bar is never stretched
|
|
57
|
-
* to its own column's range).
|
|
57
|
+
* to its own column's range). The figure sits beside the bar, never on it: a bar takes the bin's
|
|
58
|
+
* own colour, and no one ink reads on every colour a bin can have.
|
|
58
59
|
*/
|
|
59
60
|
export declare function barCell(percent: number, text: string, className?: string, color?: string): TableCell;
|
|
60
61
|
/** A signed difference in yield points, tinted by `shortfallStep` (only a shortfall of a point or more). */
|
|
@@ -92,11 +93,6 @@ export declare function derivedFindingsKeyHtml(findings: StatsFinding[]): string
|
|
|
92
93
|
* finding ids can never share an anchor, and valid in an `id` attribute whatever the id holds.
|
|
93
94
|
*/
|
|
94
95
|
export declare function findingAnchor(id: string, scope?: string): string;
|
|
95
|
-
/**
|
|
96
|
-
* `anchorScope`: give each row an `id` so the synthesis can link to it, prefixed so two summaries in
|
|
97
|
-
* one document cannot share one. Only for the page's one table per summary — a per-wafer table
|
|
98
|
-
* repeats ids that another wafer's table also carries — so it is left out there.
|
|
99
|
-
*/
|
|
100
96
|
export declare function findingsTableHtml(findings: StatsFinding[], totalWafers?: number, anchorScope?: string, live?: boolean): string;
|
|
101
97
|
/**
|
|
102
98
|
* The synthesis as a section: the headline, the items, and what was compared. Every item links to its
|
|
@@ -105,11 +101,8 @@ export declare function findingsTableHtml(findings: StatsFinding[], totalWafers?
|
|
|
105
101
|
* at nothing and no item is linked only because of where its figures came from.
|
|
106
102
|
*/
|
|
107
103
|
export declare function synthesisSectionHtml(synthesis: Synthesis, anchorFor: (target: SynthesisTarget) => string | undefined): string;
|
|
108
|
-
/**
|
|
109
|
-
|
|
110
|
-
* holds the report, which selects that finding on the map. Inert when the report is opened on its own
|
|
111
|
-
* (no parent window) or where scripts are blocked, and the rows stay a plain table either way.
|
|
112
|
-
*/
|
|
104
|
+
/** The scripts at the foot of every report document: in-page links, and for a `live` report the finding clicks. */
|
|
105
|
+
export declare function reportScripts(live: boolean | undefined): string;
|
|
113
106
|
export declare const LIVE_FINDINGS_SCRIPT = "<script>\ndocument.addEventListener('click', function (e) {\n var row = e.target.closest && e.target.closest('[data-finding]');\n if (row && window.parent !== window) window.parent.postMessage({ wmapFinding: row.getAttribute('data-finding') }, '*');\n});\n</script>";
|
|
114
107
|
export declare function formatFindingCoverage(finding: Pick<StatsFinding, 'stats'>, total?: number): string;
|
|
115
108
|
export declare function reportStyles(): string;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import{SYNTHESIS_ALSO_HEADING as
|
|
2
|
-
<h2>${o(
|
|
1
|
+
import{SYNTHESIS_ALSO_HEADING as v,synthesisMoreTests as w,synthesisRowShare as $}from"./synthesis.js";import{formatFindingTooltip as y,findingMetricLabel as k,isProportionFinding as S}from"./findingText.js";import{arrangeFindings as z}from"./filterFindings.js";import{SEVERITY_MARK as h,METER_DOTS as j,filledDots as T,impactWord as N,impactShortWord as I,shortfallColor as b,shortfallStep as M,formatPoints as F,barPercent as A}from"./presentation.js";import{fmt as f,plainBinTerms as E}from"../renderer/fmt.js";import{buildFacetTable as L,attributeLabel as D}from"./facets.js";import{escHtml as o}from"../core/utils.js";import{derivedKeyText as _,derivedFields as R}from"../renderer/testLabel.js";export function renderSection(e,r,t="",a){return`<section class="${["report-section",t].filter(Boolean).join(" ")}"${a?` id="${o(a)}"`:""}>
|
|
2
|
+
<h2>${o(e)}</h2>
|
|
3
3
|
${r}
|
|
4
|
-
</section>`}export function renderDefinitionList(
|
|
4
|
+
</section>`}export function renderDefinitionList(e,r="meta-list"){if(!e.length)return"";const t=e.map(a=>`<div class="definition-item"><dt>${o(a.label)}</dt><dd>${o(a.value)}</dd></div>`).join(`
|
|
5
5
|
`);return`<dl class="${r}">
|
|
6
|
-
${
|
|
7
|
-
</dl>`}export function buildMetadataRows(
|
|
8
|
-
${
|
|
9
|
-
<dt>${o(
|
|
10
|
-
<dd>${o(
|
|
11
|
-
${
|
|
6
|
+
${t}
|
|
7
|
+
</dl>`}export function buildMetadataRows(e){return L(e,{facetableOnly:e.length>1}).map(t=>({label:D(t.key),value:t.values.map(a=>a.value).join(", ")}))}export function renderMetadataSection(e){const r=buildMetadataRows(e);return r.length?renderSection("Wafer Info",renderDefinitionList(r)):""}export function renderMetricGrid(e){return e.length?`<dl class="metric-grid">
|
|
8
|
+
${e.map(t=>`<div class="metric">
|
|
9
|
+
<dt>${o(t.label)}</dt>
|
|
10
|
+
<dd>${o(t.value)}</dd>
|
|
11
|
+
${t.hint?`<span class="metric-hint">${o(t.hint)}</span>`:""}
|
|
12
12
|
</div>`).join(`
|
|
13
13
|
`)}
|
|
14
|
-
</dl>`:""}export function renderTable(
|
|
14
|
+
</dl>`:""}export function renderTable(e,r,t={}){if(!r.length)return`<p class="no-data">${o(t.emptyMessage??"No data")}</p>`;const a=["report-table",t.className].filter(Boolean).join(" "),l=e.map(i=>`<th>${o(i)}</th>`).join(""),c=i=>typeof i=="string"?`<td>${i}</td>`:`<td${i.className?` class="${i.className}"`:""}>${i.html}</td>`,p=r.map(i=>`<tr>${i.map(c).join("")}</tr>`).join(`
|
|
15
15
|
`);return`<table class="${a}">
|
|
16
16
|
<thead><tr>${l}</tr></thead>
|
|
17
17
|
<tbody>${p}</tbody>
|
|
18
|
-
</table>`}export function renderMeter(
|
|
19
|
-
${l}`}export function formatFindingDelta(
|
|
18
|
+
</table>`}export function renderMeter(e,r){const t=T(e);return`<span class="meter"><span class="meter-dots" aria-hidden="true">${"\u25CF".repeat(t)}${"\u25CB".repeat(j-t)}</span><span class="meter-word">${o(r)}</span></span>`}export function renderSeverityMeter(e){const{tier:r,word:t}=h[e];return renderMeter(r,t)}export const severityTier=e=>h[e].tier;export function barCell(e,r,t="",a){const l=a?`;background:${o(a)}`:"";return{html:`<span class="cellbar"><span class="cellbar-value">${o(r)}</span><span class="cellbar-track" aria-hidden="true"><i style="width:${A(e).toFixed(1)}%${l}"></i></span></span>`,className:["barcell",t].filter(Boolean).join(" ")}}export function deltaCell(e){const r=M(e);return{html:o(F(e)),className:["numeric",r?`low-${r}`:""].filter(Boolean).join(" ")}}export function withSectionNav(e,r=""){const t=[];let a=0;const l=e.replace(/<section class="(report-section[^"]*)"(?: id="([^"]*)")?>(\s*<h2>)(.*?)(<\/h2>)/g,(p,i,n,d,m,s)=>{++a;const g=n??`sec-${r}${a}`;return t.push({id:g,title:m}),`<section class="${i}" id="${g}">${d}${m}${s}`});return t.length<4?e:`<nav class="report-toc" aria-label="Sections">${t.map(p=>`<a href="#${p.id}">${p.title}</a>`).join("")}</nav>
|
|
19
|
+
${l}`}export function formatFindingDelta(e){if(e.variable.kind==="spatialPattern")return"\u2014";const r=e.effect.absoluteDelta??0,t=r>0?"+":r<0?"\u2212":"";if(S(e))return`${t}${Math.abs(r*100).toFixed(1)} pp`;if(e.variable.kind==="test"){if(e.effect.relativeDelta!==void 0&&Number.isFinite(e.effect.relativeDelta)){const a=Math.abs(e.effect.relativeDelta*100).toFixed(1);return`${t}${a}%`}return`${t}${f(Math.abs(r),e.variable.unit)}`}return`${t}${f(Math.abs(r),e.variable.unit)}`}export function derivedFindingsKeyHtml(e){const r=_(e.map(t=>({label:t.variable.label,...R(t.variable)})));return r?`<p class="report-note">${o(r)}</p>`:""}export function findingAnchor(e,r=""){return`finding-${r}`+e.replace(/[^A-Za-z0-9]/g,t=>`_${t.charCodeAt(0).toString(16)}_`)}const B="Indented rows are the findings a pattern explains, most severe first. The other findings follow, grouped by region, most severe first.";export function findingsTableHtml(e,r,t,a=!1){const l=z(e),c=[...l.patterns.flatMap(n=>[{f:n.finding,nested:!1},...n.children.map(d=>({f:d,nested:!0}))]),...l.groups.flatMap(n=>n.findings.map(d=>({f:d,nested:!1})))],p=c.length?c.map(({f:n,nested:d})=>`<tr class="tier-${severityTier(n.severity)}${d?" nested":""}${a?" live":""}"${t!==void 0?` id="${findingAnchor(n.id,t)}"`:""}${a?` data-finding="${o(n.id)}"`:""} title="${o(y(n))}${a?`
|
|
20
20
|
Click to show it on the map`:""}">
|
|
21
|
-
<td class="tight">${renderSeverityMeter(
|
|
22
|
-
<td class="tight">${o(
|
|
23
|
-
<td>${o(
|
|
24
|
-
<td class="numeric">${o(formatFindingDelta(
|
|
25
|
-
<td class="numeric">${o(formatFindingCoverage(
|
|
21
|
+
<td class="tight">${renderSeverityMeter(n.severity)}</td>
|
|
22
|
+
<td class="tight">${o(n.comparison.left)}</td>
|
|
23
|
+
<td>${o(E(k(n)))}</td>
|
|
24
|
+
<td class="numeric">${o(formatFindingDelta(n))}</td>
|
|
25
|
+
<td class="numeric">${o(formatFindingCoverage(n,r))}</td>
|
|
26
26
|
</tr>`).join(`
|
|
27
27
|
`):'<tr><td colspan="5" class="no-data">No significant findings</td></tr>';return`<table class="report-table findings-table compact">
|
|
28
28
|
<thead>
|
|
@@ -37,23 +37,67 @@ Click to show it on the map`:""}">
|
|
|
37
37
|
<tbody>
|
|
38
38
|
${p}
|
|
39
39
|
</tbody>
|
|
40
|
-
</table>${derivedFindingsKeyHtml(
|
|
41
|
-
<li class="tier-${a.impact}">${renderMeter(a.impact,
|
|
42
|
-
</ol>`:`<p class="synthesis-none">${o(
|
|
40
|
+
</table>${l.patterns.length?`<p class="report-note">${o(B)}</p>`:""}${derivedFindingsKeyHtml(e)}`}export function synthesisSectionHtml(e,r){const t=(s,g)=>{const u=r(g);return u?`<a href="#${o(u)}">${o(s)}</a>`:o(s)},[a,...l]=e.items,c=[...l,...e.also?.items??[]],p=e.also?.more??0,i=a?[t(a.subject,a.target),...a.chips.map(s=>t(s.label,s.target))]:[],n=a&&w(a);n&&i.push(o(n));const d=a?`<ol class="synthesis-items">
|
|
41
|
+
<li class="tier-${a.impact}">${renderMeter(a.impact,N(a.impact))}<span>${o(a.text)}<span class="synthesis-see">See: ${i.join(" \xB7 ")}</span></span></li>
|
|
42
|
+
</ol>`:`<p class="synthesis-none">${o(e.nothing??"Nothing stands out.")}</p>`,m=c.length?`<p class="synthesis-smaller">${o(v)}</p>
|
|
43
43
|
<ul class="synthesis-more">
|
|
44
|
-
${c.map(
|
|
44
|
+
${c.map(s=>`<li>${renderMeter(s.impact,I(s.impact))}<span>${t(s.brief,s.target)}</span><span class="synthesis-share">${o($(s))}</span></li>`).join(`
|
|
45
45
|
`)}${p?`
|
|
46
46
|
<li class="synthesis-rest"><span></span><span>and ${p} more</span><span></span></li>`:""}
|
|
47
|
-
</ul>`:"";return renderSection("What stands out",`<p class="synthesis-headline">${o(
|
|
48
|
-
${i}
|
|
47
|
+
</ul>`:"";return renderSection("What stands out",`<p class="synthesis-headline">${o(e.headline)}</p>
|
|
49
48
|
${d}
|
|
50
|
-
${
|
|
51
|
-
<p class="synthesis-checked">${o(
|
|
49
|
+
${m}
|
|
50
|
+
<p class="synthesis-checked">${o(e.checked)}</p>`,"synthesis")}const x=`<script>
|
|
51
|
+
(function () {
|
|
52
|
+
var embedded = location.href === 'about:srcdoc';
|
|
53
|
+
var stack = [];
|
|
54
|
+
var btn = document.createElement('button');
|
|
55
|
+
btn.type = 'button';
|
|
56
|
+
btn.className = 'report-back';
|
|
57
|
+
btn.textContent = '\u2190 Back';
|
|
58
|
+
btn.title = 'Back to where you were (Alt+\u2190)';
|
|
59
|
+
btn.hidden = true;
|
|
60
|
+
document.body.appendChild(btn);
|
|
61
|
+
function restore() {
|
|
62
|
+
var from = stack.pop();
|
|
63
|
+
if (!from) return;
|
|
64
|
+
window.scrollTo(0, from.y);
|
|
65
|
+
if (from.link) from.link.focus({ preventScroll: true });
|
|
66
|
+
btn.hidden = stack.length === 0;
|
|
67
|
+
}
|
|
68
|
+
function goBack() { if (stack.length) { if (embedded) restore(); else history.back(); } }
|
|
69
|
+
document.addEventListener('click', function (e) {
|
|
70
|
+
var a = e.target.closest && e.target.closest('a[href^="#"]');
|
|
71
|
+
if (!a) return;
|
|
72
|
+
var id = decodeURIComponent(a.getAttribute('href').slice(1));
|
|
73
|
+
var target = document.getElementById(id);
|
|
74
|
+
if (!target) return;
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
stack.push({ y: window.scrollY, link: a });
|
|
77
|
+
if (!embedded) history.pushState({ wmapReportJump: stack.length }, '', '#' + id);
|
|
78
|
+
target.scrollIntoView({ block: 'start' });
|
|
79
|
+
if (!target.hasAttribute('tabindex')) target.setAttribute('tabindex', '-1');
|
|
80
|
+
target.focus({ preventScroll: true });
|
|
81
|
+
// Marked for a moment: near the end of the page the target cannot reach the top, and
|
|
82
|
+
// without the mark nothing says which row the link meant.
|
|
83
|
+
target.classList.remove('report-jumped');
|
|
84
|
+
void target.offsetWidth;
|
|
85
|
+
target.classList.add('report-jumped');
|
|
86
|
+
btn.hidden = false;
|
|
87
|
+
});
|
|
88
|
+
btn.addEventListener('click', goBack);
|
|
89
|
+
document.addEventListener('keydown', function (e) {
|
|
90
|
+
if (e.altKey && e.key === 'ArrowLeft' && stack.length) { e.preventDefault(); goBack(); }
|
|
91
|
+
});
|
|
92
|
+
window.addEventListener('popstate', function () { if (stack.length) restore(); });
|
|
93
|
+
})();
|
|
94
|
+
<\/script>`;export function reportScripts(e){return e?`${x}
|
|
95
|
+
${LIVE_FINDINGS_SCRIPT}`:x}export const LIVE_FINDINGS_SCRIPT=`<script>
|
|
52
96
|
document.addEventListener('click', function (e) {
|
|
53
97
|
var row = e.target.closest && e.target.closest('[data-finding]');
|
|
54
98
|
if (row && window.parent !== window) window.parent.postMessage({ wmapFinding: row.getAttribute('data-finding') }, '*');
|
|
55
99
|
});
|
|
56
|
-
<\/script>`;export function formatFindingCoverage(
|
|
100
|
+
<\/script>`;export function formatFindingCoverage(e,r){return r!==void 0?`${e.stats.sampleSizeLeft}/${r}`:`${e.stats.sampleSizeLeft}/${e.stats.sampleSizeRight}`}export function reportStyles(){return`
|
|
57
101
|
:root {
|
|
58
102
|
--report-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
59
103
|
--report-text: #1f2328;
|
|
@@ -72,9 +116,9 @@ document.addEventListener('click', function (e) {
|
|
|
72
116
|
--report-tier-medium-edge: #a8741a;
|
|
73
117
|
--report-tier-low-bg: #edf2f7;
|
|
74
118
|
--report-tier-low-edge: #5f7f9f;
|
|
75
|
-
--report-low-1: ${
|
|
76
|
-
--report-low-2: ${
|
|
77
|
-
--report-low-3: ${
|
|
119
|
+
--report-low-1: ${b(1)};
|
|
120
|
+
--report-low-2: ${b(2)};
|
|
121
|
+
--report-low-3: ${b(3)};
|
|
78
122
|
--report-bar: #9db8d3;
|
|
79
123
|
}
|
|
80
124
|
|
|
@@ -142,9 +186,6 @@ document.addEventListener('click', function (e) {
|
|
|
142
186
|
.synthesis-more { list-style: none; margin: 0 0 8px; padding: 0; }
|
|
143
187
|
.synthesis-more li { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: baseline; margin: 0 0 3px; }
|
|
144
188
|
.synthesis-share { font-variant-numeric: tabular-nums; color: var(--report-muted); }
|
|
145
|
-
.synthesis-watch { list-style: none; margin: 0 0 6px; padding: 0; }
|
|
146
|
-
.synthesis-watch li { margin: 0 0 3px; }
|
|
147
|
-
.synthesis-watch strong { margin-right: 6px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--report-muted); }
|
|
148
189
|
.synthesis-checked, .synthesis-none { color: var(--report-muted); margin: 0; }
|
|
149
190
|
.synthesis a { color: var(--report-link); text-decoration: underline; text-underline-offset: 2px; }
|
|
150
191
|
.synthesis-see { display: block; margin-top: 4px; color: var(--report-muted); }
|
|
@@ -336,19 +377,35 @@ document.addEventListener('click', function (e) {
|
|
|
336
377
|
.report-toc a { color: var(--report-muted); text-decoration: none; }
|
|
337
378
|
.report-toc a:hover { color: var(--report-text); text-decoration: underline; }
|
|
338
379
|
|
|
339
|
-
/*
|
|
380
|
+
/* Shown after an in-page jump; returns to where the reader was. */
|
|
381
|
+
.report-back {
|
|
382
|
+
position: fixed; right: 16px; bottom: 16px; z-index: 10;
|
|
383
|
+
font: 600 13px var(--report-font); color: var(--report-link);
|
|
384
|
+
background: #fff; border: 1px solid var(--report-line-strong); border-radius: 4px;
|
|
385
|
+
padding: 6px 12px; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
|
|
386
|
+
}
|
|
387
|
+
.report-back:hover { background: var(--report-surface); }
|
|
388
|
+
.report-back:focus-visible { outline: 2px solid var(--report-link); outline-offset: 2px; }
|
|
389
|
+
.report-back[hidden] { display: none; }
|
|
390
|
+
[tabindex="-1"]:focus { outline: none; }
|
|
391
|
+
.report-jumped { animation: report-jumped 2s ease-out; }
|
|
392
|
+
@keyframes report-jumped {
|
|
393
|
+
0%, 60% { outline: 2px solid var(--report-link); outline-offset: -2px; }
|
|
394
|
+
100% { outline: 2px solid transparent; outline-offset: -2px; }
|
|
395
|
+
}
|
|
396
|
+
@media (prefers-reduced-motion: reduce) { .report-jumped { animation-duration: 0.01s; animation-delay: 1.5s; animation-fill-mode: backwards; } }
|
|
397
|
+
|
|
398
|
+
/* The value is always printed; the bar beside it is for scanning a column. */
|
|
340
399
|
table.report-table td.barcell { min-width: 150px; }
|
|
341
|
-
.cellbar {
|
|
400
|
+
.cellbar { display: flex; align-items: center; gap: 8px; }
|
|
401
|
+
.cellbar-value { flex: none; min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; }
|
|
402
|
+
.cellbar-track { flex: 1; height: 12px; }
|
|
342
403
|
.cellbar i {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
top: 50%;
|
|
346
|
-
height: 12px;
|
|
347
|
-
transform: translateY(-50%);
|
|
404
|
+
display: block;
|
|
405
|
+
height: 100%;
|
|
348
406
|
background: var(--report-bar);
|
|
349
407
|
border-radius: 0 2px 2px 0;
|
|
350
408
|
}
|
|
351
|
-
.cellbar span { position: relative; padding-left: 4px; }
|
|
352
409
|
|
|
353
410
|
/* Shortfall below the reference, light to strong. Full ink on every tint (see the tier tokens). */
|
|
354
411
|
table.report-table td.low-1 { background: var(--report-low-1); }
|
|
@@ -416,6 +473,7 @@ document.addEventListener('click', function (e) {
|
|
|
416
473
|
}
|
|
417
474
|
|
|
418
475
|
.report-toc { display: none; }
|
|
476
|
+
.report-back { display: none; }
|
|
419
477
|
|
|
420
478
|
section.report-section,
|
|
421
479
|
tr {
|