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
  • Loading branch information
ghfan authored and ghfan committed Mar 27, 2019
1 parent efd6f2c commit ef3d18c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
16 changes: 13 additions & 3 deletions public/wafer_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class WaferMap extends EventEmitter {

this._waferLot = '';

this._significantFigures = 0;

}

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

setData(minZ, maxZ, x, y, data, row, series, colorCategory, waferLot) {
Expand Down Expand Up @@ -330,6 +332,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;
Expand Down Expand Up @@ -441,6 +446,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 @@ -837,8 +846,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 Expand Up @@ -901,7 +911,7 @@ class WaferMap extends EventEmitter {
if (isOrdinal || isCustomziedBinning) {
return d[1];
}
return d;
return d;
})
.attr("class", "series-title")
.attr("x", this._element.offsetWidth - this._marginLeft - legendWidth - 12)
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 @@ -37,7 +37,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'],
colorScales: ['linear', 'ordinal', 'customzied binning'], chartTypes: ['SVG', 'Canvas'], 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 ef3d18c

Please sign in to comment.