Skip to content

Commit

Permalink
support to show the z value for plotly
Browse files Browse the repository at this point in the history
  • Loading branch information
guanghaofan committed Aug 20, 2019
1 parent d02bf7d commit 4230ce5
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion public/wafer_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,8 @@ class WaferMap extends EventEmitter {
var xId = this._xId;
var yId = this._yId;
var zId = this._zId;

var showLabel = this._showLabel;

while (tableNo !== tableCnt) {
let rowNo = Math.floor(tableNo / this._columnCnt);
Expand Down Expand Up @@ -660,6 +662,38 @@ class WaferMap extends EventEmitter {
reversescale: this._reverseColor
};
traces[traces.length] = data;

// add the annoated text
if (showLabel) {
for ( var i = 0; i < yValues.length; i++ ) {
for ( var j = 0; j < xValues.length; j++ ) {
var currentValue = plot_z[i][j];
if (currentValue != 0.0) {
var textColor = 'white';
}else{
var textColor = 'black';
}
var result = {
xref: xaxis,
yref: yaxis,
x: xValues[j],
y: yValues[i],
text: plot_z[i][j],
font: {
family: 'Arial',
size: 12,
color: 'rgb(50, 171, 196)'
},
showarrow: false,
font: {
color: textColor
}
};
layout.annotations.push(result);

}
}
}


}
Expand Down Expand Up @@ -701,7 +735,6 @@ class WaferMap extends EventEmitter {

var data = this._series ? this._words[tableNo].tables["0"].rows : this._words[tableNo].rows;

var showLabel = this._showLabel;
var nextCol = this._nextCol;
data.forEach(function(d) {

Expand Down

0 comments on commit 4230ce5

Please sign in to comment.