@ni/nimble-components 18.5.3 → 18.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-components-bundle.js +298 -71
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +421 -365
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table/components/row/styles.js +0 -1
- package/dist/esm/table/components/row/styles.js.map +1 -1
- package/dist/esm/wafer-map/index.d.ts +25 -4
- package/dist/esm/wafer-map/index.js +45 -4
- package/dist/esm/wafer-map/index.js.map +1 -1
- package/dist/esm/wafer-map/modules/computations.d.ts +8 -7
- package/dist/esm/wafer-map/modules/computations.js +38 -37
- package/dist/esm/wafer-map/modules/computations.js.map +1 -1
- package/dist/esm/wafer-map/modules/data-manager.d.ts +8 -4
- package/dist/esm/wafer-map/modules/data-manager.js +10 -0
- package/dist/esm/wafer-map/modules/data-manager.js.map +1 -1
- package/dist/esm/wafer-map/modules/event-coordinator.d.ts +1 -1
- package/dist/esm/wafer-map/modules/event-coordinator.js +6 -12
- package/dist/esm/wafer-map/modules/event-coordinator.js.map +1 -1
- package/dist/esm/wafer-map/modules/hover-handler.d.ts +12 -0
- package/dist/esm/wafer-map/modules/hover-handler.js +56 -0
- package/dist/esm/wafer-map/modules/hover-handler.js.map +1 -0
- package/dist/esm/wafer-map/modules/prerendering.d.ts +2 -2
- package/dist/esm/wafer-map/modules/prerendering.js +4 -2
- package/dist/esm/wafer-map/modules/prerendering.js.map +1 -1
- package/dist/esm/wafer-map/modules/rendering.d.ts +2 -1
- package/dist/esm/wafer-map/modules/rendering.js +38 -15
- package/dist/esm/wafer-map/modules/rendering.js.map +1 -1
- package/dist/esm/wafer-map/styles.js +27 -0
- package/dist/esm/wafer-map/styles.js.map +1 -1
- package/dist/esm/wafer-map/template.js +8 -0
- package/dist/esm/wafer-map/template.js.map +1 -1
- package/dist/esm/wafer-map/types.d.ts +9 -0
- package/dist/esm/wafer-map/types.js +4 -0
- package/dist/esm/wafer-map/types.js.map +1 -1
- package/package.json +13 -7
|
@@ -27121,7 +27121,6 @@
|
|
|
27121
27121
|
--ni-private-table-cell-action-menu-display: block;
|
|
27122
27122
|
}
|
|
27123
27123
|
|
|
27124
|
-
:host(.hover) nimble-table-cell,
|
|
27125
27124
|
:host(:hover) nimble-table-cell {
|
|
27126
27125
|
--ni-private-table-cell-action-menu-display: block;
|
|
27127
27126
|
}
|
|
@@ -32901,6 +32900,14 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
32901
32900
|
</g>
|
|
32902
32901
|
</svg>
|
|
32903
32902
|
<canvas class="wafer-map-canvas" ${ref('canvas')}></canvas>
|
|
32903
|
+
<svg class="hover-layer">
|
|
32904
|
+
<rect
|
|
32905
|
+
class="hover-rect ${x => x.hoverOpacity}"
|
|
32906
|
+
transform="${x => x.hoverTransform}"
|
|
32907
|
+
width="${x => x.hoverWidth}"
|
|
32908
|
+
height="${x => x.hoverHeight}"
|
|
32909
|
+
/>
|
|
32910
|
+
</svg>
|
|
32904
32911
|
</div>
|
|
32905
32912
|
`;
|
|
32906
32913
|
|
|
@@ -32961,6 +32968,32 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
32961
32968
|
display: inline-block;
|
|
32962
32969
|
position: absolute;
|
|
32963
32970
|
}
|
|
32971
|
+
|
|
32972
|
+
.hover-layer {
|
|
32973
|
+
position: absolute;
|
|
32974
|
+
pointer-events: none;
|
|
32975
|
+
width: 100%;
|
|
32976
|
+
height: 100%;
|
|
32977
|
+
}
|
|
32978
|
+
|
|
32979
|
+
.hover-rect {
|
|
32980
|
+
fill: transparent;
|
|
32981
|
+
stroke: white;
|
|
32982
|
+
outline-style: solid;
|
|
32983
|
+
outline-color: ${DigitalGreenLight};
|
|
32984
|
+
}
|
|
32985
|
+
|
|
32986
|
+
.hover-rect.show {
|
|
32987
|
+
opacity: 1;
|
|
32988
|
+
stroke-width: 2px;
|
|
32989
|
+
outline-width: 2px;
|
|
32990
|
+
}
|
|
32991
|
+
|
|
32992
|
+
.hover-rect.hide {
|
|
32993
|
+
opacity: 0;
|
|
32994
|
+
stroke-width: 0px;
|
|
32995
|
+
outline-width: 0px;
|
|
32996
|
+
}
|
|
32964
32997
|
`;
|
|
32965
32998
|
|
|
32966
32999
|
function ascending(a, b) {
|
|
@@ -33139,6 +33172,18 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
33139
33172
|
return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
|
|
33140
33173
|
}
|
|
33141
33174
|
|
|
33175
|
+
function quantileSorted(values, p, valueof = number$1) {
|
|
33176
|
+
if (!(n = values.length) || isNaN(p = +p)) return;
|
|
33177
|
+
if (p <= 0 || n < 2) return +valueof(values[0], 0, values);
|
|
33178
|
+
if (p >= 1) return +valueof(values[n - 1], n - 1, values);
|
|
33179
|
+
var n,
|
|
33180
|
+
i = (n - 1) * p,
|
|
33181
|
+
i0 = Math.floor(i),
|
|
33182
|
+
value0 = +valueof(values[i0], i0, values),
|
|
33183
|
+
value1 = +valueof(values[i0 + 1], i0 + 1, values);
|
|
33184
|
+
return value0 + (value1 - value0) * (i - i0);
|
|
33185
|
+
}
|
|
33186
|
+
|
|
33142
33187
|
function range(start, stop, step) {
|
|
33143
33188
|
start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
|
|
33144
33189
|
|
|
@@ -33837,6 +33882,61 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
33837
33882
|
return linearish(scale);
|
|
33838
33883
|
}
|
|
33839
33884
|
|
|
33885
|
+
function quantile() {
|
|
33886
|
+
var domain = [],
|
|
33887
|
+
range = [],
|
|
33888
|
+
thresholds = [],
|
|
33889
|
+
unknown;
|
|
33890
|
+
|
|
33891
|
+
function rescale() {
|
|
33892
|
+
var i = 0, n = Math.max(1, range.length);
|
|
33893
|
+
thresholds = new Array(n - 1);
|
|
33894
|
+
while (++i < n) thresholds[i - 1] = quantileSorted(domain, i / n);
|
|
33895
|
+
return scale;
|
|
33896
|
+
}
|
|
33897
|
+
|
|
33898
|
+
function scale(x) {
|
|
33899
|
+
return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];
|
|
33900
|
+
}
|
|
33901
|
+
|
|
33902
|
+
scale.invertExtent = function(y) {
|
|
33903
|
+
var i = range.indexOf(y);
|
|
33904
|
+
return i < 0 ? [NaN, NaN] : [
|
|
33905
|
+
i > 0 ? thresholds[i - 1] : domain[0],
|
|
33906
|
+
i < thresholds.length ? thresholds[i] : domain[domain.length - 1]
|
|
33907
|
+
];
|
|
33908
|
+
};
|
|
33909
|
+
|
|
33910
|
+
scale.domain = function(_) {
|
|
33911
|
+
if (!arguments.length) return domain.slice();
|
|
33912
|
+
domain = [];
|
|
33913
|
+
for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);
|
|
33914
|
+
domain.sort(ascending);
|
|
33915
|
+
return rescale();
|
|
33916
|
+
};
|
|
33917
|
+
|
|
33918
|
+
scale.range = function(_) {
|
|
33919
|
+
return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
|
|
33920
|
+
};
|
|
33921
|
+
|
|
33922
|
+
scale.unknown = function(_) {
|
|
33923
|
+
return arguments.length ? (unknown = _, scale) : unknown;
|
|
33924
|
+
};
|
|
33925
|
+
|
|
33926
|
+
scale.quantiles = function() {
|
|
33927
|
+
return thresholds.slice();
|
|
33928
|
+
};
|
|
33929
|
+
|
|
33930
|
+
scale.copy = function() {
|
|
33931
|
+
return quantile()
|
|
33932
|
+
.domain(domain)
|
|
33933
|
+
.range(range)
|
|
33934
|
+
.unknown(unknown);
|
|
33935
|
+
};
|
|
33936
|
+
|
|
33937
|
+
return initRange.apply(scale, arguments);
|
|
33938
|
+
}
|
|
33939
|
+
|
|
33840
33940
|
const WaferMapQuadrant = {
|
|
33841
33941
|
bottomLeft: 'bottom-left',
|
|
33842
33942
|
bottomRight: 'bottom-right',
|
|
@@ -33849,6 +33949,10 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
33849
33949
|
left: 'left',
|
|
33850
33950
|
right: 'right'
|
|
33851
33951
|
};
|
|
33952
|
+
const HoverDieOpacity = {
|
|
33953
|
+
show: 'show',
|
|
33954
|
+
hide: 'hide'
|
|
33955
|
+
};
|
|
33852
33956
|
const WaferMapColorScaleMode = {
|
|
33853
33957
|
linear: 'linear',
|
|
33854
33958
|
ordinal: 'ordinal'
|
|
@@ -33859,13 +33963,7 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
33859
33963
|
*/
|
|
33860
33964
|
class Computations {
|
|
33861
33965
|
constructor(wafermap) {
|
|
33862
|
-
this.
|
|
33863
|
-
top: 0,
|
|
33864
|
-
right: 0,
|
|
33865
|
-
bottom: 0,
|
|
33866
|
-
left: 0
|
|
33867
|
-
};
|
|
33868
|
-
this.defaultAlign = 0.5;
|
|
33966
|
+
this.defaultPadding = 0;
|
|
33869
33967
|
this.baseMarginPercentage = 0.04;
|
|
33870
33968
|
const canvasDimensions = {
|
|
33871
33969
|
width: wafermap.canvasWidth,
|
|
@@ -33890,11 +33988,13 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
33890
33988
|
const containerDiameter = Math.min(this.containerDimensions.width, this.containerDimensions.height);
|
|
33891
33989
|
// this scale is used for positioning the dies on the canvas
|
|
33892
33990
|
this.horizontalScale = this.createHorizontalScale(wafermap.quadrant, gridDimensions, containerDiameter);
|
|
33991
|
+
this.invertedHorizontalScale = this.createInvertedHorizontalScale(wafermap.quadrant, gridDimensions, containerDiameter);
|
|
33893
33992
|
// this scale is used for positioning the dies on the canvas
|
|
33894
33993
|
this.verticalScale = this.createVerticalScale(wafermap.quadrant, gridDimensions, containerDiameter);
|
|
33994
|
+
this.invertedVerticalScale = this.createInvertedVerticalScale(wafermap.quadrant, gridDimensions, containerDiameter);
|
|
33895
33995
|
this.dieDimensions = {
|
|
33896
|
-
width: this.
|
|
33897
|
-
height: this.
|
|
33996
|
+
width: this.horizontalScale.bandwidth(),
|
|
33997
|
+
height: this.verticalScale.bandwidth()
|
|
33898
33998
|
};
|
|
33899
33999
|
this.radius = containerDiameter / 2;
|
|
33900
34000
|
}
|
|
@@ -33931,42 +34031,46 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
33931
34031
|
};
|
|
33932
34032
|
}
|
|
33933
34033
|
createHorizontalScale(axisLocation, grid, containerWidth) {
|
|
34034
|
+
const scale = band()
|
|
34035
|
+
.domain(range(grid.origin.x, grid.origin.x + grid.cols))
|
|
34036
|
+
.paddingInner(0)
|
|
34037
|
+
.paddingOuter(0)
|
|
34038
|
+
.align(0)
|
|
34039
|
+
.round(false);
|
|
33934
34040
|
if (axisLocation === WaferMapQuadrant.bottomLeft
|
|
33935
34041
|
|| axisLocation === WaferMapQuadrant.topLeft) {
|
|
33936
|
-
return
|
|
33937
|
-
|
|
33938
|
-
|
|
34042
|
+
return scale.range([0, containerWidth]);
|
|
34043
|
+
}
|
|
34044
|
+
return scale.range([containerWidth, 0]);
|
|
34045
|
+
}
|
|
34046
|
+
createInvertedHorizontalScale(axisLocation, grid, containerWidth) {
|
|
34047
|
+
const scale = quantile().domain([0, containerWidth]);
|
|
34048
|
+
if (axisLocation === WaferMapQuadrant.bottomLeft
|
|
34049
|
+
|| axisLocation === WaferMapQuadrant.topLeft) {
|
|
34050
|
+
return scale.range(range(grid.origin.x, grid.origin.x + grid.cols));
|
|
33939
34051
|
}
|
|
33940
|
-
return
|
|
33941
|
-
.domain([grid.origin.x - 1, grid.origin.x + grid.cols - 1])
|
|
33942
|
-
.range([containerWidth, 0]);
|
|
34052
|
+
return scale.range(range(grid.origin.x, grid.origin.x + grid.cols).reverse());
|
|
33943
34053
|
}
|
|
33944
34054
|
createVerticalScale(axisLocation, grid, containerHeight) {
|
|
34055
|
+
const scale = band()
|
|
34056
|
+
.domain(range(grid.origin.y, grid.origin.y + grid.rows))
|
|
34057
|
+
.paddingInner(this.defaultPadding)
|
|
34058
|
+
.paddingOuter(0)
|
|
34059
|
+
.align(0)
|
|
34060
|
+
.round(false);
|
|
33945
34061
|
if (axisLocation === WaferMapQuadrant.bottomLeft
|
|
33946
34062
|
|| axisLocation === WaferMapQuadrant.bottomRight) {
|
|
33947
|
-
return
|
|
33948
|
-
|
|
33949
|
-
|
|
33950
|
-
|
|
33951
|
-
|
|
33952
|
-
|
|
33953
|
-
|
|
33954
|
-
|
|
33955
|
-
|
|
33956
|
-
|
|
33957
|
-
|
|
33958
|
-
.padding(0)
|
|
33959
|
-
.domain(this.horizontalScale.ticks(cols))
|
|
33960
|
-
.range([0, containerWidth])
|
|
33961
|
-
.bandwidth();
|
|
33962
|
-
}
|
|
33963
|
-
calculateGridHeight(rows, containerHeight) {
|
|
33964
|
-
return band()
|
|
33965
|
-
.align(this.defaultAlign)
|
|
33966
|
-
.padding(0)
|
|
33967
|
-
.domain(this.verticalScale.ticks(rows))
|
|
33968
|
-
.range([0, containerHeight])
|
|
33969
|
-
.bandwidth();
|
|
34063
|
+
return scale.range([containerHeight, 0]);
|
|
34064
|
+
}
|
|
34065
|
+
return scale.range([0, containerHeight]);
|
|
34066
|
+
}
|
|
34067
|
+
createInvertedVerticalScale(axisLocation, grid, containerHeight) {
|
|
34068
|
+
const scale = quantile().domain([0, containerHeight]);
|
|
34069
|
+
if (axisLocation === WaferMapQuadrant.bottomLeft
|
|
34070
|
+
|| axisLocation === WaferMapQuadrant.bottomRight) {
|
|
34071
|
+
return scale.range(range(grid.origin.y, grid.origin.y + grid.rows).reverse());
|
|
34072
|
+
}
|
|
34073
|
+
return scale.range(range(grid.origin.y, grid.origin.y + grid.rows));
|
|
33970
34074
|
}
|
|
33971
34075
|
calculateMarginAddition(baseMargin, addedMargin) {
|
|
33972
34076
|
return {
|
|
@@ -33991,9 +34095,11 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
33991
34095
|
this.labelsFontSize = this.calculateLabelsFontSize(dieDimensions, wafermap.maxCharacters);
|
|
33992
34096
|
this.diesRenderInfo = [];
|
|
33993
34097
|
for (const die of wafermap.dies) {
|
|
34098
|
+
const scaledX = horizontalScale(die.x) ?? 0;
|
|
34099
|
+
const scaledY = verticalScale(die.y) ?? 0;
|
|
33994
34100
|
this.diesRenderInfo.push({
|
|
33995
|
-
x:
|
|
33996
|
-
y:
|
|
34101
|
+
x: scaledX + margin.right,
|
|
34102
|
+
y: scaledY + margin.top,
|
|
33997
34103
|
fillStyle: this.calculateFillStyle(die.value, wafermap.colorScaleMode, wafermap.highlightedValues),
|
|
33998
34104
|
text: this.buildLabel(die.value, wafermap.maxCharacters, wafermap.dieLabelsHidden, wafermap.dieLabelsSuffix)
|
|
33999
34105
|
});
|
|
@@ -34070,6 +34176,7 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34070
34176
|
constructor(wafermap) {
|
|
34071
34177
|
this.computations = new Computations(wafermap);
|
|
34072
34178
|
this.prerendering = new Prerendering(wafermap, this.horizontalScale, this.verticalScale, this.dieDimensions, this.margin);
|
|
34179
|
+
this.dataMap = new Map(wafermap.dies.map(die => [`${die.x}_${die.y}`, die]));
|
|
34073
34180
|
}
|
|
34074
34181
|
get containerDimensions() {
|
|
34075
34182
|
return this.computations.containerDimensions;
|
|
@@ -34086,15 +34193,24 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34086
34193
|
get horizontalScale() {
|
|
34087
34194
|
return this.computations.horizontalScale;
|
|
34088
34195
|
}
|
|
34196
|
+
get invertedHorizontalScale() {
|
|
34197
|
+
return this.computations.invertedHorizontalScale;
|
|
34198
|
+
}
|
|
34089
34199
|
get verticalScale() {
|
|
34090
34200
|
return this.computations.verticalScale;
|
|
34091
34201
|
}
|
|
34202
|
+
get invertedVerticalScale() {
|
|
34203
|
+
return this.computations.invertedVerticalScale;
|
|
34204
|
+
}
|
|
34092
34205
|
get labelsFontSize() {
|
|
34093
34206
|
return this.prerendering.labelsFontSize;
|
|
34094
34207
|
}
|
|
34095
34208
|
get diesRenderInfo() {
|
|
34096
34209
|
return this.prerendering.diesRenderInfo;
|
|
34097
34210
|
}
|
|
34211
|
+
getWaferMapDie(point) {
|
|
34212
|
+
return this.dataMap.get(`${point.x}_${point.y}`);
|
|
34213
|
+
}
|
|
34098
34214
|
}
|
|
34099
34215
|
|
|
34100
34216
|
/**
|
|
@@ -34103,18 +34219,40 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34103
34219
|
class RenderingModule {
|
|
34104
34220
|
constructor(wafermap) {
|
|
34105
34221
|
this.wafermap = wafermap;
|
|
34106
|
-
this.context = wafermap.canvas.getContext('2d');
|
|
34107
34222
|
this.dies = wafermap.dataManager.diesRenderInfo;
|
|
34108
34223
|
this.dimensions = wafermap.dataManager.dieDimensions;
|
|
34109
34224
|
this.labelFontSize = wafermap.dataManager.labelsFontSize;
|
|
34110
34225
|
}
|
|
34111
34226
|
drawWafer() {
|
|
34112
|
-
this.
|
|
34227
|
+
this.wafermap.canvasContext.save();
|
|
34113
34228
|
this.clearCanvas();
|
|
34114
34229
|
this.scaleCanvas();
|
|
34115
34230
|
this.renderDies();
|
|
34116
34231
|
this.renderText();
|
|
34117
|
-
this.
|
|
34232
|
+
this.wafermap.canvasContext.restore();
|
|
34233
|
+
this.renderHover();
|
|
34234
|
+
}
|
|
34235
|
+
renderHover() {
|
|
34236
|
+
this.wafermap.hoverWidth = this.wafermap.dataManager.dieDimensions.width
|
|
34237
|
+
* this.wafermap.transform.k;
|
|
34238
|
+
this.wafermap.hoverHeight = this.wafermap.dataManager.dieDimensions.height
|
|
34239
|
+
* this.wafermap.transform.k;
|
|
34240
|
+
this.wafermap.hoverOpacity = this.wafermap.hoverDie === undefined
|
|
34241
|
+
? HoverDieOpacity.hide
|
|
34242
|
+
: HoverDieOpacity.show;
|
|
34243
|
+
this.wafermap.hoverTransform = this.calculateHoverTransform();
|
|
34244
|
+
}
|
|
34245
|
+
calculateHoverTransform() {
|
|
34246
|
+
if (this.wafermap.hoverDie !== undefined) {
|
|
34247
|
+
const scaledX = this.wafermap.dataManager.horizontalScale(this.wafermap.hoverDie.x);
|
|
34248
|
+
const scaledY = this.wafermap.dataManager.verticalScale(this.wafermap.hoverDie.y);
|
|
34249
|
+
const transformedPoint = this.wafermap.transform.apply([
|
|
34250
|
+
scaledX + this.wafermap.dataManager.margin.left,
|
|
34251
|
+
scaledY + this.wafermap.dataManager.margin.top
|
|
34252
|
+
]);
|
|
34253
|
+
return `translate(${transformedPoint[0]}, ${transformedPoint[1]})`;
|
|
34254
|
+
}
|
|
34255
|
+
return '';
|
|
34118
34256
|
}
|
|
34119
34257
|
renderDies() {
|
|
34120
34258
|
this.dies.sort((a, b) => {
|
|
@@ -34129,12 +34267,12 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34129
34267
|
let prev;
|
|
34130
34268
|
for (const die of this.dies) {
|
|
34131
34269
|
if (!prev) {
|
|
34132
|
-
this.
|
|
34270
|
+
this.wafermap.canvasContext.fillStyle = die.fillStyle;
|
|
34133
34271
|
}
|
|
34134
34272
|
if (prev && die.fillStyle !== prev.fillStyle && die.fillStyle) {
|
|
34135
|
-
this.
|
|
34273
|
+
this.wafermap.canvasContext.fillStyle = die.fillStyle;
|
|
34136
34274
|
}
|
|
34137
|
-
this.
|
|
34275
|
+
this.wafermap.canvasContext.fillRect(die.x, die.y, this.dimensions.width, this.dimensions.height);
|
|
34138
34276
|
prev = die;
|
|
34139
34277
|
}
|
|
34140
34278
|
}
|
|
@@ -34143,25 +34281,25 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34143
34281
|
* this.dimensions.height
|
|
34144
34282
|
* (this.wafermap.transform.k || 1);
|
|
34145
34283
|
const fontsize = this.labelFontSize;
|
|
34146
|
-
this.
|
|
34147
|
-
this.
|
|
34148
|
-
this.
|
|
34149
|
-
this.
|
|
34150
|
-
const approxTextHeight = this.
|
|
34284
|
+
this.wafermap.canvasContext.font = `${fontsize.toString()}px sans-serif`;
|
|
34285
|
+
this.wafermap.canvasContext.fillStyle = '#ffffff';
|
|
34286
|
+
this.wafermap.canvasContext.textAlign = 'center';
|
|
34287
|
+
this.wafermap.canvasContext.lineCap = 'butt';
|
|
34288
|
+
const approxTextHeight = this.wafermap.canvasContext.measureText('M');
|
|
34151
34289
|
if (dieSize >= 50) {
|
|
34152
34290
|
for (const die of this.dies) {
|
|
34153
|
-
this.
|
|
34291
|
+
this.wafermap.canvasContext.fillText(die.text, die.x + this.dimensions.width / 2, die.y
|
|
34154
34292
|
+ this.dimensions.height / 2
|
|
34155
34293
|
+ approxTextHeight.width / 2, this.dimensions.width - (this.dimensions.width / 100) * 20);
|
|
34156
34294
|
}
|
|
34157
34295
|
}
|
|
34158
34296
|
}
|
|
34159
34297
|
clearCanvas() {
|
|
34160
|
-
this.
|
|
34298
|
+
this.wafermap.canvasContext.clearRect(0, 0, this.wafermap.canvasWidth * this.wafermap.transform.k, this.wafermap.canvasHeight * this.wafermap.transform.k);
|
|
34161
34299
|
}
|
|
34162
34300
|
scaleCanvas() {
|
|
34163
|
-
this.
|
|
34164
|
-
this.
|
|
34301
|
+
this.wafermap.canvasContext.translate(this.wafermap.transform.x, this.wafermap.transform.y);
|
|
34302
|
+
this.wafermap.canvasContext.scale(this.wafermap.transform.k, this.wafermap.transform.k);
|
|
34165
34303
|
}
|
|
34166
34304
|
}
|
|
34167
34305
|
|
|
@@ -34220,6 +34358,61 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34220
34358
|
}
|
|
34221
34359
|
}
|
|
34222
34360
|
|
|
34361
|
+
/**
|
|
34362
|
+
* HoverHandler deals with user interactions and events like hovering
|
|
34363
|
+
*/
|
|
34364
|
+
class HoverHandler {
|
|
34365
|
+
constructor(wafermap) {
|
|
34366
|
+
this.wafermap = wafermap;
|
|
34367
|
+
}
|
|
34368
|
+
mousemove(event) {
|
|
34369
|
+
const mousePosition = {
|
|
34370
|
+
x: event.offsetX,
|
|
34371
|
+
y: event.offsetY
|
|
34372
|
+
};
|
|
34373
|
+
if (!this.hoversOverDie(mousePosition)) {
|
|
34374
|
+
this.wafermap.hoverDie = undefined;
|
|
34375
|
+
return;
|
|
34376
|
+
}
|
|
34377
|
+
// get original mouse position in case we are in zoom.
|
|
34378
|
+
const invertedPoint = this.wafermap.transform.invert([
|
|
34379
|
+
mousePosition.x,
|
|
34380
|
+
mousePosition.y
|
|
34381
|
+
]);
|
|
34382
|
+
const dieCoordinates = this.calculateDieCoordinates({
|
|
34383
|
+
x: invertedPoint[0],
|
|
34384
|
+
y: invertedPoint[1]
|
|
34385
|
+
});
|
|
34386
|
+
this.wafermap.hoverDie = this.wafermap.dataManager.getWaferMapDie(dieCoordinates);
|
|
34387
|
+
}
|
|
34388
|
+
mouseout(_event) {
|
|
34389
|
+
this.wafermap.hoverDie = undefined;
|
|
34390
|
+
}
|
|
34391
|
+
calculateDieCoordinates(mousePosition) {
|
|
34392
|
+
const axisLocation = this.wafermap.quadrant;
|
|
34393
|
+
const xRoundFunction = axisLocation === WaferMapQuadrant.bottomLeft
|
|
34394
|
+
|| axisLocation === WaferMapQuadrant.topLeft
|
|
34395
|
+
? Math.floor
|
|
34396
|
+
: Math.ceil;
|
|
34397
|
+
const yRoundFunction = axisLocation === WaferMapQuadrant.topLeft
|
|
34398
|
+
|| axisLocation === WaferMapQuadrant.topRight
|
|
34399
|
+
? Math.floor
|
|
34400
|
+
: Math.ceil;
|
|
34401
|
+
// go to x and y scale to get the x,y values of the die.
|
|
34402
|
+
const x = xRoundFunction(this.wafermap.dataManager.invertedHorizontalScale(mousePosition.x - this.wafermap.dataManager.margin.left));
|
|
34403
|
+
const y = yRoundFunction(this.wafermap.dataManager.invertedVerticalScale(mousePosition.y - this.wafermap.dataManager.margin.top));
|
|
34404
|
+
return { x, y };
|
|
34405
|
+
}
|
|
34406
|
+
hoversOverDie(mousePosition) {
|
|
34407
|
+
const rgba = this.wafermap.canvasContext.getImageData(mousePosition.x, mousePosition.y, 1, 1).data;
|
|
34408
|
+
let rgbaSum = 0;
|
|
34409
|
+
for (const color of rgba) {
|
|
34410
|
+
rgbaSum += color;
|
|
34411
|
+
}
|
|
34412
|
+
return rgbaSum > 0;
|
|
34413
|
+
}
|
|
34414
|
+
}
|
|
34415
|
+
|
|
34223
34416
|
/**
|
|
34224
34417
|
* EventCoordinator deals with user interactions and events
|
|
34225
34418
|
*/
|
|
@@ -34229,21 +34422,16 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34229
34422
|
this.onWheelMove = (event) => {
|
|
34230
34423
|
event.preventDefault();
|
|
34231
34424
|
};
|
|
34232
|
-
this.onMouseMove = () => {
|
|
34233
|
-
|
|
34425
|
+
this.onMouseMove = (event) => {
|
|
34426
|
+
this.hoverHandler.mousemove(event);
|
|
34234
34427
|
};
|
|
34235
|
-
this.onMouseOut = () => {
|
|
34236
|
-
|
|
34428
|
+
this.onMouseOut = (event) => {
|
|
34429
|
+
this.hoverHandler.mouseout(event);
|
|
34237
34430
|
};
|
|
34238
34431
|
this.zoomHandler = new ZoomHandler(wafermap);
|
|
34239
|
-
|
|
34240
|
-
// TODO HoverHandler - create a hoverDie element
|
|
34432
|
+
this.hoverHandler = new HoverHandler(wafermap);
|
|
34241
34433
|
this.attachEvents();
|
|
34242
34434
|
}
|
|
34243
|
-
get selectedDie() {
|
|
34244
|
-
// TODO HoverHandler - return the last selected die when called
|
|
34245
|
-
return undefined;
|
|
34246
|
-
}
|
|
34247
34435
|
detachEvents() {
|
|
34248
34436
|
this.wafermap.removeEventListener('mousemove', this.onMouseMove);
|
|
34249
34437
|
this.wafermap.removeEventListener('mouseout', this.onMouseOut);
|
|
@@ -34255,8 +34443,6 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34255
34443
|
this.wafermap.canvas.addEventListener('wheel', this.onWheelMove, {
|
|
34256
34444
|
passive: false
|
|
34257
34445
|
});
|
|
34258
|
-
// Wafermap callbacks
|
|
34259
|
-
// TODO HoverHandler - configure the callback to be fired from HoverHandler when a new die is selected
|
|
34260
34446
|
}
|
|
34261
34447
|
}
|
|
34262
34448
|
|
|
@@ -34280,18 +34466,34 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34280
34466
|
* @internal
|
|
34281
34467
|
*/
|
|
34282
34468
|
this.transform = identity$2;
|
|
34469
|
+
/**
|
|
34470
|
+
* @internal
|
|
34471
|
+
*/
|
|
34472
|
+
this.hoverTransform = '';
|
|
34473
|
+
/**
|
|
34474
|
+
* @internal
|
|
34475
|
+
*/
|
|
34476
|
+
this.hoverOpacity = HoverDieOpacity.hide;
|
|
34477
|
+
/**
|
|
34478
|
+
* @internal
|
|
34479
|
+
*/
|
|
34480
|
+
this.hoverWidth = 0;
|
|
34481
|
+
/**
|
|
34482
|
+
* @internal
|
|
34483
|
+
*/
|
|
34484
|
+
this.hoverHeight = 0;
|
|
34283
34485
|
this.highlightedValues = [];
|
|
34284
34486
|
this.dies = [];
|
|
34285
34487
|
this.colorScale = {
|
|
34286
34488
|
colors: [],
|
|
34287
34489
|
values: []
|
|
34288
34490
|
};
|
|
34289
|
-
this.emitDieSelected = (die) => {
|
|
34290
|
-
this.$emit('die-selected', { detail: { die } });
|
|
34291
|
-
};
|
|
34292
34491
|
}
|
|
34293
34492
|
connectedCallback() {
|
|
34294
34493
|
super.connectedCallback();
|
|
34494
|
+
this.canvasContext = this.canvas.getContext('2d', {
|
|
34495
|
+
willReadFrequently: true
|
|
34496
|
+
});
|
|
34295
34497
|
this.resizeObserver = this.createResizeObserver();
|
|
34296
34498
|
}
|
|
34297
34499
|
disconnectedCallback() {
|
|
@@ -34315,6 +34517,12 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34315
34517
|
DOM.queueUpdate(() => this.render());
|
|
34316
34518
|
}
|
|
34317
34519
|
}
|
|
34520
|
+
queueRenderHover() {
|
|
34521
|
+
if (!this.$fastController.isConnected) {
|
|
34522
|
+
return;
|
|
34523
|
+
}
|
|
34524
|
+
DOM.queueUpdate(() => this.renderer?.renderHover());
|
|
34525
|
+
}
|
|
34318
34526
|
initializeInternalModules() {
|
|
34319
34527
|
this.eventCoordinator?.detachEvents();
|
|
34320
34528
|
this.dataManager = new DataManager(this);
|
|
@@ -34374,6 +34582,10 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34374
34582
|
canvasHeightChanged() {
|
|
34375
34583
|
this.queueRender();
|
|
34376
34584
|
}
|
|
34585
|
+
hoverDieChanged() {
|
|
34586
|
+
this.$emit('die-hover', { currentDie: this.hoverDie });
|
|
34587
|
+
this.queueRenderHover();
|
|
34588
|
+
}
|
|
34377
34589
|
}
|
|
34378
34590
|
__decorate$1([
|
|
34379
34591
|
attr
|
|
@@ -34412,6 +34624,21 @@ Instead styling against the role which is more general and likely a better appro
|
|
|
34412
34624
|
__decorate$1([
|
|
34413
34625
|
observable
|
|
34414
34626
|
], WaferMap.prototype, "transform", void 0);
|
|
34627
|
+
__decorate$1([
|
|
34628
|
+
observable
|
|
34629
|
+
], WaferMap.prototype, "hoverTransform", void 0);
|
|
34630
|
+
__decorate$1([
|
|
34631
|
+
observable
|
|
34632
|
+
], WaferMap.prototype, "hoverOpacity", void 0);
|
|
34633
|
+
__decorate$1([
|
|
34634
|
+
observable
|
|
34635
|
+
], WaferMap.prototype, "hoverWidth", void 0);
|
|
34636
|
+
__decorate$1([
|
|
34637
|
+
observable
|
|
34638
|
+
], WaferMap.prototype, "hoverHeight", void 0);
|
|
34639
|
+
__decorate$1([
|
|
34640
|
+
observable
|
|
34641
|
+
], WaferMap.prototype, "hoverDie", void 0);
|
|
34415
34642
|
__decorate$1([
|
|
34416
34643
|
observable
|
|
34417
34644
|
], WaferMap.prototype, "highlightedValues", void 0);
|