@ni/spright-components 1.0.7 → 1.0.9
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.
|
@@ -7829,7 +7829,7 @@
|
|
|
7829
7829
|
*
|
|
7830
7830
|
* @public
|
|
7831
7831
|
*/
|
|
7832
|
-
|
|
7832
|
+
class Listbox extends FoundationElement {
|
|
7833
7833
|
constructor() {
|
|
7834
7834
|
super(...arguments);
|
|
7835
7835
|
/**
|
|
@@ -8292,35 +8292,35 @@
|
|
|
8292
8292
|
this.typeaheadExpired = false;
|
|
8293
8293
|
}
|
|
8294
8294
|
}
|
|
8295
|
-
}
|
|
8295
|
+
}
|
|
8296
8296
|
/**
|
|
8297
8297
|
* A static filter to include only selectable options.
|
|
8298
8298
|
*
|
|
8299
8299
|
* @param n - element to filter
|
|
8300
8300
|
* @public
|
|
8301
8301
|
*/
|
|
8302
|
-
Listbox
|
|
8302
|
+
Listbox.slottedOptionFilter = (n) => isListboxOption(n) && !n.hidden;
|
|
8303
8303
|
/**
|
|
8304
8304
|
* Typeahead timeout in milliseconds.
|
|
8305
8305
|
*
|
|
8306
8306
|
* @internal
|
|
8307
8307
|
*/
|
|
8308
|
-
Listbox
|
|
8308
|
+
Listbox.TYPE_AHEAD_TIMEOUT_MS = 1000;
|
|
8309
8309
|
__decorate([
|
|
8310
8310
|
attr({ mode: "boolean" })
|
|
8311
|
-
], Listbox
|
|
8311
|
+
], Listbox.prototype, "disabled", void 0);
|
|
8312
8312
|
__decorate([
|
|
8313
8313
|
observable
|
|
8314
|
-
], Listbox
|
|
8314
|
+
], Listbox.prototype, "selectedIndex", void 0);
|
|
8315
8315
|
__decorate([
|
|
8316
8316
|
observable
|
|
8317
|
-
], Listbox
|
|
8317
|
+
], Listbox.prototype, "selectedOptions", void 0);
|
|
8318
8318
|
__decorate([
|
|
8319
8319
|
observable
|
|
8320
|
-
], Listbox
|
|
8320
|
+
], Listbox.prototype, "slottedOptions", void 0);
|
|
8321
8321
|
__decorate([
|
|
8322
8322
|
observable
|
|
8323
|
-
], Listbox
|
|
8323
|
+
], Listbox.prototype, "typeaheadBuffer", void 0);
|
|
8324
8324
|
/**
|
|
8325
8325
|
* Includes ARIA states and properties relating to the ARIA listbox role
|
|
8326
8326
|
*
|
|
@@ -8341,7 +8341,7 @@
|
|
|
8341
8341
|
observable
|
|
8342
8342
|
], DelegatesARIAListbox.prototype, "ariaMultiSelectable", void 0);
|
|
8343
8343
|
applyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties);
|
|
8344
|
-
applyMixins(Listbox
|
|
8344
|
+
applyMixins(Listbox, DelegatesARIAListbox);
|
|
8345
8345
|
|
|
8346
8346
|
/**
|
|
8347
8347
|
* Positioning directions for the listbox when a select is open.
|
|
@@ -8352,7 +8352,7 @@
|
|
|
8352
8352
|
below: "below",
|
|
8353
8353
|
};
|
|
8354
8354
|
|
|
8355
|
-
class _Combobox extends Listbox
|
|
8355
|
+
class _Combobox extends Listbox {
|
|
8356
8356
|
}
|
|
8357
8357
|
/**
|
|
8358
8358
|
* A form-associated base class for the {@link (Combobox:class)} component.
|
|
@@ -10261,7 +10261,7 @@
|
|
|
10261
10261
|
*
|
|
10262
10262
|
* @public
|
|
10263
10263
|
*/
|
|
10264
|
-
class ListboxElement extends Listbox
|
|
10264
|
+
class ListboxElement extends Listbox {
|
|
10265
10265
|
constructor() {
|
|
10266
10266
|
super(...arguments);
|
|
10267
10267
|
/**
|
|
@@ -10700,32 +10700,6 @@
|
|
|
10700
10700
|
attr({ converter: nullableNumberConverter })
|
|
10701
10701
|
], ListboxElement.prototype, "size", void 0);
|
|
10702
10702
|
|
|
10703
|
-
/**
|
|
10704
|
-
* The template for the {@link @microsoft/fast-foundation#(Listbox:class)} component.
|
|
10705
|
-
* @public
|
|
10706
|
-
*/
|
|
10707
|
-
const listboxTemplate = (context, definition) => html `
|
|
10708
|
-
<template
|
|
10709
|
-
aria-activedescendant="${x => x.ariaActiveDescendant}"
|
|
10710
|
-
aria-multiselectable="${x => x.ariaMultiSelectable}"
|
|
10711
|
-
class="listbox"
|
|
10712
|
-
role="listbox"
|
|
10713
|
-
tabindex="${x => (!x.disabled ? "0" : null)}"
|
|
10714
|
-
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
10715
|
-
@focusin="${(x, c) => x.focusinHandler(c.event)}"
|
|
10716
|
-
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
10717
|
-
@mousedown="${(x, c) => x.mousedownHandler(c.event)}"
|
|
10718
|
-
>
|
|
10719
|
-
<slot
|
|
10720
|
-
${slotted({
|
|
10721
|
-
filter: ListboxElement.slottedOptionFilter,
|
|
10722
|
-
flatten: true,
|
|
10723
|
-
property: "slottedOptions",
|
|
10724
|
-
})}
|
|
10725
|
-
></slot>
|
|
10726
|
-
</template>
|
|
10727
|
-
`;
|
|
10728
|
-
|
|
10729
10703
|
/**
|
|
10730
10704
|
* Menu items roles.
|
|
10731
10705
|
* @public
|
|
@@ -12906,7 +12880,7 @@
|
|
|
12906
12880
|
*/
|
|
12907
12881
|
setDefaultSelectedOption() {
|
|
12908
12882
|
var _a;
|
|
12909
|
-
const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox
|
|
12883
|
+
const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter);
|
|
12910
12884
|
const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex(el => el.hasAttribute("selected") || el.selected || el.value === this.value);
|
|
12911
12885
|
if (selectedIndex !== -1) {
|
|
12912
12886
|
this.selectedIndex = selectedIndex;
|
|
@@ -16304,7 +16278,7 @@
|
|
|
16304
16278
|
|
|
16305
16279
|
/**
|
|
16306
16280
|
* Do not edit directly
|
|
16307
|
-
* Generated on
|
|
16281
|
+
* Generated on Mon, 03 Jun 2024 22:13:03 GMT
|
|
16308
16282
|
*/
|
|
16309
16283
|
|
|
16310
16284
|
const Information100DarkUi = "#a46eff";
|
|
@@ -16737,7 +16711,7 @@
|
|
|
16737
16711
|
|
|
16738
16712
|
const template$I = html `<slot></slot>`;
|
|
16739
16713
|
|
|
16740
|
-
const styles
|
|
16714
|
+
const styles$$ = css `
|
|
16741
16715
|
${display$1('contents')}
|
|
16742
16716
|
`;
|
|
16743
16717
|
|
|
@@ -16852,7 +16826,7 @@
|
|
|
16852
16826
|
], ThemeProvider.prototype, "theme", void 0);
|
|
16853
16827
|
const nimbleDesignSystemProvider = ThemeProvider.compose({
|
|
16854
16828
|
baseName: 'theme-provider',
|
|
16855
|
-
styles: styles
|
|
16829
|
+
styles: styles$$,
|
|
16856
16830
|
template: template$I
|
|
16857
16831
|
});
|
|
16858
16832
|
DesignSystem.getOrCreate()
|
|
@@ -17038,7 +17012,7 @@
|
|
|
17038
17012
|
}
|
|
17039
17013
|
}
|
|
17040
17014
|
|
|
17041
|
-
const styles
|
|
17015
|
+
const styles$_ = css `
|
|
17042
17016
|
@layer base, hover, focusVisible, active, disabled;
|
|
17043
17017
|
|
|
17044
17018
|
@layer base {
|
|
@@ -17222,7 +17196,7 @@
|
|
|
17222
17196
|
baseName: 'anchor',
|
|
17223
17197
|
baseClass: Anchor$1,
|
|
17224
17198
|
template: template$H,
|
|
17225
|
-
styles: styles
|
|
17199
|
+
styles: styles$_,
|
|
17226
17200
|
shadowOptions: {
|
|
17227
17201
|
delegatesFocus: true
|
|
17228
17202
|
}
|
|
@@ -17334,7 +17308,7 @@
|
|
|
17334
17308
|
padding: 0;
|
|
17335
17309
|
`;
|
|
17336
17310
|
|
|
17337
|
-
const styles$
|
|
17311
|
+
const styles$Z = css `
|
|
17338
17312
|
@layer base, checked, hover, focusVisible, active, disabled, top;
|
|
17339
17313
|
|
|
17340
17314
|
@layer base {
|
|
@@ -17612,8 +17586,8 @@
|
|
|
17612
17586
|
}
|
|
17613
17587
|
`));
|
|
17614
17588
|
|
|
17615
|
-
const styles$
|
|
17616
|
-
${styles$
|
|
17589
|
+
const styles$Y = css `
|
|
17590
|
+
${styles$Z}
|
|
17617
17591
|
${buttonAppearanceVariantStyles}
|
|
17618
17592
|
|
|
17619
17593
|
.control {
|
|
@@ -17716,7 +17690,7 @@
|
|
|
17716
17690
|
const nimbleAnchorButton = AnchorButton.compose({
|
|
17717
17691
|
baseName: 'anchor-button',
|
|
17718
17692
|
template: template$G,
|
|
17719
|
-
styles: styles$
|
|
17693
|
+
styles: styles$Y,
|
|
17720
17694
|
shadowOptions: {
|
|
17721
17695
|
delegatesFocus: true
|
|
17722
17696
|
}
|
|
@@ -17724,7 +17698,7 @@
|
|
|
17724
17698
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorButton());
|
|
17725
17699
|
const anchorButtonTag = 'nimble-anchor-button';
|
|
17726
17700
|
|
|
17727
|
-
const styles$
|
|
17701
|
+
const styles$X = css `
|
|
17728
17702
|
${display$1('grid')}
|
|
17729
17703
|
|
|
17730
17704
|
:host {
|
|
@@ -17910,7 +17884,7 @@
|
|
|
17910
17884
|
const nimbleAnchorMenuItem = AnchorMenuItem.compose({
|
|
17911
17885
|
baseName: 'anchor-menu-item',
|
|
17912
17886
|
template: template$F,
|
|
17913
|
-
styles: styles$
|
|
17887
|
+
styles: styles$X,
|
|
17914
17888
|
shadowOptions: {
|
|
17915
17889
|
delegatesFocus: true
|
|
17916
17890
|
}
|
|
@@ -17920,7 +17894,7 @@
|
|
|
17920
17894
|
.register(nimbleAnchorMenuItem());
|
|
17921
17895
|
const anchorMenuItemTag = 'nimble-anchor-menu-item';
|
|
17922
17896
|
|
|
17923
|
-
const styles$
|
|
17897
|
+
const styles$W = css `
|
|
17924
17898
|
${display$1('inline-flex')}
|
|
17925
17899
|
|
|
17926
17900
|
:host {
|
|
@@ -18090,14 +18064,14 @@
|
|
|
18090
18064
|
const nimbleAnchorTab = AnchorTab.compose({
|
|
18091
18065
|
baseName: 'anchor-tab',
|
|
18092
18066
|
template: template$E,
|
|
18093
|
-
styles: styles$
|
|
18067
|
+
styles: styles$W,
|
|
18094
18068
|
shadowOptions: {
|
|
18095
18069
|
delegatesFocus: true
|
|
18096
18070
|
}
|
|
18097
18071
|
});
|
|
18098
18072
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleAnchorTab());
|
|
18099
18073
|
|
|
18100
|
-
const styles$
|
|
18074
|
+
const styles$V = css `
|
|
18101
18075
|
${display$1('grid')}
|
|
18102
18076
|
|
|
18103
18077
|
:host {
|
|
@@ -18326,7 +18300,7 @@
|
|
|
18326
18300
|
const nimbleAnchorTabs = AnchorTabs.compose({
|
|
18327
18301
|
baseName: 'anchor-tabs',
|
|
18328
18302
|
template: template$D,
|
|
18329
|
-
styles: styles$
|
|
18303
|
+
styles: styles$V,
|
|
18330
18304
|
shadowOptions: {
|
|
18331
18305
|
delegatesFocus: false
|
|
18332
18306
|
}
|
|
@@ -18342,7 +18316,7 @@
|
|
|
18342
18316
|
-webkit-user-select: none;
|
|
18343
18317
|
`;
|
|
18344
18318
|
|
|
18345
|
-
const styles$
|
|
18319
|
+
const styles$U = css `
|
|
18346
18320
|
${display$1('block')}
|
|
18347
18321
|
|
|
18348
18322
|
:host {
|
|
@@ -18586,7 +18560,7 @@
|
|
|
18586
18560
|
const nimbleAnchorTreeItem = AnchorTreeItem.compose({
|
|
18587
18561
|
baseName: 'anchor-tree-item',
|
|
18588
18562
|
template: template$C,
|
|
18589
|
-
styles: styles$
|
|
18563
|
+
styles: styles$U,
|
|
18590
18564
|
shadowOptions: {
|
|
18591
18565
|
delegatesFocus: true
|
|
18592
18566
|
}
|
|
@@ -18602,7 +18576,7 @@
|
|
|
18602
18576
|
zIndex1000: '1000'
|
|
18603
18577
|
};
|
|
18604
18578
|
|
|
18605
|
-
const styles$
|
|
18579
|
+
const styles$T = css `
|
|
18606
18580
|
${display$1('block')}
|
|
18607
18581
|
|
|
18608
18582
|
:host {
|
|
@@ -18633,7 +18607,7 @@
|
|
|
18633
18607
|
baseName: 'anchored-region',
|
|
18634
18608
|
baseClass: AnchoredRegion$1,
|
|
18635
18609
|
template: anchoredRegionTemplate,
|
|
18636
|
-
styles: styles$
|
|
18610
|
+
styles: styles$T
|
|
18637
18611
|
});
|
|
18638
18612
|
DesignSystem.getOrCreate()
|
|
18639
18613
|
.withPrefix('nimble')
|
|
@@ -18713,7 +18687,7 @@
|
|
|
18713
18687
|
*/
|
|
18714
18688
|
const themeBehavior = (theme, styles) => new ThemeStyleSheetBehavior(theme, styles);
|
|
18715
18689
|
|
|
18716
|
-
const styles$
|
|
18690
|
+
const styles$S = css `
|
|
18717
18691
|
${display$1('flex')}
|
|
18718
18692
|
|
|
18719
18693
|
:host {
|
|
@@ -18828,8 +18802,8 @@
|
|
|
18828
18802
|
}
|
|
18829
18803
|
`));
|
|
18830
18804
|
|
|
18831
|
-
const styles$
|
|
18832
|
-
${styles$
|
|
18805
|
+
const styles$R = css `
|
|
18806
|
+
${styles$Z}
|
|
18833
18807
|
${buttonAppearanceVariantStyles}
|
|
18834
18808
|
`;
|
|
18835
18809
|
|
|
@@ -18925,7 +18899,7 @@
|
|
|
18925
18899
|
baseName: 'button',
|
|
18926
18900
|
baseClass: Button$1,
|
|
18927
18901
|
template: template$B,
|
|
18928
|
-
styles: styles$
|
|
18902
|
+
styles: styles$R,
|
|
18929
18903
|
shadowOptions: {
|
|
18930
18904
|
delegatesFocus: true
|
|
18931
18905
|
}
|
|
@@ -19682,7 +19656,7 @@
|
|
|
19682
19656
|
:innerHTML=${x => x.icon.data}
|
|
19683
19657
|
></div>`;
|
|
19684
19658
|
|
|
19685
|
-
const styles$
|
|
19659
|
+
const styles$Q = css `
|
|
19686
19660
|
${display$1('inline-flex')}
|
|
19687
19661
|
|
|
19688
19662
|
:host {
|
|
@@ -19736,7 +19710,7 @@
|
|
|
19736
19710
|
const composedIcon = iconClass.compose({
|
|
19737
19711
|
baseName,
|
|
19738
19712
|
template: template$A,
|
|
19739
|
-
styles: styles$
|
|
19713
|
+
styles: styles$Q
|
|
19740
19714
|
});
|
|
19741
19715
|
DesignSystem.getOrCreate().withPrefix('nimble').register(composedIcon());
|
|
19742
19716
|
};
|
|
@@ -19968,11 +19942,11 @@
|
|
|
19968
19942
|
const nimbleBanner = Banner.compose({
|
|
19969
19943
|
baseName: 'banner',
|
|
19970
19944
|
template: template$z,
|
|
19971
|
-
styles: styles$
|
|
19945
|
+
styles: styles$S
|
|
19972
19946
|
});
|
|
19973
19947
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
|
|
19974
19948
|
|
|
19975
|
-
const styles$
|
|
19949
|
+
const styles$P = css `
|
|
19976
19950
|
${display$1('inline-block')}
|
|
19977
19951
|
|
|
19978
19952
|
:host {
|
|
@@ -20013,11 +19987,11 @@
|
|
|
20013
19987
|
baseName: 'breadcrumb',
|
|
20014
19988
|
baseClass: Breadcrumb$1,
|
|
20015
19989
|
template: breadcrumbTemplate,
|
|
20016
|
-
styles: styles$
|
|
19990
|
+
styles: styles$P
|
|
20017
19991
|
});
|
|
20018
19992
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBreadcrumb());
|
|
20019
19993
|
|
|
20020
|
-
const styles$
|
|
19994
|
+
const styles$O = css `
|
|
20021
19995
|
${display$1('inline-flex')}
|
|
20022
19996
|
|
|
20023
19997
|
:host {
|
|
@@ -20095,14 +20069,14 @@
|
|
|
20095
20069
|
baseName: 'breadcrumb-item',
|
|
20096
20070
|
baseClass: BreadcrumbItem$1,
|
|
20097
20071
|
template: breadcrumbItemTemplate,
|
|
20098
|
-
styles: styles$
|
|
20072
|
+
styles: styles$O,
|
|
20099
20073
|
separator: forwardSlash16X16.data
|
|
20100
20074
|
});
|
|
20101
20075
|
DesignSystem.getOrCreate()
|
|
20102
20076
|
.withPrefix('nimble')
|
|
20103
20077
|
.register(nimbleBreadcrumbItem());
|
|
20104
20078
|
|
|
20105
|
-
const styles$
|
|
20079
|
+
const styles$N = css `
|
|
20106
20080
|
${display$1('flex')}
|
|
20107
20081
|
|
|
20108
20082
|
:host {
|
|
@@ -20142,11 +20116,11 @@
|
|
|
20142
20116
|
baseName: 'card',
|
|
20143
20117
|
baseClass: Card$1,
|
|
20144
20118
|
template: template$y,
|
|
20145
|
-
styles: styles$
|
|
20119
|
+
styles: styles$N
|
|
20146
20120
|
});
|
|
20147
20121
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCard());
|
|
20148
20122
|
|
|
20149
|
-
const styles$
|
|
20123
|
+
const styles$M = css `
|
|
20150
20124
|
${display$1('inline-flex')}
|
|
20151
20125
|
|
|
20152
20126
|
:host {
|
|
@@ -20305,14 +20279,14 @@
|
|
|
20305
20279
|
const nimbleCardButton = CardButton.compose({
|
|
20306
20280
|
baseName: 'card-button',
|
|
20307
20281
|
template: buttonTemplate,
|
|
20308
|
-
styles: styles$
|
|
20282
|
+
styles: styles$M,
|
|
20309
20283
|
shadowOptions: {
|
|
20310
20284
|
delegatesFocus: true
|
|
20311
20285
|
}
|
|
20312
20286
|
});
|
|
20313
20287
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCardButton());
|
|
20314
20288
|
|
|
20315
|
-
const styles$
|
|
20289
|
+
const styles$L = css `
|
|
20316
20290
|
${display$1('inline-flex')}
|
|
20317
20291
|
|
|
20318
20292
|
:host {
|
|
@@ -20471,15 +20445,15 @@
|
|
|
20471
20445
|
baseName: 'checkbox',
|
|
20472
20446
|
baseClass: Checkbox$1,
|
|
20473
20447
|
template: template$x,
|
|
20474
|
-
styles: styles$
|
|
20448
|
+
styles: styles$L,
|
|
20475
20449
|
checkedIndicator: check16X16.data,
|
|
20476
20450
|
indeterminateIndicator: minus16X16.data
|
|
20477
20451
|
});
|
|
20478
20452
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCheckbox());
|
|
20479
20453
|
const checkboxTag = 'nimble-checkbox';
|
|
20480
20454
|
|
|
20481
|
-
const styles$
|
|
20482
|
-
${styles$
|
|
20455
|
+
const styles$K = css `
|
|
20456
|
+
${styles$Z}
|
|
20483
20457
|
${buttonAppearanceVariantStyles}
|
|
20484
20458
|
|
|
20485
20459
|
@layer checked {
|
|
@@ -20625,7 +20599,7 @@
|
|
|
20625
20599
|
const nimbleToggleButton = ToggleButton.compose({
|
|
20626
20600
|
baseName: 'toggle-button',
|
|
20627
20601
|
template: template$w,
|
|
20628
|
-
styles: styles$
|
|
20602
|
+
styles: styles$K,
|
|
20629
20603
|
shadowOptions: {
|
|
20630
20604
|
delegatesFocus: true
|
|
20631
20605
|
}
|
|
@@ -20662,7 +20636,7 @@
|
|
|
20662
20636
|
block: 'block'
|
|
20663
20637
|
};
|
|
20664
20638
|
|
|
20665
|
-
const styles$
|
|
20639
|
+
const styles$J = css `
|
|
20666
20640
|
${display$1('inline-flex')}
|
|
20667
20641
|
|
|
20668
20642
|
:host {
|
|
@@ -20882,7 +20856,7 @@
|
|
|
20882
20856
|
}
|
|
20883
20857
|
`));
|
|
20884
20858
|
|
|
20885
|
-
const styles$
|
|
20859
|
+
const styles$I = css `
|
|
20886
20860
|
.error-icon {
|
|
20887
20861
|
display: none;
|
|
20888
20862
|
}
|
|
@@ -20929,9 +20903,9 @@
|
|
|
20929
20903
|
standard: 'standard'
|
|
20930
20904
|
};
|
|
20931
20905
|
|
|
20932
|
-
const styles$
|
|
20933
|
-
${styles$K}
|
|
20906
|
+
const styles$H = css `
|
|
20934
20907
|
${styles$J}
|
|
20908
|
+
${styles$I}
|
|
20935
20909
|
|
|
20936
20910
|
:host {
|
|
20937
20911
|
--ni-private-hover-bottom-border-width: 2px;
|
|
@@ -21130,7 +21104,7 @@
|
|
|
21130
21104
|
>
|
|
21131
21105
|
<slot
|
|
21132
21106
|
${slotted({
|
|
21133
|
-
filter: (n) => n instanceof HTMLElement && Listbox
|
|
21107
|
+
filter: (n) => n instanceof HTMLElement && Listbox.slottedOptionFilter(n),
|
|
21134
21108
|
flatten: true,
|
|
21135
21109
|
property: 'slottedOptions',
|
|
21136
21110
|
})}
|
|
@@ -21773,7 +21747,7 @@
|
|
|
21773
21747
|
baseName: 'combobox',
|
|
21774
21748
|
baseClass: FormAssociatedCombobox,
|
|
21775
21749
|
template: template$v,
|
|
21776
|
-
styles: styles$
|
|
21750
|
+
styles: styles$H,
|
|
21777
21751
|
shadowOptions: {
|
|
21778
21752
|
delegatesFocus: true
|
|
21779
21753
|
},
|
|
@@ -21818,7 +21792,7 @@
|
|
|
21818
21792
|
*/
|
|
21819
21793
|
const UserDismissed = Symbol('user dismissed');
|
|
21820
21794
|
|
|
21821
|
-
const styles$
|
|
21795
|
+
const styles$G = css `
|
|
21822
21796
|
${display$1('grid')}
|
|
21823
21797
|
|
|
21824
21798
|
dialog {
|
|
@@ -22073,12 +22047,12 @@
|
|
|
22073
22047
|
const nimbleDialog = Dialog.compose({
|
|
22074
22048
|
baseName: 'dialog',
|
|
22075
22049
|
template: template$u,
|
|
22076
|
-
styles: styles$
|
|
22050
|
+
styles: styles$G,
|
|
22077
22051
|
baseClass: Dialog
|
|
22078
22052
|
});
|
|
22079
22053
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDialog());
|
|
22080
22054
|
|
|
22081
|
-
const styles$
|
|
22055
|
+
const styles$F = css `
|
|
22082
22056
|
${display$1('block')}
|
|
22083
22057
|
|
|
22084
22058
|
:host {
|
|
@@ -22375,7 +22349,7 @@
|
|
|
22375
22349
|
const nimbleDrawer = Drawer.compose({
|
|
22376
22350
|
baseName: 'drawer',
|
|
22377
22351
|
template: template$t,
|
|
22378
|
-
styles: styles$
|
|
22352
|
+
styles: styles$F
|
|
22379
22353
|
});
|
|
22380
22354
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleDrawer());
|
|
22381
22355
|
|
|
@@ -24605,7 +24579,7 @@
|
|
|
24605
24579
|
}
|
|
24606
24580
|
}
|
|
24607
24581
|
|
|
24608
|
-
const styles$
|
|
24582
|
+
const styles$E = css `
|
|
24609
24583
|
${display$1('none')}
|
|
24610
24584
|
`;
|
|
24611
24585
|
|
|
@@ -24654,7 +24628,7 @@
|
|
|
24654
24628
|
], LabelProviderCore.prototype, "filterNoResults", void 0);
|
|
24655
24629
|
const nimbleLabelProviderCore = LabelProviderCore.compose({
|
|
24656
24630
|
baseName: 'label-provider-core',
|
|
24657
|
-
styles: styles$
|
|
24631
|
+
styles: styles$E
|
|
24658
24632
|
});
|
|
24659
24633
|
DesignSystem.getOrCreate()
|
|
24660
24634
|
.withPrefix('nimble')
|
|
@@ -24821,13 +24795,13 @@
|
|
|
24821
24795
|
], LabelProviderTable.prototype, "groupRowPlaceholderEmpty", void 0);
|
|
24822
24796
|
const nimbleLabelProviderTable = LabelProviderTable.compose({
|
|
24823
24797
|
baseName: 'label-provider-table',
|
|
24824
|
-
styles: styles$
|
|
24798
|
+
styles: styles$E
|
|
24825
24799
|
});
|
|
24826
24800
|
DesignSystem.getOrCreate()
|
|
24827
24801
|
.withPrefix('nimble')
|
|
24828
24802
|
.register(nimbleLabelProviderTable());
|
|
24829
24803
|
|
|
24830
|
-
const styles$
|
|
24804
|
+
const styles$D = css `
|
|
24831
24805
|
${display$1('flex')}
|
|
24832
24806
|
|
|
24833
24807
|
:host {
|
|
@@ -25000,7 +24974,7 @@
|
|
|
25000
24974
|
baseName: 'list-option',
|
|
25001
24975
|
baseClass: ListboxOption,
|
|
25002
24976
|
template: template$s,
|
|
25003
|
-
styles: styles$
|
|
24977
|
+
styles: styles$D
|
|
25004
24978
|
});
|
|
25005
24979
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleListOption());
|
|
25006
24980
|
const listOptionTag = 'nimble-list-option';
|
|
@@ -25016,7 +24990,7 @@
|
|
|
25016
24990
|
|
|
25017
24991
|
const template$r = html `<template slot="mapping"></template>`;
|
|
25018
24992
|
|
|
25019
|
-
const styles$
|
|
24993
|
+
const styles$C = css `
|
|
25020
24994
|
${display$1('none')}
|
|
25021
24995
|
`;
|
|
25022
24996
|
|
|
@@ -25033,7 +25007,7 @@
|
|
|
25033
25007
|
const emptyMapping = MappingEmpty.compose({
|
|
25034
25008
|
baseName: 'mapping-empty',
|
|
25035
25009
|
template: template$r,
|
|
25036
|
-
styles: styles$
|
|
25010
|
+
styles: styles$C
|
|
25037
25011
|
});
|
|
25038
25012
|
DesignSystem.getOrCreate().withPrefix('nimble').register(emptyMapping());
|
|
25039
25013
|
|
|
@@ -25104,7 +25078,7 @@
|
|
|
25104
25078
|
const iconMapping = MappingIcon.compose({
|
|
25105
25079
|
baseName: 'mapping-icon',
|
|
25106
25080
|
template: template$r,
|
|
25107
|
-
styles: styles$
|
|
25081
|
+
styles: styles$C
|
|
25108
25082
|
});
|
|
25109
25083
|
DesignSystem.getOrCreate().withPrefix('nimble').register(iconMapping());
|
|
25110
25084
|
|
|
@@ -25128,7 +25102,7 @@
|
|
|
25128
25102
|
const spinnerMapping = MappingSpinner.compose({
|
|
25129
25103
|
baseName: 'mapping-spinner',
|
|
25130
25104
|
template: template$r,
|
|
25131
|
-
styles: styles$
|
|
25105
|
+
styles: styles$C
|
|
25132
25106
|
});
|
|
25133
25107
|
DesignSystem.getOrCreate().withPrefix('nimble').register(spinnerMapping());
|
|
25134
25108
|
|
|
@@ -25145,11 +25119,11 @@
|
|
|
25145
25119
|
const textMapping = MappingText.compose({
|
|
25146
25120
|
baseName: 'mapping-text',
|
|
25147
25121
|
template: template$r,
|
|
25148
|
-
styles: styles$
|
|
25122
|
+
styles: styles$C
|
|
25149
25123
|
});
|
|
25150
25124
|
DesignSystem.getOrCreate().withPrefix('nimble').register(textMapping());
|
|
25151
25125
|
|
|
25152
|
-
const styles$
|
|
25126
|
+
const styles$B = css `
|
|
25153
25127
|
${display$1('grid')}
|
|
25154
25128
|
|
|
25155
25129
|
:host {
|
|
@@ -25221,7 +25195,7 @@
|
|
|
25221
25195
|
baseName: 'menu',
|
|
25222
25196
|
baseClass: Menu$1,
|
|
25223
25197
|
template: menuTemplate,
|
|
25224
|
-
styles: styles$
|
|
25198
|
+
styles: styles$B
|
|
25225
25199
|
});
|
|
25226
25200
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenu());
|
|
25227
25201
|
|
|
@@ -25238,7 +25212,7 @@
|
|
|
25238
25212
|
auto: 'auto'
|
|
25239
25213
|
};
|
|
25240
25214
|
|
|
25241
|
-
const styles$
|
|
25215
|
+
const styles$A = css `
|
|
25242
25216
|
${display$1('inline-block')}
|
|
25243
25217
|
|
|
25244
25218
|
:host {
|
|
@@ -25508,7 +25482,7 @@
|
|
|
25508
25482
|
const nimbleMenuButton = MenuButton.compose({
|
|
25509
25483
|
baseName: 'menu-button',
|
|
25510
25484
|
template: template$q,
|
|
25511
|
-
styles: styles$
|
|
25485
|
+
styles: styles$A,
|
|
25512
25486
|
shadowOptions: {
|
|
25513
25487
|
delegatesFocus: true
|
|
25514
25488
|
}
|
|
@@ -25516,7 +25490,7 @@
|
|
|
25516
25490
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenuButton());
|
|
25517
25491
|
const menuButtonTag = 'nimble-menu-button';
|
|
25518
25492
|
|
|
25519
|
-
const styles$
|
|
25493
|
+
const styles$z = css `
|
|
25520
25494
|
${display$1('grid')}
|
|
25521
25495
|
|
|
25522
25496
|
:host {
|
|
@@ -25614,7 +25588,7 @@
|
|
|
25614
25588
|
baseName: 'menu-item',
|
|
25615
25589
|
baseClass: MenuItem$1,
|
|
25616
25590
|
template: menuItemTemplate,
|
|
25617
|
-
styles: styles$
|
|
25591
|
+
styles: styles$z,
|
|
25618
25592
|
expandCollapseGlyph: arrowExpanderRight16X16.data
|
|
25619
25593
|
});
|
|
25620
25594
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleMenuItem());
|
|
@@ -25628,9 +25602,9 @@
|
|
|
25628
25602
|
block: 'block'
|
|
25629
25603
|
};
|
|
25630
25604
|
|
|
25631
|
-
const styles$
|
|
25605
|
+
const styles$y = css `
|
|
25632
25606
|
${display$1('inline-block')}
|
|
25633
|
-
${styles$
|
|
25607
|
+
${styles$I}
|
|
25634
25608
|
|
|
25635
25609
|
:host {
|
|
25636
25610
|
font: ${bodyFont};
|
|
@@ -25844,7 +25818,7 @@
|
|
|
25844
25818
|
baseName: 'number-field',
|
|
25845
25819
|
baseClass: NumberField$1,
|
|
25846
25820
|
template: numberFieldTemplate,
|
|
25847
|
-
styles: styles$
|
|
25821
|
+
styles: styles$y,
|
|
25848
25822
|
shadowOptions: {
|
|
25849
25823
|
delegatesFocus: true
|
|
25850
25824
|
},
|
|
@@ -25887,7 +25861,7 @@
|
|
|
25887
25861
|
});
|
|
25888
25862
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleNumberField());
|
|
25889
25863
|
|
|
25890
|
-
const styles$
|
|
25864
|
+
const styles$x = css `
|
|
25891
25865
|
${display$1('inline-flex')}
|
|
25892
25866
|
|
|
25893
25867
|
:host {
|
|
@@ -25988,12 +25962,12 @@
|
|
|
25988
25962
|
baseName: 'radio',
|
|
25989
25963
|
baseClass: Radio$1,
|
|
25990
25964
|
template: radioTemplate,
|
|
25991
|
-
styles: styles$
|
|
25965
|
+
styles: styles$x,
|
|
25992
25966
|
checkedIndicator: circleFilled16X16.data
|
|
25993
25967
|
});
|
|
25994
25968
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleRadio());
|
|
25995
25969
|
|
|
25996
|
-
const styles$
|
|
25970
|
+
const styles$w = css `
|
|
25997
25971
|
${display$1('inline-block')}
|
|
25998
25972
|
|
|
25999
25973
|
.positioning-region {
|
|
@@ -26028,7 +26002,7 @@
|
|
|
26028
26002
|
baseName: 'radio-group',
|
|
26029
26003
|
baseClass: RadioGroup$1,
|
|
26030
26004
|
template: radioGroupTemplate,
|
|
26031
|
-
styles: styles$
|
|
26005
|
+
styles: styles$w,
|
|
26032
26006
|
shadowOptions: {
|
|
26033
26007
|
delegatesFocus: true
|
|
26034
26008
|
}
|
|
@@ -43693,7 +43667,7 @@ img.ProseMirror-separator {
|
|
|
43693
43667
|
},
|
|
43694
43668
|
});
|
|
43695
43669
|
|
|
43696
|
-
const styles$
|
|
43670
|
+
const styles$v = css `
|
|
43697
43671
|
${display$1('inline')}
|
|
43698
43672
|
|
|
43699
43673
|
.positioning-region {
|
|
@@ -43730,7 +43704,7 @@ img.ProseMirror-separator {
|
|
|
43730
43704
|
baseName: 'toolbar',
|
|
43731
43705
|
baseClass: Toolbar$1,
|
|
43732
43706
|
template: toolbarTemplate,
|
|
43733
|
-
styles: styles$
|
|
43707
|
+
styles: styles$v,
|
|
43734
43708
|
shadowOptions: {
|
|
43735
43709
|
delegatesFocus: true
|
|
43736
43710
|
}
|
|
@@ -43762,8 +43736,8 @@ img.ProseMirror-separator {
|
|
|
43762
43736
|
cssCustomPropertyName: null
|
|
43763
43737
|
}).withDefault(richTextLabelDefaults.richTextToggleNumberedListLabel);
|
|
43764
43738
|
|
|
43765
|
-
const styles$
|
|
43766
|
-
${styles$
|
|
43739
|
+
const styles$u = css `
|
|
43740
|
+
${styles$J}
|
|
43767
43741
|
|
|
43768
43742
|
:host {
|
|
43769
43743
|
height: auto;
|
|
@@ -43780,42 +43754,6 @@ img.ProseMirror-separator {
|
|
|
43780
43754
|
}
|
|
43781
43755
|
`;
|
|
43782
43756
|
|
|
43783
|
-
const styles$u = css `
|
|
43784
|
-
${display$1('inline-flex')}
|
|
43785
|
-
|
|
43786
|
-
:host {
|
|
43787
|
-
background: ${applicationBackgroundColor};
|
|
43788
|
-
border: ${borderWidth} solid ${popupBorderColor};
|
|
43789
|
-
flex-direction: column;
|
|
43790
|
-
margin: 0;
|
|
43791
|
-
min-width: ${menuMinWidth};
|
|
43792
|
-
box-shadow: ${elevation2BoxShadow};
|
|
43793
|
-
color: ${bodyFontColor};
|
|
43794
|
-
font: ${bodyFont};
|
|
43795
|
-
}
|
|
43796
|
-
|
|
43797
|
-
:host(:focus) {
|
|
43798
|
-
outline: 0px;
|
|
43799
|
-
}
|
|
43800
|
-
|
|
43801
|
-
slot {
|
|
43802
|
-
padding: ${smallPadding};
|
|
43803
|
-
display: block;
|
|
43804
|
-
}
|
|
43805
|
-
`;
|
|
43806
|
-
|
|
43807
|
-
/**
|
|
43808
|
-
* A nimble-styled HTML list box
|
|
43809
|
-
*/
|
|
43810
|
-
class Listbox extends ListboxElement {
|
|
43811
|
-
}
|
|
43812
|
-
const nimbleListbox = Listbox.compose({
|
|
43813
|
-
baseName: 'listbox',
|
|
43814
|
-
template: listboxTemplate,
|
|
43815
|
-
styles: styles$u
|
|
43816
|
-
});
|
|
43817
|
-
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleListbox());
|
|
43818
|
-
|
|
43819
43757
|
// prettier-ignore
|
|
43820
43758
|
const template$p = html `
|
|
43821
43759
|
<template>
|
|
@@ -43838,7 +43776,7 @@ img.ProseMirror-separator {
|
|
|
43838
43776
|
?disabled="${x => x.disabled}"
|
|
43839
43777
|
>
|
|
43840
43778
|
<slot
|
|
43841
|
-
${slotted({ filter: (n) => n instanceof HTMLElement &&
|
|
43779
|
+
${slotted({ filter: (n) => n instanceof HTMLElement && ListboxElement.slottedOptionFilter(n), flatten: true, property: 'slottedOptions' })}
|
|
43842
43780
|
>
|
|
43843
43781
|
</slot>
|
|
43844
43782
|
</div>
|
|
@@ -44079,7 +44017,7 @@ img.ProseMirror-separator {
|
|
|
44079
44017
|
const nimbleRichTextMentionListbox = RichTextMentionListbox.compose({
|
|
44080
44018
|
baseName: 'rich-text-mention-listbox',
|
|
44081
44019
|
template: template$p,
|
|
44082
|
-
styles: styles$
|
|
44020
|
+
styles: styles$u
|
|
44083
44021
|
});
|
|
44084
44022
|
DesignSystem.getOrCreate()
|
|
44085
44023
|
.withPrefix('nimble')
|
|
@@ -44191,7 +44129,7 @@ img.ProseMirror-separator {
|
|
|
44191
44129
|
|
|
44192
44130
|
const styles$t = css `
|
|
44193
44131
|
${display$1('inline-flex')}
|
|
44194
|
-
${styles$
|
|
44132
|
+
${styles$I}
|
|
44195
44133
|
|
|
44196
44134
|
:host {
|
|
44197
44135
|
font: ${bodyFont};
|
|
@@ -52974,9 +52912,9 @@ img.ProseMirror-separator {
|
|
|
52974
52912
|
strong: {
|
|
52975
52913
|
parseDOM: [
|
|
52976
52914
|
{ tag: "strong" },
|
|
52977
|
-
{ tag: "b", getAttrs:
|
|
52915
|
+
{ tag: "b", getAttrs: node => node.style.fontWeight != "normal" && null },
|
|
52978
52916
|
{ style: "font-weight=400", clearMark: m => m.type.name == "strong" },
|
|
52979
|
-
{ style: "font-weight", getAttrs:
|
|
52917
|
+
{ style: "font-weight", getAttrs: value => /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null }
|
|
52980
52918
|
],
|
|
52981
52919
|
toDOM() { return ["strong"]; }
|
|
52982
52920
|
},
|
|
@@ -53230,6 +53168,7 @@ img.ProseMirror-separator {
|
|
|
53230
53168
|
code_inline: { mark: "code", noCloseToken: true }
|
|
53231
53169
|
});
|
|
53232
53170
|
|
|
53171
|
+
const blankMark = { open: "", close: "", mixable: true };
|
|
53233
53172
|
/**
|
|
53234
53173
|
A specification for serializing a ProseMirror document as
|
|
53235
53174
|
Markdown/CommonMark text.
|
|
@@ -53437,6 +53376,18 @@ img.ProseMirror-separator {
|
|
|
53437
53376
|
}
|
|
53438
53377
|
}
|
|
53439
53378
|
/**
|
|
53379
|
+
@internal
|
|
53380
|
+
*/
|
|
53381
|
+
getMark(name) {
|
|
53382
|
+
let info = this.marks[name];
|
|
53383
|
+
if (!info) {
|
|
53384
|
+
if (this.options.strict !== false)
|
|
53385
|
+
throw new Error(`Mark type \`${name}\` not supported by Markdown renderer`);
|
|
53386
|
+
info = blankMark;
|
|
53387
|
+
}
|
|
53388
|
+
return info;
|
|
53389
|
+
}
|
|
53390
|
+
/**
|
|
53440
53391
|
Render a block, prefixing each line with `delim`, and the first
|
|
53441
53392
|
line in `firstDelim`. `node` should be the node that is closed at
|
|
53442
53393
|
the end of the block, and `f` is a function that renders the
|
|
@@ -53501,9 +53452,22 @@ img.ProseMirror-separator {
|
|
|
53501
53452
|
Render the given node as a block.
|
|
53502
53453
|
*/
|
|
53503
53454
|
render(node, parent, index) {
|
|
53504
|
-
if (
|
|
53505
|
-
|
|
53506
|
-
|
|
53455
|
+
if (this.nodes[node.type.name]) {
|
|
53456
|
+
this.nodes[node.type.name](this, node, parent, index);
|
|
53457
|
+
}
|
|
53458
|
+
else {
|
|
53459
|
+
if (this.options.strict !== false) {
|
|
53460
|
+
throw new Error("Token type `" + node.type.name + "` not supported by Markdown renderer");
|
|
53461
|
+
}
|
|
53462
|
+
else if (!node.type.isLeaf) {
|
|
53463
|
+
if (node.type.inlineContent)
|
|
53464
|
+
this.renderInline(node);
|
|
53465
|
+
else
|
|
53466
|
+
this.renderContent(node);
|
|
53467
|
+
if (node.isBlock)
|
|
53468
|
+
this.closeBlock(node);
|
|
53469
|
+
}
|
|
53470
|
+
}
|
|
53507
53471
|
}
|
|
53508
53472
|
/**
|
|
53509
53473
|
Render the contents of `parent` as block nodes.
|
|
@@ -53534,7 +53498,7 @@ img.ProseMirror-separator {
|
|
|
53534
53498
|
// If whitespace has to be expelled from the node, adjust
|
|
53535
53499
|
// leading and trailing accordingly.
|
|
53536
53500
|
if (node && node.isText && marks.some(mark => {
|
|
53537
|
-
let info = this.
|
|
53501
|
+
let info = this.getMark(mark.type.name);
|
|
53538
53502
|
return info && info.expelEnclosingWhitespace && !mark.isInSet(active);
|
|
53539
53503
|
})) {
|
|
53540
53504
|
let [_, lead, rest] = /^(\s*)(.*)$/m.exec(node.text);
|
|
@@ -53546,7 +53510,7 @@ img.ProseMirror-separator {
|
|
|
53546
53510
|
}
|
|
53547
53511
|
}
|
|
53548
53512
|
if (node && node.isText && marks.some(mark => {
|
|
53549
|
-
let info = this.
|
|
53513
|
+
let info = this.getMark(mark.type.name);
|
|
53550
53514
|
return info && info.expelEnclosingWhitespace &&
|
|
53551
53515
|
(index == parent.childCount - 1 || !mark.isInSet(parent.child(index + 1).marks));
|
|
53552
53516
|
})) {
|
|
@@ -53559,7 +53523,7 @@ img.ProseMirror-separator {
|
|
|
53559
53523
|
}
|
|
53560
53524
|
}
|
|
53561
53525
|
let inner = marks.length ? marks[marks.length - 1] : null;
|
|
53562
|
-
let noEsc = inner && this.
|
|
53526
|
+
let noEsc = inner && this.getMark(inner.type.name).escape === false;
|
|
53563
53527
|
let len = marks.length - (noEsc ? 1 : 0);
|
|
53564
53528
|
// Try to reorder 'mixable' marks, such as em and strong, which
|
|
53565
53529
|
// in Markdown may be opened and closed in different order, so
|
|
@@ -53567,11 +53531,11 @@ img.ProseMirror-separator {
|
|
|
53567
53531
|
// active.
|
|
53568
53532
|
outer: for (let i = 0; i < len; i++) {
|
|
53569
53533
|
let mark = marks[i];
|
|
53570
|
-
if (!this.
|
|
53534
|
+
if (!this.getMark(mark.type.name).mixable)
|
|
53571
53535
|
break;
|
|
53572
53536
|
for (let j = 0; j < active.length; j++) {
|
|
53573
53537
|
let other = active[j];
|
|
53574
|
-
if (!this.
|
|
53538
|
+
if (!this.getMark(other.type.name).mixable)
|
|
53575
53539
|
break;
|
|
53576
53540
|
if (mark.eq(other)) {
|
|
53577
53541
|
if (i > j)
|
|
@@ -53677,7 +53641,7 @@ img.ProseMirror-separator {
|
|
|
53677
53641
|
Get the markdown string for a given opening or closing mark.
|
|
53678
53642
|
*/
|
|
53679
53643
|
markString(mark, open, parent, index) {
|
|
53680
|
-
let info = this.
|
|
53644
|
+
let info = this.getMark(mark.type.name);
|
|
53681
53645
|
let value = open ? info.open : info.close;
|
|
53682
53646
|
return typeof value == "string" ? value : value(this, mark, parent, index);
|
|
53683
53647
|
}
|
|
@@ -59068,8 +59032,8 @@ img.ProseMirror-separator {
|
|
|
59068
59032
|
.register(nimbleRichTextViewer());
|
|
59069
59033
|
|
|
59070
59034
|
const styles$r = css `
|
|
59071
|
-
${styles$K}
|
|
59072
59035
|
${styles$J}
|
|
59036
|
+
${styles$I}
|
|
59073
59037
|
|
|
59074
59038
|
${
|
|
59075
59039
|
/* We are using flex `order` to define the visual ordering of the selected value,
|
|
@@ -70772,7 +70736,7 @@ img.ProseMirror-separator {
|
|
|
70772
70736
|
|
|
70773
70737
|
const styles$7 = css `
|
|
70774
70738
|
${display$1('inline-flex')}
|
|
70775
|
-
${styles$
|
|
70739
|
+
${styles$I}
|
|
70776
70740
|
|
|
70777
70741
|
:host {
|
|
70778
70742
|
font: ${bodyFont};
|
|
@@ -71118,7 +71082,7 @@ img.ProseMirror-separator {
|
|
|
71118
71082
|
|
|
71119
71083
|
const styles$6 = css `
|
|
71120
71084
|
${display$1('inline-block')}
|
|
71121
|
-
${styles$
|
|
71085
|
+
${styles$I}
|
|
71122
71086
|
|
|
71123
71087
|
:host {
|
|
71124
71088
|
font: ${bodyFont};
|
|
@@ -76786,7 +76750,7 @@ img.ProseMirror-separator {
|
|
|
76786
76750
|
/**
|
|
76787
76751
|
* Prerendering prepares render-ready dies data to be used by the rendering module
|
|
76788
76752
|
*/
|
|
76789
|
-
|
|
76753
|
+
class Prerendering {
|
|
76790
76754
|
get labelsFontSize() {
|
|
76791
76755
|
return this._labelsFontSize;
|
|
76792
76756
|
}
|
|
@@ -76893,12 +76857,12 @@ img.ProseMirror-separator {
|
|
|
76893
76857
|
rgbColor = new ColorRGBA64(rgbColor.r, rgbColor.g, rgbColor.b, this.calculateOpacity(dieTags, highlightedTags));
|
|
76894
76858
|
return rgbColor.toStringWebRGBA();
|
|
76895
76859
|
}
|
|
76896
|
-
}
|
|
76860
|
+
}
|
|
76897
76861
|
|
|
76898
76862
|
/**
|
|
76899
76863
|
* Data Manager uses Computations and Prerendering modules in order and exposes the results
|
|
76900
76864
|
*/
|
|
76901
|
-
|
|
76865
|
+
class DataManager {
|
|
76902
76866
|
get containerDimensions() {
|
|
76903
76867
|
return this.computations.containerDimensions;
|
|
76904
76868
|
}
|
|
@@ -76935,7 +76899,7 @@ img.ProseMirror-separator {
|
|
|
76935
76899
|
constructor(wafermap) {
|
|
76936
76900
|
this.wafermap = wafermap;
|
|
76937
76901
|
this.computations = new Computations$1(wafermap);
|
|
76938
|
-
this.prerendering = new Prerendering
|
|
76902
|
+
this.prerendering = new Prerendering(wafermap);
|
|
76939
76903
|
}
|
|
76940
76904
|
updateContainerDimensions() {
|
|
76941
76905
|
this.computations.updateContainerDimensions();
|
|
@@ -76959,258 +76923,6 @@ img.ProseMirror-separator {
|
|
|
76959
76923
|
updateDataMap() {
|
|
76960
76924
|
this.dataMap = new Map(this.wafermap.dies.map(die => [`${die.x}_${die.y}`, die]));
|
|
76961
76925
|
}
|
|
76962
|
-
};
|
|
76963
|
-
|
|
76964
|
-
/**
|
|
76965
|
-
* Computations calculates and stores different measures which are used in the Wafermap
|
|
76966
|
-
*/
|
|
76967
|
-
class Computations {
|
|
76968
|
-
get containerDimensions() {
|
|
76969
|
-
return this._containerDimensions;
|
|
76970
|
-
}
|
|
76971
|
-
get dieDimensions() {
|
|
76972
|
-
return this._dieDimensions;
|
|
76973
|
-
}
|
|
76974
|
-
get margin() {
|
|
76975
|
-
return this._margin;
|
|
76976
|
-
}
|
|
76977
|
-
get horizontalScale() {
|
|
76978
|
-
return this._horizontalScale;
|
|
76979
|
-
}
|
|
76980
|
-
get verticalScale() {
|
|
76981
|
-
return this._verticalScale;
|
|
76982
|
-
}
|
|
76983
|
-
constructor(wafermap) {
|
|
76984
|
-
this.wafermap = wafermap;
|
|
76985
|
-
this.defaultPadding = 0;
|
|
76986
|
-
this.baseMarginPercentage = 0.04;
|
|
76987
|
-
}
|
|
76988
|
-
update() {
|
|
76989
|
-
const canvasDimensions = {
|
|
76990
|
-
width: this.wafermap.canvasWidth,
|
|
76991
|
-
height: this.wafermap.canvasHeight
|
|
76992
|
-
};
|
|
76993
|
-
const canvasDiameter = Math.min(canvasDimensions.width, canvasDimensions.height);
|
|
76994
|
-
const canvasMargin = {
|
|
76995
|
-
top: (canvasDimensions.height - canvasDiameter) / 2,
|
|
76996
|
-
right: (canvasDimensions.width - canvasDiameter) / 2,
|
|
76997
|
-
bottom: (canvasDimensions.height - canvasDiameter) / 2,
|
|
76998
|
-
left: (canvasDimensions.width - canvasDiameter) / 2
|
|
76999
|
-
};
|
|
77000
|
-
const baseMargin = {
|
|
77001
|
-
top: canvasDiameter * this.baseMarginPercentage,
|
|
77002
|
-
right: canvasDiameter * this.baseMarginPercentage,
|
|
77003
|
-
bottom: canvasDiameter * this.baseMarginPercentage,
|
|
77004
|
-
left: canvasDiameter * this.baseMarginPercentage
|
|
77005
|
-
};
|
|
77006
|
-
this._margin = this.calculateMarginAddition(baseMargin, canvasMargin);
|
|
77007
|
-
this._containerDimensions = this.calculateContainerDimensions(canvasDimensions, this._margin);
|
|
77008
|
-
const containerDiameter = Math.min(this._containerDimensions.width, this._containerDimensions.height);
|
|
77009
|
-
const gridDimensions = this.gridDimensionsValidAndDefined()
|
|
77010
|
-
? this.calculateGridDimensionsFromBoundingBox()
|
|
77011
|
-
: this.calculateGridDimensionsFromDies();
|
|
77012
|
-
// this scale is used for positioning the dies on the canvas
|
|
77013
|
-
const originLocation = this.wafermap.originLocation;
|
|
77014
|
-
this._horizontalScale = this.createHorizontalScale(originLocation, gridDimensions, containerDiameter);
|
|
77015
|
-
// this scale is used for positioning the dies on the canvas
|
|
77016
|
-
this._verticalScale = this.createVerticalScale(originLocation, gridDimensions, containerDiameter);
|
|
77017
|
-
this._dieDimensions = {
|
|
77018
|
-
width: Math.abs(this._horizontalScale(0) - this._horizontalScale(1)),
|
|
77019
|
-
height: Math.abs(this._verticalScale(0) - this._verticalScale(1))
|
|
77020
|
-
};
|
|
77021
|
-
}
|
|
77022
|
-
gridDimensionsValidAndDefined() {
|
|
77023
|
-
return (!this.wafermap.validity.invalidGridDimensions
|
|
77024
|
-
&& typeof this.wafermap.gridMinX === 'number'
|
|
77025
|
-
&& typeof this.wafermap.gridMinY === 'number'
|
|
77026
|
-
&& typeof this.wafermap.gridMaxX === 'number'
|
|
77027
|
-
&& typeof this.wafermap.gridMinX === 'number');
|
|
77028
|
-
}
|
|
77029
|
-
calculateGridDimensionsFromBoundingBox() {
|
|
77030
|
-
const gridDimensions = { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };
|
|
77031
|
-
if (typeof this.wafermap.gridMaxY === 'number'
|
|
77032
|
-
&& typeof this.wafermap.gridMinY === 'number'
|
|
77033
|
-
&& typeof this.wafermap.gridMaxX === 'number'
|
|
77034
|
-
&& typeof this.wafermap.gridMinX === 'number') {
|
|
77035
|
-
gridDimensions.origin.x = this.wafermap.gridMinX;
|
|
77036
|
-
gridDimensions.origin.y = this.wafermap.gridMinY;
|
|
77037
|
-
gridDimensions.rows = this.wafermap.gridMaxY - this.wafermap.gridMinY + 1;
|
|
77038
|
-
gridDimensions.cols = this.wafermap.gridMaxX - this.wafermap.gridMinX + 1;
|
|
77039
|
-
}
|
|
77040
|
-
return gridDimensions;
|
|
77041
|
-
}
|
|
77042
|
-
calculateGridDimensionsFromDies() {
|
|
77043
|
-
if (this.wafermap.diesTable === undefined) {
|
|
77044
|
-
return { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };
|
|
77045
|
-
}
|
|
77046
|
-
const colIndex = this.wafermap.diesTable
|
|
77047
|
-
.getChild('colIndex')
|
|
77048
|
-
.toArray();
|
|
77049
|
-
const rowIndex = this.wafermap.diesTable
|
|
77050
|
-
.getChild('rowIndex')
|
|
77051
|
-
.toArray();
|
|
77052
|
-
const minPoint = { x: colIndex[0], y: rowIndex[0] };
|
|
77053
|
-
const maxPoint = { x: colIndex[0], y: rowIndex[0] };
|
|
77054
|
-
// will replace iterating with arquero after fixing issues: https://github.com/uwdata/arquero/pull/346
|
|
77055
|
-
for (let i = 0; i < colIndex.length; i++) {
|
|
77056
|
-
if (colIndex[i] < minPoint.x) {
|
|
77057
|
-
minPoint.x = colIndex[i];
|
|
77058
|
-
}
|
|
77059
|
-
if (colIndex[i] > maxPoint.x) {
|
|
77060
|
-
maxPoint.x = colIndex[i];
|
|
77061
|
-
}
|
|
77062
|
-
if (rowIndex[i] < minPoint.y) {
|
|
77063
|
-
minPoint.y = rowIndex[i];
|
|
77064
|
-
}
|
|
77065
|
-
if (rowIndex[i] > maxPoint.y) {
|
|
77066
|
-
maxPoint.y = rowIndex[i];
|
|
77067
|
-
}
|
|
77068
|
-
}
|
|
77069
|
-
return {
|
|
77070
|
-
origin: minPoint,
|
|
77071
|
-
rows: maxPoint.y - minPoint.y + 1,
|
|
77072
|
-
cols: maxPoint.x - minPoint.x + 1
|
|
77073
|
-
};
|
|
77074
|
-
}
|
|
77075
|
-
calculateContainerDimensions(canvasDimensions, margin) {
|
|
77076
|
-
return {
|
|
77077
|
-
width: canvasDimensions.width - margin.left - margin.right,
|
|
77078
|
-
height: canvasDimensions.height - margin.top - margin.bottom
|
|
77079
|
-
};
|
|
77080
|
-
}
|
|
77081
|
-
createHorizontalScale(originLocation, grid, containerWidth) {
|
|
77082
|
-
const scale = linear();
|
|
77083
|
-
if (originLocation === WaferMapOriginLocation.bottomLeft
|
|
77084
|
-
|| originLocation === WaferMapOriginLocation.topLeft) {
|
|
77085
|
-
return scale
|
|
77086
|
-
.domain([grid.origin.x, grid.origin.x + grid.cols])
|
|
77087
|
-
.range([0, containerWidth]);
|
|
77088
|
-
}
|
|
77089
|
-
return scale
|
|
77090
|
-
.domain([grid.origin.x - 1, grid.origin.x + grid.cols - 1])
|
|
77091
|
-
.range([containerWidth, 0]);
|
|
77092
|
-
}
|
|
77093
|
-
createVerticalScale(originLocation, grid, containerHeight) {
|
|
77094
|
-
const scale = linear();
|
|
77095
|
-
// html canvas has top-left origin https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#the_grid
|
|
77096
|
-
// we need to flip the vertical scale
|
|
77097
|
-
if (originLocation === WaferMapOriginLocation.bottomLeft
|
|
77098
|
-
|| originLocation === WaferMapOriginLocation.bottomRight) {
|
|
77099
|
-
return scale
|
|
77100
|
-
.domain([grid.origin.y - 1, grid.origin.y + grid.rows - 1])
|
|
77101
|
-
.range([containerHeight, 0]);
|
|
77102
|
-
}
|
|
77103
|
-
return scale
|
|
77104
|
-
.domain([grid.origin.y, grid.origin.y + grid.rows])
|
|
77105
|
-
.range([0, containerHeight]);
|
|
77106
|
-
}
|
|
77107
|
-
calculateMarginAddition(baseMargin, addedMargin) {
|
|
77108
|
-
return {
|
|
77109
|
-
top: baseMargin.top + addedMargin.top,
|
|
77110
|
-
right: baseMargin.right + addedMargin.right,
|
|
77111
|
-
bottom: baseMargin.bottom + addedMargin.bottom,
|
|
77112
|
-
left: baseMargin.left + addedMargin.left
|
|
77113
|
-
};
|
|
77114
|
-
}
|
|
77115
|
-
}
|
|
77116
|
-
|
|
77117
|
-
/**
|
|
77118
|
-
* Prerendering prepares render-ready dies data to be used by the rendering module
|
|
77119
|
-
*/
|
|
77120
|
-
class Prerendering {
|
|
77121
|
-
get labelsFontSize() {
|
|
77122
|
-
return this._labelsFontSize;
|
|
77123
|
-
}
|
|
77124
|
-
get colorScale() {
|
|
77125
|
-
return this._colorScale;
|
|
77126
|
-
}
|
|
77127
|
-
constructor(wafermap) {
|
|
77128
|
-
this.wafermap = wafermap;
|
|
77129
|
-
this.fontSizeFactor = 0.8;
|
|
77130
|
-
this.colorScaleResolution = 10;
|
|
77131
|
-
}
|
|
77132
|
-
update() {
|
|
77133
|
-
this._labelsFontSize = this.calculateLabelsFontSize(this.wafermap.experimentalDataManager.dieDimensions, this.wafermap.maxCharacters);
|
|
77134
|
-
this._colorScale = this.calculateColorScale();
|
|
77135
|
-
}
|
|
77136
|
-
calculateColorScale() {
|
|
77137
|
-
if (this.wafermap.colorScaleMode === WaferMapColorScaleMode.linear) {
|
|
77138
|
-
const values = this.wafermap.colorScale.values.map(item => +item);
|
|
77139
|
-
const d3ColorScale = linear()
|
|
77140
|
-
.domain(values)
|
|
77141
|
-
.range(this.wafermap.colorScale.colors);
|
|
77142
|
-
let min = values[0];
|
|
77143
|
-
let max = values[0];
|
|
77144
|
-
values.forEach(value => {
|
|
77145
|
-
if (value < min) {
|
|
77146
|
-
min = value;
|
|
77147
|
-
}
|
|
77148
|
-
if (value > max) {
|
|
77149
|
-
max = value;
|
|
77150
|
-
}
|
|
77151
|
-
});
|
|
77152
|
-
// the linear color scale will not be infinite but will be limited by the color scale resolution
|
|
77153
|
-
const valueSamples = ticks(min, max, values.length * this.colorScaleResolution);
|
|
77154
|
-
return valueSamples.map(value => {
|
|
77155
|
-
return {
|
|
77156
|
-
color: d3ColorScale(value),
|
|
77157
|
-
value
|
|
77158
|
-
};
|
|
77159
|
-
});
|
|
77160
|
-
}
|
|
77161
|
-
// ordinal color categories have to be sorted by value
|
|
77162
|
-
return this.wafermap.colorScale.colors
|
|
77163
|
-
.map((color, index) => {
|
|
77164
|
-
return {
|
|
77165
|
-
color,
|
|
77166
|
-
value: +this.wafermap.colorScale.values[index]
|
|
77167
|
-
};
|
|
77168
|
-
})
|
|
77169
|
-
.sort((a, b) => a.value - b.value);
|
|
77170
|
-
}
|
|
77171
|
-
calculateLabelsFontSize(dieDimensions, maxCharacters) {
|
|
77172
|
-
return Math.min(dieDimensions.height, (dieDimensions.width / (Math.max(2, maxCharacters) * 0.5))
|
|
77173
|
-
* this.fontSizeFactor);
|
|
77174
|
-
}
|
|
77175
|
-
}
|
|
77176
|
-
|
|
77177
|
-
/**
|
|
77178
|
-
* Data Manager uses Computations and Prerendering modules in order and exposes the results
|
|
77179
|
-
*/
|
|
77180
|
-
class DataManager {
|
|
77181
|
-
get containerDimensions() {
|
|
77182
|
-
return this.computations.containerDimensions;
|
|
77183
|
-
}
|
|
77184
|
-
get dieDimensions() {
|
|
77185
|
-
return this.computations.dieDimensions;
|
|
77186
|
-
}
|
|
77187
|
-
get margin() {
|
|
77188
|
-
return this.computations.margin;
|
|
77189
|
-
}
|
|
77190
|
-
get horizontalScale() {
|
|
77191
|
-
return this.computations.horizontalScale;
|
|
77192
|
-
}
|
|
77193
|
-
get verticalScale() {
|
|
77194
|
-
return this.computations.verticalScale;
|
|
77195
|
-
}
|
|
77196
|
-
get labelsFontSize() {
|
|
77197
|
-
return this.prerendering.labelsFontSize;
|
|
77198
|
-
}
|
|
77199
|
-
get colorScale() {
|
|
77200
|
-
return this.prerendering.colorScale;
|
|
77201
|
-
}
|
|
77202
|
-
constructor(wafermap) {
|
|
77203
|
-
this.wafermap = wafermap;
|
|
77204
|
-
this.computations = new Computations(wafermap);
|
|
77205
|
-
this.prerendering = new Prerendering(wafermap);
|
|
77206
|
-
}
|
|
77207
|
-
updateComputations() {
|
|
77208
|
-
this.computations.update();
|
|
77209
|
-
this.prerendering.update();
|
|
77210
|
-
}
|
|
77211
|
-
updatePrerendering() {
|
|
77212
|
-
this.prerendering.update();
|
|
77213
|
-
}
|
|
77214
76926
|
}
|
|
77215
76927
|
|
|
77216
76928
|
/**
|
|
@@ -77369,8 +77081,7 @@ img.ProseMirror-separator {
|
|
|
77369
77081
|
this.updateQueued = false;
|
|
77370
77082
|
}
|
|
77371
77083
|
get requiresEventsUpdate() {
|
|
77372
|
-
return (this.isTracked('
|
|
77373
|
-
|| this.isTracked('canvasWidth')
|
|
77084
|
+
return (this.isTracked('canvasWidth')
|
|
77374
77085
|
|| this.isTracked('canvasHeight')
|
|
77375
77086
|
|| this.isTracked('originLocation')
|
|
77376
77087
|
|| this.isTracked('gridMinX')
|
|
@@ -77379,15 +77090,35 @@ img.ProseMirror-separator {
|
|
|
77379
77090
|
|| this.isTracked('gridMaxY')
|
|
77380
77091
|
|| this.isTracked('dies')
|
|
77381
77092
|
|| this.isTracked('maxCharacters')
|
|
77093
|
+
|| this.isTracked('highlightedTags')
|
|
77382
77094
|
|| this.isTracked('colorScale')
|
|
77383
77095
|
|| this.isTracked('colorScaleMode')
|
|
77384
77096
|
|| this.isTracked('dieLabelsHidden')
|
|
77385
77097
|
|| this.isTracked('dieLabelsSuffix')
|
|
77386
77098
|
|| this.isTracked('transform'));
|
|
77387
77099
|
}
|
|
77100
|
+
get requiresWorkerWaferSetup() {
|
|
77101
|
+
return (this.isTracked('canvasWidth')
|
|
77102
|
+
|| this.isTracked('canvasHeight')
|
|
77103
|
+
|| this.isTracked('originLocation')
|
|
77104
|
+
|| this.isTracked('gridMinX')
|
|
77105
|
+
|| this.isTracked('gridMaxX')
|
|
77106
|
+
|| this.isTracked('gridMinY')
|
|
77107
|
+
|| this.isTracked('gridMaxY')
|
|
77108
|
+
|| this.isTracked('dies')
|
|
77109
|
+
|| this.isTracked('maxCharacters')
|
|
77110
|
+
|| this.isTracked('highlightedTags')
|
|
77111
|
+
|| this.isTracked('colorScale')
|
|
77112
|
+
|| this.isTracked('colorScaleMode')
|
|
77113
|
+
|| this.isTracked('dieLabelsHidden')
|
|
77114
|
+
|| this.isTracked('dieLabelsSuffix'));
|
|
77115
|
+
}
|
|
77388
77116
|
get requiresContainerDimensionsUpdate() {
|
|
77389
77117
|
return this.isTracked('canvasWidth') || this.isTracked('canvasHeight');
|
|
77390
77118
|
}
|
|
77119
|
+
get requiresComponentResizeUpdate() {
|
|
77120
|
+
return this.isTracked('canvasWidth') || this.isTracked('canvasHeight');
|
|
77121
|
+
}
|
|
77391
77122
|
get requiresScalesUpdate() {
|
|
77392
77123
|
return (this.isTracked('originLocation')
|
|
77393
77124
|
|| this.isTracked('gridMinX')
|
|
@@ -77396,6 +77127,14 @@ img.ProseMirror-separator {
|
|
|
77396
77127
|
|| this.isTracked('gridMaxY')
|
|
77397
77128
|
|| this.isTracked('dies'));
|
|
77398
77129
|
}
|
|
77130
|
+
get requiresInputDataUpdate() {
|
|
77131
|
+
return (this.isTracked('originLocation')
|
|
77132
|
+
|| this.isTracked('gridMinX')
|
|
77133
|
+
|| this.isTracked('gridMaxX')
|
|
77134
|
+
|| this.isTracked('gridMinY')
|
|
77135
|
+
|| this.isTracked('gridMaxY')
|
|
77136
|
+
|| this.isTracked('dies'));
|
|
77137
|
+
}
|
|
77399
77138
|
get requiresLabelsFontSizeUpdate() {
|
|
77400
77139
|
return this.isTracked('maxCharacters');
|
|
77401
77140
|
}
|
|
@@ -77406,6 +77145,14 @@ img.ProseMirror-separator {
|
|
|
77406
77145
|
|| this.isTracked('dieLabelsHidden')
|
|
77407
77146
|
|| this.isTracked('dieLabelsSuffix'));
|
|
77408
77147
|
}
|
|
77148
|
+
get requiresColorAndTextUpdate() {
|
|
77149
|
+
return (this.isTracked('maxCharacters')
|
|
77150
|
+
|| this.isTracked('highlightedTags')
|
|
77151
|
+
|| this.isTracked('colorScale')
|
|
77152
|
+
|| this.isTracked('colorScaleMode')
|
|
77153
|
+
|| this.isTracked('dieLabelsHidden')
|
|
77154
|
+
|| this.isTracked('dieLabelsSuffix'));
|
|
77155
|
+
}
|
|
77409
77156
|
get requiresDrawnWaferUpdate() {
|
|
77410
77157
|
return this.isTracked('transform');
|
|
77411
77158
|
}
|
|
@@ -78436,7 +78183,7 @@ img.ProseMirror-separator {
|
|
|
78436
78183
|
}
|
|
78437
78184
|
|
|
78438
78185
|
// eslint-disable-next-line no-template-curly-in-string
|
|
78439
|
-
const workerCode = "var MatrixRenderer = (function (exports) {\n 'use strict';\n\n /**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n const proxyMarker = Symbol(\"Comlink.proxy\");\n const createEndpoint = Symbol(\"Comlink.endpoint\");\n const releaseProxy = Symbol(\"Comlink.releaseProxy\");\n const finalizer = Symbol(\"Comlink.finalizer\");\n const throwMarker = Symbol(\"Comlink.thrown\");\n const isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n /**\n * Internal transfer handle to handle objects marked to proxy.\n */\n const proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n };\n /**\n * Internal transfer handler to handle thrown exceptions.\n */\n const throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n };\n /**\n * Allows customizing the serialization of certain values.\n */\n const transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n ]);\n function isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n }\n function expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n }\n function isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n }\n function closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n }\n function wrap(ep, target) {\n return createProxy(ep, [], target);\n }\n function throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n }\n function releaseEndpoint(ep) {\n return requestResponseMessage(ep, {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n }\n const proxyCounter = new WeakMap();\n const proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\n function registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n }\n function unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n }\n function createProxy(ep, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n }\n function myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n }\n function processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n }\n const transferCache = new WeakMap();\n function transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n }\n function proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n }\n function toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n }\n function fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n }\n function requestResponseMessage(ep, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n ep.addEventListener(\"message\", function l(ev) {\n if (!ev.data || !ev.data.id || ev.data.id !== id) {\n return;\n }\n ep.removeEventListener(\"message\", l);\n resolve(ev.data);\n });\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n }\n function generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n }\n\n /**\n * MatrixRenderer class is meant to be used within a Web Worker context,\n * using Comlink to facilitate communication between the main thread and the worker.\n * The MatrixRenderer class manages a matrix of dies, once an instance of MatrixRenderer is created,\n * it is exposed to the main thread using Comlink's `expose` method.\n * This setup is used in the wafer-map component to perform heavy computational duties\n */\n class MatrixRenderer {\n constructor() {\n this.columnIndexes = Int32Array.from([]);\n this.rowIndexes = Int32Array.from([]);\n this.values = Float64Array.from([]);\n this.scaledColumnIndex = Float64Array.from([]);\n this.scaledRowIndex = Float64Array.from([]);\n this.columnIndexPositions = Int32Array.from([]);\n this.scaleX = 1;\n this.scaleY = 1;\n this.baseX = 1;\n this.baseY = 1;\n this.dieDimensions = { width: 1, height: 1 };\n this.transform = { k: 1, x: 0, y: 0 };\n this.smallestMarginPossible = 20;\n this.margin = {\n top: this.smallestMarginPossible,\n right: this.smallestMarginPossible,\n bottom: this.smallestMarginPossible,\n left: this.smallestMarginPossible\n };\n }\n calculateXScaledIndex(columnIndex) {\n return this.scaleX * columnIndex + this.baseX + this.margin.left;\n }\n calculateYScaledIndex(rowIndex) {\n return this.scaleY * rowIndex + this.baseY + this.margin.top;\n }\n setColumnIndexes(columnIndexes) {\n this.columnIndexes = columnIndexes;\n if (columnIndexes.length === 0 || this.columnIndexes[0] === undefined) {\n return;\n }\n const scaledColumnIndex = [\n this.calculateXScaledIndex(this.columnIndexes[0])\n ];\n const columnPositions = [0];\n let prev = this.columnIndexes[0];\n for (let i = 1; i < this.columnIndexes.length; i++) {\n const xIndex = this.columnIndexes[i];\n if (xIndex && xIndex !== prev) {\n const scaledX = this.calculateXScaledIndex(this.columnIndexes[i]);\n scaledColumnIndex.push(scaledX);\n columnPositions.push(i);\n prev = xIndex;\n }\n }\n this.scaledColumnIndex = Float64Array.from(scaledColumnIndex);\n this.columnIndexPositions = Int32Array.from(columnPositions);\n }\n setRowIndexes(rowIndexesBuffer) {\n this.rowIndexes = rowIndexesBuffer;\n this.scaledRowIndex = new Float64Array(this.rowIndexes.length);\n for (let i = 0; i < this.rowIndexes.length; i++) {\n this.scaledRowIndex[i] = this.calculateYScaledIndex(this.rowIndexes[i]);\n }\n }\n setMargin(margin) {\n this.margin = margin;\n }\n setCanvasCorners(topLeft, bottomRight) {\n this.topLeftCanvasCorner = topLeft;\n this.bottomRightCanvasCorner = bottomRight;\n }\n setDiesDimensions(data) {\n this.dieDimensions = { width: data.width, height: data.height };\n }\n setScaling(scaleX, scaleY) {\n this.scaleX = scaleX;\n this.scaleY = scaleY;\n }\n setBases(baseX, baseY) {\n this.baseX = baseX;\n this.baseY = baseY;\n }\n setTransform(transform) {\n this.transform = transform;\n }\n setCanvas(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext('2d');\n }\n getMatrix() {\n return {\n columnIndexes: this.columnIndexes,\n rowIndexes: this.rowIndexes,\n values: this.values\n };\n }\n emptyMatrix() {\n this.columnIndexes = Int32Array.from([]);\n this.rowIndexes = Int32Array.from([]);\n this.values = Float64Array.from([]);\n }\n scaleCanvas() {\n this.context.translate(this.transform.x, this.transform.y);\n this.context.scale(this.transform.k, this.transform.k);\n }\n updateMatrix(data) {\n this.columnIndexes = Int32Array.from(data.columnIndexes);\n this.rowIndexes = Int32Array.from(data.rowIndexes);\n this.values = Float64Array.from(data.values);\n }\n setCanvasDimensions(data) {\n this.canvas.width = data.width;\n this.canvas.height = data.height;\n }\n getCanvasDimensions() {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n };\n }\n clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n drawWafer() {\n this.context.restore();\n this.context.save();\n this.clearCanvas();\n this.scaleCanvas();\n if (this.topLeftCanvasCorner === undefined\n || this.bottomRightCanvasCorner === undefined) {\n throw new Error('Canvas corners are not set');\n }\n for (let i = 0; i < this.scaledColumnIndex.length; i++) {\n const scaledX = this.scaledColumnIndex[i];\n if (!(scaledX >= this.topLeftCanvasCorner.x\n && scaledX < this.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndex is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndex is 13\n const columnEndIndex = this.columnIndexPositions[i + 1] !== undefined\n ? this.columnIndexPositions[i + 1]\n : this.scaledRowIndex.length;\n for (let columnStartIndex = this.columnIndexPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndex[columnStartIndex];\n if (!(scaledY >= this.topLeftCanvasCorner.y\n && scaledY < this.bottomRightCanvasCorner.y)) {\n continue;\n }\n // Fill style is temporary green for all dies, will be replaced with a color based on the value of the die in a future implementation\n this.context.fillStyle = 'Green';\n this.context.fillRect(scaledX, scaledY, this.dieDimensions.width, this.dieDimensions.height);\n }\n }\n }\n }\n expose(MatrixRenderer);\n\n exports.MatrixRenderer = MatrixRenderer;\n\n return exports;\n\n})({});\n";
|
|
78186
|
+
const workerCode = "var MatrixRenderer = (function (exports) {\n 'use strict';\n\n /**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n const proxyMarker = Symbol(\"Comlink.proxy\");\n const createEndpoint = Symbol(\"Comlink.endpoint\");\n const releaseProxy = Symbol(\"Comlink.releaseProxy\");\n const finalizer = Symbol(\"Comlink.finalizer\");\n const throwMarker = Symbol(\"Comlink.thrown\");\n const isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n /**\n * Internal transfer handle to handle objects marked to proxy.\n */\n const proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n };\n /**\n * Internal transfer handler to handle thrown exceptions.\n */\n const throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n };\n /**\n * Allows customizing the serialization of certain values.\n */\n const transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n ]);\n function isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n }\n function expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n }\n function isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n }\n function closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n }\n function wrap(ep, target) {\n return createProxy(ep, [], target);\n }\n function throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n }\n function releaseEndpoint(ep) {\n return requestResponseMessage(ep, {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n }\n const proxyCounter = new WeakMap();\n const proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\n function registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n }\n function unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n }\n function createProxy(ep, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n }\n function myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n }\n function processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n }\n const transferCache = new WeakMap();\n function transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n }\n function proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n }\n function toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n }\n function fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n }\n function requestResponseMessage(ep, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n ep.addEventListener(\"message\", function l(ev) {\n if (!ev.data || !ev.data.id || ev.data.id !== id) {\n return;\n }\n ep.removeEventListener(\"message\", l);\n resolve(ev.data);\n });\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n }\n function generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n }\n\n /**\n * MatrixRenderer class is meant to be used within a Web Worker context,\n * using Comlink to facilitate communication between the main thread and the worker.\n * The MatrixRenderer class manages a matrix of dies, once an instance of MatrixRenderer is created,\n * it is exposed to the main thread using Comlink's `expose` method.\n * This setup is used in the wafer-map component to perform heavy computational duties\n */\n class MatrixRenderer {\n constructor() {\n this.values = Float64Array.from([]);\n this.scaledColumnIndices = Float64Array.from([]);\n this.scaledRowIndices = Float64Array.from([]);\n this.columnIndicesPositions = Int32Array.from([]);\n this.renderConfig = {\n dieDimensions: {\n width: 0,\n height: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n verticalCoefficient: 1,\n horizontalCoefficient: 1,\n horizontalConstant: 0,\n verticalConstant: 0,\n labelsFontSize: 0,\n colorScale: []\n };\n this.transformConfig = {\n transform: {\n k: 1,\n x: 0,\n y: 0\n },\n topLeftCanvasCorner: {\n x: 0,\n y: 0\n },\n bottomRightCanvasCorner: {\n x: 0,\n y: 0\n }\n };\n }\n calculateHorizontalScaledIndices(columnIndex) {\n return (this.renderConfig.horizontalCoefficient * columnIndex\n + this.renderConfig.horizontalConstant\n + this.renderConfig.margin.left);\n }\n calculateVerticalScaledIndices(rowIndex) {\n return (this.renderConfig.verticalCoefficient * rowIndex\n + this.renderConfig.verticalConstant\n + this.renderConfig.margin.top);\n }\n setColumnIndices(columnIndices) {\n if (columnIndices.length === 0 || columnIndices[0] === undefined) {\n return;\n }\n const scaledColumnIndex = [\n this.calculateHorizontalScaledIndices(columnIndices[0])\n ];\n const columnPositions = [0];\n let prev = columnIndices[0];\n for (let i = 1; i < columnIndices.length; i++) {\n const xIndex = columnIndices[i];\n if (xIndex && xIndex !== prev) {\n const scaledX = this.calculateHorizontalScaledIndices(columnIndices[i]);\n scaledColumnIndex.push(scaledX);\n columnPositions.push(i);\n prev = xIndex;\n }\n }\n this.scaledColumnIndices = Float64Array.from(scaledColumnIndex);\n this.columnIndicesPositions = Int32Array.from(columnPositions);\n }\n setRowIndices(rowIndices) {\n this.scaledRowIndices = new Float64Array(rowIndices.length);\n for (let i = 0; i < rowIndices.length; i++) {\n this.scaledRowIndices[i] = this.calculateVerticalScaledIndices(rowIndices[i]);\n }\n }\n setRenderConfig(renderConfig) {\n this.renderConfig = renderConfig;\n }\n setTransformConfig(transformData) {\n this.transformConfig = transformData;\n }\n setCanvas(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext('2d');\n }\n scaleCanvas() {\n this.context.translate(this.transformConfig.transform.x, this.transformConfig.transform.y);\n this.context.scale(this.transformConfig.transform.k, this.transformConfig.transform.k);\n }\n setCanvasDimensions(data) {\n this.canvas.width = data.width;\n this.canvas.height = data.height;\n }\n getCanvasDimensions() {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n };\n }\n clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n drawWafer() {\n this.context.restore();\n this.context.save();\n this.clearCanvas();\n this.scaleCanvas();\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n // Fill style is temporary green for all dies, will be replaced with a color based on the value of the die in a future implementation\n this.context.fillStyle = 'Green';\n this.context.fillRect(scaledX, scaledY, this.renderConfig.dieDimensions.width, this.renderConfig.dieDimensions.height);\n }\n }\n }\n }\n expose(MatrixRenderer);\n\n exports.MatrixRenderer = MatrixRenderer;\n\n return exports;\n\n})({});\n";
|
|
78440
78187
|
|
|
78441
78188
|
let url;
|
|
78442
78189
|
/**
|
|
@@ -78466,66 +78213,45 @@ img.ProseMirror-separator {
|
|
|
78466
78213
|
constructor(wafermap) {
|
|
78467
78214
|
this.wafermap = wafermap;
|
|
78468
78215
|
}
|
|
78469
|
-
async setupWafer() {
|
|
78216
|
+
async setupWafer(snapshot) {
|
|
78470
78217
|
if (this.matrixRenderer === undefined) {
|
|
78471
78218
|
const { matrixRenderer } = await createMatrixRenderer();
|
|
78472
78219
|
this.matrixRenderer = matrixRenderer;
|
|
78473
78220
|
const offscreenCanvas = this.wafermap.workerCanvas.transferControlToOffscreen();
|
|
78474
78221
|
await this.matrixRenderer.setCanvas(transfer(offscreenCanvas, [offscreenCanvas]));
|
|
78475
78222
|
}
|
|
78476
|
-
await this.matrixRenderer.setCanvasDimensions(
|
|
78477
|
-
|
|
78478
|
-
|
|
78479
|
-
|
|
78480
|
-
|
|
78481
|
-
|
|
78482
|
-
|
|
78483
|
-
const
|
|
78484
|
-
|
|
78485
|
-
|
|
78486
|
-
await this.matrixRenderer.setBases(this.wafermap.experimentalDataManager.horizontalScale(0), this.wafermap.experimentalDataManager.verticalScale(0));
|
|
78487
|
-
await this.matrixRenderer.setMargin(this.wafermap.experimentalDataManager.margin);
|
|
78488
|
-
if (this.wafermap.diesTable === undefined) {
|
|
78489
|
-
await this.matrixRenderer.setColumnIndexes(Int32Array.from([]));
|
|
78490
|
-
await this.matrixRenderer.setRowIndexes(Int32Array.from([]));
|
|
78491
|
-
return;
|
|
78492
|
-
}
|
|
78493
|
-
const columnIndexes = this.wafermap.diesTable
|
|
78494
|
-
.getChild('colIndex')
|
|
78495
|
-
.toArray();
|
|
78496
|
-
await this.matrixRenderer.setColumnIndexes(columnIndexes);
|
|
78497
|
-
const rowIndexes = this.wafermap.diesTable
|
|
78498
|
-
.getChild('rowIndex')
|
|
78499
|
-
.toArray();
|
|
78500
|
-
await this.matrixRenderer.setRowIndexes(rowIndexes);
|
|
78501
|
-
}
|
|
78502
|
-
async drawWafer() {
|
|
78503
|
-
await this.matrixRenderer.setTransform(this.wafermap.transform);
|
|
78504
|
-
const topLeftCanvasCorner = this.wafermap.transform.invert([0, 0]);
|
|
78505
|
-
const bottomRightCanvasCorner = this.wafermap.transform.invert([
|
|
78506
|
-
this.wafermap.canvasWidth,
|
|
78507
|
-
this.wafermap.canvasHeight
|
|
78223
|
+
await this.matrixRenderer.setCanvasDimensions(snapshot.canvasDimensions);
|
|
78224
|
+
await this.matrixRenderer.setRenderConfig(snapshot.renderConfig);
|
|
78225
|
+
await this.matrixRenderer.setColumnIndices(snapshot.columnIndices);
|
|
78226
|
+
await this.matrixRenderer.setRowIndices(snapshot.rowIndices);
|
|
78227
|
+
}
|
|
78228
|
+
async drawWafer(snapshot) {
|
|
78229
|
+
const topLeftCanvasCorner = snapshot.transform.invert([0, 0]);
|
|
78230
|
+
const bottomRightCanvasCorner = snapshot.transform.invert([
|
|
78231
|
+
snapshot.canvasDimensions.width,
|
|
78232
|
+
snapshot.canvasDimensions.height
|
|
78508
78233
|
]);
|
|
78509
|
-
await this.matrixRenderer.
|
|
78510
|
-
|
|
78511
|
-
|
|
78512
|
-
|
|
78513
|
-
-
|
|
78514
|
-
|
|
78515
|
-
|
|
78516
|
-
|
|
78234
|
+
await this.matrixRenderer.setTransformConfig({
|
|
78235
|
+
transform: snapshot.transform,
|
|
78236
|
+
topLeftCanvasCorner: {
|
|
78237
|
+
x: topLeftCanvasCorner[0] - snapshot.dieDimensions.width,
|
|
78238
|
+
y: topLeftCanvasCorner[1] - snapshot.dieDimensions.height
|
|
78239
|
+
},
|
|
78240
|
+
bottomRightCanvasCorner: {
|
|
78241
|
+
x: bottomRightCanvasCorner[0],
|
|
78242
|
+
y: bottomRightCanvasCorner[1]
|
|
78243
|
+
}
|
|
78517
78244
|
});
|
|
78518
78245
|
await this.matrixRenderer.drawWafer();
|
|
78519
|
-
this.renderHover();
|
|
78520
78246
|
}
|
|
78521
78247
|
renderHover() {
|
|
78522
|
-
if (this.wafermap.
|
|
78248
|
+
if (this.wafermap.computations.dieDimensions === undefined
|
|
78523
78249
|
|| this.wafermap.transform === undefined) {
|
|
78524
78250
|
return;
|
|
78525
78251
|
}
|
|
78526
|
-
this.wafermap.hoverWidth = this.wafermap.
|
|
78252
|
+
this.wafermap.hoverWidth = this.wafermap.computations.dieDimensions.width
|
|
78527
78253
|
* this.wafermap.transform.k;
|
|
78528
|
-
this.wafermap.hoverHeight = this.wafermap.
|
|
78254
|
+
this.wafermap.hoverHeight = this.wafermap.computations.dieDimensions.height
|
|
78529
78255
|
* this.wafermap.transform.k;
|
|
78530
78256
|
this.wafermap.hoverOpacity = this.wafermap.hoverDie === undefined
|
|
78531
78257
|
? HoverDieOpacity.hide
|
|
@@ -78534,17 +78260,17 @@ img.ProseMirror-separator {
|
|
|
78534
78260
|
}
|
|
78535
78261
|
calculateHoverTransform() {
|
|
78536
78262
|
if (this.wafermap.hoverDie !== undefined) {
|
|
78537
|
-
const scaledX = this.wafermap.
|
|
78263
|
+
const scaledX = this.wafermap.computations.horizontalScale(this.wafermap.hoverDie.x);
|
|
78538
78264
|
if (scaledX === undefined) {
|
|
78539
78265
|
return '';
|
|
78540
78266
|
}
|
|
78541
|
-
const scaledY = this.wafermap.
|
|
78267
|
+
const scaledY = this.wafermap.computations.verticalScale(this.wafermap.hoverDie.y);
|
|
78542
78268
|
if (scaledY === undefined) {
|
|
78543
78269
|
return '';
|
|
78544
78270
|
}
|
|
78545
78271
|
const transformedPoint = this.wafermap.transform.apply([
|
|
78546
|
-
scaledX + this.wafermap.
|
|
78547
|
-
scaledY + this.wafermap.
|
|
78272
|
+
scaledX + this.wafermap.computations.margin.left,
|
|
78273
|
+
scaledY + this.wafermap.computations.margin.top
|
|
78548
78274
|
]);
|
|
78549
78275
|
return `translate(${transformedPoint[0]}, ${transformedPoint[1]})`;
|
|
78550
78276
|
}
|
|
@@ -78704,10 +78430,8 @@ img.ProseMirror-separator {
|
|
|
78704
78430
|
? Math.ceil
|
|
78705
78431
|
: Math.floor;
|
|
78706
78432
|
// go to x and y scale to get the x,y values of the die.
|
|
78707
|
-
const x = xRoundFunction(this.wafermap.
|
|
78708
|
-
|
|
78709
|
-
const y = yRoundFunction(this.wafermap.experimentalDataManager.verticalScale.invert(mousePosition.y
|
|
78710
|
-
- this.wafermap.experimentalDataManager.margin.top));
|
|
78433
|
+
const x = xRoundFunction(this.wafermap.computations.horizontalScale.invert(mousePosition.x - this.wafermap.computations.margin.left));
|
|
78434
|
+
const y = yRoundFunction(this.wafermap.computations.verticalScale.invert(mousePosition.y - this.wafermap.computations.margin.top));
|
|
78711
78435
|
return { x, y };
|
|
78712
78436
|
}
|
|
78713
78437
|
return undefined;
|
|
@@ -78766,6 +78490,237 @@ img.ProseMirror-separator {
|
|
|
78766
78490
|
}
|
|
78767
78491
|
}
|
|
78768
78492
|
|
|
78493
|
+
/**
|
|
78494
|
+
* Computations calculates and stores different measures which are used in the Wafermap
|
|
78495
|
+
*/
|
|
78496
|
+
class Computations {
|
|
78497
|
+
get horizontalScale() {
|
|
78498
|
+
return this._horizontalScale;
|
|
78499
|
+
}
|
|
78500
|
+
get verticalScale() {
|
|
78501
|
+
return this._verticalScale;
|
|
78502
|
+
}
|
|
78503
|
+
get containerDimensions() {
|
|
78504
|
+
return this._containerDimensions;
|
|
78505
|
+
}
|
|
78506
|
+
get dieDimensions() {
|
|
78507
|
+
return this._dieDimensions;
|
|
78508
|
+
}
|
|
78509
|
+
get margin() {
|
|
78510
|
+
return this._margin;
|
|
78511
|
+
}
|
|
78512
|
+
get verticalCoefficient() {
|
|
78513
|
+
return this._verticalCoefficient;
|
|
78514
|
+
}
|
|
78515
|
+
get horizontalCoefficient() {
|
|
78516
|
+
return this._horizontalCoefficient;
|
|
78517
|
+
}
|
|
78518
|
+
get horizontalConstant() {
|
|
78519
|
+
return this._horizontalConstant;
|
|
78520
|
+
}
|
|
78521
|
+
get verticalConstant() {
|
|
78522
|
+
return this._verticalConstant;
|
|
78523
|
+
}
|
|
78524
|
+
get labelsFontSize() {
|
|
78525
|
+
return this._labelsFontSize;
|
|
78526
|
+
}
|
|
78527
|
+
get colorScale() {
|
|
78528
|
+
return this._colorScale;
|
|
78529
|
+
}
|
|
78530
|
+
constructor(wafermap) {
|
|
78531
|
+
this.wafermap = wafermap;
|
|
78532
|
+
this.baseMarginPercentage = 0.04;
|
|
78533
|
+
this.fontSizeFactor = 0.8;
|
|
78534
|
+
this.colorScaleResolution = 10;
|
|
78535
|
+
}
|
|
78536
|
+
componentResizeUpdate() {
|
|
78537
|
+
const canvasDimensions = {
|
|
78538
|
+
width: this.wafermap.canvasWidth,
|
|
78539
|
+
height: this.wafermap.canvasHeight
|
|
78540
|
+
};
|
|
78541
|
+
const canvasDiameter = Math.min(canvasDimensions.width, canvasDimensions.height);
|
|
78542
|
+
const canvasMargin = {
|
|
78543
|
+
top: (canvasDimensions.height - canvasDiameter) / 2,
|
|
78544
|
+
right: (canvasDimensions.width - canvasDiameter) / 2,
|
|
78545
|
+
bottom: (canvasDimensions.height - canvasDiameter) / 2,
|
|
78546
|
+
left: (canvasDimensions.width - canvasDiameter) / 2
|
|
78547
|
+
};
|
|
78548
|
+
const baseMargin = {
|
|
78549
|
+
top: canvasDiameter * this.baseMarginPercentage,
|
|
78550
|
+
right: canvasDiameter * this.baseMarginPercentage,
|
|
78551
|
+
bottom: canvasDiameter * this.baseMarginPercentage,
|
|
78552
|
+
left: canvasDiameter * this.baseMarginPercentage
|
|
78553
|
+
};
|
|
78554
|
+
this._margin = this.calculateMarginAddition(baseMargin, canvasMargin);
|
|
78555
|
+
this._containerDimensions = this.calculateContainerDimensions(canvasDimensions, this.margin);
|
|
78556
|
+
this.inputDataUpdate();
|
|
78557
|
+
}
|
|
78558
|
+
inputDataUpdate() {
|
|
78559
|
+
if (this._containerDimensions === undefined) {
|
|
78560
|
+
this.componentResizeUpdate();
|
|
78561
|
+
return;
|
|
78562
|
+
}
|
|
78563
|
+
const containerDiameter = Math.min(this._containerDimensions.width, this._containerDimensions.height);
|
|
78564
|
+
const gridDimensions = this.gridDimensionsValidAndDefined()
|
|
78565
|
+
? this.calculateGridDimensionsFromBoundingBox()
|
|
78566
|
+
: this.calculateGridDimensionsFromDies();
|
|
78567
|
+
// this scale is used for positioning the dies on the canvas
|
|
78568
|
+
const originLocation = this.wafermap.originLocation;
|
|
78569
|
+
this._horizontalScale = this.createHorizontalScale(originLocation, gridDimensions, containerDiameter);
|
|
78570
|
+
// this scale is used for positioning the dies on the canvas
|
|
78571
|
+
this._verticalScale = this.createVerticalScale(originLocation, gridDimensions, containerDiameter);
|
|
78572
|
+
this._horizontalCoefficient = this._horizontalScale(1) - this._horizontalScale(0);
|
|
78573
|
+
this._verticalCoefficient = this._verticalScale(1) - this._verticalScale(0);
|
|
78574
|
+
this._horizontalConstant = this._horizontalScale(0);
|
|
78575
|
+
this._verticalConstant = this._verticalScale(0);
|
|
78576
|
+
this._dieDimensions = {
|
|
78577
|
+
width: Math.abs(this._horizontalScale(0) - this._horizontalScale(1)),
|
|
78578
|
+
height: Math.abs(this._verticalScale(0) - this._verticalScale(1))
|
|
78579
|
+
};
|
|
78580
|
+
this.colorAndTextUpdate();
|
|
78581
|
+
}
|
|
78582
|
+
colorAndTextUpdate() {
|
|
78583
|
+
if (this._dieDimensions === undefined) {
|
|
78584
|
+
this.inputDataUpdate();
|
|
78585
|
+
return;
|
|
78586
|
+
}
|
|
78587
|
+
this._labelsFontSize = this.calculateLabelsFontSize(this._dieDimensions, this.wafermap.maxCharacters);
|
|
78588
|
+
this._colorScale = this.calculateColorScale();
|
|
78589
|
+
}
|
|
78590
|
+
gridDimensionsValidAndDefined() {
|
|
78591
|
+
return (!this.wafermap.validity.invalidGridDimensions
|
|
78592
|
+
&& typeof this.wafermap.gridMinX === 'number'
|
|
78593
|
+
&& typeof this.wafermap.gridMinY === 'number'
|
|
78594
|
+
&& typeof this.wafermap.gridMaxX === 'number'
|
|
78595
|
+
&& typeof this.wafermap.gridMinX === 'number');
|
|
78596
|
+
}
|
|
78597
|
+
calculateGridDimensionsFromBoundingBox() {
|
|
78598
|
+
const gridDimensions = { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };
|
|
78599
|
+
if (typeof this.wafermap.gridMaxY === 'number'
|
|
78600
|
+
&& typeof this.wafermap.gridMinY === 'number'
|
|
78601
|
+
&& typeof this.wafermap.gridMaxX === 'number'
|
|
78602
|
+
&& typeof this.wafermap.gridMinX === 'number') {
|
|
78603
|
+
gridDimensions.origin.x = this.wafermap.gridMinX;
|
|
78604
|
+
gridDimensions.origin.y = this.wafermap.gridMinY;
|
|
78605
|
+
gridDimensions.rows = this.wafermap.gridMaxY - this.wafermap.gridMinY + 1;
|
|
78606
|
+
gridDimensions.cols = this.wafermap.gridMaxX - this.wafermap.gridMinX + 1;
|
|
78607
|
+
}
|
|
78608
|
+
return gridDimensions;
|
|
78609
|
+
}
|
|
78610
|
+
calculateGridDimensionsFromDies() {
|
|
78611
|
+
if (this.wafermap.diesTable === undefined) {
|
|
78612
|
+
return { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };
|
|
78613
|
+
}
|
|
78614
|
+
const colIndex = this.wafermap.diesTable
|
|
78615
|
+
.getChild('colIndex')
|
|
78616
|
+
.toArray();
|
|
78617
|
+
const rowIndex = this.wafermap.diesTable
|
|
78618
|
+
.getChild('rowIndex')
|
|
78619
|
+
.toArray();
|
|
78620
|
+
const minPoint = { x: colIndex[0], y: rowIndex[0] };
|
|
78621
|
+
const maxPoint = { x: colIndex[0], y: rowIndex[0] };
|
|
78622
|
+
// will replace iterating with arquero after fixing issues: https://github.com/uwdata/arquero/pull/346
|
|
78623
|
+
for (let i = 0; i < colIndex.length; i++) {
|
|
78624
|
+
if (colIndex[i] < minPoint.x) {
|
|
78625
|
+
minPoint.x = colIndex[i];
|
|
78626
|
+
}
|
|
78627
|
+
if (colIndex[i] > maxPoint.x) {
|
|
78628
|
+
maxPoint.x = colIndex[i];
|
|
78629
|
+
}
|
|
78630
|
+
if (rowIndex[i] < minPoint.y) {
|
|
78631
|
+
minPoint.y = rowIndex[i];
|
|
78632
|
+
}
|
|
78633
|
+
if (rowIndex[i] > maxPoint.y) {
|
|
78634
|
+
maxPoint.y = rowIndex[i];
|
|
78635
|
+
}
|
|
78636
|
+
}
|
|
78637
|
+
return {
|
|
78638
|
+
origin: minPoint,
|
|
78639
|
+
rows: maxPoint.y - minPoint.y + 1,
|
|
78640
|
+
cols: maxPoint.x - minPoint.x + 1
|
|
78641
|
+
};
|
|
78642
|
+
}
|
|
78643
|
+
calculateContainerDimensions(canvasDimensions, margin) {
|
|
78644
|
+
return {
|
|
78645
|
+
width: canvasDimensions.width - margin.left - margin.right,
|
|
78646
|
+
height: canvasDimensions.height - margin.top - margin.bottom
|
|
78647
|
+
};
|
|
78648
|
+
}
|
|
78649
|
+
createHorizontalScale(originLocation, grid, containerWidth) {
|
|
78650
|
+
const scale = linear();
|
|
78651
|
+
if (originLocation === WaferMapOriginLocation.bottomLeft
|
|
78652
|
+
|| originLocation === WaferMapOriginLocation.topLeft) {
|
|
78653
|
+
return scale
|
|
78654
|
+
.domain([grid.origin.x, grid.origin.x + grid.cols])
|
|
78655
|
+
.range([0, containerWidth]);
|
|
78656
|
+
}
|
|
78657
|
+
return scale
|
|
78658
|
+
.domain([grid.origin.x - 1, grid.origin.x + grid.cols - 1])
|
|
78659
|
+
.range([containerWidth, 0]);
|
|
78660
|
+
}
|
|
78661
|
+
createVerticalScale(originLocation, grid, containerHeight) {
|
|
78662
|
+
const scale = linear();
|
|
78663
|
+
// html canvas has top-left origin https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#the_grid
|
|
78664
|
+
// we need to flip the vertical scale
|
|
78665
|
+
if (originLocation === WaferMapOriginLocation.bottomLeft
|
|
78666
|
+
|| originLocation === WaferMapOriginLocation.bottomRight) {
|
|
78667
|
+
return scale
|
|
78668
|
+
.domain([grid.origin.y - 1, grid.origin.y + grid.rows - 1])
|
|
78669
|
+
.range([containerHeight, 0]);
|
|
78670
|
+
}
|
|
78671
|
+
return scale
|
|
78672
|
+
.domain([grid.origin.y, grid.origin.y + grid.rows])
|
|
78673
|
+
.range([0, containerHeight]);
|
|
78674
|
+
}
|
|
78675
|
+
calculateMarginAddition(baseMargin, addedMargin) {
|
|
78676
|
+
return {
|
|
78677
|
+
top: baseMargin.top + addedMargin.top,
|
|
78678
|
+
right: baseMargin.right + addedMargin.right,
|
|
78679
|
+
bottom: baseMargin.bottom + addedMargin.bottom,
|
|
78680
|
+
left: baseMargin.left + addedMargin.left
|
|
78681
|
+
};
|
|
78682
|
+
}
|
|
78683
|
+
calculateColorScale() {
|
|
78684
|
+
if (this.wafermap.colorScaleMode === WaferMapColorScaleMode.linear) {
|
|
78685
|
+
const values = this.wafermap.colorScale.values.map(item => +item);
|
|
78686
|
+
const d3ColorScale = linear()
|
|
78687
|
+
.domain(values)
|
|
78688
|
+
.range(this.wafermap.colorScale.colors);
|
|
78689
|
+
let min = values[0];
|
|
78690
|
+
let max = values[0];
|
|
78691
|
+
values.forEach(value => {
|
|
78692
|
+
if (value < min) {
|
|
78693
|
+
min = value;
|
|
78694
|
+
}
|
|
78695
|
+
if (value > max) {
|
|
78696
|
+
max = value;
|
|
78697
|
+
}
|
|
78698
|
+
});
|
|
78699
|
+
// the linear color scale will not be infinite but will be limited by the color scale resolution
|
|
78700
|
+
const valueSamples = ticks(min, max, values.length * this.colorScaleResolution);
|
|
78701
|
+
return valueSamples.map(value => {
|
|
78702
|
+
return {
|
|
78703
|
+
color: d3ColorScale(value),
|
|
78704
|
+
value
|
|
78705
|
+
};
|
|
78706
|
+
});
|
|
78707
|
+
}
|
|
78708
|
+
// ordinal color categories have to be sorted by value
|
|
78709
|
+
return this.wafermap.colorScale.colors
|
|
78710
|
+
.map((color, index) => {
|
|
78711
|
+
return {
|
|
78712
|
+
color,
|
|
78713
|
+
value: +this.wafermap.colorScale.values[index]
|
|
78714
|
+
};
|
|
78715
|
+
})
|
|
78716
|
+
.sort((a, b) => a.value - b.value);
|
|
78717
|
+
}
|
|
78718
|
+
calculateLabelsFontSize(dieDimensions, maxCharacters) {
|
|
78719
|
+
return Math.min(dieDimensions.height, (dieDimensions.width / (Math.max(2, maxCharacters) * 0.5))
|
|
78720
|
+
* this.fontSizeFactor);
|
|
78721
|
+
}
|
|
78722
|
+
}
|
|
78723
|
+
|
|
78769
78724
|
/**
|
|
78770
78725
|
* A nimble-styled WaferMap
|
|
78771
78726
|
*/
|
|
@@ -78787,8 +78742,8 @@ img.ProseMirror-separator {
|
|
|
78787
78742
|
this.dieLabelsHidden = false;
|
|
78788
78743
|
this.dieLabelsSuffix = '';
|
|
78789
78744
|
this.colorScaleMode = WaferMapColorScaleMode.linear;
|
|
78790
|
-
this.
|
|
78791
|
-
this.dataManager = new DataManager
|
|
78745
|
+
this.computations = new Computations(this.asRequiredFieldsWaferMap);
|
|
78746
|
+
this.dataManager = new DataManager(this.asRequiredFieldsWaferMap);
|
|
78792
78747
|
this.workerRenderer = new WorkerRenderer(this.asRequiredFieldsWaferMap);
|
|
78793
78748
|
this.renderer = new RenderingModule(this.asRequiredFieldsWaferMap);
|
|
78794
78749
|
/**
|
|
@@ -78857,24 +78812,22 @@ img.ProseMirror-separator {
|
|
|
78857
78812
|
return;
|
|
78858
78813
|
}
|
|
78859
78814
|
if (this.waferMapUpdateTracker.requiresEventsUpdate) {
|
|
78860
|
-
if (this.waferMapUpdateTracker.
|
|
78861
|
-
|
|
78862
|
-
this.experimentalDataManager.updateComputations();
|
|
78863
|
-
await this.workerRenderer.setupWafer();
|
|
78864
|
-
await this.workerRenderer.drawWafer();
|
|
78815
|
+
if (this.waferMapUpdateTracker.requiresComponentResizeUpdate) {
|
|
78816
|
+
this.computations.componentResizeUpdate();
|
|
78865
78817
|
}
|
|
78866
|
-
else if (this.waferMapUpdateTracker.
|
|
78867
|
-
|
|
78868
|
-
this.experimentalDataManager.updatePrerendering();
|
|
78869
|
-
await this.workerRenderer.drawWafer();
|
|
78818
|
+
else if (this.waferMapUpdateTracker.requiresInputDataUpdate) {
|
|
78819
|
+
this.computations.inputDataUpdate();
|
|
78870
78820
|
}
|
|
78871
|
-
else if (this.waferMapUpdateTracker.
|
|
78872
|
-
|
|
78821
|
+
else if (this.waferMapUpdateTracker.requiresColorAndTextUpdate) {
|
|
78822
|
+
this.computations.colorAndTextUpdate();
|
|
78873
78823
|
}
|
|
78824
|
+
const snapshot = this.createSnapshot();
|
|
78825
|
+
if (this.waferMapUpdateTracker.requiresWorkerWaferSetup) {
|
|
78826
|
+
await this.workerRenderer.setupWafer(snapshot);
|
|
78827
|
+
}
|
|
78828
|
+
await this.workerRenderer.drawWafer(snapshot);
|
|
78874
78829
|
}
|
|
78875
|
-
|
|
78876
|
-
this.workerRenderer.renderHover();
|
|
78877
|
-
}
|
|
78830
|
+
this.workerRenderer.renderHover();
|
|
78878
78831
|
}
|
|
78879
78832
|
/**
|
|
78880
78833
|
* @internal
|
|
@@ -78921,6 +78874,44 @@ img.ProseMirror-separator {
|
|
|
78921
78874
|
isExperimentalUpdate() {
|
|
78922
78875
|
return this.diesTable !== undefined;
|
|
78923
78876
|
}
|
|
78877
|
+
createSnapshot() {
|
|
78878
|
+
const canvasDimensions = {
|
|
78879
|
+
width: this.canvasWidth ?? 0,
|
|
78880
|
+
height: this.canvasHeight ?? 0
|
|
78881
|
+
};
|
|
78882
|
+
const renderConfig = {
|
|
78883
|
+
dieDimensions: this.computations.dieDimensions,
|
|
78884
|
+
margin: this.computations.margin,
|
|
78885
|
+
verticalCoefficient: this.computations.verticalCoefficient,
|
|
78886
|
+
horizontalCoefficient: this.computations.horizontalCoefficient,
|
|
78887
|
+
horizontalConstant: this.computations.horizontalConstant,
|
|
78888
|
+
verticalConstant: this.computations.verticalConstant,
|
|
78889
|
+
labelsFontSize: this.computations.labelsFontSize,
|
|
78890
|
+
colorScale: this.computations.colorScale
|
|
78891
|
+
};
|
|
78892
|
+
const dieDimensions = this.computations.dieDimensions;
|
|
78893
|
+
const transform = this.transform;
|
|
78894
|
+
if (this.diesTable === undefined) {
|
|
78895
|
+
return {
|
|
78896
|
+
canvasDimensions,
|
|
78897
|
+
renderConfig,
|
|
78898
|
+
dieDimensions,
|
|
78899
|
+
transform,
|
|
78900
|
+
columnIndices: Int32Array.from([]),
|
|
78901
|
+
rowIndices: Int32Array.from([])
|
|
78902
|
+
};
|
|
78903
|
+
}
|
|
78904
|
+
const columnIndices = this.diesTable.getChild('colIndex').toArray();
|
|
78905
|
+
const rowIndices = this.diesTable.getChild('rowIndex').toArray();
|
|
78906
|
+
return {
|
|
78907
|
+
canvasDimensions,
|
|
78908
|
+
renderConfig,
|
|
78909
|
+
columnIndices,
|
|
78910
|
+
rowIndices,
|
|
78911
|
+
dieDimensions,
|
|
78912
|
+
transform
|
|
78913
|
+
};
|
|
78914
|
+
}
|
|
78924
78915
|
validate() {
|
|
78925
78916
|
this.waferMapValidator.validateGridDimensions();
|
|
78926
78917
|
this.waferMapValidator.validateDiesTableSchema();
|