diff --git a/change/@ni-nimble-components-95871031-15d3-48ad-952f-7c70831fb3d0.json b/change/@ni-nimble-components-95871031-15d3-48ad-952f-7c70831fb3d0.json new file mode 100644 index 0000000000..25a38a70bc --- /dev/null +++ b/change/@ni-nimble-components-95871031-15d3-48ad-952f-7c70831fb3d0.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Updated the WaferDie Interface to add an extra \"tooltip\" field", + "packageName": "@ni/nimble-components", + "email": "35329597+DStavilaNI@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/nimble-components/src/wafer-map/tests/computations.spec.ts b/packages/nimble-components/src/wafer-map/tests/computations.spec.ts index 06264e2791..b12c3cdaa5 100644 --- a/packages/nimble-components/src/wafer-map/tests/computations.spec.ts +++ b/packages/nimble-components/src/wafer-map/tests/computations.spec.ts @@ -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', () => { diff --git a/packages/nimble-components/src/wafer-map/tests/data-generator.ts b/packages/nimble-components/src/wafer-map/tests/data-generator.ts index 8c9801e496..83f6fd23b2 100644 --- a/packages/nimble-components/src/wafer-map/tests/data-generator.ts +++ b/packages/nimble-components/src/wafer-map/tests/data-generator.ts @@ -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 @@ -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 ( @@ -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)); } } } diff --git a/packages/nimble-components/src/wafer-map/tests/data-manager.spec.ts b/packages/nimble-components/src/wafer-map/tests/data-manager.spec.ts index a21de022ec..71346b87c2 100644 --- a/packages/nimble-components/src/wafer-map/tests/data-manager.spec.ts +++ b/packages/nimble-components/src/wafer-map/tests/data-manager.spec.ts @@ -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 }; diff --git a/packages/nimble-components/src/wafer-map/tests/prerendering.coloring.spec.ts b/packages/nimble-components/src/wafer-map/tests/prerendering.coloring.spec.ts index e3f930df6a..c37064f1a0 100644 --- a/packages/nimble-components/src/wafer-map/tests/prerendering.coloring.spec.ts +++ b/packages/nimble-components/src/wafer-map/tests/prerendering.coloring.spec.ts @@ -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)'; @@ -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([], []), @@ -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([], []), diff --git a/packages/nimble-components/src/wafer-map/tests/prerendering.labeling.spec.ts b/packages/nimble-components/src/wafer-map/tests/prerendering.labeling.spec.ts index 0f6e4f985c..f937a5b721 100644 --- a/packages/nimble-components/src/wafer-map/tests/prerendering.labeling.spec.ts +++ b/packages/nimble-components/src/wafer-map/tests/prerendering.labeling.spec.ts @@ -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', () => { diff --git a/packages/nimble-components/src/wafer-map/tests/prerendering.positioning.spec.ts b/packages/nimble-components/src/wafer-map/tests/prerendering.positioning.spec.ts index e66352de3a..39e59ea374 100644 --- a/packages/nimble-components/src/wafer-map/tests/prerendering.positioning.spec.ts +++ b/packages/nimble-components/src/wafer-map/tests/prerendering.positioning.spec.ts @@ -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', () => { diff --git a/packages/nimble-components/src/wafer-map/tests/sets.ts b/packages/nimble-components/src/wafer-map/tests/sets.ts index 6c8a36a7e6..bef41922d0 100644 --- a/packages/nimble-components/src/wafer-map/tests/sets.ts +++ b/packages/nimble-components/src/wafer-map/tests/sets.ts @@ -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' + } ] ]; diff --git a/packages/nimble-components/src/wafer-map/tests/types.spec.ts b/packages/nimble-components/src/wafer-map/tests/types.spec.ts index bf1fe7822a..681766b07b 100644 --- a/packages/nimble-components/src/wafer-map/tests/types.spec.ts +++ b/packages/nimble-components/src/wafer-map/tests/types.spec.ts @@ -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'; diff --git a/packages/nimble-components/src/wafer-map/types.ts b/packages/nimble-components/src/wafer-map/types.ts index 944419c2bd..8a59c1e724 100644 --- a/packages/nimble-components/src/wafer-map/types.ts +++ b/packages/nimble-components/src/wafer-map/types.ts @@ -30,6 +30,8 @@ export interface WaferMapDie { value: string; x: number; y: number; + // The metadata field is not used by the wafer-map and is only for optionally storing arbitrary metadata. + metadata?: unknown; } export interface WaferMapColorScale {