Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WaferDie interface/type update #968

Merged
merged 9 commits into from
Jan 20, 2023
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Updated the WaferDie Interface to add an extra \"tooltip\" field",
"packageName": "@ni/nimble-components",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Computations } from '../modules/computations';
import { Margin, WaferMapQuadrant } from '../types';
import { getWaferMapDies } from './utilities';

describe('Computations module', () => {
describe('Wafermap Computations module', () => {
let computationsModule: Computations;

describe('with 100 square canvas', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ const generateStringValue = (
return valueToString(value);
};

export const generateDieContent = (
x: number,
y: number,
value: string
): WaferMapDie => {
return {
x,
y,
value,
metadata: `Placeholder metadata value for Die x: ${x} y: ${y}`
};
};

export const generateWaferData = (
numDies: number,
valueGenerator?: IValueGenerator
Expand All @@ -43,7 +56,7 @@ export const generateWaferData = (
j--
) {
stringValue = generateStringValue(i, j, valueGenerator);
diesSet.push({ x: i, y: j, value: stringValue });
diesSet.push(generateDieContent(i, j, stringValue));
}
// generate points right of centerX
for (
Expand All @@ -53,7 +66,7 @@ export const generateWaferData = (
j++
) {
stringValue = generateStringValue(i, j, valueGenerator);
diesSet.push({ x: i, y: j, value: stringValue });
diesSet.push(generateDieContent(i, j, stringValue));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
getWaferMapDies
} from './utilities';

describe('Data manager', () => {
describe('Wafermap Data manager', () => {
let dataManagerModule: DataManager;
const axisLocation: WaferMapQuadrant = WaferMapQuadrant.topLeft;
const canvasDimensions = { width: 100, height: 110 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Prerendering } from '../modules/prerendering';
import { WaferMapColorScaleMode } from '../types';
import { getLinearScale, getWaferMapDies } from './utilities';

describe('Prerendering module', () => {
describe('Wafermap Prerendering module', () => {
let prerenderingModule: Prerendering;
const emptyDieColor = 'rgba(218,223,236,1)';
const nanDieColor = 'rgba(122,122,122,1)';
Expand Down Expand Up @@ -193,7 +193,13 @@ describe('Prerendering module', () => {

beforeEach(() => {
prerenderingModule = new Prerendering(
[{ x: 0, y: 0, value: 'NaN' }],
[
{
x: 0,
y: 0,
value: 'NaN'
}
],
{ colors: [], values: [] },
highlightedValues,
getLinearScale([], []),
Expand Down Expand Up @@ -223,7 +229,13 @@ describe('Prerendering module', () => {

beforeEach(() => {
prerenderingModule = new Prerendering(
[{ x: 0, y: 0, value: undefined as unknown as string }],
[
{
x: 0,
y: 0,
value: undefined as unknown as string
}
],
{ colors: [], values: [] },
highlightedValues,
getLinearScale([], []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
getWaferMapDiesAsNaN
} from './utilities';

describe('Prerendering module', () => {
describe('Wafermap Prerendering module', () => {
let prerenderingModule: Prerendering;

describe('with die input and small die height', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Prerendering } from '../modules/prerendering';
import { WaferMapColorScaleMode } from '../types';
import { getLinearScale, getWaferMapDies } from './utilities';

describe('Prerendering module', () => {
describe('Wafermap Prerendering module', () => {
let prerenderingModule: Prerendering;

describe('with die input and margin', () => {
Expand Down
224 changes: 192 additions & 32 deletions packages/nimble-components/src/wafer-map/tests/sets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,200 @@ export const highLightedValueSets = [

export const wafermapDieSets: WaferMapDie[][] = [
[
{ x: 0, y: 0, value: '100' },
{ x: 0, y: 1, value: '50' },
{ x: 0, y: 2, value: '12' },
{ x: 0, y: 3, value: '99' },
{ x: 1, y: 0, value: '78' },
{ x: 1, y: 1, value: '88' },
{ x: 1, y: 2, value: '68' },
{ x: 1, y: 3, value: '99' },
{ x: 2, y: 0, value: '99' },
{ x: 2, y: 1, value: '80' },
{ x: 2, y: 2, value: '99' },
{ x: 2, y: 3, value: '100' },
{ x: 3, y: 0, value: '40' },
{ x: 3, y: 1, value: '10' },
{ x: 3, y: 2, value: '15' },
{ x: 3, y: 3, value: '30' }
{
x: 0,
y: 0,
value: '100',
metadata: 'Placeholder metadata value for Die x: 0 y: 0'
},
{
x: 0,
y: 1,
value: '50',
metadata: 'Placeholder metadata value for Die x: 0 y: 1'
},
{
x: 0,
y: 2,
value: '12',
metadata: 'Placeholder metadata value for Die x: 0 y: 2'
},
{
x: 0,
y: 3,
value: '99',
metadata: 'Placeholder metadata value for Die x: 0 y: 3'
},
{
x: 1,
y: 0,
value: '78',
metadata: 'Placeholder metadata value for Die x: 1 y: 0'
},
{
x: 1,
y: 1,
value: '88',
metadata: 'Placeholder metadata value for Die x: 1 y: 1'
},
{
x: 1,
y: 2,
value: '68',
metadata: 'Placeholder metadata value for Die x: 1 y: 2'
},
{
x: 1,
y: 3,
value: '99',
metadata: 'Placeholder metadata value for Die x: 1 y: 3'
},
{
x: 2,
y: 0,
value: '99',
metadata: 'Placeholder metadata value for Die x: 2 y: 0'
},
{
x: 2,
y: 1,
value: '80',
metadata: 'Placeholder metadata value for Die x: 2 y: 1'
},
{
x: 2,
y: 2,
value: '99',
metadata: 'Placeholder metadata value for Die x: 2 y: 2'
},
{
x: 2,
y: 3,
value: '100',
metadata: 'Placeholder metadata value for Die x: 2 y: 3'
},
{
x: 3,
y: 0,
value: '40',
metadata: 'Placeholder metadata value for Die x: 3 y: 0'
},
{
x: 3,
y: 1,
value: '10',
metadata: 'Placeholder metadata value for Die x: 3 y: 1'
},
{
x: 3,
y: 2,
value: '15',
metadata: 'Placeholder metadata value for Die x: 3 y: 2'
},
{
x: 3,
y: 3,
value: '30',
metadata: 'Placeholder metadata value for Die x: 3 y: 3'
}
],
[
{ x: 0, y: 0, value: '16' },
{ x: 0, y: 1, value: '50' },
{ x: 0, y: 2, value: '13' },
{ x: 0, y: 3, value: '65' },
{ x: 1, y: 0, value: '78' },
{ x: 1, y: 1, value: '88' },
{ x: 1, y: 2, value: '99' },
{ x: 1, y: 3, value: '99' },
{ x: 2, y: 0, value: '99' },
{ x: 2, y: 1, value: '80' },
{ x: 2, y: 2, value: '99' },
{ x: 2, y: 3, value: '100' },
{ x: 3, y: 0, value: '70' },
{ x: 3, y: 1, value: '75' },
{ x: 3, y: 2, value: '70' },
{ x: 3, y: 3, value: '72' }
{
x: 0,
y: 0,
value: '16',
metadata: 'Placeholder metadata value for Die x: 0 y: 0'
},
{
x: 0,
y: 1,
value: '50',
metadata: 'Placeholder metadata value for Die x: 0 y: 1'
},
{
x: 0,
y: 2,
value: '13',
metadata: 'Placeholder metadata value for Die x: 0 y: 2'
},
{
x: 0,
y: 3,
value: '65',
metadata: 'Placeholder metadata value for Die x: 0 y: 3'
},
{
x: 1,
y: 0,
value: '78',
metadata: 'Placeholder metadata value for Die x: 1 y: 0'
},
{
x: 1,
y: 1,
value: '88',
metadata: 'Placeholder metadata value for Die x: 1 y: 1'
},
{
x: 1,
y: 2,
value: '99',
metadata: 'Placeholder metadata value for Die x: 1 y: 2'
},
{
x: 1,
y: 3,
value: '99',
metadata: 'Placeholder metadata value for Die x: 1 y: 3'
},
{
x: 2,
y: 0,
value: '99',
metadata: 'Placeholder metadata value for Die x: 2 y: 0'
},
{
x: 2,
y: 1,
value: '80',
metadata: 'Placeholder metadata value for Die x: 2 y: 1'
},
{
x: 2,
y: 2,
value: '99',
metadata: 'Placeholder metadata value for Die x: 2 y: 2'
},
{
x: 2,
y: 3,
value: '100',
metadata: 'Placeholder metadata value for Die x: 2 y: 3'
},
{
x: 3,
y: 0,
value: '70',
metadata: 'Placeholder metadata value for Die x: 3 y: 0'
},
{
x: 3,
y: 1,
value: '75',
metadata: 'Placeholder metadata value for Die x: 3 y: 1'
},
{
x: 3,
y: 2,
value: '70',
metadata: 'Placeholder metadata value for Die x: 3 y: 2'
},
{
x: 3,
y: 3,
value: '72',
metadata: 'Placeholder metadata value for Die x: 3 y: 3'
}
]
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { WaferMapOrientation, WaferMapQuadrant } from '../types';

describe('WaferMap type', () => {
describe('Wafermap Types', () => {
it('WaferMapQuadrant fails compile if assigning arbitrary string values', () => {
// @ts-expect-error This expect will fail if the enum-like type is missing "as const"
const value: WaferMapQuadrant = 'hello';
Expand Down
1 change: 1 addition & 0 deletions packages/nimble-components/src/wafer-map/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface WaferMapDie {
value: string;
x: number;
y: number;
metadata?: unknown;
DStavilaNI marked this conversation as resolved.
Show resolved Hide resolved
}

export interface WaferMapColorScale {
Expand Down