Skip to content

Commit

Permalink
add significant figures for color legend lable, fix count metric bug
Browse files Browse the repository at this point in the history
(cherry picked from commit ef3d18c)
  • Loading branch information
ghfan authored and guanghaofan committed Mar 29, 2019
1 parent d08bc9e commit ac58264
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
14 changes: 12 additions & 2 deletions public/wafer_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class WaferMap extends EventEmitter {
}

this._nextCol = 1;
this._significantFigures = 0;
}

setOptions(options, paramsOnly) {
Expand All @@ -160,6 +161,7 @@ class WaferMap extends EventEmitter {
this._defaultAxisOrientation = options.defaultAxisOrientation;
this._isCanvas = (options.chartType === 'Canvas' ? true : false);
this._isPlotly = (options.chartType === 'Plotly' ? true : false);
this._significantFigures = options.significantFigure;
}

setData(minZ, maxZ, x, y, data, row, series, colorCategory) {
Expand Down Expand Up @@ -351,6 +353,9 @@ class WaferMap extends EventEmitter {
let tableNo = 0;
let metricTitle = this._series ? this._words[tableNo].tables["0"].columns[2].title : this._words[tableNo].columns[2].title;
let metricField = this._series ? this._words[tableNo].tables["0"].columns[2].aggConfig._opts.params.field : this._words[tableNo].columns[2].aggConfig._opts.params.field;
if (metricField == null) {
metricField = '';
}
const xTitle = this._series ? this._words[tableNo].tables["0"].columns[0].title : this._words[tableNo].columns[0].title;
const yTitle = this._series ? this._words[tableNo].tables["0"].columns[1].title : this._words[tableNo].columns[1].title;
const xIsAsc = (this._defaultXAxisOri === 'asc' ? true : false);
Expand Down Expand Up @@ -461,6 +466,10 @@ class WaferMap extends EventEmitter {
var isHardBining = metricField.indexOf(this._defaultHBinName) === -1 ? false : true;
var isBinning = (isSoftBining || isHardBining);

if (isSoftBining && isHardBining) {
isSoftBining = false;
}

var defaultSBColors = this._defaultSBColors;
var defaultHBColors = this._defaultHBColors;

Expand Down Expand Up @@ -973,8 +982,9 @@ class WaferMap extends EventEmitter {

}
else {
const colorValue = dis * colorNo + this._minZ;
colors.push(num2e(colorNo === colorBucket ? this._maxZ : colorValue));
let colorValue = dis * colorNo + this._minZ;
colorValue = colorValue.toFixed(this._significantFigures);
colors.push(colorNo === colorBucket ? this._maxZ : colorValue);
}
colorNo++;
}
Expand Down
2 changes: 1 addition & 1 deletion public/wafer_map_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ VisTypesRegistryProvider.register(function (Private) {
collections: {
colorSchemas: ['Green-Red', 'Green-Blue', 'Green-Yellow' , 'Green-Orange', 'Yellow-Pink', 'LightGreen-SkyBlue', 'DarkGreen-Brown', 'Green-Red-Yellow',
'Green-Yellow-Blue', 'Green-Yellow-Red', 'Green-Yellow-Pink', 'Green-Red-Blue', 'Green-Pink-Yellow'],
colorScales: ['linear', 'ordinal', 'customzied binning'], chartTypes: ['SVG', 'Canvas', 'Plotly'],
colorScales: ['linear', 'ordinal', 'customzied binning'], chartTypes: ['SVG', 'Canvas', 'Plotly'], significantFigures: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '12', '14', '16'],

},
optionsTemplate: '<wafermap-vis-params></wafermap-vis-params>',
Expand Down
14 changes: 14 additions & 0 deletions public/wafer_map_vis_params.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@
></select>
</div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="significantFigure">
Significant Figures
</label>
<div class="kuiSideBarFormRow__control">
<select
id="significantFigure"
class="form-control"
ng-model="editorState.params.significantFigure"
ng-options="mode for mode in config.collections.significantFigures"
></select>
</div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="reverseColor">
Expand Down

0 comments on commit ac58264

Please sign in to comment.