@wafertools/wafermap 0.40.1 → 0.41.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 +20 -21
- package/CHANGELOG.md +140 -0
- package/README.md +6 -6
- package/dist/packages/canvas-adapter/canvasTheme.d.ts +12 -0
- package/dist/packages/canvas-adapter/canvasTheme.js +1 -1
- package/dist/packages/canvas-adapter/cellShade.d.ts +2 -2
- package/dist/packages/canvas-adapter/cellShade.js +1 -1
- package/dist/packages/canvas-adapter/chartPopulation.d.ts +3 -0
- package/dist/packages/canvas-adapter/chartPopulation.js +1 -1
- package/dist/packages/canvas-adapter/charts/capability.d.ts +3 -0
- package/dist/packages/canvas-adapter/charts/capability.js +1 -1
- package/dist/packages/canvas-adapter/charts/cardAbout.d.ts +2 -1
- package/dist/packages/canvas-adapter/charts/cardAbout.js +1 -1
- package/dist/packages/canvas-adapter/charts/chartShell.d.ts +47 -27
- package/dist/packages/canvas-adapter/charts/chartShell.js +1 -1
- package/dist/packages/canvas-adapter/charts/commonality.js +4 -4
- package/dist/packages/canvas-adapter/charts/correlation.d.ts +6 -12
- package/dist/packages/canvas-adapter/charts/correlation.js +1 -1
- package/dist/packages/canvas-adapter/charts/divergingScale.d.ts +45 -15
- package/dist/packages/canvas-adapter/charts/divergingScale.js +1 -1
- package/dist/packages/canvas-adapter/charts/groupComparison.js +1 -1
- package/dist/packages/canvas-adapter/charts/palette.d.ts +16 -30
- package/dist/packages/canvas-adapter/charts/palette.js +1 -1
- package/dist/packages/canvas-adapter/charts/patCard.js +1 -1
- package/dist/packages/canvas-adapter/charts/plotChart.d.ts +24 -1
- package/dist/packages/canvas-adapter/charts/plotChart.js +1 -1
- package/dist/packages/canvas-adapter/charts/regionYieldDiagram.d.ts +3 -0
- package/dist/packages/canvas-adapter/charts/regionYieldDiagram.js +1 -1
- package/dist/packages/canvas-adapter/charts/sweep.d.ts +3 -0
- package/dist/packages/canvas-adapter/charts/sweep.js +1 -1
- package/dist/packages/canvas-adapter/chromeRow.d.ts +68 -0
- package/dist/packages/canvas-adapter/chromeRow.js +1 -0
- package/dist/packages/canvas-adapter/chunked.d.ts +6 -0
- package/dist/packages/canvas-adapter/chunked.js +1 -1
- package/dist/packages/canvas-adapter/columnFilterPopup.d.ts +25 -0
- package/dist/packages/canvas-adapter/columnFilterPopup.js +1 -0
- package/dist/packages/canvas-adapter/composePng.d.ts +37 -0
- package/dist/packages/canvas-adapter/composePng.js +1 -0
- package/dist/packages/canvas-adapter/dataTab.d.ts +27 -0
- package/dist/packages/canvas-adapter/dataTab.js +1 -1
- package/dist/packages/canvas-adapter/dieList.js +1 -1
- package/dist/packages/canvas-adapter/differenceMapPanel.d.ts +3 -1
- package/dist/packages/canvas-adapter/differenceMapPanel.js +1 -1
- package/dist/packages/canvas-adapter/drilldown.d.ts +19 -0
- package/dist/packages/canvas-adapter/drilldown.js +1 -1
- package/dist/packages/canvas-adapter/filterEditor.d.ts +5 -0
- package/dist/packages/canvas-adapter/filterEditor.js +1 -1
- package/dist/packages/canvas-adapter/guideWindow.js +1 -1
- package/dist/packages/canvas-adapter/icons.js +1 -1
- package/dist/packages/canvas-adapter/identityHeader.d.ts +5 -0
- package/dist/packages/canvas-adapter/identityHeader.js +1 -1
- package/dist/packages/canvas-adapter/index.d.ts +7 -0
- package/dist/packages/canvas-adapter/index.js +1 -1
- package/dist/packages/canvas-adapter/insightsTab.d.ts +23 -5
- package/dist/packages/canvas-adapter/insightsTab.js +1 -1
- package/dist/packages/canvas-adapter/maplessSummary.d.ts +4 -2
- package/dist/packages/canvas-adapter/maplessSummary.js +1 -1
- package/dist/packages/canvas-adapter/openWaferMode.js +1 -1
- package/dist/packages/canvas-adapter/panelChart.d.ts +7 -0
- package/dist/packages/canvas-adapter/panelChart.js +1 -0
- package/dist/packages/canvas-adapter/panelTable.d.ts +50 -0
- package/dist/packages/canvas-adapter/panelTable.js +1 -0
- package/dist/packages/canvas-adapter/plotCard.js +1 -1
- package/dist/packages/canvas-adapter/plotEditor.d.ts +12 -0
- package/dist/packages/canvas-adapter/plotEditor.js +10 -10
- package/dist/packages/canvas-adapter/plotItems.d.ts +9 -4
- package/dist/packages/canvas-adapter/plotItems.js +1 -1
- package/dist/packages/canvas-adapter/plotJsonComplete.js +1 -1
- package/dist/packages/canvas-adapter/plotModal.d.ts +7 -0
- 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 +59 -1
- package/dist/packages/canvas-adapter/plotTab.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferGallery.d.ts +7 -0
- package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferMap.d.ts +41 -9
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/reportCharts.d.ts +41 -0
- package/dist/packages/canvas-adapter/reportCharts.js +1 -0
- package/dist/packages/canvas-adapter/reportExport.d.ts +91 -0
- package/dist/packages/canvas-adapter/reportExport.js +1 -0
- package/dist/packages/canvas-adapter/reportFigures.d.ts +29 -0
- package/dist/packages/canvas-adapter/reportFigures.js +1 -0
- package/dist/packages/canvas-adapter/reportRun.d.ts +9 -0
- package/dist/packages/canvas-adapter/reportRun.js +1 -0
- package/dist/packages/canvas-adapter/selectionOverlay.d.ts +12 -0
- package/dist/packages/canvas-adapter/selectionOverlay.js +1 -0
- package/dist/packages/canvas-adapter/summaryPanel.d.ts +150 -109
- package/dist/packages/canvas-adapter/summaryPanel.js +7 -4
- package/dist/packages/canvas-adapter/summaryToggle.js +1 -1
- package/dist/packages/canvas-adapter/tableDrilldown.d.ts +48 -0
- package/dist/packages/canvas-adapter/tableDrilldown.js +1 -0
- package/dist/packages/canvas-adapter/tableFilter.d.ts +42 -0
- package/dist/packages/canvas-adapter/tableFilter.js +1 -0
- package/dist/packages/canvas-adapter/tablePlots.d.ts +85 -0
- package/dist/packages/canvas-adapter/tablePlots.js +1 -0
- package/dist/packages/canvas-adapter/themeWatch.d.ts +7 -0
- package/dist/packages/canvas-adapter/themeWatch.js +1 -0
- package/dist/packages/canvas-adapter/toCanvas.d.ts +3 -0
- package/dist/packages/canvas-adapter/toCanvas.js +1 -1
- package/dist/packages/canvas-adapter/toolbar.d.ts +125 -36
- 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 +521 -412
- package/dist/packages/canvas-adapter/version.d.ts +2 -2
- package/dist/packages/canvas-adapter/version.js +1 -1
- package/dist/packages/canvas-adapter/viewSwitch.js +1 -1
- package/dist/packages/canvas-adapter/virtualTable.d.ts +35 -6
- package/dist/packages/canvas-adapter/virtualTable.js +1 -1
- package/dist/packages/core/aggregates.d.ts +14 -0
- package/dist/packages/core/aggregates.js +1 -1
- package/dist/packages/core/dies.d.ts +7 -0
- package/dist/packages/core/dies.js +1 -1
- package/dist/packages/core/utils.d.ts +2 -0
- package/dist/packages/core/utils.js +1 -1
- package/dist/packages/experimental/charts.d.ts +4 -0
- package/dist/packages/experimental/charts.js +1 -0
- package/dist/packages/renderer/binColors.d.ts +6 -2
- package/dist/packages/renderer/binColors.js +1 -1
- package/dist/packages/renderer/buildView.d.ts +36 -14
- package/dist/packages/renderer/buildView.js +1 -1
- package/dist/packages/renderer/buildWaferMap.d.ts +8 -0
- package/dist/packages/renderer/buildWaferMap.js +1 -1
- package/dist/packages/renderer/categoryColors.d.ts +3 -0
- package/dist/packages/renderer/categoryColors.js +1 -0
- package/dist/packages/renderer/colorMap.d.ts +15 -16
- package/dist/packages/renderer/colorMap.js +1 -1
- package/dist/packages/renderer/colorSchemes.d.ts +34 -30
- package/dist/packages/renderer/colorSchemes.js +1 -1
- package/dist/packages/renderer/dataColors.d.ts +126 -0
- package/dist/packages/renderer/dataColors.js +1 -0
- package/dist/packages/renderer/deprecate.js +1 -1
- package/dist/packages/renderer/fmt.d.ts +14 -0
- package/dist/packages/renderer/fmt.js +1 -1
- package/dist/packages/renderer/index.d.ts +2 -0
- package/dist/packages/renderer/index.js +1 -1
- package/dist/packages/renderer/spec.d.ts +5 -0
- package/dist/packages/renderer/spec.js +1 -1
- package/dist/packages/renderer/stacks.d.ts +21 -0
- package/dist/packages/renderer/stacks.js +1 -0
- package/dist/packages/renderer/timeAxis.d.ts +19 -0
- package/dist/packages/renderer/timeAxis.js +1 -0
- package/dist/packages/stats/analyzeWaferLot.js +1 -1
- package/dist/packages/stats/analyzeWaferMap.d.ts +2 -4
- package/dist/packages/stats/analyzeWaferMap.js +1 -1
- package/dist/packages/stats/binRows.js +1 -1
- package/dist/packages/stats/binShifts.d.ts +59 -0
- package/dist/packages/stats/binShifts.js +1 -0
- package/dist/packages/stats/capability.d.ts +6 -1
- package/dist/packages/stats/capability.js +1 -1
- package/dist/packages/stats/chartCatalogue.d.ts +3 -0
- package/dist/packages/stats/chartCatalogue.js +1 -1
- package/dist/packages/stats/clusterDetection.js +1 -1
- package/dist/packages/stats/columnPlot.d.ts +38 -0
- package/dist/packages/stats/columnPlot.js +1 -0
- package/dist/packages/stats/commonality.d.ts +7 -0
- package/dist/packages/stats/commonality.js +1 -1
- package/dist/packages/stats/correlation.d.ts +7 -2
- package/dist/packages/stats/correlation.js +1 -1
- package/dist/packages/stats/dataTable.d.ts +44 -0
- package/dist/packages/stats/dataTable.js +1 -0
- package/dist/packages/stats/dieRegions.js +1 -1
- package/dist/packages/stats/facets.d.ts +11 -0
- package/dist/packages/stats/facets.js +1 -1
- package/dist/packages/stats/filterFindings.d.ts +21 -0
- package/dist/packages/stats/filterFindings.js +1 -1
- package/dist/packages/stats/math.d.ts +2 -0
- package/dist/packages/stats/math.js +1 -1
- package/dist/packages/stats/overview.d.ts +114 -0
- package/dist/packages/stats/overview.js +1 -0
- package/dist/packages/stats/pat.d.ts +0 -2
- package/dist/packages/stats/pat.js +1 -1
- package/dist/packages/stats/patternClassification.d.ts +20 -3
- package/dist/packages/stats/patternClassification.js +1 -1
- package/dist/packages/stats/permutationNull.d.ts +16 -0
- package/dist/packages/stats/permutationNull.js +1 -0
- package/dist/packages/stats/plotData.d.ts +131 -10
- package/dist/packages/stats/plotData.js +1 -1
- package/dist/packages/stats/plotSpec.d.ts +10 -1
- package/dist/packages/stats/plotSpec.js +3 -3
- package/dist/packages/stats/plotTable.js +1 -1
- package/dist/packages/stats/plotWords.d.ts +52 -0
- package/dist/packages/stats/plotWords.js +1 -0
- package/dist/packages/stats/presentation.d.ts +63 -14
- package/dist/packages/stats/presentation.js +1 -1
- package/dist/packages/stats/presentationPresets.d.ts +35 -0
- package/dist/packages/stats/presentationPresets.js +1 -0
- package/dist/packages/stats/presentationSections.d.ts +83 -0
- package/dist/packages/stats/presentationSections.js +1 -0
- package/dist/packages/stats/renderSummaryReport.d.ts +80 -2
- package/dist/packages/stats/renderSummaryReport.js +1 -67
- package/dist/packages/stats/reportBlocks.d.ts +249 -0
- package/dist/packages/stats/reportBlocks.js +1 -0
- package/dist/packages/stats/reportContents.d.ts +22 -0
- package/dist/packages/stats/reportContents.js +1 -0
- package/dist/packages/stats/reportDeck.d.ts +245 -0
- package/dist/packages/stats/reportDeck.js +212 -0
- package/dist/packages/stats/reportHtml.d.ts +44 -43
- package/dist/packages/stats/reportHtml.js +82 -46
- package/dist/packages/stats/reportMaps.d.ts +67 -0
- package/dist/packages/stats/reportMaps.js +1 -0
- package/dist/packages/stats/reportSections.d.ts +55 -0
- package/dist/packages/stats/reportSections.js +1 -0
- package/dist/packages/stats/sweep.d.ts +14 -6
- package/dist/packages/stats/sweep.js +1 -1
- package/dist/packages/stats/synthesis.d.ts +79 -9
- package/dist/packages/stats/synthesis.js +1 -1
- package/dist/packages/stats/types.d.ts +22 -0
- package/dist/packages/stats/worthItems.d.ts +15 -0
- package/dist/packages/stats/worthItems.js +1 -0
- package/dist/packages/stats/yield.d.ts +13 -0
- package/dist/packages/stats/yield.js +1 -1
- package/llms.txt +1 -1
- package/package.json +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isYieldEligibleDie as
|
|
1
|
+
import{isYieldEligibleDie as T}from"../core/dies.js";import{testValue as W,testsPresent as _}from"../core/dieTable.js";import{isParametricTest as k}from"../renderer/buildWaferMap.js";import{buildSweepData as q}from"../stats/sweep.js";import{plotToSweep as z}from"../stats/plotSpec.js";import{renderPlotCard as j}from"./plotCard.js";import{renderCapabilityPanel as H}from"./charts/capability.js";import{makeTestSelect as K,openChartExpandModal as U,populationPhrase as S}from"./charts/chartShell.js";import{openCommandMenu as E,CLR as Y,FONT as G,SPACE as J,openReparentedModal as Q}from"./toolbar.js";import{requireRingCount as X}from"../core/ringCount.js";import{defaultPlot as Z,fieldCatalogue as ee,plotTitle as te,resolvePlot as ne,testsNotInLot as oe}from"../stats/plotData.js";import{newPlotId as se}from"../stats/plotSpec.js";import{sourceFromPoints as le,toPlotItems as R}from"./plotItems.js";const O=30,B=10,C=e=>e.items.flatMap(t=>t.dies);function ae(e){return e.items.map(t=>({...t,dies:t.dies.filter(o=>T(o))}))}function L(e,t,o){return(e.testDefs??[]).filter(k).map(n=>n.testNumber).filter(n=>{let u=0;for(const s of t){const a=W(s,n);if(a!==void 0&&Number.isFinite(a)&&++u>=o)return!0}return!1})}function V(e,t,o,n,u){const s=e.ownerDocument.createElement("div");s.textContent=o,s.dataset.wmapPopulation="1",Object.assign(s.style,{color:Y.label,fontSize:G.body,marginBottom:J.sm});const a=e.querySelector("[data-wmap-card-menu]")?.parentElement;a?.parentElement===e?a.after(s):e.prepend(s);const i=U(e,t,{anchor:n,onClosed:u});return()=>i?.close()}function ie(e,t,o){const n=C(o);if(o.notMeasuredReason)return o.notMeasuredReason;const u=oe(e,o.testDefs??[],()=>new Set(n.length?_(n,"values"):[]));return u||(n.some(a=>T(a))?q(n,o.testDefs,t).series.some(a=>a.points.some(i=>i.count>0))?null:"These dies have no values for this sweep\u2019s tests":"These dies are all partial or edge-excluded, which charts leave out")}function re(e,t,o){const n=ae(e),u=C(e).length,s=n.flatMap(l=>l.dies),a=S(s.length,u,e.population),i=(e.testDefs??[]).filter(k),p=o.ownerDocument,r=(l,c)=>e.notMeasuredReason?e.notMeasuredReason:s.length===0?"These dies are all partial or edge-excluded, which charts leave out":L(e,s,l).length>0?null:c,h=(l,c,b,g,v,w)=>{let D=e.activeTest??i[0]?.testNumber;const $=i.filter(P=>P.testNumber!==void 0),F=K($,D??null,P=>{D=P,M.refresh()},{ownerDocument:p}),I=v?null:y(e,t,o);let N;const A=l==="box"?{x:{builtin:"wafer"},y:{slot:"test"},color:{none:!0}}:{y:{slot:"test"},color:v?{builtin:"wafer"}:{none:!0}},M=j({doc:p,items:R(b),ctx:{testDefs:i,curation:t.attributes,...w?{populationLabel:w}:{}},extras:[F],spec:{choices:[],build:()=>({id:`drill-${l}${v?"-compare":""}`,title:c,chart:l,fields:A,...v&&l==="box"?{axes:{x:{label:"Dies"}}}:{}})},slots:()=>({test:D}),chart:{onSaveImage:t.onSaveImage,binColors:t.getBinColors?.(),readerColors:t.getReaderColors?.()},editAsPlot:I?P=>{N?.(),I(P,!0)()}:void 0});N=V(M.card,`${c} \u2014 ${g}`,`Population: ${g}`,o,()=>M.destroy())},m={section:"Distributions",label:"Value histogram",unavailable:r(1,"These dies have no parametric test values"),open:()=>h("histogram","Value histogram",n,a,!1)},d={section:"Distributions",label:"Process capability",unavailable:r(2,"Needs at least 2 of these dies with values for one test"),open:()=>{const l=H({title:"Process capability",items:n,testDefs:i,selectedTestNumber:e.activeTest,onSaveImage:t.onSaveImage,ownerDocument:p,readerColors:t.getReaderColors?.()}),c=s.length<O?` \xB7 fewer than ${O} dies, so each Ppk is a rough estimate`:"";V(l.card,`Process capability \u2014 ${a}`,`Population: ${a}${c}`,o,()=>l.destroy())}};return[m,d,...f()];function f(){const l=e.rest;if(!l||e.items.length!==1)return[];const[c]=n,b=l.dies.filter($=>T($)),g=r(1,"These dies have no parametric test values")??(c.dies.length===0?"None of the selected dies counts in a chart (partial or edge-excluded dies are left out)":b.length===0?"Every other die on the wafer is partial or edge-excluded":null),v=[{...c,label:`Selected on ${c.label} (${c.dies.length})`},{...l,dies:b,label:`Rest of ${c.label} (${b.length})`}],w=`${c.dies.length.toLocaleString()} selected dies against the other ${b.length.toLocaleString()} on ${c.label}`,D=Math.min(c.dies.length,b.length)<B?` \xB7 fewer than ${B} dies on one side, so read the spread rather than small differences`:"";return[{section:"Selection vs the rest of the wafer",label:"Value histogram",unavailable:g,open:()=>h("histogram","Value histogram, selection vs rest",v,w+D,!0,`selection vs the rest of ${c.label}`)},{section:"Selection vs the rest of the wafer",label:"Box plot",unavailable:g,open:()=>h("box","Box plot, selection vs rest",v,w+D,!0,`selection vs the rest of ${c.label}`)}]}}function y(e,t,o){const n=t.plots;if(!n)return null;const u=o.ownerDocument,s=R(e.items),a={testDefs:e.testDefs,curation:t.attributes},i=C(e),p=S(i.length,i.length,e.population),r=S(i.filter(h=>T(h)).length,i.length,e.population);return(h,m)=>()=>{const d=h.chart==="sweep",f=d?r:p;import("./plotModal.js").then(({openPlotEditor:l})=>l({doc:u,anchor:o,store:n,plot:h,draft:m,items:s,ctx:a,population:f,rawPopulation:e.population,title:`${m?d?"New sweep":"New chart":d?"Sweep":"Chart"} \u2014 ${f}`,chart:{onSaveImage:t.onSaveImage,binColors:t.getBinColors?.(),readerColors:t.getReaderColors?.(),onSelectPoints:(c,b,g,v)=>{const w=le(c,s,e.testDefs,v);w&&openDrilldownMenu(b,g,w,t)}}}))}}export function openPlotOver(e,t,o,n){y(e,t,o)?.(n,!0)()}function ue(e,t,o){const n=t.plots,u=y(e,t,o);if(!n||!u)return[];const s=R(e.items),a={testDefs:e.testDefs,curation:t.attributes},i=C(e),p=e.notMeasuredReason??(i.length===0?"Nothing is selected":null),r=n.get().map(d=>{const f=z(d);if(f)return{section:"Charts",label:f.title,unavailable:ie(d,f,e),open:u(d,!1)};const l=ne(d,s,a);return{section:"Charts",label:te(l)||"Chart",unavailable:p??l.issues[0]??(l.plotted===0?"No die here has the values this chart needs":null),open:u(d,!1)}}),h=ee(s,a),m=h.some(d=>d.group==="Tests");return r.push({section:"Charts",label:"New chart\u2026",unavailable:p??(m?null:"These dies have no parametric test values"),open:u(Z(h,se()),!0)}),r}function ce(e,t,o){const n=C(e),u=e.notMeasuredReason??(n.length===0?"Nothing is selected":null),s=n.length,a=S(s,s,e.population),i=(p,r)=>()=>{import("./dataTab.js").then(({renderSelectionTables:h})=>{const m=o.ownerDocument;let d;const f=h({doc:m,ringCount:X(e.items[0],"the drilldown tables"),items:e.items,testDefs:e.testDefs,population:e.population,view:p,onSaveText:t.onSaveText,onLocateDie:t.onLocateDie?(c,b,g)=>{d?.(),t.onLocateDie(c,b,g)}:void 0}),l=Q([f.el],{title:`${r} \u2014 ${a}`,anchor:o,ownerDocument:m,boxSize:{width:"min(96vw, 1200px)",height:"min(92vh, 780px)"},onClosed:f.destroy});l?d=()=>l.close():f.destroy()})};return[{section:"Tables",label:"Test statistics",unavailable:u??(L(e,n,1).length>0?null:"These dies have no parametric test values"),open:i("statistics","Test statistics")},...e.items.length>1?[{section:"Tables",label:"Wafers",unavailable:u,open:i("wafers","Wafers")}]:[],{section:"Tables",label:"Dies",unavailable:u,open:i("dies","Dies")}]}function de(e,t,o){return[...re(e,t,o),...ue(e,t,o),...ce(e,t,o)]}function x(e,t){return[{section:"Colour"},{label:"Change colour\u2026",active:!1,action:!0,enabled:!0,closeMenu:!0,onClick:()=>{t(),e()}}]}export function openChangeColourMenu(e,t,o){const n=E(new DOMRect(e.x,e.y-4,0,0),t,x(o,()=>n()),"Bin colour",{hook:"wmapBinColourMenu"});return n}export function openDrilldownMenu(e,t,o,n){const u=de(o,n,t),s=[];if(n.changeColour&&s.push(...x(n.changeColour,()=>p())),n.onInvertSelection){const r=n.onInvertSelection;s.push({section:"Selection"}),s.push({label:"Invert selection",active:!1,action:!0,enabled:!0,onClick:()=>{p(),r()}})}if(n.narrower){const{label:r,source:h,ctx:m}=n.narrower,d={label:`${n.narrower.backLabel??"All selected"} \u2014 ${S(C(o).length,C(o).length,o.population)}`,source:o,ctx:n};s.push({section:"Dies"}),s.push({label:r,active:!1,action:!0,enabled:!0,onClick:()=>{p(),openDrilldownMenu(e,t,h,{...m??n,narrower:d})}})}let a;for(const r of u)r.section!==a&&(s.push({section:r.section}),a=r.section),s.push({label:r.label,active:!1,action:!0,enabled:r.unavailable===null,disabledHint:r.unavailable??void 0,onClick:()=>{p(),r.open()}});const i=C(o).length,p=E(new DOMRect(e.x,e.y-4,0,0),t,s,`Open a chart or table of ${S(i,i,o.population)}`,{hook:"wmapDrilldownMenu"});return p}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type PlotWords } from '../stats/plotWords.js';
|
|
1
2
|
import { type FieldOption } from '../stats/plotData.js';
|
|
2
3
|
import { type PlotField, type PlotFilter } from '../stats/plotSpec.js';
|
|
3
4
|
import type { TestDef } from '../renderer/buildWaferMap.js';
|
|
@@ -18,6 +19,8 @@ export interface FilterEditorOptions {
|
|
|
18
19
|
attributes?: Record<string, FacetCuration>;
|
|
19
20
|
/** The switch's text: what is filtered ("Filter this plot", "Filter Insights"). */
|
|
20
21
|
switchLabel: string;
|
|
22
|
+
/** @internal The words the table says its data in. */
|
|
23
|
+
words?: PlotWords;
|
|
21
24
|
}
|
|
22
25
|
export interface FilterEditorHandle {
|
|
23
26
|
el: HTMLElement;
|
|
@@ -43,6 +46,8 @@ export interface FilterStripOptions {
|
|
|
43
46
|
kept?: string;
|
|
44
47
|
/** Buttons at the end of the line (Edit, Clear). */
|
|
45
48
|
actions?: HTMLElement[];
|
|
49
|
+
/** @internal The words the table says its data in. */
|
|
50
|
+
words?: PlotWords;
|
|
46
51
|
}
|
|
47
52
|
/**
|
|
48
53
|
* A filter as one line wherever its result is shown: a switch, each condition in words, and while on what it kept.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{conditionText as E,conditionUnit as
|
|
1
|
+
import{WAFER_WORDS as J}from"../stats/plotWords.js";import{conditionText as E,conditionUnit as M,fieldKey as T}from"../stats/plotData.js";import{sameField as U}from"../stats/plotSpec.js";import{CLR as C,FONT as F,RADIUS as I,SPACE as r,controlStyle as P,wireControlHover as H,wireTooltip as K}from"./toolbar.js";import{inputStyle as V,makeListSelect as Y,makeSegmented as _,makeToggle as D}from"./charts/chartShell.js";export function filterFields(e){return e.filter(o=>o.group!=="Pass rates"&&!("builtin"in o.field&&o.field.builtin==="test"))}const G=e=>!e.categorical,W=e=>String(Number(e.toPrecision(6)));export function buildFilterEditor(e){const{doc:o}=e,S=filterFields(e.catalogue),u=t=>S.find(s=>U(s.field,t)),m=t=>t?JSON.parse(JSON.stringify(t)):void 0;let i=m(e.filter),w=!1;const h=o.createElement("div");h.dataset.wmapFilterEditor="1",Object.assign(h.style,{display:"flex",flexDirection:"column",gap:r.md});const d=t=>{i&&i.conditions.length===0&&(i=void 0),e.onChange(m(i)),t&&k()};function L(t){if(G(t)){const n=e.extentOf(t.field);return n?{field:t.field,min:n[0],max:n[1]}:void 0}const s=e.valuesOf(t.field);return s.length?{field:t.field,values:s}:void 0}function R(t,s){const n=S.map(l=>({value:T(l.field),label:l.label,group:l.group})),f=Y(n,t?T(t):"",l=>{const b=S.find(p=>T(p.field)===l);b&&s(b)},{maxWidth:"100%",ownerDocument:o,ariaLabel:"Condition field",searchPlaceholder:"Filter fields\u2026",hook:"filter-field",emptyText:"Choose a field\u2026"});return Object.assign(f.style,{flex:"1 1 auto",minWidth:"0"}),f}function B(t,s){const n=o.createElement("button");return n.type="button",n.textContent="\u2715",n.setAttribute("aria-label",t),n.dataset.wmapFilterRemove="1",Object.assign(n.style,{...P("bare"),fontSize:F.body,padding:`0 ${r.sm}`,flexShrink:"0"}),H(n,"bare"),K(n,t),n.addEventListener("click",s),n}function N(t,s,n,f){const l=o.createElement("input");return l.type="text",l.inputMode="decimal",l.value=t===void 0?"":W(t),l.placeholder=s,l.setAttribute("aria-label",n),Object.assign(l.style,V(),{width:"9em"}),l.addEventListener("change",()=>{const b=l.value.trim(),p=b===""?void 0:Number(b);if(p!==void 0&&!Number.isFinite(p)){l.setAttribute("aria-invalid","true"),l.style.borderColor=C.errBorder;return}l.removeAttribute("aria-invalid"),l.style.borderColor="",f(p)}),l}function q(t,s){const n=o.createElement("div");n.dataset.wmapFilterCondition=String(s),n.setAttribute("role","group"),n.setAttribute("aria-label",`Condition ${s+1}`),Object.assign(n.style,{display:"flex",flexDirection:"column",gap:r.sm,padding:r.md,border:`1px solid ${C.menuBorder}`,borderRadius:I.control});const f=u(t.field),l=t.values===void 0,b=o.createElement("div");if(Object.assign(b.style,{display:"flex",alignItems:"center",gap:r.sm,flexWrap:"wrap"}),b.appendChild(R(t.field,c=>{const g=L(c);!g||!i||(i.conditions[s]=g,d(!0))})),b.appendChild(_(l?[["in","from\u2013to"],["not","outside"]]:[["in","is"],["not","is not"]],t.not?"not":"in",c=>{i&&(c==="not"?i.conditions[s].not=!0:delete i.conditions[s].not,d(!1),p.textContent=E(i.conditions[s],e.testDefs,e.attributes))},o,!0)),b.appendChild(B(`Remove the condition: ${E(t,e.testDefs,e.attributes,e.words)}`,()=>{i&&(i.conditions.splice(s,1),d(!0))})),n.appendChild(b),f)if(l){const c=o.createElement("div");Object.assign(c.style,{display:"flex",alignItems:"center",gap:r.sm,flexWrap:"wrap",fontSize:F.body,color:C.label});const g=y=>O=>{if(!i)return;const a=i.conditions[s];if(O===void 0?delete a[y]:a[y]=O,a.min===void 0&&a.max===void 0){const A=e.extentOf(a.field);A&&(a[y]=y==="min"?A[0]:A[1])}const j=a.min!==void 0&&a.max!==void 0&&a.min>a.max;j&&([a.min,a.max]=[a.max,a.min]);const z=a[y]===O&&!j;d(!z),z&&(p.textContent=E(a,e.testDefs,e.attributes,e.words))},x=M(t.field,e.testDefs),v=x?` ${x}`:"";c.append(N(t.min,"no minimum",`${f.name}: lowest value kept${x?`, in ${x}`:""}`,g("min")),o.createTextNode("to"),N(t.max,"no maximum",`${f.name}: highest value kept${x?`, in ${x}`:""}`,g("max"))),x&&c.appendChild(o.createTextNode(x));const $=e.extentOf(t.field);if($){const y=o.createElement("span");y.textContent=`(values here: ${W($[0])} to ${W($[1])}${v})`,c.appendChild(y)}n.appendChild(c)}else{const c=e.valuesOf(t.field),g=o.createElement("div");g.setAttribute("role","group"),g.setAttribute("aria-label",`${f.name}: values`),Object.assign(g.style,{display:"flex",flexWrap:"wrap",gap:`${r.xs} ${r.md}`,maxHeight:"120px",overflowY:"auto"});const x=[...c,...(t.values??[]).filter(v=>!c.includes(v))];for(const v of x){const $=D(v,(t.values??[]).includes(v),y=>{if(!i)return;const O=i.conditions[s],a=new Set(O.values??[]);if(y?a.add(v):a.delete(v),a.size===0){$.querySelector("input").checked=!0;return}O.values=x.filter(j=>a.has(j)),d(!1),p.textContent=E(O,e.testDefs,e.attributes,e.words)},o);$.dataset.wmapFilterValue=v,g.appendChild($)}n.appendChild(g)}else{const c=o.createElement("div");c.textContent=`This field is not in the ${(e.words??J).row.many} in view: the condition keeps nothing until it is changed or removed.`,Object.assign(c.style,{color:C.warnText,fontSize:F.body}),n.appendChild(c)}const p=o.createElement("div");return p.dataset.wmapFilterSummary="1",p.textContent=E(t,e.testDefs,e.attributes,e.words),Object.assign(p.style,{color:C.label,fontSize:F.body}),n.appendChild(p),n}function k(){if(h.innerHTML="",i&&i.conditions.length){const n=D(e.switchLabel,!i.off,f=>{i&&(f?delete i.off:i.off=!0,d(!1),t.style.opacity=i.off?"0.6":"1")},o,"Off keeps the conditions and applies none, so the filter can be switched back on as it was");n.dataset.wmapFilterSwitch="1",h.appendChild(n)}const t=o.createElement("div");if(Object.assign(t.style,{display:"flex",flexDirection:"column",gap:r.sm,opacity:i?.off?"0.6":"1"}),i?.conditions.forEach((n,f)=>t.appendChild(q(n,f))),w){const n=o.createElement("div");n.dataset.wmapFilterPending="1",Object.assign(n.style,{display:"flex",alignItems:"center",gap:r.sm}),n.appendChild(R(void 0,f=>{const l=L(f);l&&(w=!1,i??={conditions:[]},i.conditions.push(l),d(!0))})),n.appendChild(B("Cancel the new condition",()=>{w=!1,k()})),t.appendChild(n)}h.appendChild(t);const s=o.createElement("button");s.type="button",s.textContent=i?.conditions.length?"+ Add condition":"+ Add a condition",s.dataset.wmapFilterAdd="1",s.disabled=w||S.length===0,Object.assign(s.style,{...P("outlined"),fontSize:F.body,padding:`${r.xs} ${r.md}`,alignSelf:"flex-start"}),H(s),K(s,"Keep only what meets this condition as well as the others"),s.addEventListener("click",()=>{w=!0,k(),h.querySelector("[data-wmap-filter-pending] button")?.focus()}),h.appendChild(s)}return k(),{el:h,set:t=>{i=m(t),w=!1,k()}}}export function buildFilterStrip(e){const{doc:o,filter:S}=e,u=!S.off,m=o.createElement("div");m.dataset.wmapFilterStrip=u?"on":"off",m.setAttribute("role","status"),Object.assign(m.style,{display:"flex",flexWrap:"wrap",alignItems:"center",gap:`${r.xs} ${r.md}`,flexBasis:"100%",padding:`${r.xs} ${r.md}`,borderRadius:I.control,fontSize:F.body,background:u?C.infoBg:"transparent",color:u?C.infoText:C.label,border:`1px ${u?"solid":"dashed"} ${u?C.iconActive:C.menuBorder}`});const i=D(u?`${e.label} on:`:`${e.label} off`,u,e.onToggle,o,u?"Switch the filter off: its conditions are kept, and nothing is filtered until it is switched back on":"Switch the filter back on, with the conditions below");i.dataset.wmapFilterStripSwitch="1",i.style.fontWeight="600",i.style.color="inherit",m.appendChild(i);const w=o.createElement("span");w.dataset.wmapFilterStripText="1";const h=S.conditions.map(d=>E(d,e.testDefs,e.attributes,e.words)).join(" \xB7 ");if(w.textContent=u?h:`(would keep only: ${h})`,m.appendChild(w),u&&e.kept){const d=o.createElement("span");d.dataset.wmapFilterStripKept="1",d.textContent=`\u2014 ${e.kept}`,d.style.fontWeight="600",m.appendChild(d)}if(e.actions?.length){const d=o.createElement("span");Object.assign(d.style,{display:"inline-flex",gap:r.sm,marginLeft:"auto"}),d.append(...e.actions),m.appendChild(d)}return m}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{openHtmlReport as W}from"../stats/renderFindingsReport.js";import{buildWaferMap as F}from"../renderer/buildWaferMap.js";import{analyzeWaferMap as H}from"../stats/analyzeWaferMap.js";import{CLR as f,FONT as S,RADIUS as k,MOTION as B,wireControlHover as R,copyWmapThemeTokens as z,syncWmapPopupTheme as q,openModal as P,openFloatingWindow as j,wireExpandToggle as U}from"./toolbar.js";let y=null;function D(e,r,s=!1){if(!r)return;const t=e.querySelector(`[id="${r}"]`);if(!t)return;const i=e.ownerDocument.defaultView,n=()=>t.scrollIntoView({block:"start"});s||!i?.requestAnimationFrame?n():i.requestAnimationFrame(()=>i.requestAnimationFrame(n))}const T=[];export function registerGuideOpener(e){return T.push(e),()=>{const r=T.lastIndexOf(e);r>=0&&T.splice(r,1)}}export function openGuideAt(e,r){const s=T[T.length-1];s?s(e):N(void 0,r,e)}const I=40,V=I+8;function X(e,r){const s=e.createElement("div");s.classList.add("wmap-guide-search"),s.style.cssText="display:flex;align-items:center;gap:2px;margin-left:10px;flex:1;min-width:80px;max-width:260px;";const t=e.createElement("input");t.type="text",t.placeholder="Search guide\u2026",t.setAttribute("aria-label","Search guide"),t.style.cssText=`flex:1;min-width:0;padding:4px 8px;font-size:12px;background:${f.menuBg};color:${f.text};border:1px solid ${f.menuBorder};border-radius:${k.control};outline:none;`,t.addEventListener("focus",()=>{t.style.borderColor=f.iconActive}),t.addEventListener("blur",()=>{t.style.borderColor=f.menuBorder});const i=e.createElement("span");i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.style.cssText=`font-size:12px;color:${f.label};min-width:44px;text-align:center;flex-shrink:0;white-space:nowrap;`;function n(a,u){const d=e.createElement("button");return d.type="button",d.textContent=a,d.setAttribute("aria-label",u),d.disabled=!0,d.style.cssText=`border:none;background:none;cursor:pointer;padding:4px 6px;border-radius:${k.control};font-size:12px;color:${f.label};flex-shrink:0;opacity:0.4;`,d.addEventListener("mouseenter",()=>{d.disabled||(d.style.background=f.bgHover)}),d.addEventListener("mouseleave",()=>{d.style.background="none"}),d}const c=n("\u25B2","Previous match"),o=n("\u25BC","Next match");let l=[],m=-1;function p(){const a=l.length===0;c.disabled=a,o.disabled=a,c.style.opacity=a?"0.4":"",o.style.opacity=a?"0.4":""}function x(){for(const a of l)a.parentNode?.replaceChild(e.createTextNode(a.textContent??""),a);r.normalize(),l=[],m=-1}function g(a){if(l.length===0)return;m>=0&&(l[m].style.outline="none"),m=(a%l.length+l.length)%l.length;const u=l[m];u.style.outline=`2px solid ${f.iconActive}`,u.style.outlineOffset="1px",u.scrollIntoView({behavior:"smooth",block:"center"}),i.textContent=`${m+1}/${l.length}`}function b(a){x();const u=a.trim();if(!u){i.textContent="",p();return}const d=u.toLowerCase(),h=e.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(C){const w=C.parentElement;return!w||w.closest("script,style,.wmap-guide-toc")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),L=[];let G;for(;G=h.nextNode();)L.push(G);for(const C of L){const w=C.textContent??"",_=w.toLowerCase();if(!_.includes(d))continue;const A=e.createDocumentFragment();let E=0,v=_.indexOf(d);for(;v!==-1;){v>E&&A.appendChild(e.createTextNode(w.slice(E,v)));const $=e.createElement("mark");$.textContent=w.slice(v,v+u.length),A.appendChild($),l.push($),E=v+u.length,v=_.indexOf(d,E)}E<w.length&&A.appendChild(e.createTextNode(w.slice(E))),C.parentNode?.replaceChild(A,C)}p(),l.length===0?i.textContent="No matches":g(0)}return t.addEventListener("input",()=>b(t.value)),t.addEventListener("keydown",a=>{a.key==="Enter"?(a.preventDefault(),g(m+(a.shiftKey?-1:1))):a.key==="Escape"&&(t.value?(t.value="",b("")):t.blur())}),c.addEventListener("click",()=>g(m-1)),o.addEventListener("click",()=>g(m+1)),s.append(t,i,c,o),s}function J(e,r,s){const t=[...r.querySelectorAll("h2[id]")];if(t.length<2)return;for(const u of r.querySelectorAll("h1[id],h2[id],h3[id],h4[id]"))u.style.scrollMarginTop=`${V}px`;const i=e.createElement("div");i.classList.add("wmap-guide-toc"),i.style.cssText=`position:sticky;top:0;z-index:2;background:${f.menuBg};border-bottom:1px solid ${f.menuBorder};font-family:system-ui,-apple-system,"Segoe UI",sans-serif;`;const n=e.createElement("div");n.style.cssText=`display:flex;align-items:center;gap:4px;height:${I}px;padding:0 12px;box-sizing:border-box;`;const c=e.createElement("span");c.innerHTML='<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>',c.style.cssText=`display:inline-flex;transition:transform ${B.base};flex-shrink:0;`;const o=e.createElement("button");o.type="button";const l="wmap-guide-toc-panel";o.setAttribute("aria-expanded","false"),o.setAttribute("aria-controls",l),o.style.cssText=`display:flex;align-items:center;gap:6px;border:none;background:none;cursor:pointer;padding:6px 8px;margin:0 -8px 0 -8px;border-radius:${k.control};font-size:13px;font-weight:600;color:${f.text};`;const m=e.createElement("span");m.textContent=`Contents (${t.length})`,o.append(c,m),o.addEventListener("mouseenter",()=>{o.style.background=f.bgHover}),o.addEventListener("mouseleave",()=>{o.style.background="none"});const p=e.createElement("button");p.type="button",p.textContent="\u2191 Top",p.style.cssText=`margin-left:auto;border:none;background:none;cursor:pointer;padding:6px 8px;border-radius:${k.control};font-size:12px;color:${f.label};`,p.addEventListener("mouseenter",()=>{p.style.background=f.bgHover}),p.addEventListener("mouseleave",()=>{p.style.background="none"}),p.addEventListener("click",()=>{a.close(),r.scrollTo({top:0,behavior:"smooth"})}),s?n.append(o,X(e,r),p):n.append(o,p);const x=e.createElement("div");x.id=l,x.hidden=!0,x.style.cssText="padding:2px 12px 12px;max-height:min(60vh,440px);overflow-y:auto;";const g=/^\s*\d+(?:\.\d+)*\.?\s+/;for(const u of r.querySelectorAll("h2[id],h3[id],h4[id]")){const d=u.firstChild;d?.nodeType===Node.TEXT_NODE&&(d.textContent=(d.textContent??"").replace(g,""))}const b=e.createElement("ul");b.setAttribute("role","list"),b.style.cssText="list-style:none;margin:0;padding:0;columns:200px;column-gap:24px;";for(const u of t){const d=e.createElement("li");d.style.cssText="break-inside:avoid;";const h=e.createElement("a");h.href=`#${u.id}`,h.textContent=u.textContent??"",h.style.cssText=`display:block;padding:4px 6px;margin:0 -6px;border-radius:${k.control};font-size:12.5px;color:${f.iconActive};text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;`,h.addEventListener("mouseenter",()=>{h.style.background=f.bgHover}),h.addEventListener("mouseleave",()=>{h.style.background="none"}),h.addEventListener("click",L=>{L.preventDefault(),a.close(),u.scrollIntoView({behavior:"smooth",block:"start"})}),d.appendChild(h),b.appendChild(d)}x.appendChild(b);const a=U(o,u=>{x.hidden=!u,o.setAttribute("aria-expanded",String(u)),c.style.transform=u?"rotate(180deg)":"none"});i.append(n,x),r.prepend(i)}function O(e,r,s,t,i){const n=r,c=n.__wmapDemoApi;n.__wmapDemoApi=t;const o=e.createElement("div");return o.classList.add("wmap-guide-content"),o.innerHTML=s,J(e,o,i),{content:o,restoreApi:()=>{n.__wmapDemoApi===t&&(n.__wmapDemoApi=c)}}}function M(e,r){const s=r,t=e.querySelector("script");if(t){const i=e.ownerDocument.createElement("script");i.textContent=t.textContent,e.appendChild(i);const n=e.querySelector(".wmap-guide");return n&&s.__wmapPopulateGuideDemos?.(n),s.__wmapDestroyGuideDemos}}function K(e,r,s,t,i){const n=t?.ownerDocument??document,c=n.defaultView??window,{content:o,restoreApi:l}=O(n,c,r,s,!0);Object.assign(o.style,{flex:"1",overflow:"auto",minHeight:"0",minWidth:"0"});let m,p;const x=j({title:e,anchor:t,ownerDocument:n,printable:!0,onMaximizeChange:g=>{o.style.setProperty("--wmap-guide-reading-width",g?"1000px":"720px")},onClose:()=>{y===p&&(y=null),m?.(),l()}});return x.contentWrap.appendChild(o),m=M(o,c),D(o,i),p={close:x.close,show:g=>x.box.isConnected?(x.bringToFront(),D(o,g,!0),!0):!1}}function Q(e,r,s,t,i){const n=e.document;n.title=r,Object.assign(n.documentElement.style,{height:"100%"}),Object.assign(n.body.style,{margin:"0",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",fontFamily:S.family}),z(document.documentElement,n.documentElement);const c=q(document.documentElement,n.documentElement),{content:o,restoreApi:l}=O(n,e,s,t,!1);Object.assign(o.style,{flex:"1",overflow:"auto",minHeight:"0",minWidth:"0"}),n.body.appendChild(o);const m=M(o,e);D(o,i);let p=!1;const x=()=>{if(!p){p=!0,clearInterval(g),c();try{m?.()}catch{}l(),y===b&&(y=null)}},g=setInterval(()=>{e.closed&&x()},400);e.addEventListener("pagehide",x);const b={close:()=>{e.closed||e.close(),x()},show:a=>e.closed?(x(),!1):(e.focus(),D(o,a,!0),!0)};return b}export function openUserGuideWindow(e,r,s,t,i){if(y&&i&&y.show(i))return;y&&(y.close(),y=null);const n=s?.title??"Wafer Map \u2014 User Guide",c=(s?.html??"")+r,l=(t?.ownerDocument.defaultView??window).open("","_blank","width=800,height=820");y=l?Q(l,n,c,e,i):K(n,c,e,t,i)}export function openWaferMapGuide(e,r){N(e,r)}function N(e,r,s){Promise.all([import("./userGuideHtml.js"),import("./renderWaferMap.js"),import("./renderWaferGallery.js")]).then(([t,i,n])=>{openUserGuideWindow({buildWaferMap:F,renderWaferMap:i.renderWaferMap,renderWaferGallery:n.renderWaferGallery,analyzeWaferMap:H},t.USER_GUIDE_HTML,e,r,s)})}export function openReportModal(e,r){const s=r?.ownerDocument??document,t=s.createElement("iframe");t.srcdoc=e,t.title="Summary report",Object.assign(t.style,{border:"0",width:"100%",flex:"1",minHeight:"0",background:"#fff"});const i=s.createElement("div");Object.assign(i.style,{display:"flex",justifyContent:"flex-end",padding:"6px 14px",borderBottom:`1px solid ${f.menuBorder}`,flexShrink:"0"});const n=s.createElement("button");n.type="button",R(n,"bare"),n.textContent="Open as full page \u2197",Object.assign(n.style,{border:"none",background:"none",color:f.iconActive,cursor:"pointer",fontSize:S.body,textDecoration:"underline",padding:"0"}),n.addEventListener("click",()=>W(e)),i.appendChild(n);const c=s.defaultView??window,o=m=>{if(m.source!==t.contentWindow)return;const p=m.data?.wmapFinding;typeof p=="string"&&r?.onFinding?.(p,l)};r?.onFinding&&c.addEventListener("message",o);const l=P({title:"Summary report",anchor:r?.anchor,ownerDocument:s,printable:()=>t.contentWindow?.print(),onClose:()=>c.removeEventListener("message",o)});return l.contentWrap.style.flexDirection="column",l.contentWrap.appendChild(i),l.contentWrap.appendChild(t),l}
|
|
1
|
+
import{openHtmlReport as W}from"../stats/renderFindingsReport.js";import{buildWaferMap as F}from"../renderer/buildWaferMap.js";import{analyzeWaferMap as H}from"../stats/analyzeWaferMap.js";import{CLR as m,FONT as S,RADIUS as k,MOTION as B,wireControlHover as R,copyWmapThemeTokens as z,syncWmapPopupTheme as q,openModal as P,openFloatingWindow as j,wireExpandToggle as U}from"./toolbar.js";let y=null;function D(e,r,s=!1){if(!r)return;const t=e.querySelector(`[id="${r}"]`);if(!t)return;const i=e.ownerDocument.defaultView,n=()=>t.scrollIntoView({block:"start"});s||!i?.requestAnimationFrame?n():i.requestAnimationFrame(()=>i.requestAnimationFrame(n))}const T=[];export function registerGuideOpener(e){return T.push(e),()=>{const r=T.lastIndexOf(e);r>=0&&T.splice(r,1)}}export function openGuideAt(e,r){const s=T[T.length-1];s?s(e):N(void 0,r,e)}const I=40,V=I+8;function X(e,r){const s=e.createElement("div");s.classList.add("wmap-guide-search"),s.style.cssText="display:flex;align-items:center;gap:2px;margin-left:10px;flex:1;min-width:80px;max-width:260px;";const t=e.createElement("input");t.type="text",t.placeholder="Search guide\u2026",t.setAttribute("aria-label","Search guide"),t.style.cssText=`flex:1;min-width:0;padding:4px 8px;font-size:12px;background:${m.menuBg};color:${m.text};border:1px solid ${m.menuBorder};border-radius:${k.control};outline:none;`,t.addEventListener("focus",()=>{t.style.borderColor=m.iconActive}),t.addEventListener("blur",()=>{t.style.borderColor=m.menuBorder});const i=e.createElement("span");i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.style.cssText=`font-size:12px;color:${m.label};min-width:44px;text-align:center;flex-shrink:0;white-space:nowrap;`;function n(a,u){const d=e.createElement("button");return d.type="button",d.textContent=a,d.setAttribute("aria-label",u),d.disabled=!0,d.style.cssText=`border:none;background:none;cursor:pointer;padding:4px 6px;border-radius:${k.control};font-size:12px;color:${m.label};flex-shrink:0;opacity:0.4;`,d.addEventListener("mouseenter",()=>{d.disabled||(d.style.background=m.bgHover)}),d.addEventListener("mouseleave",()=>{d.style.background="none"}),d}const c=n("\u25B2","Previous match"),o=n("\u25BC","Next match");let l=[],f=-1;function p(){const a=l.length===0;c.disabled=a,o.disabled=a,c.style.opacity=a?"0.4":"",o.style.opacity=a?"0.4":""}function x(){for(const a of l)a.parentNode?.replaceChild(e.createTextNode(a.textContent??""),a);r.normalize(),l=[],f=-1}function g(a){if(l.length===0)return;f>=0&&(l[f].style.outline="none"),f=(a%l.length+l.length)%l.length;const u=l[f];u.style.outline=`2px solid ${m.iconActive}`,u.style.outlineOffset="1px",u.scrollIntoView({behavior:"smooth",block:"center"}),i.textContent=`${f+1}/${l.length}`}function b(a){x();const u=a.trim();if(!u){i.textContent="",p();return}const d=u.toLowerCase(),h=e.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(C){const w=C.parentElement;return!w||w.closest("script,style,.wmap-guide-toc")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),L=[];let G;for(;G=h.nextNode();)L.push(G);for(const C of L){const w=C.textContent??"",_=w.toLowerCase();if(!_.includes(d))continue;const A=e.createDocumentFragment();let E=0,v=_.indexOf(d);for(;v!==-1;){v>E&&A.appendChild(e.createTextNode(w.slice(E,v)));const $=e.createElement("mark");$.textContent=w.slice(v,v+u.length),A.appendChild($),l.push($),E=v+u.length,v=_.indexOf(d,E)}E<w.length&&A.appendChild(e.createTextNode(w.slice(E))),C.parentNode?.replaceChild(A,C)}p(),l.length===0?i.textContent="No matches":g(0)}return t.addEventListener("input",()=>b(t.value)),t.addEventListener("keydown",a=>{a.key==="Enter"?(a.preventDefault(),g(f+(a.shiftKey?-1:1))):a.key==="Escape"&&(t.value?(t.value="",b("")):t.blur())}),c.addEventListener("click",()=>g(f-1)),o.addEventListener("click",()=>g(f+1)),s.append(t,i,c,o),s}function J(e,r,s){const t=[...r.querySelectorAll("h2[id]")];if(t.length<2)return;for(const u of r.querySelectorAll("h1[id],h2[id],h3[id],h4[id]"))u.style.scrollMarginTop=`${V}px`;const i=e.createElement("div");i.classList.add("wmap-guide-toc"),i.style.cssText=`position:sticky;top:0;z-index:2;background:${m.menuBg};border-bottom:1px solid ${m.menuBorder};font-family:system-ui,-apple-system,"Segoe UI",sans-serif;`;const n=e.createElement("div");n.style.cssText=`display:flex;align-items:center;gap:4px;height:${I}px;padding:0 12px;box-sizing:border-box;`;const c=e.createElement("span");c.innerHTML='<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>',c.style.cssText=`display:inline-flex;transition:transform ${B.base};flex-shrink:0;`;const o=e.createElement("button");o.type="button";const l="wmap-guide-toc-panel";o.setAttribute("aria-expanded","false"),o.setAttribute("aria-controls",l),o.style.cssText=`display:flex;align-items:center;gap:6px;border:none;background:none;cursor:pointer;padding:6px 8px;margin:0 -8px 0 -8px;border-radius:${k.control};font-size:13px;font-weight:600;color:${m.text};`;const f=e.createElement("span");f.textContent=`Contents (${t.length})`,o.append(c,f),o.addEventListener("mouseenter",()=>{o.style.background=m.bgHover}),o.addEventListener("mouseleave",()=>{o.style.background="none"});const p=e.createElement("button");p.type="button",p.textContent="\u2191 Top",p.style.cssText=`margin-left:auto;border:none;background:none;cursor:pointer;padding:6px 8px;border-radius:${k.control};font-size:12px;color:${m.label};`,p.addEventListener("mouseenter",()=>{p.style.background=m.bgHover}),p.addEventListener("mouseleave",()=>{p.style.background="none"}),p.addEventListener("click",()=>{a.close(),r.scrollTo({top:0,behavior:"smooth"})}),s?n.append(o,X(e,r),p):n.append(o,p);const x=e.createElement("div");x.id=l,x.hidden=!0,x.style.cssText="padding:2px 12px 12px;max-height:min(60vh,440px);overflow-y:auto;";const g=/^\s*\d+(?:\.\d+)*\.?\s+/;for(const u of r.querySelectorAll("h2[id],h3[id],h4[id]")){const d=u.firstChild;d?.nodeType===Node.TEXT_NODE&&(d.textContent=(d.textContent??"").replace(g,""))}const b=e.createElement("ul");b.setAttribute("role","list"),b.style.cssText="list-style:none;margin:0;padding:0;columns:200px;column-gap:24px;";for(const u of t){const d=e.createElement("li");d.style.cssText="break-inside:avoid;";const h=e.createElement("a");h.href=`#${u.id}`,h.textContent=u.textContent??"",h.style.cssText=`display:block;padding:4px 6px;margin:0 -6px;border-radius:${k.control};font-size:12.5px;color:${m.iconActive};text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;`,h.addEventListener("mouseenter",()=>{h.style.background=m.bgHover}),h.addEventListener("mouseleave",()=>{h.style.background="none"}),h.addEventListener("click",L=>{L.preventDefault(),a.close(),u.scrollIntoView({behavior:"smooth",block:"start"})}),d.appendChild(h),b.appendChild(d)}x.appendChild(b);const a=U(o,u=>{x.hidden=!u,o.setAttribute("aria-expanded",String(u)),c.style.transform=u?"rotate(180deg)":"none"});i.append(n,x),r.prepend(i)}function O(e,r,s,t,i){const n=r,c=n.__wmapDemoApi;n.__wmapDemoApi=t;const o=e.createElement("div");return o.classList.add("wmap-guide-content"),o.innerHTML=s,J(e,o,i),{content:o,restoreApi:()=>{n.__wmapDemoApi===t&&(n.__wmapDemoApi=c)}}}function M(e,r){const s=r,t=e.querySelector("script");if(t){const i=e.ownerDocument.createElement("script");i.textContent=t.textContent,e.appendChild(i);const n=e.querySelector(".wmap-guide");return n&&s.__wmapPopulateGuideDemos?.(n),s.__wmapDestroyGuideDemos}}function K(e,r,s,t,i){const n=t?.ownerDocument??document,c=n.defaultView??window,{content:o,restoreApi:l}=O(n,c,r,s,!0);Object.assign(o.style,{flex:"1",overflow:"auto",minHeight:"0",minWidth:"0"});let f,p;const x=j({title:e,anchor:t,ownerDocument:n,printable:!0,onMaximizeChange:g=>{o.style.setProperty("--wmap-guide-reading-width",g?"1000px":"720px")},onClose:()=>{y===p&&(y=null),f?.(),l()}});return x.contentWrap.appendChild(o),f=M(o,c),D(o,i),p={close:x.close,show:g=>x.box.isConnected?(x.bringToFront(),D(o,g,!0),!0):!1}}function Q(e,r,s,t,i){const n=e.document;n.title=r,Object.assign(n.documentElement.style,{height:"100%"}),Object.assign(n.body.style,{margin:"0",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",fontFamily:S.family,background:m.menuBg,color:m.text}),z(document.documentElement,n.documentElement);const c=q(document.documentElement,n.documentElement),{content:o,restoreApi:l}=O(n,e,s,t,!1);Object.assign(o.style,{flex:"1",overflow:"auto",minHeight:"0",minWidth:"0"}),n.body.appendChild(o);const f=M(o,e);D(o,i);let p=!1;const x=()=>{if(!p){p=!0,clearInterval(g),c();try{f?.()}catch{}l(),y===b&&(y=null)}},g=setInterval(()=>{e.closed&&x()},400);e.addEventListener("pagehide",x);const b={close:()=>{e.closed||e.close(),x()},show:a=>e.closed?(x(),!1):(e.focus(),D(o,a,!0),!0)};return b}export function openUserGuideWindow(e,r,s,t,i){if(y&&i&&y.show(i))return;y&&(y.close(),y=null);const n=s?.title??"Wafer Map \u2014 User Guide",c=(s?.html??"")+r,l=(t?.ownerDocument.defaultView??window).open("","_blank","width=800,height=820");y=l?Q(l,n,c,e,i):K(n,c,e,t,i)}export function openWaferMapGuide(e,r){N(e,r)}function N(e,r,s){Promise.all([import("./userGuideHtml.js"),import("./renderWaferMap.js"),import("./renderWaferGallery.js")]).then(([t,i,n])=>{openUserGuideWindow({buildWaferMap:F,renderWaferMap:i.renderWaferMap,renderWaferGallery:n.renderWaferGallery,analyzeWaferMap:H},t.USER_GUIDE_HTML,e,r,s)})}export function openReportModal(e,r){const s=r?.ownerDocument??document,t=s.createElement("iframe");t.srcdoc=e,t.title="Summary report",Object.assign(t.style,{border:"0",width:"100%",flex:"1",minHeight:"0",background:"#fff"});const i=s.createElement("div");Object.assign(i.style,{display:"flex",justifyContent:"flex-end",padding:"6px 14px",borderBottom:`1px solid ${m.menuBorder}`,flexShrink:"0"});const n=s.createElement("button");n.type="button",R(n,"bare"),n.textContent="Open as full page \u2197",Object.assign(n.style,{border:"none",background:"none",color:m.iconActive,cursor:"pointer",fontSize:S.body,textDecoration:"underline",padding:"0"}),n.addEventListener("click",()=>W(e)),i.appendChild(n);const c=s.defaultView??window,o=f=>{if(f.source!==t.contentWindow)return;const p=f.data?.wmapFinding;typeof p=="string"&&r?.onFinding?.(p,l)};r?.onFinding&&c.addEventListener("message",o);const l=P({title:"Summary report",anchor:r?.anchor,ownerDocument:s,printable:()=>t.contentWindow?.print(),onClose:()=>c.removeEventListener("message",o)});return l.contentWrap.style.flexDirection="column",l.contentWrap.appendChild(i),l.contentWrap.appendChild(t),l}
|
|
@@ -2,7 +2,7 @@ export const ICONS={aggr:'<svg viewBox="0 0 24 24" width="16" height="16" fill="
|
|
|
2
2
|
<rect x="3" y="3" width="4" height="18" rx="1"/>
|
|
3
3
|
<rect x="10" y="3" width="4" height="18" rx="1"/>
|
|
4
4
|
<rect x="17" y="3" width="4" height="18" rx="1"/>
|
|
5
|
-
</svg>`,download:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"/><circle cx="12" cy="13" r="3"/></svg>',downloadAll:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"/><circle cx="12" cy="13" r="3"/><circle cx="5.5" cy="4.5" r="0.8" fill="currentColor" stroke="none"/><circle cx="8" cy="4.5" r="0.8" fill="currentColor" stroke="none"/><circle cx="5.5" cy="7" r="0.8" fill="currentColor" stroke="none"/><circle cx="8" cy="7" r="0.8" fill="currentColor" stroke="none"/></svg>',drilldown:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3v18h18"/><path d="M7 16c3-1 4-9 7-9s3 5 6 5"/></svg>',expand:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h6v6"/><path d="M9 21H3v-6"/><path d="M21 3l-7 7"/><path d="M3 21l7-7"/></svg>',findings:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M12 2v4"/><path d="M16 2v4"/><rect width="16" height="18" x="4" y="4" rx="2"/><path d="M8 10h6"/><path d="M8 14h8"/><path d="M8 18h5"/></svg>',flipH:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m3 7 5 5-5 5V7"/><path d="m21 7-5 5 5 5V7"/><path d="M12 20v2"/><path d="M12 14v2"/><path d="M12 8v2"/><path d="M12 2v2"/></svg>',flipV:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m17 3-5 5-5-5h10"/><path d="m17 21-5-5-5 5h10"/><path d="M4 12H2"/><path d="M10 12H8"/><path d="M16 12h-2"/><path d="M22 12h-2"/></svg>',help:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/></svg>',labels:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4v16"/><path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"/><path d="M9 20h6"/></svg>',legend:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/><path d="M14 4h7"/><path d="M14 9h7"/><path d="M14 15h7"/><path d="M14 20h7"/></svg>',logScale:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 21 L5 3"/><path d="M3.5 5 L5 3 L6.5 5"/><path d="M5 21 L21 21"/><path d="M19 19.5 L21 21 L19 22.5"/><path d="M6 20 C 6 12, 10 7, 20 6"/></svg>',maximize:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/></svg>',minimize:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3v3a2 2 0 0 1-2 2H3"/><path d="M21 8h-3a2 2 0 0 1-2-2V3"/><path d="M3 16h3a2 2 0 0 1 2 2v3"/><path d="M16 21v-3a2 2 0 0 1 2-2h3"/></svg>',mode:`<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
5
|
+
</svg>`,download:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"/><circle cx="12" cy="13" r="3"/></svg>',downloadAll:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"/><circle cx="12" cy="13" r="3"/><circle cx="5.5" cy="4.5" r="0.8" fill="currentColor" stroke="none"/><circle cx="8" cy="4.5" r="0.8" fill="currentColor" stroke="none"/><circle cx="5.5" cy="7" r="0.8" fill="currentColor" stroke="none"/><circle cx="8" cy="7" r="0.8" fill="currentColor" stroke="none"/></svg>',drilldown:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3v18h18"/><path d="M7 16c3-1 4-9 7-9s3 5 6 5"/></svg>',expand:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h6v6"/><path d="M9 21H3v-6"/><path d="M21 3l-7 7"/><path d="M3 21l7-7"/></svg>',export:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v12"/><path d="m7 10 5 5 5-5"/><path d="M5 21h14"/></svg>',filter:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 4h18l-7 8.5V19l-4 2v-8.5z"/></svg>',findings:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M12 2v4"/><path d="M16 2v4"/><rect width="16" height="18" x="4" y="4" rx="2"/><path d="M8 10h6"/><path d="M8 14h8"/><path d="M8 18h5"/></svg>',flipH:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m3 7 5 5-5 5V7"/><path d="m21 7-5 5 5 5V7"/><path d="M12 20v2"/><path d="M12 14v2"/><path d="M12 8v2"/><path d="M12 2v2"/></svg>',flipV:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m17 3-5 5-5-5h10"/><path d="m17 21-5-5-5 5h10"/><path d="M4 12H2"/><path d="M10 12H8"/><path d="M16 12h-2"/><path d="M22 12h-2"/></svg>',help:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/></svg>',labels:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4v16"/><path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"/><path d="M9 20h6"/></svg>',legend:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/><path d="M14 4h7"/><path d="M14 9h7"/><path d="M14 15h7"/><path d="M14 20h7"/></svg>',logScale:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 21 L5 3"/><path d="M3.5 5 L5 3 L6.5 5"/><path d="M5 21 L21 21"/><path d="M19 19.5 L21 21 L19 22.5"/><path d="M6 20 C 6 12, 10 7, 20 6"/></svg>',maximize:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/></svg>',minimize:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3v3a2 2 0 0 1-2 2H3"/><path d="M21 8h-3a2 2 0 0 1-2-2V3"/><path d="M3 16h3a2 2 0 0 1 2 2v3"/><path d="M16 21v-3a2 2 0 0 1 2-2h3"/></svg>',mode:`<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
6
6
|
<ellipse cx="12" cy="7" rx="9" ry="4" />
|
|
7
7
|
|
|
8
8
|
<g stroke="currentColor" stroke-width="1.4" opacity="0.85">
|
|
@@ -31,6 +31,8 @@ export interface IdentityHeaderController {
|
|
|
31
31
|
* of anything else.
|
|
32
32
|
*/
|
|
33
33
|
metaPanel: HTMLDivElement;
|
|
34
|
+
/** Decide again whether the metadata fits on the row beside the label, after the room around it changed. */
|
|
35
|
+
refit(): void;
|
|
34
36
|
/** Re-render with a new label / metadata / lot-stack context. */
|
|
35
37
|
update(label: string, metadata: WaferMetadata | null | undefined, lotStack?: IdentityHeaderLotStack): void;
|
|
36
38
|
/** True when there is nothing at all to show (no label text, no metadata,
|
|
@@ -42,6 +44,9 @@ export interface IdentityHeaderController {
|
|
|
42
44
|
* chevron/aria state from `metaPanel`'s own visibility. No-op if already
|
|
43
45
|
* collapsed. */
|
|
44
46
|
collapse(): void;
|
|
47
|
+
/** True when the wafer's name is being cut short for lack of room, so a neighbour that can yield (the Plot mode
|
|
48
|
+
* button's word) gives the room back. */
|
|
49
|
+
nameCut(): boolean;
|
|
45
50
|
destroy(): void;
|
|
46
51
|
}
|
|
47
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{metadataEntries as v,buildCompactMetadataRows as E}from"./summaryPanel.js";import{attributeLabel as M}from"../stats/facets.js";import{SHADOW as k,LEADING as
|
|
1
|
+
import{metadataEntries as v,buildCompactMetadataRows as E}from"./summaryPanel.js";import{attributeLabel as M}from"../stats/facets.js";import{SHADOW as k,LEADING as W,SPACE as C,FONT as x,CLR as y,RADIUS as j,Z_ABOVE as H,wireExpandToggle as A,wireControlHover as P}from"./toolbar.js";import{fmtAggregationMethod as R,fmtStackedLabel as B}from"../renderer/fmt.js";export function createMetaPanelEl(i){const t=i.createElement("div");return Object.assign(t.style,{position:"absolute",top:"0",left:"0",right:"0",zIndex:H,background:y.menuBg,borderBottom:`1px solid ${y.menuBorder}`,boxShadow:k.menu,padding:`${C.md} ${C.lg}`,fontSize:x.body,maxHeight:"100%",overflowY:"auto",boxSizing:"border-box",display:"none"}),t}export function attachExpandableMetadata(i,t,a,n,u){const l=n??{};if(v(l).length===0)return null;const r=i.createElement("span");Object.assign(r.style,{fontSize:x.body,lineHeight:W.none,color:y.label,flexShrink:"0"}),r.textContent="\u25BE",t.appendChild(r),Object.assign(t.style,{cursor:"pointer",borderRadius:j.control}),P(t,"bare");const s=createMetaPanelEl(i);s.dataset.wmapCardMetaPanel="1";const d=E(l,u);return d&&s.appendChild(d),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-label",`Wafer info for ${a||"this card"}. Click to expand.`),A(t,e=>{r.textContent=e?"\u25B4":"\u25BE",t.setAttribute("aria-expanded",String(e)),s.style.display=e?"block":"none"}),s}export function collapsedLabel(i,t){if(t)return t.aggrMethod?`${t.lotSize} wafers \xB7 ${R(t.aggrMethod)}`:`${t.lotSize} wafers`;if(i.lot&&i.waferId!==void 0&&i.waferId!==""){const a=String(i.lot),n=String(i.waferId);return n.includes(a)?n:`${a} \xB7 ${n}`}for(const a of["lot","waferId","product","testProgram"]){const n=i[a];if(n!=null&&n!=="")return String(n)}}export function createIdentityHeader(i,t,a={}){let n=i,u=t??{},l=a.lotStack,r=!1,s=!1;const d=a.ownerDocument??document,e=d.createElement("div");Object.assign(e.style,{display:"flex",alignItems:"center",gap:C.xs,minWidth:"0"});const c=d.createElement("span");Object.assign(c.style,{fontWeight:"700",fontSize:x.sub,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),e.appendChild(c);const w=d.createElement("span");Object.assign(w.style,{fontSize:x.body,lineHeight:W.none,color:y.label,flexShrink:"0",display:"none"}),e.appendChild(w);const z=4,f=d.createElement("span");Object.assign(f.style,{fontSize:x.body,color:y.label,whiteSpace:"nowrap",overflow:"hidden",flexShrink:"0",display:"none",marginLeft:C.sm}),e.appendChild(f);const p=createMetaPanelEl(d);p.dataset.wmapMetaPanel="1";function S(){return v(u).length>0||!!l}function I(){return l?[]:v(u).filter(([,o])=>!n.includes(o))}function $(){return e.clientWidth?c.scrollWidth>c.clientWidth||f.scrollWidth>f.clientWidth||e.scrollWidth>e.clientWidth:!0}function b(){c.textContent=n;const o=I();f.textContent=o.map(([m,g])=>`${M(m,a.attributes)}: ${g}`).join(" \xB7 "),f.style.display=o.length>0?"":"none",s=o.length>0&&o.length<=z&&!$(),f.style.display=s?"":"none";const h=S()&&!s;if(w.style.display=h?"":"none",e.style.cursor=h?"pointer":"",h||(r=!1),w.textContent=r?"\u25B4":"\u25BE",p.style.display=r?"block":"none",h?(e.setAttribute("aria-expanded",String(r)),e.setAttribute("aria-label",`Wafer info: ${n||"this wafer"}. ${r?"Click to collapse.":"Click to expand."}`)):(e.removeAttribute("aria-expanded"),e.removeAttribute("aria-label")),p.innerHTML="",r){if(l){const g=d.createElement("div");Object.assign(g.style,{fontWeight:"600",marginBottom:"3px"}),g.textContent=B(l.lotSize,l.aggrMethod),p.appendChild(g)}const m=E(u,a.attributes);m&&p.appendChild(m)}}const L=A(e,o=>{!S()||s||(r=o,b())});b();const O=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>b());return O?.observe(e),{wrap:e,metaPanel:p,nameCut(){return c.scrollWidth>c.clientWidth+1},refit(){b()},update(o,h,m){n=o,u=h??{},l=m,b()},isEmpty(){return!n&&!S()},collapse(){r&&(r=!1,b())},destroy(){O?.disconnect(),L.destroy(),e.remove(),p.remove()}}}
|
|
@@ -11,7 +11,14 @@ export type { DieListDisplayOptions } from './dieList.js';
|
|
|
11
11
|
export { collectWarnings, severityOf } from './warnings.js';
|
|
12
12
|
export type { WarningsOptions } from './warnings.js';
|
|
13
13
|
export type { InsightsOptions, InsightsView } from './insightsTab.js';
|
|
14
|
+
export type { CardReportHook } from './charts/chartShell.js';
|
|
15
|
+
export { reportContents, renderReportDeck, renderReportSlides } from './reportExport.js';
|
|
16
|
+
export { chartSection } from '../stats/reportSections.js';
|
|
17
|
+
export { presentationPresets, combinePresets } from '../stats/presentationPresets.js';
|
|
18
|
+
export type { PresentationPreset } from '../stats/presentationPresets.js';
|
|
19
|
+
export type { ReportContents, ReportDeckRequest, ReportChartInfo, ReportScope, ReportSectionInfo, ReportSectionId, ReportProducer, ReportMetric, ReportSlides, ReportSlide, SlidePage, SlideItem, SlideCell, SlideColours, ReportMapOptions, ReportValueMapOptions, ReportItemsOptions, OverviewGroup, } from './reportExport.js';
|
|
14
20
|
export { setDetachWindowOpener } from './toolbar.js';
|
|
21
|
+
export { wireMenuA11y } from './toolbar.js';
|
|
15
22
|
export type { DetachWindowOpener } from './toolbar.js';
|
|
16
23
|
export type { UserGuideExtension } from './guideWindow.js';
|
|
17
24
|
export { openWaferMapGuide } from './guideWindow.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{WMAP_VERSION,WMAP_BUILD_TIME}from"./version.js";export{renderWaferMap}from"./renderWaferMap.js";export{WAFER_PREFERENCE_KEYS}from"./renderWaferMap.js";export{renderWaferGallery}from"./renderWaferGallery.js";export{getPinnedTests,setPinnedTests,onPinnedTestsChange}from"./pinnedTests.js";export{collectWarnings,severityOf}from"./warnings.js";export{setDetachWindowOpener}from"./toolbar.js";export{openWaferMapGuide}from"./guideWindow.js";export{ICONS}from"./icons.js";export{openReportModal}from"./guideWindow.js";
|
|
1
|
+
export{WMAP_VERSION,WMAP_BUILD_TIME}from"./version.js";export{renderWaferMap}from"./renderWaferMap.js";export{WAFER_PREFERENCE_KEYS}from"./renderWaferMap.js";export{renderWaferGallery}from"./renderWaferGallery.js";export{getPinnedTests,setPinnedTests,onPinnedTestsChange}from"./pinnedTests.js";export{collectWarnings,severityOf}from"./warnings.js";export{reportContents,renderReportDeck,renderReportSlides}from"./reportExport.js";export{chartSection}from"../stats/reportSections.js";export{presentationPresets,combinePresets}from"../stats/presentationPresets.js";export{setDetachWindowOpener}from"./toolbar.js";export{wireMenuA11y}from"./toolbar.js";export{openWaferMapGuide}from"./guideWindow.js";export{ICONS}from"./icons.js";export{openReportModal}from"./guideWindow.js";
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import type { Die } from '../core/dies.js';
|
|
2
|
+
import { type ReaderColors } from './charts/divergingScale.js';
|
|
2
3
|
import type { Wafer } from '../core/wafer.js';
|
|
3
4
|
import type { LotStatsSummary, StatsSummary } from '../stats/types.js';
|
|
4
5
|
import { type FacetCuration, type FacetItem } from '../stats/facets.js';
|
|
5
6
|
import { type TestDef } from '../renderer/buildWaferMap.js';
|
|
6
7
|
import type { WaferMapDisplayItem } from './renderWaferGallery.js';
|
|
7
8
|
import { type PlotStore } from './plotStore.js';
|
|
8
|
-
import type
|
|
9
|
+
import { type PlotFilter, type PlotSpec } from '../stats/plotSpec.js';
|
|
9
10
|
import type { SavedFilter } from '../stats/filterFile.js';
|
|
10
11
|
import { type PageFilterController } from './pageFilter.js';
|
|
11
12
|
import type { BinColors } from '../renderer/binColors.js';
|
|
12
13
|
import { type SaveImageHandler, type SaveTextHandler } from './toolbar.js';
|
|
13
14
|
import type { RenderableWaferMap } from './renderWaferMap.js';
|
|
14
15
|
import type { SweepSpec } from '../stats/sweep.js';
|
|
15
|
-
import { type AxisPrefs } from './charts/chartShell.js';
|
|
16
|
-
import { type SynthesisTarget } from '../stats/synthesis.js';
|
|
16
|
+
import { type CardReportHook, type AxisPrefs } from './charts/chartShell.js';
|
|
17
|
+
import { type SynthesisItem, type SynthesisTarget } from '../stats/synthesis.js';
|
|
17
18
|
export type InsightsView = 'overview' | 'distributions' | 'correlation' | 'sweeps' | 'data' | 'plot';
|
|
18
|
-
|
|
19
|
+
export declare const REPORT_SET_TEST = "wmap:report-set-test";
|
|
19
20
|
export interface InsightsOptions {
|
|
20
21
|
/**
|
|
21
22
|
* Show an "Insights" tab in the toolbar and a Maps | Insights switch. Selecting it replaces the canvas/
|
|
@@ -75,6 +76,11 @@ export interface InsightsOptions {
|
|
|
75
76
|
* the browser's own file input; a desktop host passes its native dialog.
|
|
76
77
|
*/
|
|
77
78
|
onPickPlotsFile?: () => Promise<string | null>;
|
|
79
|
+
/**
|
|
80
|
+
* The host's report of charts: given, every chart card's ⋯ menu offers "Add to report" (or "Remove from report"), which
|
|
81
|
+
* calls `toggle` with the chart's id (the one a report asks for it by) and title. Without it the row is not shown.
|
|
82
|
+
*/
|
|
83
|
+
report?: CardReportHook;
|
|
78
84
|
/**
|
|
79
85
|
* The page filter to start with: conditions the wafers and dies of the gallery, the map and every Insights tab must
|
|
80
86
|
* meet (one split, the edge ring, a range of a test), with `off` to keep them unapplied. It is one filter for all of
|
|
@@ -133,6 +139,11 @@ export interface InsightsTabDeps {
|
|
|
133
139
|
* picked up, and so a bin is the same colour in a chart as on the map.
|
|
134
140
|
*/
|
|
135
141
|
getBinColors: () => BinColors;
|
|
142
|
+
/**
|
|
143
|
+
* The reader's colour preferences (the map's value gradient and Reverse), read fresh each
|
|
144
|
+
* render: a chart of a measured value takes the reader's gradient, as the maps do.
|
|
145
|
+
*/
|
|
146
|
+
getReaderColors?: () => ReaderColors;
|
|
136
147
|
/** Read fresh each render — used by the Overview tab's ring/quadrant regional yield cards. Default 4. */
|
|
137
148
|
getRingCount: () => number;
|
|
138
149
|
onSaveImage?: SaveImageHandler;
|
|
@@ -183,11 +194,13 @@ export interface InsightsTabDeps {
|
|
|
183
194
|
plots?: PlotSpec[];
|
|
184
195
|
onPlotsChange?: (plots: PlotSpec[]) => void;
|
|
185
196
|
onPickPlotsFile?: () => Promise<string | null>;
|
|
197
|
+
report?: CardReportHook;
|
|
186
198
|
/**
|
|
187
199
|
* Leaves Insights and shows a "What stands out" item on the map, as its row in the Summary panel does: a finding's dies,
|
|
188
200
|
* or a test's value map with the dies it fails. Omitted ⇒ the Worth a look cards offer no Show on map.
|
|
189
201
|
*/
|
|
190
|
-
|
|
202
|
+
/** Leaves Insights and shows an item on the map, as its row in the Summary panel does (`item` says how, for a test that differs between groups). */
|
|
203
|
+
showOnMap?: (target: SynthesisTarget, item?: SynthesisItem) => void;
|
|
191
204
|
/** The PAT card's Map the verdicts: back to the maps, coloured by PAT verdict. */
|
|
192
205
|
showPatMap?: () => void;
|
|
193
206
|
/** See `InsightsOptions.filter` and `onFilterChange`. */
|
|
@@ -239,6 +252,11 @@ export interface InsightsTabHandle {
|
|
|
239
252
|
destroy: () => void;
|
|
240
253
|
/** Adopt axis settings set from outside (the host's `setOptions`), in every chart. */
|
|
241
254
|
setAxisPrefs: (prefs: AxisPrefs) => void;
|
|
255
|
+
/**
|
|
256
|
+
* The reader's data colours changed: draw the cards on screen again with them, where they stand (the page, the sub-tab, the
|
|
257
|
+
* scroll and every card stay), and let the sub-tabs off screen be built afresh when visited.
|
|
258
|
+
*/
|
|
259
|
+
repaintColours: () => void;
|
|
242
260
|
/**
|
|
243
261
|
* Opens the Overview at the Worth a look card of the item `key` names (`synthesisKey`), scrolled into view: the Summary
|
|
244
262
|
* panel's Chart link. False when there is no such card (the item has none, or the list is hidden while narrowed).
|