@wafertools/wafermap 0.35.0 → 0.36.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 +18 -9
- package/CHANGELOG.md +246 -0
- package/README.md +7 -4
- 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/boxplot.js +1 -1
- package/dist/packages/canvas-adapter/charts/capability.js +1 -1
- package/dist/packages/canvas-adapter/charts/correlation.js +1 -1
- package/dist/packages/canvas-adapter/charts/histogram.js +1 -1
- package/dist/packages/canvas-adapter/dataTab.js +1 -1
- package/dist/packages/canvas-adapter/drilldown.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 +7 -0
- package/dist/packages/canvas-adapter/insightsTab.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 +85 -38
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/summaryPanel.d.ts +38 -12
- package/dist/packages/canvas-adapter/summaryPanel.js +4 -2
- package/dist/packages/canvas-adapter/summaryToggle.d.ts +11 -0
- package/dist/packages/canvas-adapter/summaryToggle.js +1 -0
- package/dist/packages/canvas-adapter/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 +2 -0
- package/dist/packages/canvas-adapter/toolbar.js +2 -2
- package/dist/packages/canvas-adapter/userGuideHtml.d.ts +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.js +46 -23
- 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 +5 -0
- package/dist/packages/core/classify.js +1 -1
- package/dist/packages/core/dieTable.d.ts +31 -0
- package/dist/packages/core/dieTable.js +1 -1
- package/dist/packages/core/passBins.d.ts +6 -0
- package/dist/packages/core/passBins.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 +50 -4
- package/dist/packages/renderer/buildWaferMap.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/spec.d.ts +4 -0
- package/dist/packages/renderer/spec.js +1 -1
- package/dist/packages/renderer/valueFilter.d.ts +55 -0
- package/dist/packages/renderer/valueFilter.js +1 -0
- package/dist/packages/stats/analyzeWaferLot.d.ts +16 -0
- package/dist/packages/stats/analyzeWaferLot.js +1 -1
- package/dist/packages/stats/analyzeWaferMap.d.ts +62 -4
- package/dist/packages/stats/analyzeWaferMap.js +1 -1
- package/dist/packages/stats/capability.d.ts +5 -0
- package/dist/packages/stats/capability.js +1 -1
- package/dist/packages/stats/clusterDetection.js +1 -1
- package/dist/packages/stats/connectedComponents.d.ts +19 -0
- package/dist/packages/stats/connectedComponents.js +1 -1
- package/dist/packages/stats/correlation.d.ts +36 -4
- package/dist/packages/stats/correlation.js +1 -1
- package/dist/packages/stats/filterFindings.d.ts +1 -1
- 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/index.d.ts +2 -1
- package/dist/packages/stats/index.js +1 -1
- package/dist/packages/stats/lotDrift.js +1 -1
- package/dist/packages/stats/lotPattern.js +1 -1
- package/dist/packages/stats/math.d.ts +25 -3
- package/dist/packages/stats/math.js +1 -1
- package/dist/packages/stats/mergeTestDefs.js +1 -1
- package/dist/packages/stats/patternClassification.d.ts +44 -18
- package/dist/packages/stats/patternClassification.js +1 -1
- package/dist/packages/stats/plotData.d.ts +11 -0
- package/dist/packages/stats/plotData.js +1 -1
- package/dist/packages/stats/regions.d.ts +6 -0
- package/dist/packages/stats/regions.js +1 -1
- package/dist/packages/stats/renderSummaryReport.js +33 -33
- package/dist/packages/stats/reportHtml.d.ts +12 -18
- package/dist/packages/stats/reportHtml.js +112 -48
- package/dist/packages/stats/synthesis.d.ts +48 -17
- package/dist/packages/stats/synthesis.js +1 -1
- 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 +89 -22
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/dist/packages/canvas-adapter/summaryRail.d.ts +0 -7
- package/dist/packages/canvas-adapter/summaryRail.js +0 -1
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import{waferDisplayLabel as
|
|
2
|
-
`)}function
|
|
3
|
-
`)),
|
|
1
|
+
import{waferDisplayLabel as I}from"../core/waferLabel.js";import{binPassSets as Le,binPassSetsByWafer as Ie,mergeBinDefs as X,resolveBinColors as Ee,resolveBinColorsByWafer as ke}from"../renderer/binColors.js";import{commonPassBins as He,itemPassBins as E,passBinsLabel as Ae}from"../core/passBins.js";import{itemRingCount as je}from"../core/ringCount.js";import{isParametricTest as k,isBuiltMap as Z}from"../renderer/buildWaferMap.js";import{buildRingRegions as ee,buildQuadrantRegions as te,buildRegionYieldData as Ge}from"./regions.js";import{openHtmlReport as qe}from"./renderFindingsReport.js";import{analyzeWaferLot as ze}from"./analyzeWaferLot.js";import{computeFunctionalYield as Oe,analyzeWaferMap as _e}from"./analyzeWaferMap.js";import{mergeTestDefs as Qe}from"./mergeTestDefs.js";import{buildFacetTable as Ve,facetValueOf as Ue,FACET_NONE_VALUE as Ke}from"./facets.js";import{visibleFindings as H}from"./filterFindings.js";import{buildYieldDataCombined as Je}from"./yield.js";import{describeWaferPopulation as ne,populationLabel as Xe}from"./population.js";import{buildTestPassRateData as Ze,hasJudgeableTests as et,poolFunctionalYield as tt}from"./testPassRate.js";import{buildCapabilityData as nt,pooledTestStatsSteps as st}from"./capability.js";import{buildSynthesis as at}from"./synthesis.js";import{binBreakdownRows as it,binBreakdownTitle as ot,binCountsFrom as rt,pooledBinCounts as lt,totalOf as ct}from"./binRows.js";import{MEAN_WAFER_YIELD_LABEL as dt,shortfallLegend as A}from"./presentation.js";import{regionYieldRows as se,waferYieldRows as ut}from"./yieldRows.js";import{describeValues as ft}from"./math.js";import{fmt as Y}from"../renderer/fmt.js";import{getDieKey as mt,isPositionedDie as pt,diePassStatus as ae}from"../core/dies.js";import{excludedCounts as gt,testValue as ht}from"../core/dieTable.js";import{limitSetName as bt}from"../renderer/valueFilter.js";import{findingsTableHtml as ie,findingAnchor as yt,synthesisSectionHtml as St,reportScripts as j,barCell as M,deltaCell as G,withSectionNav as oe,renderMetadataSection as re,renderMetricGrid as le,renderSection as D,renderTable as P,reportStyles as q}from"./reportHtml.js";import{escHtml as $,drain as wt}from"../core/utils.js";function ce(e,i){return i===0?"\u2014":`${(e/i*100).toFixed(1)}%`}function $t(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($).join(" \xB7 ")}`:""}function de(e,i,o,s,r){if(!e.size)return"";const t=it(e,i,s).map(a=>{const l=a.passing?"muted-row":"",c=u=>({html:$(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 D(ot(o,ct(e)),P(["Bin","Name","Dies","Share"],t,{className:"compact"}))}function vt(e,i,o,s,r,t){const a=Le(e,r);return["hard","soft"].map(l=>de(rt(e,l,l==="hard"?s.hard:s.soft),l==="hard"?i:o,l,a[l],t[l])).join(`
|
|
2
|
+
`)}function ue(e,i,o,s){const r=new Set(s),t=new Map(o.map(n=>[mt(n),n]));if(!o.some(n=>n.hbin!=null||n.sbin!=null)||!i.length)return"";const l=[];for(const n of i){let f=0,S=0;for(const v of n.dieKeys){const y=t.get(v);if(!y||y.partial||y.edgeExcluded)continue;const p=ae(y,r);p!==void 0&&(S++,p&&f++)}S&&l.push({label:n.label,pass:f,total:S})}if(!l.length)return"";const{rows:c}=se(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=>[$(n.label),String(n.passDies),String(n.n),M(n.yieldPercent,ce(n.passDies,n.n)),G(n.delta)]);return D(e,P(["Region","Pass","Total","Yield","vs wafer"],u,{className:"compact"})+`<p class="report-legend">${A("the wafer")}</p>`)}function xt(e,i){const o=new Float64Array(e.length);let s=0;for(const S of e){const v=ht(S,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:f}=ft(o.subarray(0,s));return{testNumber:i,count:r,min:t,mean:a,max:l,q1:c,median:u,q3:n,stddev:f}}function fe(e,i,o,s,r,t){if(!i.length)return"";const a=e.filter(d=>!d.partial&&!d.edgeExcluded),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(k)){const m=l.get(d.testNumber)??xt(a,d.testNumber);m&&u.push({name:d.name,unit:d.unit||void 0,stats:m,limitYield:c.get(d.testNumber)})}if(!u.length)return"";const n=d=>u.every(m=>m.stats[d]!==void 0),f=n("q1")&&n("median")&&n("q3"),S=n("stddev"),v=u.some(d=>d.limitYield!==void 0&&d.limitYield!==null),y=(d,m)=>d===void 0?"\u2014":Y(d,m),p=gt(a),g=p?`${[...p.counts.values()].reduce((d,m)=>d+m,0).toLocaleString("en-GB")} values outside the ${bt(p.by)} are excluded (not in N): `+[...p.counts].map(([d,m])=>`${$(i.find(w=>w.testNumber===d)?.name??`test ${d}`)} ${m.toLocaleString("en-GB")}`).join(", ")+". ":"",b=["Test","N","Min",...f?["Q1","Median"]:[],"Mean",...f?["Q3"]:[],"Max",...S?["StdDev"]:[],...v?["Limit yield"]:[]],x=u.map(({name:d,unit:m,stats:w,limitYield:F})=>[$(d),{html:String(w.count),className:"numeric"},y(w.min,m),...f?[y(w.q1,m),y(w.median,m)]:[],y(w.mean,m),...f?[y(w.q3,m)]:[],y(w.max,m),...S?[y(w.stddev,m)]:[],...v?[F==null?"\u2014":`${F.toFixed(1)}%`]:[]]);return D("Test Values",P(b,x,{className:"compact"})+`<p class="report-legend">${S?"StdDev is the sample standard deviation (n\u22121). ":""}${g}${r??""}</p>`,"",t)}function me(e,i,o,s){const r=o??Oe(e,i);if(!r?.length)return"";const t=r.map(a=>[$(a.label),String(a.totalDies),String(a.passDies),String(a.failDies),a.passRatePercent!==null?`${a.passRatePercent.toFixed(1)}%`:"\u2014"]);return D("Functional Tests",P(["Test","N","Pass","Fail","Pass Rate"],t,{className:"compact"}),"",s)}function pe(e,i){const o=nt(e,i);if(!o.length)return"";const s=t=>t===null?"\u2014":t.toFixed(2),r=o.map(t=>[$(t.label),t.hasSpec?t.limitBasis==="spec"?`LSL ${Y(t.lsl,t.unit)} \u2013 USL ${Y(t.usl,t.unit)}`:`Lo limit ${Y(t.lsl,t.unit)} \u2013 Hi limit ${Y(t.usl,t.unit)}`:"\u2014",Y(t.mean,t.unit),s(t.cp),s(t.cpk),s(t.pp),s(t.ppk)]);return D("Process Capability",P(["Test","Limits","Mean","Cp","Cpk","Pp","Ppk"],r,{className:"compact"}))}function ge(e,i,o="",s=!1){const r=H(e);return r.length?D("Findings",ie(r,i,o,s)):""}const z=e=>`report-tests-${e}`,O=e=>`report-functional-${e}`;function he(e,i,o,s){const r=new Set(H(e.findings).map(a=>a.id)),t=a=>a.kind==="finding"?r.has(a.id)?yt(a.id,o):void 0:s.get(a.testNumber);return St(at(e,{passBins:i?[...i]:void 0}),t)}function be(e,i,o,s){const r=new Map;for(const t of e)(k(t)?o:s)&&r.set(t.testNumber,k(t)?z(i):O(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:f}=e,S=e.binColors??Ee(s,{passBins:n,hbinDefs:a,sbinDefs:l}),v=o.metadata,y=$t(v),p=i.title??`Wafer Summary${y}`,g=new Date().toLocaleString(),b=s.filter(pt),x=ee(b,o,f),d=te(b,o,f),m=[{label:"Total dies",value:String(r.totalDies)},{label:"Filled dies",value:String(t.filledDies),hint:`${ce(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: ${Ae([n])})`,value:`${r.yieldPercent.toFixed(1)}%`}]:[],...r.edgeExcludedDies>0?[{label:"Edge excluded (outer zone)",value:String(r.edgeExcludedDies)}]:[]],w=fe(s,c,u?.stats.perTestStats,u?.stats.testSpecYield,void 0,z("")),F=me(s,c,u?.stats.functionalYield,O("")),B=[re([{metadata:o.metadata}]),D("Summary",[le(m)].filter(Boolean).join(`
|
|
3
|
+
`)),u?he(u,n,"",be(c,"",!!w,!!F)):"",vt(s,a,l,{hard:u?.stats.hardBinCounts,soft:u?.stats.softBinCounts},n,S),ue("Ring Yield",x,s,n),ue("Quadrant Yield",d,s,n),w,F,pe([{dies:s}],c),u?ge(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>${$(p)}</title>
|
|
9
9
|
<style>
|
|
10
|
-
${
|
|
10
|
+
${q()}
|
|
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>${$(p)}</h1>
|
|
17
|
+
<p class="report-subtitle">Generated ${$(g)}</p>
|
|
18
18
|
</header>
|
|
19
|
-
${
|
|
20
|
-
<p class="footer">Generated ${
|
|
19
|
+
${oe(B)}
|
|
20
|
+
<p class="footer">Generated ${$(g)}</p>
|
|
21
21
|
</main>
|
|
22
|
-
${
|
|
22
|
+
${j(e.live)}
|
|
23
23
|
</body>
|
|
24
|
-
</html>`}function
|
|
25
|
-
`))}const
|
|
26
|
-
`)}`)}if(!
|
|
27
|
-
`)+
|
|
28
|
-
`)}function
|
|
29
|
-
`);return{lotSummary:
|
|
24
|
+
</html>`}function Dt(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(ut(o).rows.map(t=>[t.waferIndex,t])),r=e.perWafer.map(t=>{const a=$(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)}%`),G(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 Pt(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">${$(l)}</h3>`+ie(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 D("Findings by Wafer",r+i.join(`
|
|
25
|
+
`))}const Ft=3;function Tt(e,i,o){const s=e.map(c=>({metadata:c.wafer?.metadata})),r=Ve(s,{facetableOnly:!0}).filter(c=>c.splittable);if(!r.length)return"";const t=r.slice(0,Ft),a=[];for(const c of t){const u=new Map;e.forEach((g,b)=>{const x=Ue(g.wafer?.metadata,c.key)??Ke;(u.get(x)??u.set(x,[]).get(x)).push(b)});const n=[...u.entries()].map(([g,b])=>({key:g,items:b.map(x=>e[x])}));if(n.length<2)continue;const f=n.map(g=>[$(g.key),$(g.items.map(b=>b.label).join(", "))]),S=Je(n.map(g=>({key:g.key,items:g.items.map(b=>({label:b.label,dies:b.dies,passBins:E(b,o)}))}))).map(g=>[$(g.label),String(g.itemCount),`${g.percent.toFixed(1)}%`]),v=[P([c.label,"Wafers"],f,{className:"compact"}),P([c.label,"Wafers","Yield"],S,{className:"compact"})],y=e.flatMap(g=>g.dies??[]);let p=0;for(const g of["spec","testFlag","functional"]){if(!et(i,g,y))continue;const b=Ze(n.map(m=>({key:m.key,items:m.items.map(w=>({dies:w.dies,testSpecYield:w.statsSummary?.stats.testSpecYield,functionalYield:w.statsSummary?.stats.functionalYield}))})),i,g);if(!b.rows.length)continue;const x=b.rows.map(m=>[$(m.label),...m.byGroup.map(w=>w.passRatePercent===null?"\u2014":`${w.passRatePercent.toFixed(1)}%`),m.overall.passRatePercent===null?"\u2014":`${m.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">${$(d)}</h4>`+P(["Test",...b.groups,"All"],x,{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">${$(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 splittable field(s) not shown.</p>`:"";return D("Split Comparison",a.join(`
|
|
27
|
+
`)+l)}function Bt(e,i,o,s,r,t){const a=Ie(r);return["hard","soft"].map(l=>de(lt(s,e,l),l==="hard"?i:o,l,a[l],t[l])).join(`
|
|
28
|
+
`)}function ye(e,i,o,s,r,t){const a=Ge(o,s,r,c=>t[c],i);if(!a.length)return"";const l=se(a).rows.map(c=>[$(c.label),M(c.yieldPercent,`${c.yieldPercent.toFixed(1)}%`),G(c.delta)]);return D(e,P(["Region","Yield","vs lot"],l,{className:"compact"})+`<p class="report-legend">${A("the lot")}</p>`)}function Ct(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 f=c.get(n.testNumber)??{n:0,sum:0,min:1/0,max:-1/0,parts:[]};f.n+=n.count,f.sum+=n.mean*n.count,f.min=Math.min(f.min,n.min),f.max=Math.max(f.max,n.max),f.parts.push({n:n.count,mean:n.mean,sd:n.stddev}),c.set(n.testNumber,f)}a=[...c.entries()].map(([u,n])=>{const f=n.sum/n.n,S=n.parts.every(y=>y.sd!==void 0),v=S&&n.n>1?n.parts.reduce((y,p)=>y+Math.max(0,p.n-1)*p.sd**2+p.n*(p.mean-f)**2,0)/(n.n-1):S?0:void 0;return{testNumber:u,count:n.n,min:n.min,max:n.max,mean:f,...v!==void 0?{stddev:Math.sqrt(v)}:{}}})}const l=a?void 0:[...wt(st(e,o)).stats].map(([c,u])=>({testNumber:c,...u}));return fe(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 Yt(e,i,o,s){const r=tt(o);return me(e,i,r,s)}const _=["lot","product","testProgram","temperature"];function Nt(e){const i=new Map(_.map(t=>[t,new Set]));for(const t of e)for(const a of _){const l=t.wafer?.metadata?.[a];l!=null&&l!==""&&i.get(a).add(String(l))}const o=_.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 Se(e,i,o,s,r,t,a,l,c="",u=!1){const n=ze(e.map(h=>h.source??h),{perWaferSummaries:e.map(h=>h.statsSummary),...a}),f=[],S=[],v=[],y=[];for(const h of e){const C=h.dies??[];h.wafer&&(f.push(h.wafer),v.push(C),y.push(E(h,r)));for(const T of C)S.push(T)}const p=e.map(h=>({dies:h.dies??[],passBins:E(h,r)})),g=l??ke(p,{hbinDefs:i,sbinDefs:o}).colors,b=S.some(h=>h.hbin!=null),x=S.some(h=>h.sbin!=null),d=b||x,m=n.perWafer.map(h=>h.summary.stats.yieldPercent).filter(h=>h!==null),w=m.length?m.reduce((h,C)=>h+C,0)/m.length:null;let F=0,B=0,N=0,R=0,W=0;for(const h of p){const C=new Set(h.passBins);for(const T of h.dies){if(F++,T.edgeExcluded&&R++,T.partial&&W++,T.partial||T.edgeExcluded)continue;const J=ae(T,C);J!==void 0&&(B++,J&&N++)}}const $e=B-N,Q=B>0?N/B*100:null,ve=[{label:"Wafers",value:String(n.stats.waferCount)},{label:"Total dies",value:String(F)},...d?[{label:"Good dies",value:String(N)},{label:"Bad dies",value:String($e)}]:[],...R>0?[{label:"Edge excluded",value:String(R)}]:[],...W>0?[{label:"Partial dies",value:String(W)}]:[],...w!==null?[{label:dt,value:`${w.toFixed(1)}%`}]:[],...Q!==null?[{label:"Total yield",value:`${Q.toFixed(1)}%`}]:[]],xe=ne(n.perWafer.map(h=>h.summary.wafer)),De=D(xe.lotId!==void 0?"Lot Summary":"Summary",le(ve)),Pe=re(e.map(h=>({metadata:h.wafer?.metadata}))),Fe=D("Per-Wafer Yield",Dt(n,e)),V=t??je(e[0]),Te=Tt(e,s,r),L=n.perWafer.map(h=>h.summary),Be=d?Bt(S,i,o,L,p,g):"",Ce=d&&f.length?ye("Ring Yield (All Wafers)",ee,v,f,V,y):"",Ye=d&&f.length?ye("Quadrant Yield (All Wafers)",te,v,f,V,y):"",U=s.length?Ct(e,S,s,L,n.stats.testSpecYield,z(c)):"",K=s.length?Yt(S,s,L,O(c)):"",Ne=s.length?pe(e,s):"",Me=n.findings.length?ge(n.findings,n.stats.waferCount,c,u):"",Re=Pt(n),We=[De,he(n,He(p.map(h=>h.passBins)),c,be(s,c,!!U,!!K)),Pe,Fe,Te,Be,Ce,Ye,U,K,Ne,Me,Re].filter(Boolean).join(`
|
|
29
|
+
`);return{lotSummary:n,sections:We}}function we(e,i,o,s=""){return`<main class="report">
|
|
30
30
|
<header class="report-header">
|
|
31
|
-
<h1>${
|
|
32
|
-
<p class="report-subtitle">Generated ${
|
|
31
|
+
<h1>${$(e)}</h1>
|
|
32
|
+
<p class="report-subtitle">Generated ${$(o)}</p>
|
|
33
33
|
</header>
|
|
34
|
-
${
|
|
35
|
-
<p class="footer">Generated ${
|
|
36
|
-
</main>`}export function renderLotSummaryReportHtml(
|
|
34
|
+
${oe(i,s)}
|
|
35
|
+
<p class="footer">Generated ${$(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=Nt(o);if(n.length===1){const{lotSummary:p,sections:g}=Se(n[0].items,s,r,t,a,l,c,e.binColors,"",e.live),b=ne(p.perWafer.map(d=>d.summary.wafer)),x=i.title??(b.lotId!==void 0?`Lot Summary \u2014 ${b.lotId}`:`Summary \u2014 ${Xe(b)}`);return`<!DOCTYPE html>
|
|
37
37
|
<html lang="en">
|
|
38
38
|
<head>
|
|
39
39
|
<meta charset="UTF-8">
|
|
40
|
-
<title>${
|
|
40
|
+
<title>${$(x)}</title>
|
|
41
41
|
<style>
|
|
42
|
-
${
|
|
42
|
+
${q()}
|
|
43
43
|
</style>
|
|
44
44
|
</head>
|
|
45
45
|
<body>
|
|
46
|
-
${
|
|
47
|
-
${
|
|
46
|
+
${we(x,g,u)}
|
|
47
|
+
${j(e.live)}
|
|
48
48
|
</body>
|
|
49
|
-
</html>`}const
|
|
50
|
-
${
|
|
49
|
+
</html>`}const f=i.title??"Summary",S=n.map((p,g)=>{const b=`g${g+1}-`,{lotSummary:x,sections:d}=Se(p.items,s,r,t,a,l,c,e.binColors,b,e.live),m=p.varying.includes("lot")?void 0:x.lot?.lot??x.lot?.lotId,w=m?`${p.label} \xB7 Lot ${String(m)}`:p.label;return we(`${f} \u2014 ${w}`,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>`,y=S.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>${$(f)}</title>
|
|
56
56
|
<style>
|
|
57
|
-
${
|
|
57
|
+
${q()}
|
|
58
58
|
</style>
|
|
59
59
|
</head>
|
|
60
60
|
<body>
|
|
61
61
|
<div class="report" style="padding-top:24px;">
|
|
62
|
-
${
|
|
62
|
+
${v}
|
|
63
63
|
</div>
|
|
64
|
-
${
|
|
65
|
-
${
|
|
64
|
+
${y}
|
|
65
|
+
${j(e.live)}
|
|
66
66
|
</body>
|
|
67
|
-
</html>`}export{
|
|
67
|
+
</html>`}export{qe 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??(Z(e)?_e(e):void 0),passBins:[...e.passBins],ringCount:e.ringCount,binColors:o.binColors,live:o.live},o)}export function renderLotReportHtml(e,i={}){const o=X(e.map(t=>t.hbinDefs)),s=X(e.map(t=>t.sbinDefs)),r=e.some(t=>t.testDefs?.length)?Qe([...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:Z(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})}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StatsFinding, StatsSeverity } from './types.js';
|
|
2
|
-
import { type Synthesis } from './synthesis.js';
|
|
2
|
+
import { type Synthesis, type SynthesisTarget } from './synthesis.js';
|
|
3
3
|
import { type MeterTier } from './presentation.js';
|
|
4
4
|
export type { MeterTier };
|
|
5
5
|
import { type FacetItem } from './facets.js';
|
|
@@ -8,7 +8,7 @@ export interface MetricItem {
|
|
|
8
8
|
value: string;
|
|
9
9
|
hint?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare function renderSection(title: string, body: string, className?: string): string;
|
|
11
|
+
export declare function renderSection(title: string, body: string, className?: string, id?: string): string;
|
|
12
12
|
export declare function renderDefinitionList(entries: Array<{
|
|
13
13
|
label: string;
|
|
14
14
|
value: string;
|
|
@@ -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,23 +93,16 @@ 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
|
-
* The synthesis as a section: the headline, the
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
|
|
106
|
-
export declare function synthesisSectionHtml(synthesis: Synthesis, anchorIds: ReadonlySet<string>, scope?: string): string;
|
|
107
|
-
/**
|
|
108
|
-
* For a report shown inside the app (the panel's modal): a click on a finding's row tells the page that
|
|
109
|
-
* holds the report, which selects that finding on the map. Inert when the report is opened on its own
|
|
110
|
-
* (no parent window) or where scripts are blocked, and the rows stay a plain table either way.
|
|
98
|
+
* The synthesis as a section: the headline, the items, and what was compared. Every item links to its
|
|
99
|
+
* evidence the same way — the lead by a "See" line naming its target and its parts, each further item and
|
|
100
|
+
* Watch line by its own text — wherever `anchorFor` finds that evidence on the page, so a link never points
|
|
101
|
+
* at nothing and no item is linked only because of where its figures came from.
|
|
111
102
|
*/
|
|
103
|
+
export declare function synthesisSectionHtml(synthesis: Synthesis, anchorFor: (target: SynthesisTarget) => string | undefined): string;
|
|
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;
|
|
112
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>";
|
|
113
107
|
export declare function formatFindingCoverage(finding: Pick<StatsFinding, 'stats'>, total?: number): string;
|
|
114
108
|
export declare function reportStyles(): string;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import{
|
|
2
|
-
<h2>${
|
|
3
|
-
${
|
|
4
|
-
</section>`}export function renderDefinitionList(
|
|
5
|
-
`);return`<dl class="${
|
|
6
|
-
${
|
|
7
|
-
</dl>`}export function buildMetadataRows(
|
|
8
|
-
${
|
|
9
|
-
<dt>${
|
|
10
|
-
<dd>${
|
|
11
|
-
${
|
|
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 b,METER_DOTS as j,filledDots as T,impactWord as N,impactShortWord as I,shortfallColor as h,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
|
+
${r}
|
|
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
|
+
`);return`<dl class="${r}">
|
|
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(
|
|
15
|
-
`);return`<table class="${
|
|
16
|
-
<thead><tr>${
|
|
17
|
-
<tbody>${
|
|
18
|
-
</table>`}export function renderMeter(
|
|
19
|
-
${
|
|
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(s=>`<th>${o(s)}</th>`).join(""),c=s=>typeof s=="string"?`<td>${s}</td>`:`<td${s.className?` class="${s.className}"`:""}>${s.html}</td>`,p=r.map(s=>`<tr>${s.map(c).join("")}</tr>`).join(`
|
|
15
|
+
`);return`<table class="${a}">
|
|
16
|
+
<thead><tr>${l}</tr></thead>
|
|
17
|
+
<tbody>${p}</tbody>
|
|
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}=b[e];return renderMeter(r,t)}export const severityTier=e=>b[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,s,n,d,m,i)=>{++a;const g=n??`sec-${r}${a}`;return t.push({id:g,title:m}),`<section class="${s}" id="${g}">${d}${m}${i}`});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">${
|
|
23
|
-
<td>${
|
|
24
|
-
<td class="numeric">${
|
|
25
|
-
<td class="numeric">${
|
|
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>
|
|
@@ -31,33 +31,79 @@ Click to show it on the map`:""}">
|
|
|
31
31
|
<th>Region</th>
|
|
32
32
|
<th>Metric</th>
|
|
33
33
|
<th class="numeric">Delta</th>
|
|
34
|
-
<th class="numeric">${
|
|
34
|
+
<th class="numeric">${r!==void 0?"Wafers":"N (region/rest)"}</th>
|
|
35
35
|
</tr>
|
|
36
36
|
</thead>
|
|
37
37
|
<tbody>
|
|
38
|
-
${
|
|
38
|
+
${p}
|
|
39
39
|
</tbody>
|
|
40
|
-
</table>${derivedFindingsKeyHtml(
|
|
41
|
-
<li class="tier-${
|
|
42
|
-
</ol>`:`<p class="synthesis-none">${
|
|
40
|
+
</table>${l.patterns.length?`<p class="report-note">${o(B)}</p>`:""}${derivedFindingsKeyHtml(e)}`}export function synthesisSectionHtml(e,r){const t=(i,g)=>{const u=r(g);return u?`<a href="#${o(u)}">${o(i)}</a>`:o(i)},[a,...l]=e.items,c=[...l,...e.also?.items??[]],p=e.also?.more??0,s=a?[t(a.subject,a.target),...a.chips.map(i=>t(i.label,i.target))]:[],n=a&&w(a);n&&s.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: ${s.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
|
-
${
|
|
45
|
-
`)}${
|
|
46
|
-
<li class="synthesis-rest"><span></span><span>and ${
|
|
47
|
-
</ul>`:"";return renderSection("What stands out",`<p class="synthesis-headline">${o(
|
|
48
|
-
${
|
|
49
|
-
${
|
|
50
|
-
${
|
|
51
|
-
<p class="synthesis-checked">${
|
|
44
|
+
${c.map(i=>`<li>${renderMeter(i.impact,I(i.impact))}<span>${t(i.brief,i.target)}</span><span class="synthesis-share">${o($(i))}</span></li>`).join(`
|
|
45
|
+
`)}${p?`
|
|
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(e.headline)}</p>
|
|
48
|
+
${d}
|
|
49
|
+
${m}
|
|
50
|
+
${e.watch?`<ul class="synthesis-watch">${e.watch.map(i=>`<li><strong>Watch</strong> ${t(i.text,i.target)}</li>`).join("")}</ul>`:""}
|
|
51
|
+
<p class="synthesis-checked">${o(e.checked)}</p>`,"synthesis")}const x=`<script>
|
|
52
|
+
(function () {
|
|
53
|
+
var embedded = location.href === 'about:srcdoc';
|
|
54
|
+
var stack = [];
|
|
55
|
+
var btn = document.createElement('button');
|
|
56
|
+
btn.type = 'button';
|
|
57
|
+
btn.className = 'report-back';
|
|
58
|
+
btn.textContent = '\u2190 Back';
|
|
59
|
+
btn.title = 'Back to where you were (Alt+\u2190)';
|
|
60
|
+
btn.hidden = true;
|
|
61
|
+
document.body.appendChild(btn);
|
|
62
|
+
function restore() {
|
|
63
|
+
var from = stack.pop();
|
|
64
|
+
if (!from) return;
|
|
65
|
+
window.scrollTo(0, from.y);
|
|
66
|
+
if (from.link) from.link.focus({ preventScroll: true });
|
|
67
|
+
btn.hidden = stack.length === 0;
|
|
68
|
+
}
|
|
69
|
+
function goBack() { if (stack.length) { if (embedded) restore(); else history.back(); } }
|
|
70
|
+
document.addEventListener('click', function (e) {
|
|
71
|
+
var a = e.target.closest && e.target.closest('a[href^="#"]');
|
|
72
|
+
if (!a) return;
|
|
73
|
+
var id = decodeURIComponent(a.getAttribute('href').slice(1));
|
|
74
|
+
var target = document.getElementById(id);
|
|
75
|
+
if (!target) return;
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
stack.push({ y: window.scrollY, link: a });
|
|
78
|
+
if (!embedded) history.pushState({ wmapReportJump: stack.length }, '', '#' + id);
|
|
79
|
+
target.scrollIntoView({ block: 'start' });
|
|
80
|
+
if (!target.hasAttribute('tabindex')) target.setAttribute('tabindex', '-1');
|
|
81
|
+
target.focus({ preventScroll: true });
|
|
82
|
+
// Marked for a moment: near the end of the page the target cannot reach the top, and
|
|
83
|
+
// without the mark nothing says which row the link meant.
|
|
84
|
+
target.classList.remove('report-jumped');
|
|
85
|
+
void target.offsetWidth;
|
|
86
|
+
target.classList.add('report-jumped');
|
|
87
|
+
btn.hidden = false;
|
|
88
|
+
});
|
|
89
|
+
btn.addEventListener('click', goBack);
|
|
90
|
+
document.addEventListener('keydown', function (e) {
|
|
91
|
+
if (e.altKey && e.key === 'ArrowLeft' && stack.length) { e.preventDefault(); goBack(); }
|
|
92
|
+
});
|
|
93
|
+
window.addEventListener('popstate', function () { if (stack.length) restore(); });
|
|
94
|
+
})();
|
|
95
|
+
<\/script>`;export function reportScripts(e){return e?`${x}
|
|
96
|
+
${LIVE_FINDINGS_SCRIPT}`:x}export const LIVE_FINDINGS_SCRIPT=`<script>
|
|
52
97
|
document.addEventListener('click', function (e) {
|
|
53
98
|
var row = e.target.closest && e.target.closest('[data-finding]');
|
|
54
99
|
if (row && window.parent !== window) window.parent.postMessage({ wmapFinding: row.getAttribute('data-finding') }, '*');
|
|
55
100
|
});
|
|
56
|
-
<\/script>`;export function formatFindingCoverage(
|
|
101
|
+
<\/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
102
|
:root {
|
|
58
103
|
--report-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
59
104
|
--report-text: #1f2328;
|
|
60
105
|
--report-muted: #5c6570;
|
|
106
|
+
--report-link: #0b5cad;
|
|
61
107
|
--report-subtle: #7a828d;
|
|
62
108
|
--report-line: #d8dee6;
|
|
63
109
|
--report-line-strong: #c7ced8;
|
|
@@ -71,9 +117,9 @@ document.addEventListener('click', function (e) {
|
|
|
71
117
|
--report-tier-medium-edge: #a8741a;
|
|
72
118
|
--report-tier-low-bg: #edf2f7;
|
|
73
119
|
--report-tier-low-edge: #5f7f9f;
|
|
74
|
-
--report-low-1: ${
|
|
75
|
-
--report-low-2: ${
|
|
76
|
-
--report-low-3: ${
|
|
120
|
+
--report-low-1: ${h(1)};
|
|
121
|
+
--report-low-2: ${h(2)};
|
|
122
|
+
--report-low-3: ${h(3)};
|
|
77
123
|
--report-bar: #9db8d3;
|
|
78
124
|
}
|
|
79
125
|
|
|
@@ -145,7 +191,8 @@ document.addEventListener('click', function (e) {
|
|
|
145
191
|
.synthesis-watch li { margin: 0 0 3px; }
|
|
146
192
|
.synthesis-watch strong { margin-right: 6px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--report-muted); }
|
|
147
193
|
.synthesis-checked, .synthesis-none { color: var(--report-muted); margin: 0; }
|
|
148
|
-
.synthesis a { color:
|
|
194
|
+
.synthesis a { color: var(--report-link); text-decoration: underline; text-underline-offset: 2px; }
|
|
195
|
+
.synthesis-see { display: block; margin-top: 4px; color: var(--report-muted); }
|
|
149
196
|
|
|
150
197
|
.report-subheading {
|
|
151
198
|
margin: 14px 0 6px;
|
|
@@ -334,19 +381,35 @@ document.addEventListener('click', function (e) {
|
|
|
334
381
|
.report-toc a { color: var(--report-muted); text-decoration: none; }
|
|
335
382
|
.report-toc a:hover { color: var(--report-text); text-decoration: underline; }
|
|
336
383
|
|
|
337
|
-
/*
|
|
384
|
+
/* Shown after an in-page jump; returns to where the reader was. */
|
|
385
|
+
.report-back {
|
|
386
|
+
position: fixed; right: 16px; bottom: 16px; z-index: 10;
|
|
387
|
+
font: 600 13px var(--report-font); color: var(--report-link);
|
|
388
|
+
background: #fff; border: 1px solid var(--report-line-strong); border-radius: 4px;
|
|
389
|
+
padding: 6px 12px; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
|
|
390
|
+
}
|
|
391
|
+
.report-back:hover { background: var(--report-surface); }
|
|
392
|
+
.report-back:focus-visible { outline: 2px solid var(--report-link); outline-offset: 2px; }
|
|
393
|
+
.report-back[hidden] { display: none; }
|
|
394
|
+
[tabindex="-1"]:focus { outline: none; }
|
|
395
|
+
.report-jumped { animation: report-jumped 2s ease-out; }
|
|
396
|
+
@keyframes report-jumped {
|
|
397
|
+
0%, 60% { outline: 2px solid var(--report-link); outline-offset: -2px; }
|
|
398
|
+
100% { outline: 2px solid transparent; outline-offset: -2px; }
|
|
399
|
+
}
|
|
400
|
+
@media (prefers-reduced-motion: reduce) { .report-jumped { animation-duration: 0.01s; animation-delay: 1.5s; animation-fill-mode: backwards; } }
|
|
401
|
+
|
|
402
|
+
/* The value is always printed; the bar beside it is for scanning a column. */
|
|
338
403
|
table.report-table td.barcell { min-width: 150px; }
|
|
339
|
-
.cellbar {
|
|
404
|
+
.cellbar { display: flex; align-items: center; gap: 8px; }
|
|
405
|
+
.cellbar-value { flex: none; min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; }
|
|
406
|
+
.cellbar-track { flex: 1; height: 12px; }
|
|
340
407
|
.cellbar i {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
top: 50%;
|
|
344
|
-
height: 12px;
|
|
345
|
-
transform: translateY(-50%);
|
|
408
|
+
display: block;
|
|
409
|
+
height: 100%;
|
|
346
410
|
background: var(--report-bar);
|
|
347
411
|
border-radius: 0 2px 2px 0;
|
|
348
412
|
}
|
|
349
|
-
.cellbar span { position: relative; padding-left: 4px; }
|
|
350
413
|
|
|
351
414
|
/* Shortfall below the reference, light to strong. Full ink on every tint (see the tier tokens). */
|
|
352
415
|
table.report-table td.low-1 { background: var(--report-low-1); }
|
|
@@ -414,6 +477,7 @@ document.addEventListener('click', function (e) {
|
|
|
414
477
|
}
|
|
415
478
|
|
|
416
479
|
.report-toc { display: none; }
|
|
480
|
+
.report-back { display: none; }
|
|
417
481
|
|
|
418
482
|
section.report-section,
|
|
419
483
|
tr {
|