@wafertools/wafermap 0.36.0 → 0.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +385 -0
- package/README.md +7 -7
- package/dist/packages/canvas-adapter/charts/capability.js +1 -1
- package/dist/packages/canvas-adapter/charts/cardAbout.d.ts +21 -0
- package/dist/packages/canvas-adapter/charts/cardAbout.js +1 -0
- package/dist/packages/canvas-adapter/charts/chartShell.d.ts +65 -12
- package/dist/packages/canvas-adapter/charts/chartShell.js +1 -1
- package/dist/packages/canvas-adapter/charts/commonality.d.ts +18 -0
- package/dist/packages/canvas-adapter/charts/commonality.js +1 -0
- package/dist/packages/canvas-adapter/charts/correlation.js +1 -1
- package/dist/packages/canvas-adapter/charts/groupComparison.d.ts +31 -0
- package/dist/packages/canvas-adapter/charts/groupComparison.js +1 -0
- package/dist/packages/canvas-adapter/charts/index.d.ts +0 -10
- package/dist/packages/canvas-adapter/charts/index.js +1 -1
- package/dist/packages/canvas-adapter/charts/patCard.d.ts +23 -0
- package/dist/packages/canvas-adapter/charts/patCard.js +1 -0
- package/dist/packages/canvas-adapter/charts/plotChart.d.ts +56 -2
- package/dist/packages/canvas-adapter/charts/plotChart.js +1 -1
- package/dist/packages/canvas-adapter/charts/pointInteractions.d.ts +2 -0
- package/dist/packages/canvas-adapter/charts/pointInteractions.js +1 -1
- package/dist/packages/canvas-adapter/charts/regionYieldDiagram.js +1 -1
- package/dist/packages/canvas-adapter/charts/sweep.js +1 -1
- package/dist/packages/canvas-adapter/dataTab.d.ts +3 -0
- package/dist/packages/canvas-adapter/dataTab.js +1 -1
- package/dist/packages/canvas-adapter/dieList.d.ts +12 -0
- package/dist/packages/canvas-adapter/dieList.js +2 -2
- package/dist/packages/canvas-adapter/differenceMapPanel.d.ts +26 -0
- package/dist/packages/canvas-adapter/differenceMapPanel.js +1 -0
- package/dist/packages/canvas-adapter/drilldown.d.ts +3 -0
- package/dist/packages/canvas-adapter/drilldown.js +1 -1
- package/dist/packages/canvas-adapter/filterButton.d.ts +3 -0
- package/dist/packages/canvas-adapter/filterButton.js +1 -0
- package/dist/packages/canvas-adapter/filterEditor.d.ts +53 -0
- package/dist/packages/canvas-adapter/filterEditor.js +1 -0
- package/dist/packages/canvas-adapter/guideWindow.d.ts +9 -1
- package/dist/packages/canvas-adapter/guideWindow.js +1 -1
- package/dist/packages/canvas-adapter/icons.js +1 -1
- package/dist/packages/canvas-adapter/insightsTab.d.ts +52 -2
- package/dist/packages/canvas-adapter/insightsTab.js +1 -1
- package/dist/packages/canvas-adapter/pageFilter.d.ts +84 -0
- package/dist/packages/canvas-adapter/pageFilter.js +2 -0
- package/dist/packages/canvas-adapter/patMode.d.ts +27 -0
- package/dist/packages/canvas-adapter/patMode.js +1 -0
- package/dist/packages/canvas-adapter/plotCard.d.ts +67 -0
- package/dist/packages/canvas-adapter/plotCard.js +1 -0
- package/dist/packages/canvas-adapter/plotEditor.d.ts +13 -2
- package/dist/packages/canvas-adapter/plotEditor.js +1 -1
- package/dist/packages/canvas-adapter/plotModal.js +1 -1
- package/dist/packages/canvas-adapter/plotStore.js +1 -1
- package/dist/packages/canvas-adapter/plotTab.d.ts +6 -0
- package/dist/packages/canvas-adapter/plotTab.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/summaryPanel.d.ts +15 -5
- package/dist/packages/canvas-adapter/summaryPanel.js +4 -4
- package/dist/packages/canvas-adapter/toolbar.d.ts +17 -2
- 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 +590 -140
- package/dist/packages/canvas-adapter/version.d.ts +2 -2
- package/dist/packages/canvas-adapter/version.js +1 -1
- package/dist/packages/core/classify.d.ts +11 -0
- package/dist/packages/core/classify.js +1 -1
- package/dist/packages/core/dies.d.ts +2 -0
- package/dist/packages/core/dies.js +1 -1
- package/dist/packages/core/wafer.d.ts +2 -2
- package/dist/packages/renderer/buildView.js +1 -1
- package/dist/packages/renderer/buildWaferMap.d.ts +2 -0
- package/dist/packages/renderer/buildWaferMap.js +1 -1
- package/dist/packages/renderer/deprecate.d.ts +2 -8
- package/dist/packages/renderer/deprecate.js +1 -1
- package/dist/packages/renderer/fmt.js +1 -1
- package/dist/packages/renderer/testLabel.d.ts +0 -11
- package/dist/packages/renderer/testLabel.js +1 -1
- package/dist/packages/stats/analyzeWaferLot.d.ts +6 -0
- package/dist/packages/stats/analyzeWaferLot.js +1 -1
- package/dist/packages/stats/analyzeWaferMap.d.ts +8 -0
- package/dist/packages/stats/analyzeWaferMap.js +1 -1
- package/dist/packages/stats/binPareto.d.ts +2 -54
- package/dist/packages/stats/binPareto.js +1 -1
- package/dist/packages/stats/binRows.js +1 -1
- package/dist/packages/stats/capability.d.ts +10 -0
- package/dist/packages/stats/capability.js +1 -1
- package/dist/packages/stats/cardSpec.d.ts +53 -0
- package/dist/packages/stats/cardSpec.js +1 -0
- package/dist/packages/stats/chartCatalogue.d.ts +37 -0
- package/dist/packages/stats/chartCatalogue.js +1 -0
- package/dist/packages/stats/clusterDetection.d.ts +9 -0
- package/dist/packages/stats/clusterDetection.js +1 -1
- package/dist/packages/stats/commonality.d.ts +62 -0
- package/dist/packages/stats/commonality.js +1 -0
- package/dist/packages/stats/control.d.ts +21 -0
- package/dist/packages/stats/control.js +1 -0
- package/dist/packages/stats/correlation.d.ts +9 -3
- package/dist/packages/stats/correlation.js +1 -1
- package/dist/packages/stats/dieRegions.d.ts +4 -1
- package/dist/packages/stats/dieRegions.js +1 -1
- package/dist/packages/stats/differenceMap.d.ts +22 -0
- package/dist/packages/stats/differenceMap.js +1 -0
- package/dist/packages/stats/examplePicks.d.ts +22 -0
- package/dist/packages/stats/examplePicks.js +1 -0
- package/dist/packages/stats/filterFile.d.ts +41 -0
- package/dist/packages/stats/filterFile.js +2 -0
- package/dist/packages/stats/filterFindings.d.ts +20 -5
- package/dist/packages/stats/filterFindings.js +1 -1
- package/dist/packages/stats/groupCompare.d.ts +87 -0
- package/dist/packages/stats/groupCompare.js +1 -0
- package/dist/packages/stats/guideSections.d.ts +55 -0
- package/dist/packages/stats/guideSections.js +1 -0
- package/dist/packages/stats/index.d.ts +3 -1
- package/dist/packages/stats/index.js +1 -1
- package/dist/packages/stats/math.d.ts +29 -4
- package/dist/packages/stats/math.js +1 -1
- package/dist/packages/stats/metadataColumns.d.ts +3 -0
- package/dist/packages/stats/metadataColumns.js +1 -1
- package/dist/packages/stats/pat.d.ts +58 -0
- package/dist/packages/stats/pat.js +1 -0
- package/dist/packages/stats/patSummary.d.ts +45 -0
- package/dist/packages/stats/patSummary.js +1 -0
- package/dist/packages/stats/patternClassification.d.ts +3 -3
- package/dist/packages/stats/patternClassification.js +1 -1
- package/dist/packages/stats/plotData.d.ts +294 -17
- package/dist/packages/stats/plotData.js +1 -1
- package/dist/packages/stats/plotId.d.ts +2 -0
- package/dist/packages/stats/plotId.js +1 -1
- package/dist/packages/stats/plotReferences.d.ts +17 -0
- package/dist/packages/stats/plotReferences.js +1 -0
- package/dist/packages/stats/plotSpec.d.ts +239 -3
- package/dist/packages/stats/plotSpec.js +4 -4
- package/dist/packages/stats/regions.js +1 -1
- package/dist/packages/stats/renderSummaryReport.js +31 -31
- package/dist/packages/stats/reportHtml.js +9 -13
- package/dist/packages/stats/synthesis.d.ts +44 -16
- package/dist/packages/stats/synthesis.js +1 -1
- package/dist/packages/stats/testPassRate.d.ts +7 -0
- package/dist/packages/stats/testPassRate.js +1 -1
- package/dist/packages/stats/types.d.ts +13 -8
- package/dist/packages/stats/yield.d.ts +3 -11
- package/dist/packages/stats/yield.js +1 -1
- package/llms.txt +1 -1
- package/package.json +10 -2
- package/dist/packages/canvas-adapter/charts/barPanel.d.ts +0 -83
- package/dist/packages/canvas-adapter/charts/barPanel.js +0 -1
- package/dist/packages/canvas-adapter/charts/binCluster.d.ts +0 -27
- package/dist/packages/canvas-adapter/charts/binCluster.js +0 -1
- package/dist/packages/canvas-adapter/charts/boxplot.d.ts +0 -72
- package/dist/packages/canvas-adapter/charts/boxplot.js +0 -1
- package/dist/packages/canvas-adapter/charts/groupedBarPlot.d.ts +0 -53
- package/dist/packages/canvas-adapter/charts/groupedBarPlot.js +0 -1
- package/dist/packages/canvas-adapter/charts/histogram.d.ts +0 -61
- package/dist/packages/canvas-adapter/charts/histogram.js +0 -1
- package/dist/packages/canvas-adapter/charts/scatter.d.ts +0 -80
- package/dist/packages/canvas-adapter/charts/scatter.js +0 -1
- package/dist/packages/canvas-adapter/charts/testPassRate.d.ts +0 -27
- package/dist/packages/canvas-adapter/charts/testPassRate.js +0 -1
- package/dist/packages/canvas-adapter/charts/trend.d.ts +0 -50
- package/dist/packages/canvas-adapter/charts/trend.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{mergeTestDefs as I}from"../stats/mergeTestDefs.js";import{DEFAULT_FACET_CURATION as T}from"../stats/facets.js";import{conditionText as k}from"../stats/plotData.js";import{readFilter as A}from"../stats/plotSpec.js";import{addSavedFilters as B,readSavedFilters as L,readFiltersFile as J,writeFiltersFile as W}from"../stats/filterFile.js";import{newFilterId as R}from"../stats/plotId.js";import{applyConditions as $,fieldCatalogue as P,fieldExtent as G,fieldValues as z}from"../stats/plotData.js";import{toPlotItems as U}from"./plotItems.js";import{buildFilterEditor as K,buildFilterStrip as M}from"./filterEditor.js";import{CLR as b,FONT as j,RADIUS as _,SPACE as g,openModal as q,saveTextFile as H,wireTooltip as V}from"./toolbar.js";import{inputStyle as Y}from"./charts/chartShell.js";import{bandButton as O}from"./filterButton.js";export function readFilterOption(n){if(n==null)return;const t=[],l=typeof n=="object"&&!Array.isArray(n)?A(JSON.parse(JSON.stringify(n)),"insights.filter",t):void 0;return l||t.push("insights.filter: needs at least one condition, so no filter is applied"),t.length&&console.warn(`[wafermap] ${t.join("; ")}`),l}const D=n=>JSON.parse(JSON.stringify(n));export function createPageFilter(n){const{doc:t}=n,h={...T,...n.attributes};let l=readFilterOption(n.initial);const y=new Set;let x=(()=>{if(!n.savedFilters)return[];const i=L(n.savedFilters,"insights.savedFilters");return i.warnings.length&&console.warn(`[wafermap] ${i.warnings.join("; ")}`),i.filters})();const E=i=>({items:U(i.map(s=>({label:s.identity??s.label,dies:s.dies,waferIndex:s.waferIndex,wafer:s.wafer,passBins:s.passBins,ringCount:n.getRingCount()}))),ctx:{testDefs:I([...i]).defs,curation:h}}),v=i=>{if(!l||l.off)return;const s=E(i);return $(l.conditions,s.items,s.ctx)},S={get:()=>l,set(i){l=i,n.onChange?.(i?D(i):void 0);for(const s of[...y])s()},subscribe(i){return y.add(i),()=>{y.delete(i)}},saved:()=>x,setSaved(i){x=i.map(s=>JSON.parse(JSON.stringify(s))),n.onSavedFiltersChange?.(x.map(s=>JSON.parse(JSON.stringify(s))))},keep(i){const s=v(i);if(!s||s.issue)return{items:i,result:s,narrowing:!1};const r=s.index.map((p,u)=>{const a=i[p],e=s.items[u].dies;return e.length===a.dies.length?a:{...a,dies:e,statsSummary:void 0}});return{items:r,result:s,narrowing:r.length!==i.length||r.some((p,u)=>p!==i[s.index[u]])}},mark(i){const s=new Set,r=v(i);if(!r||r.issue)return{items:i,hidden:s,result:r,narrowing:!1};const p=new Map(r.index.map((e,c)=>[e,r.items[c].dies]));let u=!1;return{items:i.map((e,c)=>{const o=p.get(c);if(o===void 0&&(s.add(c),u=!0),o&&o.length===e.dies.length)return e;u=!0;const w=o?new Set(o):void 0,d=e.dies.map(m=>w?.has(m)?m:{...m,filteredOut:!0});return{...e,dies:d,statsSummary:void 0}}),hidden:s,result:r,narrowing:u}},createBand(i,s){const r=t.createElement("div");r.dataset.wmapInsightsFilter="1",Object.assign(r.style,{display:"none",...s});const p=(a,e,c,o)=>O(t,a,e,c,o);return{el:r,refresh:(a,e)=>{if(r.replaceChildren(),r.style.display=l?"":"none",!l)return;const c=[p("Edit\u2026","wmapInsightsFilterEdit","Change the conditions",()=>S.openEditor(r,e)),p("Remove","wmapInsightsFilterRemove","Delete the filter: every wafer and die is shown again",()=>S.set(void 0))];if(a?.issue){const d=t.createElement("div");d.dataset.wmapInsightsFilterIssue="1",d.setAttribute("role","status"),Object.assign(d.style,{display:"flex",flexWrap:"wrap",alignItems:"center",gap:g.md,padding:`${g.xs} ${g.md}`,background:b.warnBg,border:`1px solid ${b.warnBorder}`,borderRadius:_.control,color:b.warnText,fontSize:j.body});const m=t.createElement("span");m.textContent=`The filter cannot be applied to these wafers (${a.issue}), so nothing is filtered.`;const F=t.createElement("span");Object.assign(F.style,{display:"inline-flex",gap:g.sm,marginLeft:"auto"}),F.append(...c),d.append(m,F),r.appendChild(d);return}const o=d=>d.toLocaleString("en-GB"),w=a?`${o(a.wafers.kept)} of ${o(a.wafers.total)} wafer${a.wafers.total===1?"":"s"} \xB7 ${o(a.dies.kept)} of ${o(a.dies.total)} dies`:void 0;r.appendChild(M({doc:t,filter:l,testDefs:I([...e]).defs,attributes:h,label:"Filter",kept:w,actions:c,onToggle:d=>{if(!l)return;const m={...l};d?delete m.off:m.off=!0,S.set(m)}}))}}},openEditor(i,s){const r=E(s);let p=l?D(l):void 0,u;const a=q({title:"Filter",anchor:i,ownerDocument:t,boxSize:{width:"min(92vw, 640px)",height:"min(85vh, 640px)"},maximizable:!1,initialFocus:()=>p?u:d.el.querySelector("[data-wmap-filter-add]")??u,onClose:()=>{}});a.box.dataset.wmapInsightsFilterModal="1";const e=t.createElement("div");Object.assign(e.style,{display:"flex",flexDirection:"column",gap:g.lg,padding:g.xl,color:b.text,fontSize:j.body,overflowY:"auto",flex:"1 1 auto",minHeight:"0"});const c=t.createElement("p");c.style.margin="0",c.textContent="The maps, the gallery and every Insights tab show only the wafers and dies that meet every condition. A condition on a wafer field (split, yield) keeps whole wafers; one on a die field (bin, ring, a test) keeps those dies inside them, and a map draws the others dimmed. The filter is shown above each view for as long as it exists, and can be switched off there without losing it.";const o=t.createElement("div");o.dataset.wmapInsightsFilterPreview="1",o.setAttribute("aria-live","polite"),Object.assign(o.style,{fontWeight:"600",color:b.value});const w=()=>{if(!p||p.off){o.textContent=p?"Off: every wafer and die is shown.":"No conditions: every wafer and die is shown.";return}const f=$(p.conditions,r.items,r.ctx);o.textContent=f.issue?`Cannot be applied: ${f.issue}`:`Keeps ${f.wafers.kept.toLocaleString("en-GB")} of ${f.wafers.total.toLocaleString("en-GB")} wafers \xB7 ${f.dies.kept.toLocaleString("en-GB")} of ${f.dies.total.toLocaleString("en-GB")} dies`},d=K({doc:t,catalogue:P(r.items,r.ctx),filter:p,testDefs:r.ctx.testDefs,attributes:h,switchLabel:"Filter",valuesOf:f=>z(f,r.items,r.ctx),extentOf:f=>G(f,r.items,r.ctx),onChange:f=>{p=f,w()}});w();const m=t.createElement("div");Object.assign(m.style,{display:"flex",justifyContent:"flex-end",gap:g.md,flexWrap:"wrap",flexShrink:"0",padding:`${g.md} ${g.xl}`,borderTop:`1px solid ${b.menuBorder}`});const F=O(t,"Cancel","wmapInsightsFilterCancel","Close without changing the filter",()=>a.close());u=O(t,"Apply","wmapInsightsFilterApply","Filter the maps, the gallery and Insights by these conditions",()=>{a.close(),S.set(p)});for(const f of[F,u])f.style.padding=`${g.sm} ${g.lg}`;m.append(F,u),e.append(c,d.el,o,Q({doc:t,popItems:r,getDraft:()=>p,load:f=>{p={conditions:JSON.parse(JSON.stringify(f.conditions))},d.set(p),w()},saved:()=>S.saved(),setSaved:f=>S.setSaved(f),onSaveText:n.onSaveText,pickFile:n.pickFiltersFile,attributes:h})),a.contentWrap.style.flexDirection="column",a.contentWrap.append(e,m)}};return S}function Q(n){const{doc:t}=n,h=t.createElement("div");h.dataset.wmapSavedFilters="1",Object.assign(h.style,{display:"flex",flexDirection:"column",gap:g.md,borderTop:`1px solid ${b.menuBorder}`,paddingTop:g.lg});const l=t.createElement("div");l.textContent="Saved filters",Object.assign(l.style,{fontWeight:"600",color:b.value});const y=t.createElement("div");y.dataset.wmapSavedFiltersStatus="1",y.setAttribute("role","status"),Object.assign(y.style,{color:b.label,whiteSpace:"pre-line"});const x=(a,e=[])=>{y.textContent=[a,...e].filter(Boolean).join(`
|
|
2
|
+
`)},E=t.createElement("div");Object.assign(E.style,{display:"flex",gap:g.sm,flexWrap:"wrap",alignItems:"center"});const v=t.createElement("input");v.type="text",v.placeholder="Name for the conditions above",v.setAttribute("aria-label","Name for the saved filter"),v.dataset.wmapSavedFilterName="1",Object.assign(v.style,{...Y(),flex:"1 1 12em"});const S=O(t,"Save","wmapSavedFilterSave","Keep the conditions above under this name",()=>{const a=n.getDraft(),e=v.value.trim();if(!a||a.conditions.length===0){x("Add a condition first: there is nothing to save.");return}if(!e){x("Give the filter a name."),v.focus();return}const c=JSON.parse(JSON.stringify(a.conditions)),o=n.saved(),w=o.findIndex(d=>d.name===e);n.setSaved(w<0?[...o,{id:R(),name:e,conditions:c}]:o.map((d,m)=>m===w?{...d,conditions:c}:d)),v.value="",x(w<0?`Saved \u201C${e}\u201D.`:`Updated \u201C${e}\u201D.`),s()});E.append(v,S);const i=t.createElement("div");i.dataset.wmapSavedFilterList="1",Object.assign(i.style,{display:"flex",flexDirection:"column",gap:g.xs});function s(){i.replaceChildren();const a=n.saved();if(a.length===0){const e=t.createElement("div");e.textContent="None yet. Set conditions above and save them under a name to use them again.",e.style.color=b.label,i.appendChild(e);return}for(const e of a){const c=t.createElement("div");c.dataset.wmapSavedFilter=e.id,Object.assign(c.style,{display:"flex",gap:g.sm,alignItems:"center",flexWrap:"wrap"});const o=t.createElement("span");Object.assign(o.style,{flex:"1 1 14em",minWidth:"0"});const w=t.createElement("strong");w.textContent=e.name;const d=t.createElement("span");d.style.color=b.label,d.textContent=` \u2014 ${e.conditions.map(C=>k(C,n.popItems.ctx.testDefs,n.attributes)).join(" \xB7 ")}`,o.append(w,d);const m=$(e.conditions,n.popItems.items,n.popItems.ctx).issue;if(m){const C=t.createElement("div");C.dataset.wmapSavedFilterIssue="1",C.textContent=`Cannot be applied to these wafers: ${m}`,Object.assign(C.style,{color:b.warnText,fontSize:j.body}),o.appendChild(C)}const F=O(t,"Load","wmapSavedFilterLoad","Put these conditions in the editor, replacing the ones there",()=>{n.load(e),x(`Loaded \u201C${e.name}\u201D. Press Apply to filter by it.`)}),f=O(t,"Delete","wmapSavedFilterDelete","Remove this saved filter",()=>{const C=n.saved();n.setSaved(C.filter(N=>N.id!==e.id)),x(`Deleted \u201C${e.name}\u201D.`),s()});c.append(o,F,f),i.appendChild(c)}}const r=t.createElement("div");Object.assign(r.style,{display:"flex",gap:g.sm,flexWrap:"wrap"});const p=O(t,"Export\u2026","wmapSavedFilterExport","Save all your saved filters to a file, to share or to keep a copy",()=>{if(n.saved().length===0){x("There are no saved filters to export yet.");return}H(W(n.saved()),"wafermap-filters.json","application/json",n.onSaveText)}),u=O(t,"Import\u2026","wmapSavedFilterImport","Add the filters from a file written by Export\u2026",()=>{(async()=>{const a=await X(t,n.pickFile);if(a===null)return;const e=J(a);if(e.error){x(`Could not import: ${e.error}`);return}const{filters:c,copies:o}=B(n.saved(),e.filters);n.setSaved(c),s(),x(`Imported ${e.filters.length} filter${e.filters.length===1?"":"s"}.`,[...e.warnings,...o.length?[`Kept as copies, since a filter with the same id already existed: ${o.join(", ")}`]:[]])})()});for(const a of[S,p,u])a.style.padding=`${g.sm} ${g.lg}`;return r.append(u,p),V(v,"The name the filter is listed under; saving under a name already used updates that filter"),s(),h.append(l,E,i,r,y),h}async function X(n,t){return t?t():new Promise(h=>{const l=n.createElement("input");l.type="file",l.accept=".json,application/json",l.addEventListener("change",()=>{const y=l.files?.[0];if(!y){h(null);return}y.text().then(h,()=>h(null))}),l.addEventListener("cancel",()=>h(null)),l.click()})}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Die } from '../core/dies.js';
|
|
2
|
+
import type { MetadataFieldDef, TestDef } from '../renderer/buildWaferMap.js';
|
|
3
|
+
/** The die metadata key the verdict is carried under. Not a host key: nothing a host sets can collide with it. */
|
|
4
|
+
export declare const PAT_MODE_KEY = "wmapPat";
|
|
5
|
+
/** The field the legend and tooltip name the verdict by; the colours say what a verdict is (blue within, amber outlier, red fails). */
|
|
6
|
+
export declare const PAT_MODE_FIELD: MetadataFieldDef;
|
|
7
|
+
/** The lot-wide order of the verdicts: fixed, so no card has to be read to know it. */
|
|
8
|
+
export declare const PAT_MODE_ORDER: readonly string[];
|
|
9
|
+
/** Whether these view options are the PAT verdict mode. */
|
|
10
|
+
export declare function isPatMode(o: {
|
|
11
|
+
plotMode?: string;
|
|
12
|
+
activeMetadataKey?: string;
|
|
13
|
+
}): boolean;
|
|
14
|
+
/** Cheap test for the mode menu: a test with both limits and a wafer with enough dies to set PAT limits from. */
|
|
15
|
+
export declare function patModeOffered(items: ReadonlyArray<{
|
|
16
|
+
dies: readonly Die[];
|
|
17
|
+
testDefs?: readonly TestDef[];
|
|
18
|
+
} | null | undefined>): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* A wafer's dies with each die's verdict under {@link PAT_MODE_KEY}. The verdicts are judged over the dies the page
|
|
21
|
+
* filter keeps (the Insights PAT card's rule), and a die the filter dropped keeps no verdict and is left as it is, to be
|
|
22
|
+
* drawn dimmed. A die no test judged carries no value and draws as no data. Memoised on the die list.
|
|
23
|
+
*/
|
|
24
|
+
export declare function withPatVerdicts(dies: readonly Die[], testDefs: readonly TestDef[] | undefined, passBins: readonly number[]): Die[];
|
|
25
|
+
/** `fields` with the verdict field added (once). */
|
|
26
|
+
export declare function withPatField(fields: readonly MetadataFieldDef[] | undefined): MetadataFieldDef[];
|
|
27
|
+
//# sourceMappingURL=patMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{copyDie as D}from"../core/dieTable.js";import{PAT_MIN_DIES as P,PAT_VERDICT_LABEL as a,PAT_VERDICT_ORDER as _,patTests as E,waferPatVerdicts as d}from"../stats/pat.js";export const PAT_MODE_KEY="wmapPat",PAT_MODE_FIELD={key:PAT_MODE_KEY,label:"PAT verdict",values:[{value:a.within,color:"#0072b2"},{value:a.outlier,color:"#e69f00"},{value:a.fails,color:"#c0392b"}]},PAT_MODE_ORDER=_;export function isPatMode(t){return t.plotMode==="metadata"&&t.activeMetadataKey===PAT_MODE_KEY}export function patModeOffered(t){return t.some(o=>!!o&&o.dies.length>=P&&E(o.testDefs??[]).length>0)}const u=new WeakMap;export function withPatVerdicts(t,o,c){const n=o??[],s=c.join(","),r=u.get(t);if(r&&r.testDefs===n&&r.passKey===s)return r.out;const l=t.some(e=>e.filteredOut)?t.filter(e=>!e.filteredOut):t,p=d(l,n,c);let m=0;const i=t.map(e=>{if(e.filteredOut)return e;const f=p[m++]?.verdict;return f?D(e,{metadata:{...e.metadata,[PAT_MODE_KEY]:a[f]}}):e});return u.set(t,{testDefs:n,passKey:s,out:i}),i}export function withPatField(t){return t?.some(o=>o.key===PAT_MODE_KEY)?[...t]:[...t??[],PAT_MODE_FIELD]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type PlotContext, type PlotItem, type PlotPoint, type ResolvedPlot } from '../stats/plotData.js';
|
|
2
|
+
import { type CardSlotValues, type CardSpec } from '../stats/cardSpec.js';
|
|
3
|
+
import { type PlotSpec } from '../stats/plotSpec.js';
|
|
4
|
+
import { type PlotChartOptions } from './charts/plotChart.js';
|
|
5
|
+
type ChoiceOptions = Array<[value: string, label: string, hint?: string]>;
|
|
6
|
+
/**
|
|
7
|
+
* One of a card's own choices (Hard or Soft bins, the sort): its options and the one shown first. Options given as a
|
|
8
|
+
* function are named for whether the card is drilled into a group (the sort then orders wafers, not groups).
|
|
9
|
+
*/
|
|
10
|
+
export interface CardChoice {
|
|
11
|
+
current: string;
|
|
12
|
+
options: ChoiceOptions | ((drilled: boolean) => ChoiceOptions);
|
|
13
|
+
}
|
|
14
|
+
/** A change the card makes to whichever variant is shown: a drill into one group. */
|
|
15
|
+
export type CardTransform = (spec: CardSpec) => CardSpec;
|
|
16
|
+
export interface PlotCardOptions {
|
|
17
|
+
doc: Document;
|
|
18
|
+
items: readonly PlotItem[];
|
|
19
|
+
ctx: PlotContext;
|
|
20
|
+
/** The card, or its variants: one segmented control per choice, and the spec for the values chosen, in order. */
|
|
21
|
+
spec: CardSpec | {
|
|
22
|
+
choices: CardChoice[];
|
|
23
|
+
build: (values: readonly string[]) => CardSpec;
|
|
24
|
+
};
|
|
25
|
+
/** The slots' values now (the section's test, the Group by). */
|
|
26
|
+
slots?: () => CardSlotValues;
|
|
27
|
+
/**
|
|
28
|
+
* Clicking a mark that is not one wafer (a group's bar) drills into it: the change to draw, or `null` to fall through to
|
|
29
|
+
* `chart.onSelectPoints`. A Back button undoes it.
|
|
30
|
+
*/
|
|
31
|
+
drill?: (points: readonly PlotPoint[]) => CardTransform | null;
|
|
32
|
+
/** What a click on a bar that drills does, in the reader's words ("see its wafers"). */
|
|
33
|
+
drillLabel?: string;
|
|
34
|
+
/** Lines the card adds under its statement, for what the plot itself cannot know (two judgements disagreeing). */
|
|
35
|
+
notes?: (spec: CardSpec) => string[];
|
|
36
|
+
/** Controls the host owns (a test picker shared across a section, its axis settings), put before the card's own. */
|
|
37
|
+
extras?: HTMLElement[];
|
|
38
|
+
/** A Back button the host drives: shown while `shown()` (a scope narrowed elsewhere), calling `onBack`. */
|
|
39
|
+
externalBack?: {
|
|
40
|
+
shown: () => boolean;
|
|
41
|
+
onBack: () => void;
|
|
42
|
+
};
|
|
43
|
+
/** Why the card draws nothing on this population (a trend through one wafer), in place of the plot. */
|
|
44
|
+
unavailable?: string;
|
|
45
|
+
/** Told each resolved plot, after it is drawn (a host control that reflects what was drawn). */
|
|
46
|
+
onResolved?: (r: ResolvedPlot) => void;
|
|
47
|
+
chart: Omit<PlotChartOptions, 'ownerDocument' | 'waferLabel'>;
|
|
48
|
+
/**
|
|
49
|
+
* Edit as plot, in the card's ⋯ menu: called with the reader's own plot of what the card shows now (`freezeCard`) and
|
|
50
|
+
* the population the card draws, to open in the plot editor. Absent = no such row (a host that keeps no plots).
|
|
51
|
+
*/
|
|
52
|
+
editAsPlot?: (plot: PlotSpec, over: {
|
|
53
|
+
items: readonly PlotItem[];
|
|
54
|
+
ctx: PlotContext;
|
|
55
|
+
}) => void;
|
|
56
|
+
}
|
|
57
|
+
export interface PlotCardHandle {
|
|
58
|
+
card: HTMLElement;
|
|
59
|
+
/** The spec drawn now, slots unfilled. */
|
|
60
|
+
current(): CardSpec;
|
|
61
|
+
/** Draw again, with the slots as they are now. */
|
|
62
|
+
refresh(): void;
|
|
63
|
+
destroy(): void;
|
|
64
|
+
}
|
|
65
|
+
export declare function renderPlotCard(o: PlotCardOptions): PlotCardHandle;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=plotCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolvePlot as k}from"../stats/plotData.js";import{fillCard as w,freezeCard as y}from"../stats/cardSpec.js";import{newPlotId as B}from"../stats/plotSpec.js";import{renderPlotChart as v}from"./charts/plotChart.js";import{makeBackButton as D,makeSegmented as A}from"./charts/chartShell.js";import{markNoPrint as P}from"./toolbar.js";export function renderPlotCard(e){let i;const f=D(()=>{i?(i=void 0,a()):e.externalBack?.onBack()},e.doc);P(f);const m={ownerDocument:e.doc,waferLabel:t=>e.items[t]?.label??"",...e.chart,onSelectPoints:e.drill||e.chart.onSelectPoints?(t,n,s,c)=>{const r=i?null:e.drill?.(t);if(r){i=r,a();return}e.chart.onSelectPoints?.(t,n,s,c)}:void 0},l=v(m),d="build"in e.spec?e.spec:void 0,p=d?.choices.map(t=>t.current)??[],h=()=>d?d.build(p):e.spec,o=()=>i?i(h()):h(),b=()=>({testDefs:e.ctx.testDefs,groupBy:e.ctx.groupBy,...e.slots?.()});if(e.editAsPlot){const t=e.editAsPlot;l.setMenuRows(()=>{const n=y(o(),{...b(),waferCount:e.items.length},B());return[{label:"Edit as plot",disabledHint:"issue"in n?n.issue:void 0,onClick:()=>{"spec"in n&&t(n.spec,{items:e.items,ctx:e.ctx})}}]})}l.actions.appendChild(f);for(const t of e.extras??[])l.actions.appendChild(t);let u=[],x;const g=()=>{const t=!!i;if(x===t)return;x=t;const n=(d?.choices??[]).map((s,c)=>{const r=A(typeof s.options=="function"?s.options(t):s.options,p[c],C=>{p[c]=C,a()},e.doc);return P(r),r});if(u.length)u.forEach((s,c)=>s.replaceWith(n[c]));else for(const s of n)l.actions.appendChild(s);u=n};function a(){g(),f.style.display=i||e.externalBack?.shown()?"":"none",m.selectActionLabel=e.drill&&!i?e.drillLabel:e.chart.selectActionLabel;const t=w(o(),b()),n="spec"in t?t.spec:{...o(),fields:{}},s=k(n,e.items,e.ctx),c=e.notes?.(o())??[],r=e.unavailable?{...s,marks:void 0,issues:[e.unavailable]}:"issue"in t?{...s,issues:[t.issue]}:c.length?{...s,notes:[...s.notes,...c]}:s;l.setPlot(r),e.onResolved?.(r)}return a(),{card:l.card,current:o,refresh:a,destroy:()=>l.destroy()}}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type FieldOption } from '../stats/plotData.js';
|
|
2
|
-
import { type PlotSpec } from '../stats/plotSpec.js';
|
|
2
|
+
import { type PlotField, type PlotSpec } from '../stats/plotSpec.js';
|
|
3
|
+
import type { TestDef } from '../renderer/buildWaferMap.js';
|
|
4
|
+
import type { FacetCuration } from '../stats/facets.js';
|
|
5
|
+
import { inputStyle } from './charts/chartShell.js';
|
|
6
|
+
export { inputStyle };
|
|
3
7
|
export interface PlotEditorOptions {
|
|
4
8
|
doc: Document;
|
|
5
9
|
plot: PlotSpec;
|
|
@@ -14,6 +18,14 @@ export interface PlotEditorOptions {
|
|
|
14
18
|
};
|
|
15
19
|
/** Called with the new spec after every change. */
|
|
16
20
|
onChange: (next: PlotSpec) => void;
|
|
21
|
+
/** The values a category field takes on the population, in order: what a filter condition offers. */
|
|
22
|
+
valuesOf?: (field: PlotField) => string[];
|
|
23
|
+
/** The range a number field spans on the population: where a new range condition starts. */
|
|
24
|
+
extentOf?: (field: PlotField) => [number, number] | undefined;
|
|
25
|
+
/** The population's test definitions, so a condition on a test is stated with its name and unit. */
|
|
26
|
+
testDefs?: readonly TestDef[];
|
|
27
|
+
/** The host's names for wafer attributes, so a condition names a field as the field list does. */
|
|
28
|
+
attributes?: Record<string, FacetCuration>;
|
|
17
29
|
}
|
|
18
30
|
export interface PlotEditorHandle {
|
|
19
31
|
el: HTMLElement;
|
|
@@ -22,7 +34,6 @@ export interface PlotEditorHandle {
|
|
|
22
34
|
/** The automatic text changed (the data did): refresh the placeholders. */
|
|
23
35
|
refreshAuto(): void;
|
|
24
36
|
}
|
|
25
|
-
export declare function inputStyle(): Partial<CSSStyleDeclaration>;
|
|
26
37
|
/** A labelled control with an optional hint beneath it: the one layout every editor field uses. */
|
|
27
38
|
export declare function fieldRow(doc: Document, label: string, control: HTMLElement, hint?: string): HTMLElement;
|
|
28
39
|
export declare function createPlotEditor(o: PlotEditorOptions): PlotEditorHandle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{combinationIssue as le,describeTitleDrift as oe,fieldKey as k,fieldsForRole as q,titleDrift as ae}from"../stats/plotData.js";import{sameField as $}from"../stats/plotSpec.js";import{CLR as m,FONT as S,RADIUS as V,SPACE as b,controlStyle as K,wireControlHover as _,wireTooltip as se}from"./toolbar.js";import{makeListSelect as X,makeSegmented as N,makeToggle as re}from"./charts/chartShell.js";const Y="\0follow",z="\0none",ce=[["scatter","Scatter","One point per die or wafer, one value against another"],["histogram","Histogram","How often each value occurs"],["box","Box","Quartiles, with whiskers to the minimum and maximum, for each category"],["bar","Bar","One combined value for each category, or a count"],["line","Line","One combined value at each X, joined"]],A="\0auto",G="\0count",Q={mean:"Mean",median:"Median",min:"Minimum",max:"Maximum",sum:"Sum",count:"Count",yield:"Pooled yield (passing over judged dies)"};export function inputStyle(){return{background:m.menuBg,color:m.text,border:`1px solid ${m.menuBorder}`,borderRadius:V.control,padding:`${b.xs} ${b.sm}`,fontSize:S.body,fontFamily:S.family,boxSizing:"border-box",minWidth:"0"}}export function fieldRow(d,r,B,a){const p=d.createElement("div");Object.assign(p.style,{display:"flex",flexDirection:"column",gap:b.xxs,minWidth:"0"});const x=d.createElement("div");if(x.textContent=r,Object.assign(x.style,{fontSize:S.sub,color:m.label,fontWeight:"600"}),p.append(x,B),a){const T=d.createElement("div");T.textContent=a,Object.assign(T.style,{fontSize:S.sub,color:m.label}),p.appendChild(T)}return p}export function createPlotEditor(d){const{doc:r}=d,B=t=>t.fields?t:{...t,fields:{}};let a=B(d.plot),p="setup";const x=r.createElement("div");x.dataset.wmapPlotEditor="1",Object.assign(x.style,{display:"flex",flexDirection:"column",gap:b.lg,minWidth:"0"});const T=t=>{a=t,d.onChange(t)},y=t=>{const e=JSON.parse(JSON.stringify(a));t(e),T(e)},c=(t,e,i)=>fieldRow(r,t,e,i),D=t=>{const e=t&&d.catalogue.find(i=>$(i.field,t));return e?{label:e.name,level:e.level,kind:e.kind,yield:"builtin"in e.field&&e.field.builtin==="yield"}:void 0};function Z(t,e){const i=a.fields??{},n=i.color&&!("follow"in i.color)&&!("none"in i.color)?i.color:void 0,o={x:D(i.x),y:D(i.y),color:D(n)};o[t]=D(e.field);const l=a.chart==="scatter"&&o.color?.kind==="numeric"&&!!n&&!("meta"in n);return le(a.chart,o,{aggregate:a.aggregate,level:a.level,continuousColor:l})?.short}const I=t=>{const e=a.fields?.[t],i=e&&!("follow"in e)&&!("none"in e)?e:void 0;return q(d.catalogue,a.chart,t).map(n=>{const o=i&&$(n.field,i)?void 0:Z(t,n);return{value:k(n.field),label:n.label,group:n.group,...o?{disabled:o}:{}}})},H=t=>d.catalogue.find(e=>k(e.field)===t)?.field;function w(t,e,i={}){const n=a.fields[t],o=I(t);if(i.optional&&o.unshift({value:G,label:i.optional,group:"Count"}),n&&!o.some(u=>u.value===k(n))){const u=d.catalogue.some(C=>$(C.field,n)),h="test"in n?n.name??`Test ${n.test}`:"meta"in n?n.meta:n.builtin;o.unshift({value:k(n),label:`${h} (${u?"not usable here":"not in this lot"})`,group:"Saved"})}const l=n?k(n):i.optional?G:"",s=X(o,l,u=>{if(u===G){y(C=>{delete C.fields[t]});return}const h=H(u)??a.fields[t];h&&y(C=>{C.fields[t]=h})},{maxWidth:"100%",ownerDocument:r,ariaLabel:e,emptyText:"Choose a field\u2026",searchPlaceholder:"Filter fields\u2026",hook:`plot-${t}`});return s.style.width="100%",s}const P={},F={};function ee(t){y(e=>{e.chart=t;for(const i of["x","y"]){const n=q(d.catalogue,t,i),o=h=>!!h&&n.some(C=>$(C.field,h)),l=e.fields[i];if(l&&!o(l)&&($(l,F[i])||(P[i]=l),delete e.fields[i]),e.fields[i]||i==="y"&&t==="bar")continue;const s=P[i];if(o(s)){e.fields[i]=s,delete P[i],delete F[i];continue}const u=i==="x"&&(t==="box"||t==="bar")?{builtin:"wafer"}:i==="x"&&t==="line"?n.find(h=>h.group==="Wafer")?.field??n[0]?.field:n[0]?.field;u&&!(i==="x"&&t==="histogram")&&(e.fields[i]=u,F[i]=u)}}),O()}function te(){const t=!!a.fields.y&&"builtin"in a.fields.y&&a.fields.y.builtin==="yield",e=[{value:A,label:"Automatic"},...["mean","median","min","max","sum","count"].map(n=>({value:n,label:Q[n]}))];t&&e.push({value:"yield",label:Q.yield});const i=X(e,a.aggregate??A,n=>y(o=>{n===A?delete o.aggregate:o.aggregate=n}),{maxWidth:"100%",ownerDocument:r,ariaLabel:"Combine values by",hook:"plot-aggregate"});return i.style.width="100%",i}function ie(){const t=a.fields.color,e=d.followLabel(),i=[{value:Y,label:e?`Follow Group by (${e})`:"Follow Group by (single colour)",group:"Colour"},{value:z,label:"None",group:"Colour"},...I("color")],n=t===void 0||"follow"in t?Y:"none"in t?z:k(t),o=X(i,n,l=>{y(s=>{if(l===Y)delete s.fields.color;else if(l===z)s.fields.color={none:!0};else{const u=H(l);u&&(s.fields.color=u)}})},{maxWidth:"100%",ownerDocument:r,ariaLabel:"Colour",searchPlaceholder:"Filter fields\u2026",hook:"plot-color"});return o.style.width="100%",o}function J(t,e,i,n){const o=r.createElement("input");return o.type="text",o.value=t,o.placeholder=e,o.setAttribute("aria-label",i),Object.assign(o.style,inputStyle(),{width:"100%"}),o.addEventListener("input",()=>n(o.value)),o.addEventListener("keydown",l=>{l.key==="Escape"&&(l.stopPropagation(),o.blur())}),o}function W(t,e,i){const n=r.createElement("input");n.type="text",n.inputMode="decimal",n.value=t===void 0?"":String(t),n.placeholder="auto",n.setAttribute("aria-label",e),Object.assign(n.style,inputStyle(),{width:"100%",fontVariantNumeric:"tabular-nums"});const o=()=>{const l=n.value.trim();if(l===""){i(void 0);return}const s=Number(l);Number.isFinite(s)?i(s):n.value=t===void 0?"":String(t)};return n.addEventListener("change",o),n.addEventListener("keydown",l=>{l.key==="Enter"&&o(),l.key==="Escape"&&(l.stopPropagation(),n.value=t===void 0?"":String(t),n.blur())}),n}function U(t,e,i,n){const o=a.axes?.[t]??{},l=g=>y(f=>{f.axes=f.axes??{};const E=f.axes[t]=f.axes[t]??{};g(E);for(const j of Object.keys(E))(E[j]===void 0||E[j]===""||j==="reverse"&&E[j]===!1)&&delete E[j];Object.keys(E).length===0&&delete f.axes[t],Object.keys(f.axes).length===0&&delete f.axes}),s=r.createElement("div");Object.assign(s.style,{display:"flex",flexDirection:"column",gap:b.md,padding:b.lg,border:`1px solid ${m.menuBorder}`,borderRadius:V.control});const u=r.createElement("div");u.textContent=e,Object.assign(u.style,{fontSize:S.body,fontWeight:"600",color:m.value}),s.appendChild(u);const h=J(o.label??"",i??"",`${e} title`,g=>l(f=>{f.label=g.trim()===""?void 0:g}));if(h.dataset.wmapPlotAxisTitle=t,s.appendChild(c("Title",h)),n.limits===!1)return s;const C=r.createElement("div");return Object.assign(C.style,{display:"grid",gridTemplateColumns:"1fr 1fr",gap:b.md}),C.append(c("Minimum",W(o.min,`${e} minimum`,g=>l(f=>{f.min=g}))),c("Maximum",W(o.max,`${e} maximum`,g=>l(f=>{f.max=g})))),s.appendChild(C),n.scale&&s.appendChild(c("Scale",N([["linear","Linear"],["log","Log"]],o.scale??"linear",g=>l(f=>{f.scale=g==="log"?"log":void 0}),r))),s.appendChild(re("Reverse direction",!!o.reverse,g=>l(f=>{f.reverse=g}),r)),s}const ne=t=>x.querySelector(`[role="tab"][data-tab="${t}"]`);let L,v;const R=new Map;function M(){if(!v)return;const t=oe(ae(a,d.catalogue));if(v.replaceChildren(),v.style.display=t?"flex":"none",!t)return;const e=r.createElement("span");e.textContent=t;const i=r.createElement("button");i.type="button",i.textContent="Use the automatic title",i.dataset.wmapPlotAutoTitle="1",Object.assign(i.style,K("outlined")),_(i),i.addEventListener("click",()=>{y(n=>{delete n.title}),O()}),v.append(e,i)}function O(){x.replaceChildren(),R.clear();const t=r.createElement("div");t.setAttribute("role","tablist"),Object.assign(t.style,{display:"flex",gap:b.sm,borderBottom:`1px solid ${m.menuBorder}`});for(const[i,n,o]of[["setup","Setup","Which fields to plot and how they are combined"],["customise","Customise","Titles, axis limits, scale and direction"]]){const l=r.createElement("button");l.type="button",l.textContent=n,se(l,o),l.setAttribute("role","tab"),l.dataset.tab=i,l.setAttribute("aria-selected",String(p===i)),Object.assign(l.style,{...K("bare"),padding:`${b.sm} ${b.lg}`,fontSize:S.body,borderBottom:`2px solid ${p===i?m.iconActive:"transparent"}`,borderRadius:"0",color:p===i?m.iconActive:m.text,fontWeight:p===i?"600":"400"}),_(l,"bare"),l.tabIndex=p===i?0:-1,l.addEventListener("click",()=>{p=i,O()}),l.addEventListener("keydown",s=>{s.key!=="ArrowLeft"&&s.key!=="ArrowRight"||(s.preventDefault(),p=i==="setup"?"customise":"setup",O(),ne(p)?.focus())}),t.appendChild(l)}x.appendChild(t);const e=r.createElement("div");if(e.setAttribute("role","tabpanel"),Object.assign(e.style,{display:"flex",flexDirection:"column",gap:b.lg}),p==="setup"){e.appendChild(c("Chart type",N(ce,a.chart,n=>ee(n),r,!0)));const i=a.level==="wafer"?"wafers":"dies";switch(a.chart){case"scatter":e.appendChild(c("X axis",w("x","X axis"))),e.appendChild(c("Y axis",w("y","Y axis")));break;case"histogram":e.appendChild(c("Values",w("y","Values")));break;case"box":e.appendChild(c("Categories (X axis)",w("x","Categories"),"Compare by this field: one box per value, whether it is a wafer attribute (lot, split) or a die region (ring, reticle cell).")),e.appendChild(c("Values (Y axis)",w("y","Values")));break;case"bar":e.appendChild(c("Categories (X axis)",w("x","Categories"),"Compare by this field: one bar per value, whether it is a wafer attribute (lot, split) or a die region (ring, reticle cell).")),e.appendChild(c("Values (Y axis)",w("y","Values",{optional:`Count of ${i}`})));break;case"line":e.appendChild(c("X axis",w("x","X axis"),"A line joins the value at each X.")),e.appendChild(c("Y axis",w("y","Y axis")));break}e.appendChild(c("Colour",ie(),"Compare by this field: each value gets its own colour. Follow Group by takes it from the Group by control.")),(a.chart==="bar"||a.chart==="line"||a.level==="wafer")&&e.appendChild(c("Combine values by",te())),e.appendChild(c("One mark per",N([[A,"Automatic"],["die","Die"],["wafer","Wafer"]],a.level??A,n=>{y(o=>{n===A?delete o.level:o.level=n}),O()},r,!0),a.level==="wafer"?"Die-level values are combined per wafer.":"Automatic uses the finest level the chosen fields allow."))}else{L=J(a.title??"",d.autoText().title,"Plot title",l=>{y(s=>{l.trim()===""?delete s.title:Object.assign(s,{title:l})}),M()}),L.dataset.wmapPlotTitle="1",v=r.createElement("div"),v.dataset.wmapPlotTitleDrift="1",Object.assign(v.style,{display:"none",flexDirection:"column",gap:b.sm,alignItems:"flex-start",padding:`${b.sm} ${b.md}`,background:m.warnBg,border:`1px solid ${m.warnBorder}`,borderRadius:V.control,color:m.warnText,fontSize:S.body}),e.appendChild(c("Title",L)),e.appendChild(v),M();const i=d.autoText(),n=a.chart==="box"||a.chart==="bar";e.appendChild(U("x",a.chart==="histogram"?"Values axis":n?"Categories axis":"X axis",i.x,{scale:!n,limits:!n})),e.appendChild(U("y",a.chart==="histogram"?"Count axis":n||a.chart==="line"?"Values axis":"Y axis",i.y,{scale:a.chart!=="histogram"})),a.chart==="histogram"&&e.appendChild(c("Bins",W(a.bins,"Number of bins",l=>y(s=>{l===void 0||!Number.isInteger(l)||l<1?delete s.bins:s.bins=Math.min(l,200)})),"Automatic is 16 equal bins."));const o=a.fields??{};(o.x&&"test"in o.x||o.y&&"test"in o.y)&&e.appendChild(c("Limits",N([["both","Test + spec"],["test","Test"],["spec","Spec"],["none","None"]],a.limits??"both",l=>y(s=>{l==="both"?delete s.limits:s.limits=l}),r),"Drawn as dashed lines on the axis of a test that has them: short dashes for test limits, long for spec limits."));for(const l of e.querySelectorAll("[data-wmap-plot-axis-title]"))R.set(l.dataset.wmapPlotAxisTitle,l)}x.appendChild(e)}return O(),{el:x,setPlot(t){const e=B(t);JSON.stringify(e)!==JSON.stringify(a)&&(a=e,O())},refreshAuto(){const t=d.autoText();L&&(L.placeholder=t.title),M();for(const[e,i]of R)i.placeholder=(e==="x"?t.x:t.y)??""}}}
|
|
1
|
+
import{combinationIssue as $e,describeTitleDrift as je,fieldKey as N,fieldsForRole as ge,titleDrift as Pe,withTestSetNames as ye}from"../stats/plotData.js";import{isBinned as $,isField as U,isPassRateSet as We,isTestSet as P,sameField as j,xFieldsOf as Re,PLOT_BINS_DEFAULT as re,PLOT_BINS_MAX as Be,PLOT_BINS_MIN as De,PLOT_X_LEVELS as ce}from"../stats/plotSpec.js";import{formatTestList as Fe,parseTestList as Ie}from"../stats/sweepText.js";import{formatReferences as ze,parseReferences as Me}from"../stats/plotReferences.js";import{CLR as S,FONT as D,RADIUS as we,SPACE as C,controlStyle as K,wireControlHover as Q,wireTooltip as de}from"./toolbar.js";import{inputStyle as Z,makeListSelect as _,makeSegmented as T,makeToggle as Y}from"./charts/chartShell.js";export{Z as inputStyle};import{buildFilterEditor as Ve}from"./filterEditor.js";const ue="\0follow",z="\0none",Xe=[["scatter","Scatter","One point per die or wafer, one value against another"],["histogram","Histogram","How often each value occurs"],["box","Box","Quartiles, with whiskers to the minimum and maximum, for each category"],["bar","Bar","One combined value for each category, or a count"],["line","Line","One combined value at each X, joined"],["probability","Probability","The share of values at or below each value, one curve per colour: on the normal-probability axis a normal distribution is a straight line, and its tails are spread out to read"],["control","Control","One value per wafer in order, against limits from its own wafer-to-wafer variation, with the points that break a Western Electric rule marked"],["heatmap","Heatmap","One cell per row and column, coloured by the value combined there: tests by wafer, bins by wafer, rings by split"],["goal","Goal","Every test with both limits as a point: how far its mean is off centre, and how wide it is, against lines of equal Ppk"]],y="\0auto",fe="\0count",he="\0set",qe=8,_e=[[y,"None","The values as measured, in their own unit"],["limits","To limits","0 at the low limit and 1 at the high one, each test by its own limits (spec limits where it has both)"],["zscore","z-score","Standard deviations from the mean of the values in view, each test on its own"],["robust","Robust z","Like a z-score, from the median and the median absolute deviation, so a few outliers do not set the scale"]],xe={mean:"Mean",median:"Median",min:"Minimum",max:"Maximum",sum:"Sum",count:"Count",yield:"Pooled yield (passing over judged dies)"};export function fieldRow(x,f,G,l){const A=x.createElement("div");Object.assign(A.style,{display:"flex",flexDirection:"column",gap:C.xxs,minWidth:"0"});const k=x.createElement("div");if(k.textContent=f,Object.assign(k.style,{fontSize:D.sub,color:S.label,fontWeight:"600"}),A.append(k,G),l){const M=x.createElement("div");M.textContent=l,Object.assign(M.style,{fontSize:D.sub,color:S.label}),A.appendChild(M)}return A}export function createPlotEditor(x){const{doc:f}=x,G=e=>e.fields?e:{...e,fields:{}};let l=G(x.plot),A="setup";const k=f.createElement("div");k.dataset.wmapPlotEditor="1",Object.assign(k.style,{display:"flex",flexDirection:"column",gap:C.lg,minWidth:"0"});const M=e=>{l=e,x.onChange(e)},b=e=>{const t=JSON.parse(JSON.stringify(l));e(t),M(t)},h=(e,t,i)=>fieldRow(f,e,t,i),H=e=>{if(P(e))return{label:"Tests",level:"die",kind:"numeric",yield:!1};const t=e&&x.catalogue.find(i=>j(i.field,$(e)?e.binned:e));return t?{label:t.name,level:t.level,kind:e&&$(e)?"categorical":t.kind,yield:!(e&&$(e))&&"builtin"in t.field&&t.field.builtin==="yield"}:void 0},E=(e=l)=>[...Re(e.fields?.x)],I=(e,t)=>{t.length===0?delete e.fields.x:e.fields.x=t.length===1?t[0]:t},ve=e=>{const t=e.map(H).filter(i=>!!i);return t.find(i=>i.level==="die")??t[0]};function pe(e,t,i=0){const s=l.fields??{},a=s.color&&!("follow"in s.color)&&!("none"in s.color)?s.color:void 0,o=E();e==="x"&&(o[i]=t.field);const c={x:ve(o),y:H(s.y),color:H(a)};e!=="x"&&(c[e]=H(t.field));const n=l.chart==="scatter"&&c.color?.kind==="numeric"&&!!a&&!("meta"in a);return $e(l.chart,c,{aggregate:l.aggregate,level:l.level,continuousColor:n})?.short}const ee=()=>x.catalogue.flatMap(e=>e.group==="Tests"&&"test"in e.field?[{testNumber:e.field.test,name:e.field.name??""}]:[]),F=()=>P(l.fields?.y)?l.fields.y:void 0,V=e=>!!e&&"builtin"in e&&e.builtin==="test",te=(e,t=0)=>{const i=e==="x"?E()[t]:l.fields?.[e],s=i&&!("follow"in i)&&!("none"in i)?i:void 0,a=e==="x"?E().filter((c,n)=>n!==t):[],o=ge(x.catalogue,l.chart,e).filter(c=>(F()||!V(c.field))&&!a.some(n=>j(n,c.field))).map(c=>{const n=s&&j(c.field,s)?void 0:pe(e,c,t);return{value:N(c.field),label:c.label,group:c.group,...n?{disabled:n}:{}}});return e==="y"?o:[...o,...ie(e,t)]},ie=(e,t=0)=>{if(e==="x"&&!(l.chart==="box"||l.chart==="bar"||l.chart==="heatmap"))return[];if(e==="color"&&l.chart==="scatter")return[];const i=[...e==="x"?E().filter((s,a)=>a!==t):E(),...l.fields?.color&&U(l.fields.color)?[l.fields.color]:[]];return x.catalogue.filter(s=>s.kind==="numeric"&&!s.categorical&&s.group!=="Pass rates"&&!P(s.field)&&!i.some(a=>j(a,s.field))).map(s=>{const a={binned:s.field},o=e==="facet"&&s.level==="die"&&l.level==="wafer"?`${s.name} is per die: this plot has one mark per wafer`:e==="x"||e==="color"?pe(e,{...s,field:a,kind:"categorical",categorical:!0},t):void 0;return{value:N(a),label:`${s.label} in ranges`,group:s.group,...o?{disabled:o}:{}}})},X=e=>{const t=x.catalogue.find(s=>N(s.field)===e)?.field;if(t||!e.startsWith("binned:"))return t;const i=x.catalogue.find(s=>N({binned:s.field})===e)?.field;return i?{binned:i}:void 0};function J(e,t,i,s){if(!t||!$(t))return e;const a=f.createElement("div");Object.assign(a.style,{display:"flex",flexDirection:"column",gap:C.xs,minWidth:"0"});const o=f.createElement("div");Object.assign(o.style,{display:"flex",gap:C.sm,alignItems:"center",minWidth:"0"});const c=R(t.bins??re,"Number of ranges",u=>{const d=u===void 0?re:Math.round(u);b(p=>s(p,g=>{d===re?delete g.bins:g.bins=Math.min(Be,Math.max(De,d))})),O()});c.dataset.wmapPlotBins=i,c.style.width="64px";const n=f.createElement("span");n.textContent="ranges",Object.assign(n.style,{fontSize:D.sub,color:S.label});const r=T([["count","Equal counts","Each range holds about the same number of values (quartiles, deciles)"],["width","Equal widths","Each range spans the same width of values"]],t.by??"count",u=>b(d=>s(d,p=>{u==="count"?delete p.by:p.by="width"})),f);return o.append(c,n,r),a.append(e,o),a}function L(e,t,i={}){const s=i.at??0,a=e==="x"?E()[s]:l.fields.y,o=te(e,s);if(i.optional&&o.unshift({value:fe,label:i.optional,group:"Count"}),e==="y"&&l.chart!=="scatter"&&ee().length>=2&&o.unshift({value:he,label:"Several tests\u2026",group:"Several tests"}),a&&!P(a)&&!o.some(u=>u.value===N(a))){const u=x.catalogue.some(p=>j(p.field,a)),d="test"in a?a.name??`Test ${a.test}`:"meta"in a?a.meta:"builtin"in a?a.builtin:"";o.unshift({value:N(a),label:`${d} (${u?"not usable here":"not in this lot"})`,group:"Saved"})}const n=a?P(a)?he:N(a):i.optional?fe:"",r=_(o,n,u=>{if(u===fe){b(g=>{delete g.fields[e]});return}if(u===he){F()||(Ce(),O());return}const d=X(u)??a;if(!d)return;const p=e==="y"&&!!F();b(g=>{if(e==="x"){const v=E(g);v[s]=d,I(g,v)}else g.fields.y=d;if(!p)return;const w=E(g),m=w.filter(v=>!V(v));m.length!==w.length&&I(g,m.length||!(g.chart==="box"||g.chart==="bar")?m:[{builtin:"wafer"}]),V(g.fields.color)&&delete g.fields.color}),(p||$(d)||a&&$(a))&&O()},{maxWidth:"100%",ownerDocument:f,ariaLabel:t,emptyText:"Choose a field\u2026",searchPlaceholder:"Filter fields\u2026",hook:e==="x"&&s>0?`plot-x-${s+1}`:`plot-${e}`});return r.style.width="100%",r}function Ce(){const e=ee(),t=ye({tests:e.slice(0,qe).map(i=>i.testNumber)},e);b(i=>{i.fields.y=t;const s=E(i);(i.chart==="box"||i.chart==="bar")&&(s.length===0||s.length===1&&j(s[0],{builtin:"wafer"}))&&(i.fields.x={builtin:"test"})})}function Ee(e){const t=f.createElement("div");Object.assign(t.style,{display:"flex",flexDirection:"column",gap:C.xxs});const i=f.createElement("input");i.type="text",i.value=Fe(e.tests),i.placeholder="1010, 1011, 1020..1030",i.setAttribute("aria-label","Tests"),i.dataset.wmapPlotTests="1",Object.assign(i.style,Z(),{width:"100%",fontVariantNumeric:"tabular-nums"});const s=f.createElement("div");return s.setAttribute("role","alert"),Object.assign(s.style,{fontSize:D.sub,color:S.errText}),i.addEventListener("input",()=>{const a=Ie(i.value),o=a.ok?a.value.length===0?"Name at least one test":void 0:a.error;if(s.textContent=o??"",i.setAttribute("aria-invalid",String(!!o)),i.style.borderColor=o?S.errText:S.menuBorder,o||!a.ok)return;const c=a.value;b(n=>{n.fields.y=ye({tests:c},ee())})}),i.addEventListener("keydown",a=>{a.key==="Escape"&&(a.stopPropagation(),i.blur())}),t.append(i,s),t}function me(){const e=E(),t=f.createElement("div");t.dataset.wmapPlotLevels="1",Object.assign(t.style,{display:"flex",flexDirection:"column",gap:C.xs,minWidth:"0"});const i=d=>{const p=e[d];return(p&&x.catalogue.find(g=>j(g.field,p))?.name)??`level ${d+1}`},s=(d,p,g,w,m)=>{const v=f.createElement("button");return v.type="button",v.textContent=d,v.setAttribute("aria-label",p),v.dataset.wmapPlotLevel=g,v.disabled=w,de(v,p),Object.assign(v.style,K("outlined"),{minWidth:"28px",opacity:w?"0.4":"1"}),Q(v),v.addEventListener("click",m),v},a=(...d)=>{O();for(const p of d){const g=k.querySelector(`[data-wmap-plot-level="${p}"]`);if(g&&!g.disabled){g.focus();return}}},o=(d,p)=>{b(w=>{const m=E(w);[m[d],m[d+p]]=[m[d+p],m[d]],I(w,m)});const g=d+p;a(`${p<0?"out":"in"}:${g}`,`${p<0?"in":"out"}:${g}`)},c=Math.max(1,e.length);for(let d=0;d<c;d++){const p=f.createElement("div");Object.assign(p.style,{display:"flex",gap:C.xs,alignItems:"center",minWidth:"0"});const g=J(L("x",c>1?`Categories, level ${d+1} of ${c}`:"Categories",{at:d}),e[d],`x-${d+1}`,(w,m)=>{const v=E(w),W=v[d];W&&$(W)&&(m(W),I(w,v))});Object.assign(g.style,{flex:"1",minWidth:"0"}),p.appendChild(g),e.length>1&&p.append(s("\u2191",`Move ${i(d)} out a level`,`out:${d}`,d===0,()=>o(d,-1)),s("\u2193",`Move ${i(d)} in a level`,`in:${d}`,d===e.length-1,()=>o(d,1)),s("\xD7",`Remove ${i(d)} from the categories`,`remove:${d}`,!1,()=>{b(w=>{const m=E(w);m.splice(d,1),I(w,m)}),a(`remove:${Math.min(d,e.length-2)}`),e.length-1<2&&k.querySelector('[data-wmap-select="plot-x"]')?.focus()})),t.appendChild(p)}const n=e.length<ce&&e.length>0?te("x",e.length).find(d=>!d.disabled):void 0,r=f.createElement("button");r.type="button",r.textContent="+ Add a level",r.dataset.wmapPlotLevelAdd="1",r.disabled=!n;const u=e.length>=ce?`At most ${ce} levels`:n?"Divide each category by another field, nested inside it":"No other field can divide these categories";return de(r,u),Object.assign(r.style,K("outlined"),{alignSelf:"flex-start",opacity:r.disabled?"0.4":"1"}),Q(r),r.addEventListener("click",()=>{const d=n&&X(n.value);d&&(b(p=>{I(p,[...E(p),d])}),O(),k.querySelector(`[data-wmap-select="plot-x-${e.length+1}"]`)?.focus())}),t.appendChild(r),t}const ae={},se={};function Oe(e){b(t=>{t.chart=e;for(const i of["x","y"]){const s=ge(x.catalogue,e,i),a=u=>!!u&&(P(u)?i==="y"&&e!=="scatter":$(u)?i==="x"&&(e==="box"||e==="bar"||e==="heatmap"):s.some(d=>j(d.field,u))),o=u=>Array.isArray(u)?(e==="box"||e==="bar")&&u.every(a):a(u),c=t.fields[i];if(c&&!o(c)&&((Array.isArray(c)||!j(c,se[i]))&&(ae[i]=c),delete t.fields[i]),t.fields[i]||i==="y"&&(e==="bar"||e==="goal"||e==="heatmap"))continue;const n=ae[i];if(o(n)){i==="x"?t.fields.x=n:t.fields.y=n,delete ae[i],delete se[i];continue}const r=i==="x"&&(e==="box"||e==="bar"||e==="heatmap")?{builtin:"wafer"}:i==="x"&&(e==="line"||e==="control")?s.find(u=>u.group==="Wafer")?.field??s[0]?.field:s[0]?.field;r&&!(i==="x"&&(e==="histogram"||e==="probability"||e==="goal"))&&(t.fields[i]=r,se[i]=r)}}),O()}function Se(){const e=!!l.fields.y&&"builtin"in l.fields.y&&l.fields.y.builtin==="yield",t=[{value:y,label:"Automatic"},...["mean","median","min","max","sum","count"].map(s=>({value:s,label:xe[s]}))];e&&t.push({value:"yield",label:xe.yield});const i=_(t,l.aggregate??y,s=>b(a=>{s===y?delete a.aggregate:a.aggregate=s}),{maxWidth:"100%",ownerDocument:f,ariaLabel:"Combine values by",hook:"plot-aggregate"});return i.style.width="100%",i}function Te(){const e=l.fields.color,t=x.followLabel(),i=[{value:ue,label:t?`Follow Group by (${t})`:"Follow Group by (single colour)",group:"Colour"},{value:z,label:"None",group:"Colour"},...te("color")],s=e===void 0||"follow"in e?ue:"none"in e?z:N(e),a=_(i,s,o=>{b(c=>{if(o===ue)delete c.fields.color;else if(o===z)c.fields.color={none:!0};else{const n=X(o);n&&(c.fields.color=n)}}),(o.startsWith("binned:")||s.startsWith("binned:"))&&O()},{maxWidth:"100%",ownerDocument:f,ariaLabel:"Colour",searchPlaceholder:"Filter fields\u2026",hook:"plot-color"});return a.style.width="100%",J(a,e&&U(e)?e:void 0,"color",(o,c)=>{const n=o.fields.color;n&&U(n)&&$(n)&&c(n)})}function Ae(){const e=l.fields.rows,t=x.catalogue.filter(a=>a.categorical&&!E().some(o=>j(o,a.field))&&(!V(a.field)||F())).map(a=>({value:N(a.field),label:a.label,group:a.group}));t.push(...ie("rows"));const i=e?N(e):F()?N({builtin:"test"}):"",s=_(t,i,a=>{const o=X(a);o&&(b(c=>{c.fields.rows=o}),(a.startsWith("binned:")||i.startsWith("binned:"))&&O())},{maxWidth:"100%",ownerDocument:f,ariaLabel:"Rows",emptyText:"Choose a field\u2026",searchPlaceholder:"Filter fields\u2026",hook:"plot-rows"});return s.style.width="100%",J(s,e,"rows",(a,o)=>{const c=a.fields.rows;c&&$(c)&&o(c)})}function ke(){const e=l.fields.facet,t=[...E(),...l.fields.color&&U(l.fields.color)?[l.fields.color]:[]],i=[{value:z,label:"None: one plot",group:"Panels"}];for(const o of x.catalogue){if(!o.categorical||t.some(n=>j(n,o.field))||V(o.field)&&!F())continue;const c=o.level==="die"&&l.level==="wafer"?`${o.name} is per die: this plot has one mark per wafer`:void 0;i.push({value:N(o.field),label:o.label,group:o.group,...c?{disabled:c}:{}})}i.push(...ie("facet"));const s=e?N(e):z,a=_(i,s,o=>{b(c=>{if(o===z)delete c.fields.facet;else{const n=X(o);n&&(c.fields.facet=n)}}),(o.startsWith("binned:")||s.startsWith("binned:"))&&O()},{maxWidth:"100%",ownerDocument:f,ariaLabel:"Panels",searchPlaceholder:"Filter fields\u2026",hook:"plot-facet"});return a.style.width="100%",J(a,e,"facet",(o,c)=>{const n=o.fields.facet;n&&$(n)&&c(n)})}function Le(){const e=Ve({doc:f,catalogue:x.catalogue,filter:l.where,testDefs:x.testDefs,attributes:x.attributes,switchLabel:"Filter this plot",valuesOf:t=>x.valuesOf?.(t)??[],extentOf:t=>x.extentOf?.(t),onChange:t=>b(i=>{t?i.where=t:delete i.where})});return e.el.dataset.wmapPlotWhere="1",e.el}function ne(e,t,i,s){const a=f.createElement("input");return a.type="text",a.value=e,a.placeholder=t,a.setAttribute("aria-label",i),Object.assign(a.style,Z(),{width:"100%"}),a.addEventListener("input",()=>s(a.value)),a.addEventListener("keydown",o=>{o.key==="Escape"&&(o.stopPropagation(),a.blur())}),a}function R(e,t,i){const s=f.createElement("input");s.type="text",s.inputMode="decimal",s.value=e===void 0?"":String(e),s.placeholder="auto",s.setAttribute("aria-label",t),Object.assign(s.style,Z(),{width:"100%",fontVariantNumeric:"tabular-nums"});const a=()=>{const o=s.value.trim();if(o===""){i(void 0);return}const c=Number(o);Number.isFinite(c)?i(c):s.value=e===void 0?"":String(e)};return s.addEventListener("change",a),s.addEventListener("keydown",o=>{o.key==="Enter"&&a(),o.key==="Escape"&&(o.stopPropagation(),s.value=e===void 0?"":String(e),s.blur())}),s}function be(e,t,i,s){const a=l.axes?.[e]??{},o=w=>b(m=>{m.axes=m.axes??{};const v=m.axes[e]=m.axes[e]??{};w(v);for(const W of Object.keys(v))(v[W]===void 0||v[W]===""||W==="reverse"&&v[W]===!1)&&delete v[W];Object.keys(v).length===0&&delete m.axes[e],Object.keys(m.axes).length===0&&delete m.axes}),c=f.createElement("div");Object.assign(c.style,{display:"flex",flexDirection:"column",gap:C.md,padding:C.lg,border:`1px solid ${S.menuBorder}`,borderRadius:we.control});const n=f.createElement("div");n.textContent=t,Object.assign(n.style,{fontSize:D.body,fontWeight:"600",color:S.value}),c.appendChild(n);const r=ne(a.label??"",i??"",`${t} title`,w=>o(m=>{m.label=w.trim()===""?void 0:w}));if(r.dataset.wmapPlotAxisTitle=e,c.appendChild(h("Title",r)),s.limits===!1)return c;const u=f.createElement("div");if(Object.assign(u.style,{display:"grid",gridTemplateColumns:"1fr 1fr",gap:C.md}),u.append(h("Minimum",R(a.min,`${t} minimum`,w=>o(m=>{m.min=w}))),h("Maximum",R(a.max,`${t} maximum`,w=>o(m=>{m.max=w})))),c.appendChild(u),s.scale&&c.appendChild(h("Scale",T([["linear","Linear"],["log","Log"]],a.scale??"linear",w=>o(m=>{m.scale=w==="log"?"log":void 0}),f))),c.appendChild(Y("Reverse direction",!!a.reverse,w=>o(m=>{m.reverse=w}),f)),s.references===!1)return c;const d=ne(ze(a.references),"0.45 Target, 0.3..0.5 Window, median",`${t} reference lines`,w=>{const m=Me(w);if(!m.ok){p.textContent=m.error,d.setAttribute("aria-invalid","true");return}p.textContent="",d.removeAttribute("aria-invalid"),o(v=>{v.references=m.value.length?m.value:void 0})});d.dataset.wmapPlotRefs=e;const p=f.createElement("div");p.setAttribute("role","alert"),Object.assign(p.style,{fontSize:D.sub,color:S.errText});const g=h("Reference lines",d,"A value for a line, or lo..hi for a shaded band, each with an optional name, in the axis\u2019s own unit.");return g.appendChild(p),c.appendChild(g),c}const Ne=e=>k.querySelector(`[role="tab"][data-tab="${e}"]`);let q,B;const le=new Map;function oe(){if(!B)return;const e=je(Pe(l,x.catalogue));if(B.replaceChildren(),B.style.display=e?"flex":"none",!e)return;const t=f.createElement("span");t.textContent=e;const i=f.createElement("button");i.type="button",i.textContent="Use the automatic title",i.dataset.wmapPlotAutoTitle="1",Object.assign(i.style,K("outlined")),Q(i),i.addEventListener("click",()=>{b(s=>{delete s.title}),O()}),B.append(t,i)}function O(){k.replaceChildren(),le.clear();const e=f.createElement("div");e.setAttribute("role","tablist"),Object.assign(e.style,{display:"flex",gap:C.sm,borderBottom:`1px solid ${S.menuBorder}`});for(const[i,s,a]of[["setup","Setup","Which fields to plot and how they are combined"],["customise","Customise","Titles, axis limits, scale and direction"]]){const o=f.createElement("button");o.type="button",o.textContent=s,de(o,a),o.setAttribute("role","tab"),o.dataset.tab=i,o.setAttribute("aria-selected",String(A===i)),Object.assign(o.style,{...K("bare"),padding:`${C.sm} ${C.lg}`,fontSize:D.body,borderBottom:`2px solid ${A===i?S.iconActive:"transparent"}`,borderRadius:"0",color:A===i?S.iconActive:S.text,fontWeight:A===i?"600":"400"}),Q(o,"bare"),o.tabIndex=A===i?0:-1,o.addEventListener("click",()=>{A=i,O()}),o.addEventListener("keydown",c=>{c.key!=="ArrowLeft"&&c.key!=="ArrowRight"||(c.preventDefault(),A=i==="setup"?"customise":"setup",O(),Ne(A)?.focus())}),e.appendChild(o)}k.appendChild(e);const t=f.createElement("div");if(t.setAttribute("role","tabpanel"),Object.assign(t.style,{display:"flex",flexDirection:"column",gap:C.lg}),A==="setup"){t.appendChild(h("Chart type",T(Xe,l.chart,n=>Oe(n),f,!0)));const i=l.level==="wafer"?"wafers":"dies";switch(l.chart){case"scatter":t.appendChild(h("X axis",L("x","X axis"))),t.appendChild(h("Y axis",L("y","Y axis")));break;case"histogram":t.appendChild(h("Values",L("y","Values")));break;case"control":t.appendChild(h("Along (X axis)",L("x","Along"),"A wafer field with a number per wafer: wafer order, slot, a date.")),t.appendChild(h("Values (Y axis)",L("y","Values"),"One value per wafer: a test\u2019s wafer mean (or as Combine values by says), a yield or a pass rate.")),t.appendChild(h("Limits from the first",R(l.baseline,"Wafers the limits are set from",n=>b(r=>{n===void 0||!Number.isInteger(n)||n<3?delete r.baseline:r.baseline=n})),"Wafers, at least 3. Empty sets the limits from every wafer."));break;case"heatmap":t.appendChild(h("Columns (X axis)",L("x","Columns"),"One column per value: wafer, split, site\u2026")),t.appendChild(h("Rows",Ae(),"One row per value. With several tests as the values, Test gives a row per test.")),t.appendChild(h("Values (colour)",L("y","Values",{optional:`Count of ${i}`}),"What each cell\u2019s colour shows, combined over its dies or wafers."));break;case"goal":t.appendChild(h("Tests",L("y","Tests",{optional:"Every test with both limits"}),"Each test with both a low and a high limit is a point. Colour by a split to see it move."));break;case"probability":t.appendChild(h("Values (X axis)",L("y","Values"),"One curve per colour, each value at its share of its group: a shift is a curve moved sideways, a wider spread a flatter one, a second population a bend."));break;case"box":t.appendChild(h("Categories (X axis)",me(),"Compare by this field: one box per value, whether it is a wafer attribute (lot, split) or a die region (ring, reticle cell). Add a level to nest another inside it: the first level is the outer groups.")),t.appendChild(h("Values (Y axis)",L("y","Values")));break;case"bar":t.appendChild(h("Categories (X axis)",me(),"Compare by this field: one bar per value, whether it is a wafer attribute (lot, split) or a die region (ring, reticle cell). Add a level to nest another inside it: the first level is the outer groups.")),t.appendChild(h("Values (Y axis)",L("y","Values",{optional:`Count of ${i}`})));break;case"line":t.appendChild(h("X axis",L("x","X axis"),"A line joins the value at each X.")),t.appendChild(h("Y axis",L("y","Y axis")));break}const s=F();s&&l.chart!=="scatter"&&(t.appendChild(h("Tests",Ee(s),"Test numbers, or a range such as 1010..1030 for the tests declared between them. Put Test on the X axis or the colour to tell them apart.")),(l.chart==="bar"||l.chart==="line")&&t.appendChild(h("Read as",T([[y,"Values","Each test\u2019s measured values"],["passRate","Pass rates","Each test\u2019s share of judged dies that pass it"]],s.passRate?"passRate":y,n=>{b(r=>{const u=r.fields.y;if(!P(u))return;const d={...u};n===y?(delete d.passRate,delete d.judge):(d.passRate=!0,delete r.normalize),r.fields.y=d}),O()},f))));const a=l.fields.y;a&&(We(a)||!P(a)&&"passRate"in a)&&t.appendChild(h("Judged by",T([[y,"Test limits","A parametric test\u2019s measured value against its test limits"],["flag","Tester flag","The pass or fail the tester recorded for each die"]],a.judge??y,n=>b(r=>{const u={...r.fields.y};n===y?delete u.judge:u.judge="flag",r.fields.y=u}),f),"A functional test is judged by its recorded verdict either way.")),t.appendChild(h("Colour",Te(),"Compare by this field: each value gets its own colour. Follow Group by takes it from the Group by control.")),t.appendChild(h("Filter",Le(),"Keep only the dies that meet every condition: bin 1, the edge ring, a range of a test. A condition on a wafer field (split, yield) keeps whole wafers.")),l.chart==="line"&&t.appendChild(h("Band",T([[y,"None"],["sd","\xB11 SD","Mean \xB1 one standard deviation of the values at each X"],["ci95","95% CI","The mean\u2019s 95% confidence interval (Student\u2019s t)"],["iqr","Quartiles"],["minmax","Range"]],l.spread??y,n=>b(r=>{n===y?delete r.spread:r.spread=n}),f),"Round a line of means or medians.")),t.appendChild(h("Panels",ke(),"One panel per value of this field, on shared axes and colours: split or lot takes whole wafers, ring or site the dies in it.")),l.chart==="scatter"&&(t.appendChild(h("Fit line",T([[y,"None"],["linear","Least squares","Y on X: the usual regression line"],["orthogonal","Orthogonal","Closest to the points at right angles: for two measurements of one quantity (two testers, two insertions)"]],l.fit??y,n=>b(r=>{n===y?delete r.fit:r.fit=n}),f),"One line per colour, with its equation, R\xB2 and n above the chart.")),t.appendChild(Y("y = x line",!!l.identity,n=>b(r=>{n?r.identity=!0:delete r.identity}),f))),l.chart==="histogram"&&(t.appendChild(h("Bars as",T([[y,"Counts"],["percent","Shares","Each colour\u2019s bars as a share of its own values, so groups of different size compare"]],l.histNorm==="percent"?"percent":y,n=>b(r=>{n===y?delete r.histNorm:r.histNorm="percent"}),f))),t.appendChild(Y("Normal curve",!!l.normalCurve,n=>b(r=>{n?r.normalCurve=!0:delete r.normalCurve}),f)));const o=l.fields.y;if((l.chart==="histogram"||l.chart==="probability")&&o&&"test"in o&&!l.normalize){const n=f.createElement("div");Object.assign(n.style,{display:"grid",gridTemplateColumns:"1fr 1fr",gap:C.md});const r=u=>d=>b(p=>{const g={...p.whatIf??{}};d===void 0?delete g[u]:g[u]=d,g.lo===void 0&&g.hi===void 0?delete p.whatIf:p.whatIf=g});n.append(h("Low",R(l.whatIf?.lo,"What-if low limit",r("lo"))),h("High",R(l.whatIf?.hi,"What-if high limit",r("hi")))),t.appendChild(h("What-if limits",n,"In the test\u2019s own unit (V, A\u2026). The line under the plot gives the test\u2019s pass rate now and with these, and the dies that change."))}if(l.chart==="box"||l.chart==="bar"){t.appendChild(h("Orientation",T([[y,"Vertical","Categories along the bottom"],["horizontal","Horizontal","Categories down the left: for many categories or long names"]],l.orientation==="horizontal"?"horizontal":y,r=>b(u=>{r===y?delete u.orientation:u.orientation="horizontal"}),f)));const n=E().length<=1;n&&(t.appendChild(h("Order",T([[y,"Field order","The field\u2019s own order: wafers as loaded, numbers by value, names naturally"],["value","Largest first",l.chart==="box"?"By median, largest first":"By value, largest first (a pareto)"],["ascending","Smallest first",l.chart==="box"?"By median, smallest first":"By value, smallest first (the worst pass rate at the top)"]],l.sort??y,r=>{b(u=>{r===y?(delete u.sort,delete u.cumulative):(u.sort=r,r==="ascending"&&delete u.cumulative)}),O()},f))),t.appendChild(h("Show the first",R(l.top,"Categories shown",r=>b(u=>{r===void 0||!Number.isInteger(r)||r<1?delete u.top:u.top=r})),"Leave empty for every category; the rest are counted in a note."))),l.chart==="bar"&&(t.appendChild(h("Colours",T([[y,"Side by side"],["share","Share of colour","Side by side, each colour as its share of its own total, so groups of different sizes compare"],["stack","Stacked","One bar per category, its colours one on another"],["percent","100%","Each colour as its share of the category"]],l.stack??(l.barNorm==="percent"?"share":y),r=>b(u=>{delete u.stack,delete u.barNorm,r==="share"?u.barNorm="percent":r!==y&&(u.stack=r)}),f),"Shares and stacking add values, so they need a count or a sum.")),n&&l.sort==="value"&&t.appendChild(Y("Cumulative line (pareto)",!!l.cumulative,r=>b(u=>{r?u.cumulative=!0:delete u.cumulative}),f)),t.appendChild(Y("Values on the bars",!!l.valueLabels,r=>b(u=>{r?u.valueLabels=!0:delete u.valueLabels}),f,"Each bar\u2019s value at its end. Shown only when every value fits its bar, so none is left unlabelled.")))}const c=l.fields.y;l.chart!=="scatter"&&c&&(P(c)||"test"in c)&&t.appendChild(h("Rescale values",T(_e,l.normalize??y,n=>{b(r=>{n===y?delete r.normalize:r.normalize=n})},f),s?"Tests in different units share one axis only once they are rescaled.":void 0)),(l.chart==="bar"||l.chart==="line"||l.chart==="control"||l.chart==="heatmap"||l.level==="wafer")&&t.appendChild(h("Combine values by",Se())),t.appendChild(h("One mark per",T([[y,"Automatic"],["die","Die"],["wafer","Wafer"]],l.level??y,n=>{b(r=>{n===y?delete r.level:r.level=n}),O()},f,!0),l.level==="wafer"?"Die-level values are combined per wafer.":"Automatic uses the finest level the chosen fields allow."))}else{q=ne(l.title??"",x.autoText().title,"Plot title",n=>{b(r=>{n.trim()===""?delete r.title:Object.assign(r,{title:n})}),oe()}),q.dataset.wmapPlotTitle="1",B=f.createElement("div"),B.dataset.wmapPlotTitleDrift="1",Object.assign(B.style,{display:"none",flexDirection:"column",gap:C.sm,alignItems:"flex-start",padding:`${C.sm} ${C.md}`,background:S.warnBg,border:`1px solid ${S.warnBorder}`,borderRadius:we.control,color:S.warnText,fontSize:D.body}),t.appendChild(h("Title",q)),t.appendChild(B),oe();const i=x.autoText(),s=l.chart==="box"||l.chart==="bar",a=l.chart==="probability",o=n=>{switch(l.chart){case"scatter":case"line":return!0;case"histogram":case"probability":return n==="x";case"box":case"bar":case"control":return n==="y";default:return!1}};t.appendChild(be("x",l.chart==="histogram"||a?"Values axis":s?"Categories axis":"X axis",i.x,{scale:!s,limits:!s,references:o("x")})),t.appendChild(be("y",l.chart==="histogram"?"Count axis":a?"Cumulative share axis":s||l.chart==="line"?"Values axis":"Y axis",i.y,{scale:l.chart!=="histogram"&&!a,limits:!a,references:o("y")})),a&&t.appendChild(h("Share axis",T([["normal","Normal probability","Shares spaced by the normal quantile: a normal distribution is a straight line"],["linear","Linear","Shares spaced evenly, 0 to 100%"]],l.probabilityAxis??"normal",n=>b(r=>{n==="normal"?delete r.probabilityAxis:r.probabilityAxis="linear"}),f),"Normal probability spreads out the tails, where outliers and a second population show.")),l.chart==="histogram"&&t.appendChild(h("Bins",R(l.bins,"Number of bins",n=>b(r=>{n===void 0||!Number.isInteger(n)||n<1?delete r.bins:r.bins=Math.min(n,200)})),"Automatic is 16 equal bins."));const c=l.fields??{};(c.x&&"test"in c.x||c.y&&("test"in c.y||P(c.y)))&&t.appendChild(h("Limits",T([["both","Test + spec"],["test","Test"],["spec","Spec"],["none","None"]],l.limits??"both",n=>b(r=>{n==="both"?delete r.limits:r.limits=n}),f),"Drawn as dashed lines on the axis of a test that has them: short dashes for test limits, long for spec limits."));for(const n of t.querySelectorAll("[data-wmap-plot-axis-title]"))le.set(n.dataset.wmapPlotAxisTitle,n)}k.appendChild(t)}return O(),{el:k,setPlot(e){const t=G(e);JSON.stringify(t)!==JSON.stringify(l)&&(l=t,O())},refreshAuto(){const e=x.autoText();q&&(q.placeholder=e.title),oe();for(const[t,i]of le)i.placeholder=(t==="x"?e.x:e.y)??""}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fieldCatalogue as z,
|
|
1
|
+
import{fieldCatalogue as z,fieldValues as H,fieldExtent as I,resolvePlot as $,plotTitle as F}from"../stats/plotData.js";import{plotToSweep as J}from"../stats/plotSpec.js";import{renderPlotChart as M}from"./charts/plotChart.js";import{renderSweepPanel as Y}from"./charts/sweep.js";import{createPlotEditor as V}from"./plotEditor.js";import{createSweepEditor as q}from"./sweepEditor.js";import{CLR as b,FONT as T,SPACE as i,controlStyle as B,openReparentedModal as G,wireControlHover as L}from"./toolbar.js";export function openPlotEditor(e){const{doc:o,store:c}=e;let n=e.plot,a=!e.draft;const W=z(e.items,e.ctx),h=t=>$(t,e.items,e.ctx),p=o.createElement("div");p.dataset.wmapPlotWindow="1",Object.assign(p.style,{display:"flex",flexWrap:"wrap",gap:i.xxl,alignItems:"flex-start",width:"100%",boxSizing:"border-box",padding:i.xl});const f=o.createElement("div");if(Object.assign(f.style,{flex:"3 1 420px",minWidth:"0",display:"flex",flexDirection:"column",gap:i.md,maxHeight:"calc(min(92vh, 800px) - 110px)",overflowY:"auto"}),e.population){const t=o.createElement("div");t.textContent=`Population: ${e.population}`,t.dataset.wmapPopulation="1",Object.assign(t.style,{color:b.label,fontSize:T.body}),f.appendChild(t)}const w=n.chart==="sweep";let r;if(w){const t=Y({spec:J(n),dies:e.items.flatMap(l=>l.dies),testDefs:e.ctx.testDefs?[...e.ctx.testDefs]:void 0,population:e.rawPopulation??e.population,onSaveImage:e.chart.onSaveImage,onSelectPoint:e.onSelectLevel,ownerDocument:o});r={card:t.card,setPlot:l=>t.setSpec(J(l)),destroy:()=>t.destroy()}}else{const t=M({...e.chart,ownerDocument:o,waferLabel:l=>e.items[l]?.label??""});r={card:t.card,setPlot:l=>t.setPlot(h(l)),destroy:()=>t.destroy()}}r.card.style.alignSelf="stretch",f.appendChild(r.card);const m=o.createElement("div");Object.assign(m.style,{flex:"1 1 300px",minWidth:"260px",maxWidth:"420px",display:"flex",flexDirection:"column",gap:i.lg,maxHeight:"calc(min(92vh, 800px) - 110px)",overflowY:"auto",paddingRight:i.sm});const C=t=>{n=t,a&&c.upsert(t),y()},u=w?{...q({doc:o,plot:n,testDefs:e.ctx.testDefs,onChange:C}),refreshAuto:()=>{}}:V({doc:o,plot:n,catalogue:W,followLabel:()=>e.groupLabel??(e.items.length>1?"a colour per wafer":void 0),autoText:()=>{const t=h(n);return{title:t.autoTitle,x:t.x?.label,y:t.y?.label}},onChange:C,valuesOf:t=>H(t,e.items,e.ctx),extentOf:t=>I(t,e.items,e.ctx),testDefs:e.ctx.testDefs,attributes:e.ctx.curation});m.appendChild(u.el);const x=o.createElement("div");Object.assign(x.style,{display:"flex",flexDirection:"column",gap:i.sm,color:b.label,fontSize:T.body,position:"sticky",bottom:"0",background:b.menuBg,borderTop:`1px solid ${b.menuBorder}`,paddingTop:i.sm,paddingBottom:i.md});const P=o.createElement("div");x.appendChild(P);const s=o.createElement("button");s.type="button",s.textContent="Add to my plots",s.dataset.wmapPlotAdd="1",Object.assign(s.style,{...B("outlined"),alignSelf:"flex-start"}),L(s),s.addEventListener("click",()=>{a=!0,c.upsert(n),N()});const O=JSON.parse(JSON.stringify(e.plot)),E=(t,l,R)=>{const d=o.createElement("button");return d.type="button",d.textContent=t,d.dataset[l]="1",Object.assign(d.style,B("outlined")),L(d),d.addEventListener("click",R),d},g=E("Reset","wmapPlotReset",()=>D()),k=E("Cancel","wmapPlotCancel",()=>{D(),v?.close()}),S=o.createElement("div");Object.assign(S.style,{display:"flex",gap:i.md,flexWrap:"wrap"}),S.append(g,k,s),x.appendChild(S),m.appendChild(x);const A=()=>JSON.stringify(n)!==JSON.stringify(O);function D(){n=JSON.parse(JSON.stringify(O)),a&&c.upsert(n),u.setPlot(n),y()}function N(){P.textContent=a?`Changes are saved to \u201C${w?n.title??"Sweep":F(h(n))}\u201D.`:"This is a draft: it is not kept until you add it to your plots.",s.style.display=a?"none":"",g.disabled=!A(),g.style.opacity=g.disabled?"0.5":"1"}function y(){r.setPlot(n),u.refreshAuto(),N()}y(),p.append(f,m);const j=c.subscribe(()=>{if(!a)return;const t=c.get().find(l=>l.id===n.id);if(!t){v?.close();return}JSON.stringify(t)!==JSON.stringify(n)&&(n=t,u.setPlot(t),y())}),v=G([p],{title:e.title??(a?"Edit plot":"New plot"),anchor:e.anchor,ownerDocument:o,boxSize:{width:"min(96vw, 1180px)",height:"min(92vh, 800px)"},onClosed:()=>{j(),r.destroy(),e.onClosed?.()}});v||(j(),r.destroy())}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sweepToPlot as O}from"../stats/plotSpec.js";import{newPlotId as g}from"../stats/plotId.js";import{noticeOnce as x}from"../renderer/deprecate.js";export function copyTitle(i,m){const l=i.replace(/(?:\s*\(copy(?: \d+)?\))+$/,"")||i,r=new Set(m);let d=`${l} (copy)`;for(let f=2;r.has(d);f++)d=`${l} (copy ${f})`;return d}export function plotStoreFor(i){return createPlotStore(i?.plots,i?.onPlotsChange,void 0,{sweeps:i?.sweeps,onRemove:i?.onRemoveSweeps})}export function createPlotStore(i,m,l=400,r){const d=new Set((i??[]).map(e=>e.id)),f=(r?.sweeps??[]).filter(e=>!d.has(e.id));(r?.sweeps?.length??0)>0&&x("insights.sweeps","`insights.sweeps` is deprecated: sweeps are plots now. Pass them in `insights.plots` as sweep plots (readPlotsFile reads a sweeps file), which the
|
|
1
|
+
import{sweepToPlot as O}from"../stats/plotSpec.js";import{newPlotId as g}from"../stats/plotId.js";import{noticeOnce as x}from"../renderer/deprecate.js";export function copyTitle(i,m){const l=i.replace(/(?:\s*\(copy(?: \d+)?\))+$/,"")||i,r=new Set(m);let d=`${l} (copy)`;for(let f=2;r.has(d);f++)d=`${l} (copy ${f})`;return d}export function plotStoreFor(i){return createPlotStore(i?.plots,i?.onPlotsChange,void 0,{sweeps:i?.sweeps,onRemove:i?.onRemoveSweeps})}export function createPlotStore(i,m,l=400,r){const d=new Set((i??[]).map(e=>e.id)),f=(r?.sweeps??[]).filter(e=>!d.has(e.id));(r?.sweeps?.length??0)>0&&x("insights.sweeps","`insights.sweeps` is deprecated: sweeps are plots now. Pass them in `insights.plots` as sweep plots (readPlotsFile reads a sweeps file), which the My plots tab can also save and share.");const h=new Set((r?.sweeps??[]).map(e=>e.id));let t=[...i??[],...f.map(O)].map(e=>JSON.parse(JSON.stringify(e)));const u=new Set;let p,w=!1;const S=()=>{p!==void 0&&(clearTimeout(p),p=void 0),w&&(w=!1,m?.(t.map(e=>JSON.parse(JSON.stringify(e)))))},a=()=>{for(const e of[...u])e();w=!0,p!==void 0&&clearTimeout(p),p=setTimeout(S,l)};return{get:()=>t,upsert(e){const s=t.findIndex(n=>n.id===e.id);t=s<0?[...t,e]:t.map((n,o)=>o===s?e:n),a()},insertAt(e,s){const n=Math.max(0,Math.min(e,t.length));t=[...t.slice(0,n),s,...t.slice(n)],a()},remove(e){const s=t.findIndex(o=>o.id===e);if(s<0)return;const n=t[s];return t=t.filter((o,c)=>c!==s),a(),h.has(e)&&r?.onRemove?.([e]),{plot:n,index:s}},duplicate(e){const s=t.findIndex(c=>c.id===e);if(s<0)return;const n=t[s],o=JSON.parse(JSON.stringify(n));return o.id=g(),n.title&&Object.assign(o,{title:copyTitle(n.title,t.map(c=>c.title))}),t=[...t.slice(0,s+1),o,...t.slice(s+1)],a(),o},replaceAll(e){const s=[...h].filter(n=>t.some(o=>o.id===n)&&!e.some(o=>o.id===n));t=e.map(n=>JSON.parse(JSON.stringify(n))),a(),s.length>0&&r?.onRemove?.(s)},subscribe(e){return u.add(e),()=>{u.delete(e)}},flush:S}}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Die } from '../core/dies.js';
|
|
2
2
|
import type { TestDef } from '../renderer/buildWaferMap.js';
|
|
3
|
+
import type { BinColors } from '../renderer/binColors.js';
|
|
4
|
+
import type { WaferContextMenuHandler } from './charts/chartShell.js';
|
|
3
5
|
import type { FacetCuration } from '../stats/facets.js';
|
|
4
6
|
import type { PlotStore } from './plotStore.js';
|
|
5
7
|
import type { InsightsItem } from './insightsTab.js';
|
|
@@ -18,6 +20,10 @@ export interface PlotSectionDeps {
|
|
|
18
20
|
groupLabel?: string;
|
|
19
21
|
onSaveImage?: SaveImageHandler;
|
|
20
22
|
onSaveText?: SaveTextHandler;
|
|
23
|
+
/** The maps' bin colours: a plot coloured by bin draws each bin in its map colour. */
|
|
24
|
+
getBinColors?: () => BinColors;
|
|
25
|
+
/** Right-click a wafer's own mark: that wafer's menu, by its index in the host's list. */
|
|
26
|
+
waferMenu?: WaferContextMenuHandler;
|
|
21
27
|
/** Click a point: open its wafer, on a test's values when the plot is about one. */
|
|
22
28
|
openWafer?: (waferIndex: number, label: string, testNumber?: number) => void;
|
|
23
29
|
/** A single-wafer host's version of the same: show the test on the map that is already there. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defaultPlot as Z,defaultSweep as ee,describeTitleDrift as te,examplePlots as oe,fieldCatalogue as ne,resolvePlot as se,titleDrift as re}from"../stats/plotData.js";import{addPlots as le,newPlotId as T,readPlotsFile as ae,writePlotsFile as ie}from"../stats/plotSpec.js";import{isYieldEligibleDie as ce}from"../core/dies.js";import{testValue as pe}from"../core/dieTable.js";import{sweepAppliesTo as de}from"../stats/sweep.js";import{plotToSweep as L}from"../stats/plotSpec.js";import{renderPlotChart as fe}from"./charts/plotChart.js";import{renderSweepPanel as ue}from"./charts/sweep.js";import{makeChartGridWrap as me}from"./charts/chartShell.js";import{confirmDialog as he}from"./confirmDialog.js";import{openDrilldownMenu as O}from"./drilldown.js";import{openPlotEditor as ge}from"./plotModal.js";import{sourceFromDies as ye,sourceFromPoints as we,toPlotItems as be}from"./plotItems.js";import{CLR as g,FONT as S,RADIUS as F,SPACE as u,controlStyle as xe,markNoPrint as E,saveTextFile as Pe,wireControlHover as ve,wireTooltip as De}from"./toolbar.js";const R=1e4;export function createPlotSection(r){const{doc:i,store:l}=r,c=be(r.items.map(e=>({label:e.identity??e.label,dies:e.dies,waferIndex:e.waferIndex,wafer:e.wafer,passBins:e.passBins,ringCount:r.ringCount}))),C={testDefs:r.testDefs,groupBy:r.groupBy,curation:r.attributes},U=e=>se(e,c,C),b=ne(c,C),m=i.createElement("div");m.dataset.wmapPlotTab="1",Object.assign(m.style,{display:"flex",flexDirection:"column",gap:u.lg,width:"100%"});const x=i.createElement("div");Object.assign(x.style,{display:"flex",flexWrap:"wrap",gap:u.md,alignItems:"center"});const d=(e,t,n,o)=>{const s=i.createElement("button");return s.type="button",s.textContent=e,s.dataset[t]="1",Object.assign(s.style,{...xe("outlined"),fontSize:S.body}),ve(s),De(s,n),s.addEventListener("click",o),s},P=d("Delete all plots\u2026","wmapPlotDeleteAll","Remove every plot and sweep. You are asked first, and Undo brings them back for ten seconds",()=>{V()});x.append(d("+ New plot","wmapPlotNew","Start a chart of your own: choose its type, what goes on each axis and how it is coloured",()=>z()),d("+ New sweep","wmapPlotNewSweep","Read an ordered run of tests as a response curve, and measure where two curves cross",()=>M()),d("Add examples","wmapPlotExamples","Draw one example of each chart type this lot can show, to edit or delete",()=>Y()),d("Import plots\u2026","wmapPlotImport","Add the plots from a file written by Export plots\u2026",()=>{Q()}),d("Export plots\u2026","wmapPlotExport","Save all your plots to a file, to share or to keep a copy",()=>X()),P),E(x),m.appendChild(x);const p=i.createElement("div");p.setAttribute("role","status"),Object.assign(p.style,{display:"none",flexWrap:"wrap",gap:u.md,alignItems:"center",padding:`${u.sm} ${u.md}`,background:g.menuBg,border:`1px solid ${g.menuBorder}`,borderRadius:F.container,color:g.text,fontSize:S.body}),E(p),m.appendChild(p);let h;function y(e,t,n=[]){h!==void 0&&clearTimeout(h),p.replaceChildren();const o=i.createElement("span");if(o.textContent=e,p.appendChild(o),t){const s=d(t.label,"wmapPlotNoticeAction",t.label==="Undo"?"Put back what was just removed":t.label,()=>{t.run(),I()});p.appendChild(s)}for(const s of n){const a=i.createElement("div");a.textContent=s,Object.assign(a.style,{flexBasis:"100%",color:g.label}),p.appendChild(a)}p.style.display="flex",h=setTimeout(I,t?R:R*2)}function I(){h!==void 0&&(clearTimeout(h),h=void 0),p.style.display="none",p.replaceChildren()}const v=i.createElement("div");v.textContent="No plots yet. A plot is any measured value against another, or a distribution, that you choose: New plot starts one, and it is kept for the next lot. Add examples draws one of each chart type from this lot to start from.",Object.assign(v.style,{color:g.label,fontSize:S.body,padding:`${u.lg} 0`});const D=me(i);m.append(v,D);const w=new Map,A=()=>({onSaveImage:r.onSaveImage,onOpenWafer:r.openWafer?(e,t)=>r.openWafer(c[e].waferIndex??e,c[e].label,t):r.focusTest&&c.length===1?(e,t)=>{t!==void 0&&r.focusTest(t)}:void 0,openActionLabel:!r.openWafer&&r.focusTest&&c.length===1?"show this test on the map":void 0,onSelectPoints:(e,t,n)=>W(e,t,n)}),$=()=>({plots:l,onSaveImage:r.onSaveImage,onSaveText:r.onSaveText,onLocateDie:r.locateDie});function W(e,t,n){const o=we(e,c,r.testDefs);o&&O(t,n,o,$())}function k(e,t=!1){ge({doc:i,anchor:m,store:l,plot:e,draft:t,items:c,ctx:C,groupLabel:r.groupLabel,chart:A(),onSelectLevel:j})}function M(){const e=ee(r.testDefs,T());l.upsert(e),k(e)}function j(e,t){const n=s=>e.testNumbers.some(a=>{const f=pe(s,a);return f!==void 0&&Number.isFinite(f)}),o=ye(c,`measured at ${e.label}`,s=>ce(s)&&n(s),r.testDefs,e.testNumbers[0]);o&&O({x:t.clientX,y:t.clientY},t.target,o,$())}function z(){const e=Z(b,T());l.upsert(e),k(e)}function Y(){const e=o=>JSON.stringify([o.chart,o.fields,o.aggregate??null,o.sweep??null]),t=new Set(l.get().map(e)),n=oe(b,c.length,T).filter(o=>!t.has(e(o)));if(n.length===0){y(b.some(o=>o.group==="Tests")?"The examples for this lot are already in your plots.":"There are no measured values in this lot to draw examples from.");return}for(const o of n)l.upsert(o);y(`Added ${n.length} example plot${n.length===1?"":"s"}: ${n.map(o=>o.chart).join(", ")}. Edit one to make it yours, or Delete what you do not need.`)}function N(e,t){const n=(o,s,a,f)=>e.appendChild(d(o,s,a,f));n("Edit","wmapPlotEdit","Change this plot\u2019s type, fields, titles, limits and axes",()=>{const o=l.get().find(s=>s.id===t.id);o&&k(o)}),n("Duplicate","wmapPlotDuplicate","Make a copy of this plot to vary",()=>{l.duplicate(t.id)}),n("Delete","wmapPlotDelete","Remove this plot. Undo brings it back for ten seconds",()=>{const o=l.remove(t.id);o&&y(`Deleted \u201C${o.plot.title??"plot"}\u201D.`,{label:"Undo",run:()=>l.insertAt(o.index,o.plot)})})}function _(e){return e.chart==="sweep"?J(e):H(e)}function H(e){const t=fe({ownerDocument:i,waferLabel:s=>c[s]?.label??"",...A()});t.card.dataset.wmapPlotId=e.id,E(t.actions),N(t.actions,e);const n=i.createElement("div");n.dataset.wmapPlotTitleDrift="1",Object.assign(n.style,{display:"none",flexWrap:"wrap",gap:u.md,alignItems:"center",flexBasis:"100%",padding:`${u.xs} ${u.md}`,background:g.warnBg,border:`1px solid ${g.warnBorder}`,borderRadius:F.control,color:g.warnText,fontSize:S.body}),t.actions.appendChild(n);const o={card:t.card,actions:t.actions,json:"",driftNote:n,destroy:()=>t.destroy(),update:s=>{const a=U(s);t.setPlot(a),t.card.style.opacity=a.issues.length?"0.7":"1",G(n,s)}};return w.set(e.id,o),o}function J(e){const t=L(e),n=c.flatMap(a=>a.dies),o=ue({spec:t,dies:n,testDefs:r.testDefs,onSaveImage:r.onSaveImage,ownerDocument:i,onSelectPoint:j});o.card.dataset.wmapPlotId=e.id,o.card.dataset.wmapSweepPlot="1",E(o.actions),N(o.actions,e);const s={card:o.card,actions:o.actions,json:"",destroy:()=>o.destroy(),update:a=>{const f=L(a);o.setSpec(f),o.card.style.opacity=de(f,r.testDefs)?"1":"0.7"}};return w.set(e.id,s),s}function G(e,t){const n=te(re(t,b));if(e.replaceChildren(),e.style.display=n?"flex":"none",!n)return;const o=i.createElement("span");o.textContent=n,e.append(o,d("Use the automatic title","wmapPlotAutoTitle","Replace the title you typed with the one written from the plot\u2019s settings",()=>{const s=l.get().find(f=>f.id===t.id);if(!s)return;const a={...s};delete a.title,l.upsert(a)}))}function B(){const e=l.get();for(const[t,n]of w)e.some(o=>o.id===t)||(n.destroy(),n.card.remove(),w.delete(t));e.forEach((t,n)=>{const o=w.get(t.id)??_(t),s=JSON.stringify(t);o.json!==s&&(o.json=s,o.update(t)),D.children[n]!==o.card&&D.insertBefore(o.card,D.children[n]??null)}),v.style.display=e.length===0?"":"none",P.disabled=e.length===0,P.style.opacity=e.length===0?"0.5":"1",P.style.cursor=e.length===0?"default":"pointer"}const K=l.subscribe(B);B();async function V(){const e=l.get().slice();if(e.length===0)return;const t=e.length;if(!await he({doc:i,anchor:m,title:"Delete all plots",message:t===1?"Delete your 1 saved plot? It is kept on this computer for the next lot, so it will not be there for the next file either. Export plots\u2026 first to keep a copy.":`Delete all ${t} saved plots, sweeps included? They are kept on this computer for the next lot, so they will not be there for the next file either. Export plots\u2026 first to keep a copy.`,confirmLabel:t===1?"Delete 1 plot":`Delete ${t} plots`}))return;const o=l.get().slice();o.length!==0&&(l.replaceAll([]),y(`Deleted ${o.length===1?"1 plot":`all ${o.length} plots`}.`,{label:"Undo",run:()=>l.replaceAll(o)}))}function X(){const e=l.get();if(e.length===0){y("There are no plots to export yet.");return}Pe(ie(e),"wafermap-plots.json","application/json",r.onSaveText)}async function q(){return r.pickPlotsFile?r.pickPlotsFile():new Promise(e=>{const t=i.createElement("input");t.type="file",t.accept=".json,application/json",t.addEventListener("change",()=>{const n=t.files?.[0];if(!n){e(null);return}n.text().then(e,()=>e(null))}),t.addEventListener("cancel",()=>e(null)),t.click()})}async function Q(){const e=await q();if(e===null)return;const t=ae(e);if(t.error){y(`Could not import: ${t.error}`);return}const{plots:n,copies:o}=le(l.get(),t.plots);l.replaceAll(n);const s=[...t.warnings,...o.length?[`Kept as copies, since a plot with the same id already existed: ${o.join(", ")}`]:[]];y(`Imported ${t.plots.length} plot${t.plots.length===1?"":"s"}.`,void 0,s)}return{card:m,destroy:()=>{K(),h!==void 0&&clearTimeout(h);for(const e of w.values())e.destroy();w.clear(),l.flush()}}}
|
|
1
|
+
import{defaultPlot as te,defaultSweep as oe,describeTitleDrift as ne,examplePlots as se,fieldCatalogue as re,resolvePlot as le,titleDrift as ae}from"../stats/plotData.js";import{addPlots as ie,newPlotId as T,readPlotsFile as ce,writePlotsFile as pe}from"../stats/plotSpec.js";import{buildFilterStrip as de}from"./filterEditor.js";import{isYieldEligibleDie as fe}from"../core/dies.js";import{testValue as ue}from"../core/dieTable.js";import{sweepAppliesTo as me}from"../stats/sweep.js";import{plotToSweep as F}from"../stats/plotSpec.js";import{renderPlotChart as he}from"./charts/plotChart.js";import{renderSweepPanel as ge}from"./charts/sweep.js";import{makeChartGridWrap as we}from"./charts/chartShell.js";import{confirmDialog as ye}from"./confirmDialog.js";import{openDrilldownMenu as L}from"./drilldown.js";import{openPlotEditor as be}from"./plotModal.js";import{sourceFromDies as xe,sourceFromPoints as ve,toPlotItems as Pe}from"./plotItems.js";import{CLR as g,FONT as C,RADIUS as O,SPACE as u,controlStyle as De,markNoPrint as E,saveTextFile as Se,wireControlHover as Ce,wireTooltip as Ee}from"./toolbar.js";const W=1e4;export function createPlotSection(r){const{doc:i,store:l}=r,p=Pe(r.items.map(e=>({label:e.identity??e.label,dies:e.dies,waferIndex:e.waferIndex,wafer:e.wafer,passBins:e.passBins,ringCount:r.ringCount}))),b={testDefs:r.testDefs,groupBy:r.groupBy,curation:r.attributes},M=e=>le(e,p,b),x=re(p,b),m=i.createElement("div");m.dataset.wmapPlotTab="1",Object.assign(m.style,{display:"flex",flexDirection:"column",gap:u.lg,width:"100%"});const v=i.createElement("div");Object.assign(v.style,{display:"flex",flexWrap:"wrap",gap:u.md,alignItems:"center"});const f=(e,t,n,o)=>{const s=i.createElement("button");return s.type="button",s.textContent=e,s.dataset[t]="1",Object.assign(s.style,{...De("outlined"),fontSize:C.body}),Ce(s),Ee(s,n),s.addEventListener("click",o),s},P=f("Delete all plots\u2026","wmapPlotDeleteAll","Remove every plot and sweep. You are asked first, and Undo brings them back for ten seconds",()=>{X()});v.append(f("+ New plot","wmapPlotNew","Start a chart of your own: choose its type, what goes on each axis and how it is coloured",()=>z()),f("+ New sweep","wmapPlotNewSweep","Read an ordered run of tests as a response curve, and measure where two curves cross",()=>U()),f("Add examples","wmapPlotExamples","Draw one example of each chart type this lot can show, to edit or delete",()=>Y()),f("Import plots\u2026","wmapPlotImport","Add the plots from a file written by Export plots\u2026",()=>{Z()}),f("Export plots\u2026","wmapPlotExport","Save all your plots to a file, to share or to keep a copy",()=>q()),P),E(v),m.appendChild(v);const d=i.createElement("div");d.setAttribute("role","status"),Object.assign(d.style,{display:"none",flexWrap:"wrap",gap:u.md,alignItems:"center",padding:`${u.sm} ${u.md}`,background:g.menuBg,border:`1px solid ${g.menuBorder}`,borderRadius:O.container,color:g.text,fontSize:C.body}),E(d),m.appendChild(d);let h;function w(e,t,n=[]){h!==void 0&&clearTimeout(h),d.replaceChildren();const o=i.createElement("span");if(o.textContent=e,d.appendChild(o),t){const s=f(t.label,"wmapPlotNoticeAction",t.label==="Undo"?"Put back what was just removed":t.label,()=>{t.run(),I()});d.appendChild(s)}for(const s of n){const a=i.createElement("div");a.textContent=s,Object.assign(a.style,{flexBasis:"100%",color:g.label}),d.appendChild(a)}d.style.display="flex",h=setTimeout(I,t?W:W*2)}function I(){h!==void 0&&(clearTimeout(h),h=void 0),d.style.display="none",d.replaceChildren()}const D=i.createElement("div");D.textContent="No plots yet. A plot is any measured value against another, or a distribution, that you choose: New plot starts one, and it is kept for the next lot. Add examples draws one of each chart type from this lot to start from.",Object.assign(D.style,{color:g.label,fontSize:C.body,padding:`${u.lg} 0`});const S=we(i);m.append(D,S);const y=new Map,A=()=>({onSaveImage:r.onSaveImage,binColors:r.getBinColors?.(),onWaferMenu:r.waferMenu?(e,t,n)=>r.waferMenu(p[e].waferIndex??e,t,n):void 0,onOpenWafer:r.openWafer?(e,t)=>r.openWafer(p[e].waferIndex??e,p[e].label,t):r.focusTest&&p.length===1?(e,t)=>{t!==void 0&&r.focusTest(t)}:void 0,openActionLabel:!r.openWafer&&r.focusTest&&p.length===1?"show this test on the map":void 0,onSelectPoints:(e,t,n)=>R(e,t,n)}),$=()=>({plots:l,getBinColors:r.getBinColors,onSaveImage:r.onSaveImage,onSaveText:r.onSaveText,onLocateDie:r.locateDie});function R(e,t,n){const o=ve(e,p,r.testDefs);o&&L(t,n,o,$())}function k(e,t=!1){be({doc:i,anchor:m,store:l,plot:e,draft:t,items:p,ctx:b,groupLabel:r.groupLabel,chart:A(),onSelectLevel:j})}function U(){const e=oe(r.testDefs,T());l.upsert(e),k(e)}function j(e,t){const n=s=>e.testNumbers.some(a=>{const c=ue(s,a);return c!==void 0&&Number.isFinite(c)}),o=xe(p,`measured at ${e.label}`,s=>fe(s)&&n(s),r.testDefs,e.testNumbers[0]);o&&L({x:t.clientX,y:t.clientY},t.target,o,$())}function z(){const e=te(x,T());l.upsert(e),k(e)}function Y(){const e=o=>JSON.stringify([o.chart,o.fields,o.aggregate??null,o.sweep??null,o.fit??null,o.normalCurve??null,o.spread??null,o.normalize??null,o.sort??null,o.cumulative??null,o.stack??null]),t=new Set(l.get().map(e)),n=se(x,p.length,T,{items:p,ctx:b}).filter(o=>!t.has(e(o)));if(n.length===0){w(x.some(o=>o.group==="Tests")?"The examples for this lot are already in your plots.":"There are no measured values in this lot to draw examples from.");return}for(const o of n)l.upsert(o);w(`Added ${n.length} example plot${n.length===1?"":"s"}: ${[...new Set(n.map(o=>o.chart))].join(", ")}. Edit one to make it yours, or Delete what you do not need.`)}function B(e,t){const n=(o,s,a,c)=>e.appendChild(f(o,s,a,c));n("Edit","wmapPlotEdit","Change this plot\u2019s type, fields, titles, limits and axes",()=>{const o=l.get().find(s=>s.id===t.id);o&&k(o)}),n("Duplicate","wmapPlotDuplicate","Make a copy of this plot to vary",()=>{l.duplicate(t.id)}),n("Delete","wmapPlotDelete","Remove this plot. Undo brings it back for ten seconds",()=>{const o=l.remove(t.id);o&&w(`Deleted \u201C${o.plot.title??"plot"}\u201D.`,{label:"Undo",run:()=>l.insertAt(o.index,o.plot)})})}function _(e){return e.chart==="sweep"?J(e):H(e)}function H(e){const t=he({ownerDocument:i,waferLabel:a=>p[a]?.label??"",...A()});t.card.dataset.wmapPlotId=e.id,E(t.actions),B(t.actions,e);const n=i.createElement("div");n.dataset.wmapPlotTitleDrift="1",Object.assign(n.style,{display:"none",flexWrap:"wrap",gap:u.md,alignItems:"center",flexBasis:"100%",padding:`${u.xs} ${u.md}`,background:g.warnBg,border:`1px solid ${g.warnBorder}`,borderRadius:O.control,color:g.warnText,fontSize:C.body});const o=i.createElement("div");o.style.flexBasis="100%",t.actions.append(o,n);const s={card:t.card,actions:t.actions,json:"",driftNote:n,destroy:()=>t.destroy(),update:a=>{const c=M(a);t.setPlot(c),G(o,a),t.card.style.opacity=c.issues.length?"0.7":"1",K(n,a)}};return y.set(e.id,s),s}function J(e){const t=F(e),n=p.flatMap(a=>a.dies),o=ge({spec:t,dies:n,testDefs:r.testDefs,onSaveImage:r.onSaveImage,ownerDocument:i,onSelectPoint:j});o.card.dataset.wmapPlotId=e.id,o.card.dataset.wmapSweepPlot="1",E(o.actions),B(o.actions,e);const s={card:o.card,actions:o.actions,json:"",destroy:()=>o.destroy(),update:a=>{const c=F(a);o.setSpec(c),o.card.style.opacity=me(c,r.testDefs)?"1":"0.7"}};return y.set(e.id,s),s}function G(e,t){const n=t.where;e.replaceChildren(),n&&e.appendChild(de({doc:i,filter:n,testDefs:r.testDefs,attributes:r.attributes,label:"Filter",onToggle:o=>{const s=l.get().find(ee=>ee.id===t.id),a=s?.where;if(!s||!a)return;const c={...a};o?delete c.off:c.off=!0,l.upsert({...s,where:c})}}))}function K(e,t){const n=ne(ae(t,x));if(e.replaceChildren(),e.style.display=n?"flex":"none",!n)return;const o=i.createElement("span");o.textContent=n,e.append(o,f("Use the automatic title","wmapPlotAutoTitle","Replace the title you typed with the one written from the plot\u2019s settings",()=>{const s=l.get().find(c=>c.id===t.id);if(!s)return;const a={...s};delete a.title,l.upsert(a)}))}function N(){const e=l.get();for(const[t,n]of y)e.some(o=>o.id===t)||(n.destroy(),n.card.remove(),y.delete(t));e.forEach((t,n)=>{const o=y.get(t.id)??_(t),s=JSON.stringify(t);o.json!==s&&(o.json=s,o.update(t)),S.children[n]!==o.card&&S.insertBefore(o.card,S.children[n]??null)}),D.style.display=e.length===0?"":"none",P.disabled=e.length===0,P.style.opacity=e.length===0?"0.5":"1",P.style.cursor=e.length===0?"default":"pointer"}const V=l.subscribe(N);N();async function X(){const e=l.get().slice();if(e.length===0)return;const t=e.length;if(!await ye({doc:i,anchor:m,title:"Delete all plots",message:t===1?"Delete your 1 saved plot? It is kept on this computer for the next lot, so it will not be there for the next file either. Export plots\u2026 first to keep a copy.":`Delete all ${t} saved plots, sweeps included? They are kept on this computer for the next lot, so they will not be there for the next file either. Export plots\u2026 first to keep a copy.`,confirmLabel:t===1?"Delete 1 plot":`Delete ${t} plots`}))return;const o=l.get().slice();o.length!==0&&(l.replaceAll([]),w(`Deleted ${o.length===1?"1 plot":`all ${o.length} plots`}.`,{label:"Undo",run:()=>l.replaceAll(o)}))}function q(){const e=l.get();if(e.length===0){w("There are no plots to export yet.");return}Se(pe(e),"wafermap-plots.json","application/json",r.onSaveText)}async function Q(){return r.pickPlotsFile?r.pickPlotsFile():new Promise(e=>{const t=i.createElement("input");t.type="file",t.accept=".json,application/json",t.addEventListener("change",()=>{const n=t.files?.[0];if(!n){e(null);return}n.text().then(e,()=>e(null))}),t.addEventListener("cancel",()=>e(null)),t.click()})}async function Z(){const e=await Q();if(e===null)return;const t=ce(e);if(t.error){w(`Could not import: ${t.error}`);return}const{plots:n,copies:o}=ie(l.get(),t.plots);l.replaceAll(n);const s=[...t.warnings,...o.length?[`Kept as copies, since a plot with the same id already existed: ${o.join(", ")}`]:[]];w(`Imported ${t.plots.length} plot${t.plots.length===1?"":"s"}.`,void 0,s)}return{card:m,destroy:()=>{V(),h!==void 0&&clearTimeout(h);for(const e of y.values())e.destroy();y.clear(),l.flush()}}}
|