diff --git a/angular-workspace/projects/ni/nimble-angular/CHANGELOG.json b/angular-workspace/projects/ni/nimble-angular/CHANGELOG.json index c95bf7331b..43e44a26b9 100644 --- a/angular-workspace/projects/ni/nimble-angular/CHANGELOG.json +++ b/angular-workspace/projects/ni/nimble-angular/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@ni/nimble-angular", "entries": [ + { + "date": "Mon, 25 Mar 2024 17:03:11 GMT", + "version": "20.5.3", + "tag": "@ni/nimble-angular_v20.5.3", + "comments": { + "patch": [ + { + "author": "beachball", + "package": "@ni/nimble-angular", + "comment": "Bump @ni/nimble-components to v23.0.1", + "commit": "not available" + } + ] + } + }, { "date": "Thu, 21 Mar 2024 17:13:38 GMT", "version": "20.5.2", diff --git a/angular-workspace/projects/ni/nimble-angular/CHANGELOG.md b/angular-workspace/projects/ni/nimble-angular/CHANGELOG.md index 3a4d8e308d..9f66bd06eb 100644 --- a/angular-workspace/projects/ni/nimble-angular/CHANGELOG.md +++ b/angular-workspace/projects/ni/nimble-angular/CHANGELOG.md @@ -1,9 +1,17 @@ # Change Log - @ni/nimble-angular -This log was last generated on Thu, 21 Mar 2024 17:13:38 GMT and should not be manually modified. +This log was last generated on Mon, 25 Mar 2024 17:03:11 GMT and should not be manually modified. +## 20.5.3 + +Mon, 25 Mar 2024 17:03:11 GMT + +### Patches + +- Bump @ni/nimble-components to v23.0.1 + ## 20.5.2 Thu, 21 Mar 2024 17:13:38 GMT diff --git a/angular-workspace/projects/ni/nimble-angular/package.json b/angular-workspace/projects/ni/nimble-angular/package.json index b6db60197e..d98a826070 100644 --- a/angular-workspace/projects/ni/nimble-angular/package.json +++ b/angular-workspace/projects/ni/nimble-angular/package.json @@ -1,6 +1,6 @@ { "name": "@ni/nimble-angular", - "version": "20.5.2", + "version": "20.5.3", "description": "Angular components for the NI Nimble Design System", "scripts": { "invoke-publish": "cd ../../../ && npm run build:library && cd dist/ni/nimble-angular && npm publish" @@ -31,7 +31,7 @@ "@angular/forms": "^15.2.10", "@angular/localize": "^15.2.10", "@angular/router": "^15.2.10", - "@ni/nimble-components": "^23.0.0" + "@ni/nimble-components": "^23.0.1" }, "dependencies": { "tslib": "^2.2.0" diff --git a/package-lock.json b/package-lock.json index 46b53e8b5b..3767bc84bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,7 +74,7 @@ }, "angular-workspace/projects/ni/nimble-angular": { "name": "@ni/nimble-angular", - "version": "20.5.2", + "version": "20.5.3", "license": "MIT", "dependencies": { "tslib": "^2.2.0" @@ -85,7 +85,7 @@ "@angular/forms": "^15.2.10", "@angular/localize": "^15.2.10", "@angular/router": "^15.2.10", - "@ni/nimble-components": "^23.0.0" + "@ni/nimble-components": "^23.0.1" } }, "node_modules/@11ty/dependency-tree": { @@ -33940,7 +33940,7 @@ }, "packages/nimble-blazor": { "name": "@ni/nimble-blazor", - "version": "14.5.2", + "version": "14.5.3", "hasInstallScript": true, "license": "MIT", "devDependencies": { @@ -33976,7 +33976,7 @@ }, "packages/nimble-components": { "name": "@ni/nimble-components", - "version": "23.0.0", + "version": "23.0.1", "license": "MIT", "dependencies": { "@microsoft/fast-colors": "^5.3.1", diff --git a/packages/nimble-blazor/package.json b/packages/nimble-blazor/package.json index 85d6a32cc7..fc97e5c96e 100644 --- a/packages/nimble-blazor/package.json +++ b/packages/nimble-blazor/package.json @@ -1,6 +1,6 @@ { "name": "@ni/nimble-blazor", - "version": "14.5.2", + "version": "14.5.3", "description": "Blazor components for the NI Nimble Design System", "scripts": { "postinstall": "node build/generate-playwright-version-properties/source/index.js", diff --git a/packages/nimble-components/CHANGELOG.json b/packages/nimble-components/CHANGELOG.json index 13aaa57ee5..f72608c8e3 100644 --- a/packages/nimble-components/CHANGELOG.json +++ b/packages/nimble-components/CHANGELOG.json @@ -1,6 +1,21 @@ { "name": "@ni/nimble-components", "entries": [ + { + "date": "Mon, 25 Mar 2024 17:03:11 GMT", + "version": "23.0.1", + "tag": "@ni/nimble-components_v23.0.1", + "comments": { + "patch": [ + { + "author": "33986780+munteannatan@users.noreply.github.com", + "package": "@ni/nimble-components", + "commit": "f56b73b45161a55b967dc03bbdd094a6527c814c", + "comment": "Created new hover event for the new diesTable api and changed the zoom event" + } + ] + } + }, { "date": "Fri, 22 Mar 2024 16:18:25 GMT", "version": "23.0.0", diff --git a/packages/nimble-components/CHANGELOG.md b/packages/nimble-components/CHANGELOG.md index a3208751fb..4b8e71ac3a 100644 --- a/packages/nimble-components/CHANGELOG.md +++ b/packages/nimble-components/CHANGELOG.md @@ -1,9 +1,17 @@ # Change Log - @ni/nimble-components -This log was last generated on Thu, 21 Mar 2024 17:13:38 GMT and should not be manually modified. +This log was last generated on Mon, 25 Mar 2024 17:03:11 GMT and should not be manually modified. +## 23.0.1 + +Mon, 25 Mar 2024 17:03:11 GMT + +### Patches + +- Created new hover event for the new diesTable api and changed the zoom event ([ni/nimble@f56b73b](https://github.com/ni/nimble/commit/f56b73b45161a55b967dc03bbdd094a6527c814c)) + ## 23.0.0 Thu, 21 Mar 2024 17:13:38 GMT diff --git a/packages/nimble-components/package.json b/packages/nimble-components/package.json index b2052a19b5..171e0ee8b9 100644 --- a/packages/nimble-components/package.json +++ b/packages/nimble-components/package.json @@ -1,6 +1,6 @@ { "name": "@ni/nimble-components", - "version": "23.0.0", + "version": "23.0.1", "description": "Styled web components for the NI Nimble Design System", "scripts": { "build": "npm run generate-icons && npm run generate-workers && npm run build-components && npm run bundle-components && npm run generate-scss && npm run build-storybook", diff --git a/packages/nimble-components/src/wafer-map/index.ts b/packages/nimble-components/src/wafer-map/index.ts index 3d2f85f9d0..9e740cbc80 100644 --- a/packages/nimble-components/src/wafer-map/index.ts +++ b/packages/nimble-components/src/wafer-map/index.ts @@ -45,7 +45,7 @@ export class WaferMap< * @internal * needs to be initialized before the properties trigger changes */ - public readonly waferMapUpdateTracker: WaferMapUpdateTracker = new WaferMapUpdateTracker(this as WaferMap); + public readonly waferMapUpdateTracker: WaferMapUpdateTracker = new WaferMapUpdateTracker(this.asRequiredFieldsWaferMap); @attr({ attribute: 'origin-location' }) public originLocation: WaferMapOriginLocation = WaferMapOriginLocation.bottomLeft; @@ -96,31 +96,30 @@ export class WaferMap< * @internal */ public readonly stableDataManager: DataManager = new DataManager( - this as WaferMap + this.asRequiredFieldsWaferMap ); /** * @internal */ - public readonly experimentalDataManager: ExperimentalDataManager = new ExperimentalDataManager(this as WaferMap); + public readonly experimentalDataManager: ExperimentalDataManager = new ExperimentalDataManager( + this.asRequiredFieldsWaferMap + ); - /** - * @internal - */ public dataManager: DataManager | ExperimentalDataManager = this.stableDataManager; /** * @internal */ - public readonly mainRenderer: RenderingModule = new RenderingModule( - this as WaferMap + public readonly mainRenderer = new RenderingModule( + this.asRequiredFieldsWaferMap ); /** * @internal */ - public readonly workerRenderer: WorkerRenderer = new WorkerRenderer( - this as WaferMap + public readonly workerRenderer = new WorkerRenderer( + this.asRequiredFieldsWaferMap ); @observable @@ -181,17 +180,17 @@ export class WaferMap< }; private readonly hoverHandler: HoverHandler = new HoverHandler( - this as WaferMap + this.asRequiredFieldsWaferMap ); - private readonly experimentalHoverHandler: ExperimentalHoverHandler = new ExperimentalHoverHandler(this as WaferMap); + private readonly experimentalHoverHandler: ExperimentalHoverHandler = new ExperimentalHoverHandler(this.asRequiredFieldsWaferMap); private readonly zoomHandler: ZoomHandler = new ZoomHandler( - this as WaferMap + this.asRequiredFieldsWaferMap ); private readonly resizeObserver = this.createResizeObserver(); - private readonly waferMapValidator: WaferMapValidator = new WaferMapValidator(this as WaferMap); + private readonly waferMapValidator: WaferMapValidator = new WaferMapValidator(this.asRequiredFieldsWaferMap); public get validity(): WaferMapValidity { return this.waferMapValidator.getValidity(); @@ -237,9 +236,9 @@ export class WaferMap< if (this.waferMapUpdateTracker.requiresEventsUpdate) { // zoom translateExtent needs to be recalculated when canvas size changes this.zoomHandler.disconnect(); - this.dataManager = this.diesTable === undefined - ? this.stableDataManager - : this.experimentalDataManager; + this.dataManager = this.isExperimentalRenderer() + ? this.experimentalDataManager + : this.stableDataManager; if (this.waferMapUpdateTracker.requiresContainerDimensionsUpdate) { this.dataManager.updateContainerDimensions(); this.renderer.updateSortedDiesAndDrawWafer(); @@ -379,6 +378,10 @@ export class WaferMap< this.waferMapUpdateTracker.track('hoverDie'); this.waferMapUpdateTracker.queueUpdate(); } + + private get asRequiredFieldsWaferMap(): WaferMap { + return this as WaferMap; + } } const nimbleWaferMap = WaferMap.compose({ diff --git a/packages/nimble-components/src/wafer-map/modules/wafer-map-validator.ts b/packages/nimble-components/src/wafer-map/modules/wafer-map-validator.ts index 2b58532488..6788f50149 100644 --- a/packages/nimble-components/src/wafer-map/modules/wafer-map-validator.ts +++ b/packages/nimble-components/src/wafer-map/modules/wafer-map-validator.ts @@ -1,4 +1,4 @@ -import { DataType, Float, Int, Precision } from 'apache-arrow'; +import { DataType, Precision } from 'apache-arrow'; import type { WaferMap } from '..'; import type { WaferMapValidity } from '../types'; @@ -25,10 +25,10 @@ export class WaferMapValidator { public validateGridDimensions(): boolean { this.invalidGridDimensions = false; if ( - typeof this.wafermap.gridMinX === 'undefined' - && typeof this.wafermap.gridMaxX === 'undefined' - && typeof this.wafermap.gridMinY === 'undefined' - && typeof this.wafermap.gridMaxY === 'undefined' + this.wafermap.gridMinX === undefined + && this.wafermap.gridMaxX === undefined + && this.wafermap.gridMinY === undefined + && this.wafermap.gridMaxY === undefined ) { this.invalidGridDimensions = false; } else if ( @@ -49,41 +49,20 @@ export class WaferMapValidator { if (this.wafermap.diesTable === undefined) { this.invalidDiesTableSchema = false; } else { - const colIndexField = this.wafermap.diesTable.schema.fields.findIndex( - f => f.name === 'colIndex' - ); - const rowIndexField = this.wafermap.diesTable.schema.fields.findIndex( - f => f.name === 'rowIndex' - ); - const valueField = this.wafermap.diesTable.schema.fields.findIndex( - f => f.name === 'value' - ); + const fields = this.wafermap.diesTable.schema.fields; + const colField = fields.find(field => field.name === 'colIndex'); + const rowField = fields.find(field => field.name === 'rowIndex'); + const valueField = fields.find(field => field.name === 'value'); if ( - this.wafermap.diesTable.numCols < 3 - || colIndexField === -1 - || rowIndexField === -1 - || valueField === -1 - || !DataType.isInt( - this.wafermap.diesTable.schema.fields[colIndexField]!.type - ) - || ( - this.wafermap.diesTable.schema.fields[colIndexField]! - .type as Int - ).bitWidth !== 32 - || !DataType.isInt( - this.wafermap.diesTable.schema.fields[rowIndexField]!.type - ) - || ( - this.wafermap.diesTable.schema.fields[rowIndexField]! - .type as Int - ).bitWidth !== 32 - || !DataType.isFloat( - this.wafermap.diesTable.schema.fields[valueField]!.type - ) - || ( - this.wafermap.diesTable.schema.fields[valueField]! - .type as Float - ).precision !== Precision.DOUBLE + !colField + || !rowField + || !valueField + || !DataType.isInt(colField.type) + || colField.type.bitWidth !== 32 + || !DataType.isInt(rowField.type) + || rowField.type.bitWidth !== 32 + || !DataType.isFloat(valueField.type) + || valueField.type.precision !== Precision.DOUBLE ) { this.invalidDiesTableSchema = true; } 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 deb673b81c..0f0ead89ef 100644 --- a/packages/nimble-components/src/wafer-map/tests/computations.spec.ts +++ b/packages/nimble-components/src/wafer-map/tests/computations.spec.ts @@ -1,4 +1,3 @@ -import type { WaferMap } from '..'; import { Computations } from '../modules/computations'; import { Margin, WaferMapOriginLocation } from '../types'; import { getWaferMapMockComputations, getWaferMapDies } from './utilities'; @@ -20,7 +19,7 @@ describe('Wafermap Computations module', () => { 100, 100 ); - computationsModule = new Computations(waferMock as WaferMap); + computationsModule = new Computations(waferMock); computationsModule.updateContainerDimensions(); }); @@ -70,7 +69,7 @@ describe('Wafermap Computations module', () => { 200, 100 ); - computationsModule = new Computations(waferMock as WaferMap); + computationsModule = new Computations(waferMock); computationsModule.updateContainerDimensions(); }); @@ -114,7 +113,7 @@ describe('Wafermap Computations module', () => { 100, 100 ); - computationsModule = new Computations(waferMock as WaferMap); + computationsModule = new Computations(waferMock); computationsModule.updateContainerDimensions(); }); @@ -136,7 +135,7 @@ describe('Wafermap Computations module', () => { 100, 100 ); - computationsModule = new Computations(waferMock as WaferMap); + computationsModule = new Computations(waferMock); computationsModule.updateContainerDimensions(); }); @@ -158,7 +157,7 @@ describe('Wafermap Computations module', () => { 100, 100 ); - computationsModule = new Computations(waferMock as WaferMap); + computationsModule = new Computations(waferMock); computationsModule.updateContainerDimensions(); }); @@ -180,7 +179,7 @@ describe('Wafermap Computations module', () => { 100, 100 ); - computationsModule = new Computations(waferMock as WaferMap); + computationsModule = new Computations(waferMock); computationsModule.updateContainerDimensions(); }); 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 c36d067239..2b93f87e82 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 @@ -1,5 +1,3 @@ -import type { WaferMap } from '..'; -import type { DataManager } from '../modules/data-manager'; import { Prerendering } from '../modules/prerendering'; import { WaferMapColorScaleMode } from '../types'; import { @@ -42,9 +40,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -85,9 +83,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -128,9 +126,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -175,9 +173,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -218,9 +216,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -270,9 +268,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -316,9 +314,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -356,9 +354,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -403,9 +401,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); 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 be9f4c56d0..dead70f68d 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 @@ -1,5 +1,3 @@ -import type { WaferMap } from '..'; -import type { DataManager } from '../modules/data-manager'; import { Prerendering } from '../modules/prerendering'; import { WaferMapColorScaleMode } from '../types'; import { @@ -38,9 +36,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -80,9 +78,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -116,9 +114,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -156,9 +154,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -197,9 +195,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -240,9 +238,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -283,9 +281,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -330,9 +328,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); 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 6bf5d9e4a0..8b65558c50 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 @@ -1,5 +1,3 @@ -import type { WaferMap } from '..'; -import type { DataManager } from '../modules/data-manager'; import { Prerendering } from '../modules/prerendering'; import { WaferMapColorScaleMode } from '../types'; import { @@ -37,9 +35,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -95,9 +93,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); @@ -142,9 +140,9 @@ describe('Wafermap Prerendering module', () => { dieLabelsHidden, dieLabelsSuffix, maxCharacters, - dataManagerMock as DataManager + dataManagerMock ); - prerenderingModule = new Prerendering(waferMock as WaferMap); + prerenderingModule = new Prerendering(waferMock); prerenderingModule.updateLabelsFontSize(); }); diff --git a/packages/nimble-components/src/wafer-map/tests/utilities.ts b/packages/nimble-components/src/wafer-map/tests/utilities.ts index d961e7711b..c38651fadd 100644 --- a/packages/nimble-components/src/wafer-map/tests/utilities.ts +++ b/packages/nimble-components/src/wafer-map/tests/utilities.ts @@ -99,17 +99,19 @@ export function getDataManagerMock( margin: Margin, horizontalScale: ScaleBand = getScaleBand([], []), verticalScale: ScaleBand = getScaleBand([], []) -): Pick< +): DataManager { + const dataManagerMock: Pick< DataManager, 'horizontalScale' | 'verticalScale' | 'dieDimensions' | 'margin' - > { - return { + > = { horizontalScale, verticalScale, dieDimensions, margin }; + return dataManagerMock as DataManager; } + export function getDataManagerMockForHover( margin: Margin, invertedHorizontalScale: ScaleQuantile = getScaleQuantile( @@ -120,15 +122,16 @@ export function getDataManagerMockForHover( [], [] ) -): Pick< +): DataManager { + const dataManagerMock: Pick< DataManager, 'invertedHorizontalScale' | 'invertedVerticalScale' | 'margin' - > { - return { + > = { invertedHorizontalScale, invertedVerticalScale, margin }; + return dataManagerMock as DataManager; } export function getWaferMapMockPrerendering( @@ -140,7 +143,8 @@ export function getWaferMapMockPrerendering( dieLabelsSuffix = '', maxCharacters = 4, dataManager = {} as DataManager -): Pick< +): WaferMap { + const waferMapMock: Pick< WaferMap, | 'dies' | 'colorScale' @@ -150,8 +154,7 @@ export function getWaferMapMockPrerendering( | 'dieLabelsSuffix' | 'maxCharacters' | 'dataManager' - > { - return { + > = { dies, colorScale, highlightedTags, @@ -161,6 +164,7 @@ export function getWaferMapMockPrerendering( maxCharacters, dataManager }; + return waferMapMock as WaferMap; } export function getWaferMapMockHover( @@ -170,7 +174,8 @@ export function getWaferMapMockHover( hoverDie: HoverDie | undefined, dataManager: DataManager, isExperimentalRenderer: boolean -): Pick< +): WaferMap { + const waferMapMock: Pick< WaferMap, | 'diesTable' | 'transform' @@ -178,8 +183,7 @@ export function getWaferMapMockHover( | 'hoverDie' | 'dataManager' | 'isExperimentalRenderer' - > { - return { + > = { diesTable, transform, originLocation, @@ -187,6 +191,7 @@ export function getWaferMapMockHover( dataManager, isExperimentalRenderer: () => isExperimentalRenderer }; + return waferMapMock as WaferMap; } export function getWaferMapMockComputations( dies: WaferMapDie[] = getWaferMapDies(), @@ -197,17 +202,18 @@ export function getWaferMapMockComputations( invalidGridDimensions: false, invalidDiesTableSchema: false } -): Pick< +): WaferMap { + const waferMapMock: Pick< WaferMap, 'dies' | 'originLocation' | 'canvasWidth' | 'canvasHeight' | 'validity' - > { - return { + > = { dies, originLocation, canvasWidth, canvasHeight, validity }; + return waferMapMock as WaferMap; } export function getWaferMapMockComputationsExperimental( diesTable: Table = getWaferMapDiesTable(), @@ -237,15 +243,16 @@ export function getWaferMapMockValidator( gridMinY: number | undefined, gridMaxY: number | undefined, diesTable: Table | undefined = undefined -): Pick< +): WaferMap { + const waferMapMock: Pick< WaferMap, 'gridMinX' | 'gridMaxX' | 'gridMinY' | 'gridMaxY' | 'diesTable' - > { - return { + > = { gridMinX, gridMaxX, gridMinY, gridMaxY, diesTable }; + return waferMapMock as WaferMap; } diff --git a/packages/nimble-components/src/wafer-map/tests/wafer-map-validator.spec.ts b/packages/nimble-components/src/wafer-map/tests/wafer-map-validator.spec.ts index 732833fa9a..659fbee23c 100644 --- a/packages/nimble-components/src/wafer-map/tests/wafer-map-validator.spec.ts +++ b/packages/nimble-components/src/wafer-map/tests/wafer-map-validator.spec.ts @@ -1,5 +1,4 @@ import { Table, tableFromArrays } from 'apache-arrow'; -import type { WaferMap } from '..'; import { WaferMapValidator } from '../modules/wafer-map-validator'; import { getWaferMapMockValidator } from './utilities'; @@ -13,7 +12,7 @@ describe('Wafermap Validator module', () => { undefined, undefined ); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateGridDimensions(); expect(waferMapValidator.isValid()).toBeTrue(); @@ -21,7 +20,7 @@ describe('Wafermap Validator module', () => { it('with equal grid dimensions should be valid', () => { const waferMock = getWaferMapMockValidator(0, 0, 0, 0); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateGridDimensions(); expect(waferMapValidator.isValid()).toBeTrue(); @@ -29,7 +28,7 @@ describe('Wafermap Validator module', () => { it('with positive grid dimensions should be valid', () => { const waferMock = getWaferMapMockValidator(1, 2, 1, 2); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateGridDimensions(); expect(waferMapValidator.isValid()).toBeTrue(); @@ -37,7 +36,7 @@ describe('Wafermap Validator module', () => { it('with negative grid dimensions should be valid', () => { const waferMock = getWaferMapMockValidator(-2, -1, -2, -1); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateGridDimensions(); expect(waferMapValidator.isValid()).toBeTrue(); @@ -45,7 +44,7 @@ describe('Wafermap Validator module', () => { it('with one undefined grid dimension should not be valid', () => { const waferMock = getWaferMapMockValidator(0, 0, 0, undefined); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateGridDimensions(); expect(waferMapValidator.isValid()).toBeFalse(); @@ -53,7 +52,7 @@ describe('Wafermap Validator module', () => { it('with impossible grid dimension should not be valid', () => { const waferMock = getWaferMapMockValidator(1, -1, 1, -1); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateGridDimensions(); expect(waferMapValidator.getValidity()).toEqual({ @@ -71,7 +70,7 @@ describe('Wafermap Validator module', () => { undefined, undefined ); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateDiesTableSchema(); expect(waferMapValidator.isValid()).toBeTrue(); }); @@ -88,7 +87,7 @@ describe('Wafermap Validator module', () => { value: Float64Array.from([]) }) ); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateDiesTableSchema(); expect(waferMapValidator.isValid()).toBeTrue(); @@ -106,7 +105,7 @@ describe('Wafermap Validator module', () => { value: Float32Array.from([]) }) ); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateDiesTableSchema(); expect(waferMapValidator.isValid()).toBeFalse(); @@ -124,7 +123,7 @@ describe('Wafermap Validator module', () => { value: Float64Array.from([]) }) ); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateDiesTableSchema(); expect(waferMapValidator.isValid()).toBeFalse(); @@ -142,7 +141,7 @@ describe('Wafermap Validator module', () => { value: Int32Array.from([]) }) ); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateDiesTableSchema(); expect(waferMapValidator.isValid()).toBeFalse(); @@ -156,7 +155,7 @@ describe('Wafermap Validator module', () => { undefined, new Table() ); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateDiesTableSchema(); expect(waferMapValidator.isValid()).toBeFalse(); @@ -172,7 +171,7 @@ describe('Wafermap Validator module', () => { rowIndex: Int32Array.from([]) }) ); - waferMapValidator = new WaferMapValidator(waferMock as WaferMap); + waferMapValidator = new WaferMapValidator(waferMock); waferMapValidator.validateDiesTableSchema(); expect(waferMapValidator.isValid()).toBeFalse(); diff --git a/packages/nimble-components/src/wafer-map/tests/wafer-map.stories.ts b/packages/nimble-components/src/wafer-map/tests/wafer-map.stories.ts index 2cd7f02974..c0b82ce309 100644 --- a/packages/nimble-components/src/wafer-map/tests/wafer-map.stories.ts +++ b/packages/nimble-components/src/wafer-map/tests/wafer-map.stories.ts @@ -81,7 +81,7 @@ const getDiesSet = ( )!; break; default: - returnedValue = [] as WaferMapDie[]; + returnedValue = []; } return returnedValue; }; @@ -133,7 +133,7 @@ const getHighlightedTags = (setName: string, sets: string[][]): string[] => { returnedValue = sets[3]!; break; default: - returnedValue = [] as string[]; + returnedValue = []; break; } return returnedValue;