@ni/nimble-components 24.1.4 → 24.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-components-bundle.js +121 -94
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +6091 -6088
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/combobox/index.d.ts +2 -7
- package/dist/esm/combobox/index.js +0 -15
- package/dist/esm/combobox/index.js.map +1 -1
- package/dist/esm/src/combobox/index.d.ts +2 -7
- package/dist/esm/src/wafer-map/index.d.ts +8 -17
- package/dist/esm/src/wafer-map/modules/experimental/computations.d.ts +1 -2
- package/dist/esm/src/wafer-map/modules/experimental/data-manager.d.ts +4 -10
- package/dist/esm/src/wafer-map/modules/experimental/hover-handler.d.ts +1 -5
- package/dist/esm/src/wafer-map/modules/experimental/prerendering.d.ts +18 -0
- package/dist/esm/src/wafer-map/modules/experimental/worker-renderer.d.ts +0 -1
- package/dist/esm/src/wafer-map/types.d.ts +6 -0
- package/dist/esm/wafer-map/index.d.ts +8 -17
- package/dist/esm/wafer-map/index.js +35 -24
- package/dist/esm/wafer-map/index.js.map +1 -1
- package/dist/esm/wafer-map/modules/experimental/computations.d.ts +1 -2
- package/dist/esm/wafer-map/modules/experimental/computations.js +1 -4
- package/dist/esm/wafer-map/modules/experimental/computations.js.map +1 -1
- package/dist/esm/wafer-map/modules/experimental/data-manager.d.ts +4 -10
- package/dist/esm/wafer-map/modules/experimental/data-manager.js +8 -26
- package/dist/esm/wafer-map/modules/experimental/data-manager.js.map +1 -1
- package/dist/esm/wafer-map/modules/experimental/hover-handler.d.ts +1 -5
- package/dist/esm/wafer-map/modules/experimental/hover-handler.js +6 -10
- package/dist/esm/wafer-map/modules/experimental/hover-handler.js.map +1 -1
- package/dist/esm/wafer-map/modules/experimental/prerendering.d.ts +18 -0
- package/dist/esm/wafer-map/modules/experimental/prerendering.js +63 -0
- package/dist/esm/wafer-map/modules/experimental/prerendering.js.map +1 -0
- package/dist/esm/wafer-map/modules/experimental/worker-renderer.d.ts +0 -1
- package/dist/esm/wafer-map/modules/experimental/worker-renderer.js +6 -10
- package/dist/esm/wafer-map/modules/experimental/worker-renderer.js.map +1 -1
- package/dist/esm/wafer-map/modules/hover-handler.js +2 -4
- package/dist/esm/wafer-map/modules/hover-handler.js.map +1 -1
- package/dist/esm/wafer-map/types.d.ts +6 -0
- package/dist/esm/wafer-map/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computations.js","sourceRoot":"","sources":["../../../../../src/wafer-map/modules/experimental/computations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAsB,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAWzE;;GAEG;AACH,MAAM,OAAO,YAAY;IACrB,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAUD,YAAoC,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QAHrC,mBAAc,GAAG,CAAC,CAAC;QACnB,yBAAoB,GAAG,IAAI,CAAC;IAEY,CAAC;IAEnD,yBAAyB;QAC5B,MAAM,gBAAgB,GAAG;YACrB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW;YAChC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY;SACrC,CAAC;QACF,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAC3B,gB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AAG,EAAE,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;YACrC,KAAK,EAAE,UAAU,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK;YAC3C,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM;YAC9C,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;SAC3C,CAAC;IACN,CAAC;CACJ","sourcesContent":["import { scaleLinear, ScaleLinear } from 'd3-scale';\nimport type { WaferMap } from '../..';\nimport { Dimensions, Margin, WaferMapOriginLocation } from '../../types';\n\ninterface GridDimensions {\n origin: {\n x: number,\n y: number\n };\n rows: number;\n cols: number;\n}\n\n/**\n * Computations calculates and stores different measures which are used in the Wafermap\n */\nexport class Computations {\n public get containerDimensions(): Dimensions {\n return this._containerDimensions;\n }\n\n public get dieDimensions(): Dimensions {\n return this._dieDimensions;\n }\n\n public get margin(): Margin {\n return this._margin;\n }\n\n public get horizontalScale(): ScaleLinear<number, number> {\n return this._horizontalScale;\n }\n\n public get verticalScale(): ScaleLinear<number, number> {\n return this._verticalScale;\n }\n\n private _containerDimensions!: Dimensions;\n private _dieDimensions!: Dimensions;\n private _margin!: Margin;\n private _horizontalScale!: ScaleLinear<number, number>;\n private _verticalScale!: ScaleLinear<number, number>;\n private readonly defaultPadding = 0;\n private readonly baseMarginPercentage = 0.04;\n\n public constructor(private readonly wafermap: WaferMap) {}\n\n public updateContainerDimensions(): void {\n const canvasDimensions = {\n width: this.wafermap.canvasWidth,\n height: this.wafermap.canvasHeight\n };\n const canvasDiameter = Math.min(\n canvasDimensions.width,\n canvasDimensions.height\n );\n const canvasMargin = {\n top: (canvasDimensions.height - canvasDiameter) / 2,\n right: (canvasDimensions.width - canvasDiameter) / 2,\n bottom: (canvasDimensions.height - canvasDiameter) / 2,\n left: (canvasDimensions.width - canvasDiameter) / 2\n };\n const baseMargin = {\n top: canvasDiameter * this.baseMarginPercentage,\n right: canvasDiameter * this.baseMarginPercentage,\n bottom: canvasDiameter * this.baseMarginPercentage,\n left: canvasDiameter * this.baseMarginPercentage\n };\n this._margin = this.calculateMarginAddition(baseMargin, canvasMargin);\n this._containerDimensions = this.calculateContainerDimensions(\n canvasDimensions,\n this._margin\n );\n this.updateScales();\n }\n\n public updateScales(): void {\n const containerDiameter = Math.min(\n this._containerDimensions.width,\n this._containerDimensions.height\n );\n const gridDimensions = this.gridDimensionsValidAndDefined()\n ? this.calculateGridDimensionsFromBoundingBox()\n : this.calculateGridDimensionsFromDies();\n // this scale is used for positioning the dies on the canvas\n const originLocation = this.wafermap.originLocation;\n this._horizontalScale = this.createHorizontalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n // this scale is used for positioning the dies on the canvas\n this._verticalScale = this.createVerticalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n this._dieDimensions = {\n width: Math.abs(\n this._horizontalScale(0) - this._horizontalScale(1)\n ),\n height: Math.abs(this._verticalScale(0) - this._verticalScale(1))\n };\n }\n\n private gridDimensionsValidAndDefined(): boolean {\n return (\n !this.wafermap.validity.invalidGridDimensions\n && typeof this.wafermap.gridMinX === 'number'\n && typeof this.wafermap.gridMinY === 'number'\n && typeof this.wafermap.gridMaxX === 'number'\n && typeof this.wafermap.gridMinX === 'number'\n );\n }\n\n private calculateGridDimensionsFromBoundingBox(): GridDimensions {\n const gridDimensions = { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };\n if (\n typeof this.wafermap.gridMaxY === 'number'\n && typeof this.wafermap.gridMinY === 'number'\n && typeof this.wafermap.gridMaxX === 'number'\n && typeof this.wafermap.gridMinX === 'number'\n ) {\n gridDimensions.origin.x = this.wafermap.gridMinX;\n gridDimensions.origin.y = this.wafermap.gridMinY;\n gridDimensions.rows = this.wafermap.gridMaxY - this.wafermap.gridMinY + 1;\n gridDimensions.cols = this.wafermap.gridMaxX - this.wafermap.gridMinX + 1;\n }\n return gridDimensions;\n }\n\n private calculateGridDimensionsFromDies(): GridDimensions {\n if (this.wafermap.diesTable === undefined) {\n return { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };\n }\n\n const colIndex = this.wafermap.diesTable\n .getChild('colIndex')!\n .toArray();\n const rowIndex = this.wafermap.diesTable\n .getChild('rowIndex')!\n .toArray();\n\n const minPoint = { x: colIndex[0]!, y: rowIndex[0]! };\n const maxPoint = { x: colIndex[0]!, y: rowIndex[0]! };\n\n // will replace iterating with arquero after fixing issues: https://github.com/uwdata/arquero/pull/346\n for (let i = 0; i < colIndex.length; i++) {\n if (colIndex[i]! < minPoint.x) {\n minPoint.x = colIndex[i]!;\n }\n if (colIndex[i]! > maxPoint.x) {\n maxPoint.x = colIndex[i]!;\n }\n if (rowIndex[i]! < minPoint.y) {\n minPoint.y = rowIndex[i]!;\n }\n if (rowIndex[i]! > maxPoint.y) {\n maxPoint.y = rowIndex[i]!;\n }\n }\n\n return {\n origin: minPoint,\n rows: maxPoint.y - minPoint.y + 1,\n cols: maxPoint.x - minPoint.x + 1\n };\n }\n\n private calculateContainerDimensions(\n canvasDimensions: Dimensions,\n margin: Margin\n ): Dimensions {\n return {\n width: canvasDimensions.width - margin.left - margin.right,\n height: canvasDimensions.height - margin.top - margin.bottom\n };\n }\n\n private createHorizontalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerWidth: number\n ): ScaleLinear<number, number> {\n const scale = scaleLinear<number, number>();\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.topLeft\n ) {\n return scale\n .domain([grid.origin.x, grid.origin.x + grid.cols])\n .range([0, containerWidth]);\n }\n return scale\n .domain([grid.origin.x - 1, grid.origin.x + grid.cols - 1])\n .range([containerWidth, 0]);\n }\n\n private createVerticalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerHeight: number\n ): ScaleLinear<number, number> {\n const scale = scaleLinear<number, number>();\n // html canvas has top-left origin https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#the_grid\n // we need to flip the vertical scale\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.bottomRight\n ) {\n return scale\n .domain([grid.origin.y - 1, grid.origin.y + grid.rows - 1])\n .range([containerHeight, 0]);\n }\n return scale\n .domain([grid.origin.y, grid.origin.y + grid.rows])\n .range([0, containerHeight]);\n }\n\n private calculateMarginAddition(\n baseMargin: Margin,\n addedMargin: Margin\n ): Margin {\n return {\n top: baseMargin.top + addedMargin.top,\n right: baseMargin.right + addedMargin.right,\n bottom: baseMargin.bottom + addedMargin.bottom,\n left: baseMargin.left + addedMargin.left\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"computations.js","sourceRoot":"","sources":["../../../../../src/wafer-map/modules/experimental/computations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAsB,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAWzE;;GAEG;AACH,MAAM,OAAO,YAAY;IACrB,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAUD,YAAoC,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QAHrC,mBAAc,GAAG,CAAC,CAAC;QACnB,yBAAoB,GAAG,IAAI,CAAC;IAEY,CAAC;IAEnD,MAAM;QACT,MAAM,gBAAgB,GAAG;YACrB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW;YAChC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY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ACH,GAAG,EAAE,UAAU,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;YACrC,KAAK,EAAE,UAAU,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK;YAC3C,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM;YAC9C,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI;SAC3C,CAAC;IACN,CAAC;CACJ","sourcesContent":["import { scaleLinear, ScaleLinear } from 'd3-scale';\nimport type { WaferMap } from '../..';\nimport { Dimensions, Margin, WaferMapOriginLocation } from '../../types';\n\ninterface GridDimensions {\n origin: {\n x: number,\n y: number\n };\n rows: number;\n cols: number;\n}\n\n/**\n * Computations calculates and stores different measures which are used in the Wafermap\n */\nexport class Computations {\n public get containerDimensions(): Dimensions {\n return this._containerDimensions;\n }\n\n public get dieDimensions(): Dimensions {\n return this._dieDimensions;\n }\n\n public get margin(): Margin {\n return this._margin;\n }\n\n public get horizontalScale(): ScaleLinear<number, number> {\n return this._horizontalScale;\n }\n\n public get verticalScale(): ScaleLinear<number, number> {\n return this._verticalScale;\n }\n\n private _containerDimensions!: Dimensions;\n private _dieDimensions!: Dimensions;\n private _margin!: Margin;\n private _horizontalScale!: ScaleLinear<number, number>;\n private _verticalScale!: ScaleLinear<number, number>;\n private readonly defaultPadding = 0;\n private readonly baseMarginPercentage = 0.04;\n\n public constructor(private readonly wafermap: WaferMap) {}\n\n public update(): void {\n const canvasDimensions = {\n width: this.wafermap.canvasWidth,\n height: this.wafermap.canvasHeight\n };\n const canvasDiameter = Math.min(\n canvasDimensions.width,\n canvasDimensions.height\n );\n const canvasMargin = {\n top: (canvasDimensions.height - canvasDiameter) / 2,\n right: (canvasDimensions.width - canvasDiameter) / 2,\n bottom: (canvasDimensions.height - canvasDiameter) / 2,\n left: (canvasDimensions.width - canvasDiameter) / 2\n };\n const baseMargin = {\n top: canvasDiameter * this.baseMarginPercentage,\n right: canvasDiameter * this.baseMarginPercentage,\n bottom: canvasDiameter * this.baseMarginPercentage,\n left: canvasDiameter * this.baseMarginPercentage\n };\n this._margin = this.calculateMarginAddition(baseMargin, canvasMargin);\n this._containerDimensions = this.calculateContainerDimensions(\n canvasDimensions,\n this._margin\n );\n const containerDiameter = Math.min(\n this._containerDimensions.width,\n this._containerDimensions.height\n );\n const gridDimensions = this.gridDimensionsValidAndDefined()\n ? this.calculateGridDimensionsFromBoundingBox()\n : this.calculateGridDimensionsFromDies();\n // this scale is used for positioning the dies on the canvas\n const originLocation = this.wafermap.originLocation;\n this._horizontalScale = this.createHorizontalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n // this scale is used for positioning the dies on the canvas\n this._verticalScale = this.createVerticalScale(\n originLocation,\n gridDimensions,\n containerDiameter\n );\n this._dieDimensions = {\n width: Math.abs(\n this._horizontalScale(0) - this._horizontalScale(1)\n ),\n height: Math.abs(this._verticalScale(0) - this._verticalScale(1))\n };\n }\n\n private gridDimensionsValidAndDefined(): boolean {\n return (\n !this.wafermap.validity.invalidGridDimensions\n && typeof this.wafermap.gridMinX === 'number'\n && typeof this.wafermap.gridMinY === 'number'\n && typeof this.wafermap.gridMaxX === 'number'\n && typeof this.wafermap.gridMinX === 'number'\n );\n }\n\n private calculateGridDimensionsFromBoundingBox(): GridDimensions {\n const gridDimensions = { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };\n if (\n typeof this.wafermap.gridMaxY === 'number'\n && typeof this.wafermap.gridMinY === 'number'\n && typeof this.wafermap.gridMaxX === 'number'\n && typeof this.wafermap.gridMinX === 'number'\n ) {\n gridDimensions.origin.x = this.wafermap.gridMinX;\n gridDimensions.origin.y = this.wafermap.gridMinY;\n gridDimensions.rows = this.wafermap.gridMaxY - this.wafermap.gridMinY + 1;\n gridDimensions.cols = this.wafermap.gridMaxX - this.wafermap.gridMinX + 1;\n }\n return gridDimensions;\n }\n\n private calculateGridDimensionsFromDies(): GridDimensions {\n if (this.wafermap.diesTable === undefined) {\n return { origin: { x: 0, y: 0 }, rows: 0, cols: 0 };\n }\n\n const colIndex = this.wafermap.diesTable\n .getChild('colIndex')!\n .toArray();\n const rowIndex = this.wafermap.diesTable\n .getChild('rowIndex')!\n .toArray();\n\n const minPoint = { x: colIndex[0]!, y: rowIndex[0]! };\n const maxPoint = { x: colIndex[0]!, y: rowIndex[0]! };\n\n // will replace iterating with arquero after fixing issues: https://github.com/uwdata/arquero/pull/346\n for (let i = 0; i < colIndex.length; i++) {\n if (colIndex[i]! < minPoint.x) {\n minPoint.x = colIndex[i]!;\n }\n if (colIndex[i]! > maxPoint.x) {\n maxPoint.x = colIndex[i]!;\n }\n if (rowIndex[i]! < minPoint.y) {\n minPoint.y = rowIndex[i]!;\n }\n if (rowIndex[i]! > maxPoint.y) {\n maxPoint.y = rowIndex[i]!;\n }\n }\n\n return {\n origin: minPoint,\n rows: maxPoint.y - minPoint.y + 1,\n cols: maxPoint.x - minPoint.x + 1\n };\n }\n\n private calculateContainerDimensions(\n canvasDimensions: Dimensions,\n margin: Margin\n ): Dimensions {\n return {\n width: canvasDimensions.width - margin.left - margin.right,\n height: canvasDimensions.height - margin.top - margin.bottom\n };\n }\n\n private createHorizontalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerWidth: number\n ): ScaleLinear<number, number> {\n const scale = scaleLinear<number, number>();\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.topLeft\n ) {\n return scale\n .domain([grid.origin.x, grid.origin.x + grid.cols])\n .range([0, containerWidth]);\n }\n return scale\n .domain([grid.origin.x - 1, grid.origin.x + grid.cols - 1])\n .range([containerWidth, 0]);\n }\n\n private createVerticalScale(\n originLocation: WaferMapOriginLocation,\n grid: GridDimensions,\n containerHeight: number\n ): ScaleLinear<number, number> {\n const scale = scaleLinear<number, number>();\n // html canvas has top-left origin https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#the_grid\n // we need to flip the vertical scale\n if (\n originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.bottomRight\n ) {\n return scale\n .domain([grid.origin.y - 1, grid.origin.y + grid.rows - 1])\n .range([containerHeight, 0]);\n }\n return scale\n .domain([grid.origin.y, grid.origin.y + grid.rows])\n .range([0, containerHeight]);\n }\n\n private calculateMarginAddition(\n baseMargin: Margin,\n addedMargin: Margin\n ): Margin {\n return {\n top: baseMargin.top + addedMargin.top,\n right: baseMargin.right + addedMargin.right,\n bottom: baseMargin.bottom + addedMargin.bottom,\n left: baseMargin.left + addedMargin.left\n };\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ScaleLinear } from 'd3-scale';
|
|
2
2
|
import type { WaferMap } from '../..';
|
|
3
|
-
import type { Dimensions, Margin
|
|
3
|
+
import type { ColorScale, Dimensions, Margin } from '../../types';
|
|
4
4
|
/**
|
|
5
5
|
* Data Manager uses Computations and Prerendering modules in order and exposes the results
|
|
6
6
|
*/
|
|
@@ -12,16 +12,10 @@ export declare class DataManager {
|
|
|
12
12
|
get horizontalScale(): ScaleLinear<number, number>;
|
|
13
13
|
get verticalScale(): ScaleLinear<number, number>;
|
|
14
14
|
get labelsFontSize(): number;
|
|
15
|
-
get
|
|
16
|
-
get data(): Map<string, WaferMapDie>;
|
|
15
|
+
get colorScale(): ColorScale;
|
|
17
16
|
private readonly computations;
|
|
18
17
|
private readonly prerendering;
|
|
19
|
-
private dataMap;
|
|
20
18
|
constructor(wafermap: WaferMap);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
updateLabelsFontSize(): void;
|
|
24
|
-
updateDiesRenderInfo(): void;
|
|
25
|
-
getWaferMapDie(point: PointCoordinates): WaferMapDie | undefined;
|
|
26
|
-
private updateDataMap;
|
|
19
|
+
updateComputations(): void;
|
|
20
|
+
updatePrerendering(): void;
|
|
27
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Computations } from './computations';
|
|
2
|
-
import { Prerendering } from '
|
|
2
|
+
import { Prerendering } from './prerendering';
|
|
3
3
|
/**
|
|
4
4
|
* Data Manager uses Computations and Prerendering modules in order and exposes the results
|
|
5
5
|
*/
|
|
@@ -22,38 +22,20 @@ export class DataManager {
|
|
|
22
22
|
get labelsFontSize() {
|
|
23
23
|
return this.prerendering.labelsFontSize;
|
|
24
24
|
}
|
|
25
|
-
get
|
|
26
|
-
return this.prerendering.
|
|
27
|
-
}
|
|
28
|
-
get data() {
|
|
29
|
-
return this.dataMap;
|
|
25
|
+
get colorScale() {
|
|
26
|
+
return this.prerendering.colorScale;
|
|
30
27
|
}
|
|
31
28
|
constructor(wafermap) {
|
|
32
29
|
this.wafermap = wafermap;
|
|
33
30
|
this.computations = new Computations(wafermap);
|
|
34
31
|
this.prerendering = new Prerendering(wafermap);
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
this.computations.
|
|
38
|
-
this.
|
|
39
|
-
this.updateLabelsFontSize();
|
|
40
|
-
}
|
|
41
|
-
updateScales() {
|
|
42
|
-
this.computations.updateScales();
|
|
43
|
-
this.updateDataMap();
|
|
44
|
-
this.updateLabelsFontSize();
|
|
45
|
-
}
|
|
46
|
-
updateLabelsFontSize() {
|
|
47
|
-
this.prerendering.updateLabelsFontSize();
|
|
48
|
-
}
|
|
49
|
-
updateDiesRenderInfo() {
|
|
50
|
-
this.prerendering.updateDiesRenderInfo();
|
|
51
|
-
}
|
|
52
|
-
getWaferMapDie(point) {
|
|
53
|
-
return this.dataMap.get(`${point.x}_${point.y}`);
|
|
33
|
+
updateComputations() {
|
|
34
|
+
this.computations.update();
|
|
35
|
+
this.prerendering.update();
|
|
54
36
|
}
|
|
55
|
-
|
|
56
|
-
this.
|
|
37
|
+
updatePrerendering() {
|
|
38
|
+
this.prerendering.update();
|
|
57
39
|
}
|
|
58
40
|
}
|
|
59
41
|
//# sourceMappingURL=data-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-manager.js","sourceRoot":"","sources":["../../../../../src/wafer-map/modules/experimental/data-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"data-manager.js","sourceRoot":"","sources":["../../../../../src/wafer-map/modules/experimental/data-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C;;GAEG;AACH,MAAM,OAAO,WAAW;IACpB,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC;IACjD,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC;IAC3C,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;IACpC,CAAC;IAED,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC;IAC7C,CAAC;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC;IAC3C,CAAC;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC;IAC5C,CAAC;IAED,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;IACxC,CAAC;IAKD,YAAoC,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QAClD,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC;IAEM,kBAAkB;QACrB,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;IAEM,kBAAkB;QACrB,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;CACJ","sourcesContent":["import type { ScaleLinear } from 'd3-scale';\nimport { Computations } from './computations';\nimport { Prerendering } from './prerendering';\nimport type { WaferMap } from '../..';\nimport type { ColorScale, Dimensions, Margin } from '../../types';\n\n/**\n * Data Manager uses Computations and Prerendering modules in order and exposes the results\n */\nexport class DataManager {\n public get containerDimensions(): Dimensions {\n return this.computations.containerDimensions;\n }\n\n public get dieDimensions(): Dimensions {\n return this.computations.dieDimensions;\n }\n\n public get margin(): Margin {\n return this.computations.margin;\n }\n\n public get horizontalScale(): ScaleLinear<number, number> {\n return this.computations.horizontalScale;\n }\n\n public get verticalScale(): ScaleLinear<number, number> {\n return this.computations.verticalScale;\n }\n\n public get labelsFontSize(): number {\n return this.prerendering.labelsFontSize;\n }\n\n public get colorScale(): ColorScale {\n return this.prerendering.colorScale;\n }\n\n private readonly computations: Computations;\n private readonly prerendering: Prerendering;\n\n public constructor(private readonly wafermap: WaferMap) {\n this.computations = new Computations(wafermap);\n this.prerendering = new Prerendering(wafermap);\n }\n\n public updateComputations(): void {\n this.computations.update();\n this.prerendering.update();\n }\n\n public updatePrerendering(): void {\n this.prerendering.update();\n }\n}\n"]}
|
|
@@ -13,11 +13,7 @@ export declare class HoverHandler {
|
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
15
|
disconnect(): void;
|
|
16
|
-
|
|
17
|
-
* @internal
|
|
18
|
-
* keep public for testing until data manager refactor
|
|
19
|
-
*/
|
|
20
|
-
readonly onMouseMove: (event: MouseEvent) => void;
|
|
16
|
+
private readonly onMouseMove;
|
|
21
17
|
private readonly onMouseOut;
|
|
22
18
|
private calculateDieCoordinates;
|
|
23
19
|
}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { WaferMapOriginLocation } from '../../types';
|
|
2
|
-
import { DataManager } from './data-manager';
|
|
3
2
|
/**
|
|
4
3
|
* HoverHandler deals with user interactions and events like hovering
|
|
5
4
|
*/
|
|
6
5
|
export class HoverHandler {
|
|
7
6
|
constructor(wafermap) {
|
|
8
7
|
this.wafermap = wafermap;
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
* keep public for testing until data manager refactor
|
|
12
|
-
*/
|
|
13
8
|
this.onMouseMove = (event) => {
|
|
14
|
-
if (!this.wafermap.
|
|
9
|
+
if (!this.wafermap.isExperimentalUpdate()) {
|
|
15
10
|
return;
|
|
16
11
|
}
|
|
17
12
|
// get original mouse position in case we are in zoom.
|
|
@@ -66,8 +61,7 @@ export class HoverHandler {
|
|
|
66
61
|
this.wafermap.removeEventListener('mouseout', this.onMouseOut);
|
|
67
62
|
}
|
|
68
63
|
calculateDieCoordinates(mousePosition) {
|
|
69
|
-
if (this.wafermap.
|
|
70
|
-
&& this.wafermap.dataManager instanceof DataManager) {
|
|
64
|
+
if (this.wafermap.isExperimentalUpdate()) {
|
|
71
65
|
const originLocation = this.wafermap.originLocation;
|
|
72
66
|
const xRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
|
|
73
67
|
|| originLocation === WaferMapOriginLocation.topLeft
|
|
@@ -78,8 +72,10 @@ export class HoverHandler {
|
|
|
78
72
|
? Math.ceil
|
|
79
73
|
: Math.floor;
|
|
80
74
|
// go to x and y scale to get the x,y values of the die.
|
|
81
|
-
const x = xRoundFunction(this.wafermap.
|
|
82
|
-
|
|
75
|
+
const x = xRoundFunction(this.wafermap.experimentalDataManager.horizontalScale.invert(mousePosition.x
|
|
76
|
+
- this.wafermap.experimentalDataManager.margin.left));
|
|
77
|
+
const y = yRoundFunction(this.wafermap.experimentalDataManager.verticalScale.invert(mousePosition.y
|
|
78
|
+
- this.wafermap.experimentalDataManager.margin.top));
|
|
83
79
|
return { x, y };
|
|
84
80
|
}
|
|
85
81
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-handler.js","sourceRoot":"","sources":["../../../../../src/wafer-map/modules/experimental/hover-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,sBAAsB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"hover-handler.js","sourceRoot":"","sources":["../../../../../src/wafer-map/modules/experimental/hover-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEvE;;GAEG;AACH,MAAM,OAAO,YAAY;IACrB,YAAoC,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QAkBrC,gBAAW,GAAG,CAAC,KAAiB,EAAQ,EAAE;YACvD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,EAAE;gBACvC,OAAO;aACV;YACD,sDAAsD;YACtD,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC;gBACjD,KAAK,CAAC,OAAO;gBACb,KAAK,CAAC,OAAO;aAChB,CAAC,CAAC;YACH,MAAM,cAAc,GAAG,IAAI,CAAC,uBAAuB,CAAC;gBAChD,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC;gBACnB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC;aACtB,CAAC,CAAC;YACH,IAAI,cAAc,KAAK,SAAS,EAAE;gBAC9B,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,SAAS,CAAC;gBACnC,OAAO;aACV;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ;iBACzB,SAAU,CAAC,QAAQ,CAAC,UAAU,CAAE;iBAChC,OAAO,EAAE,CAAC;YACf,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ;iBACzB,SAAU,CAAC,QAAQ,CAAC,UAAU,CAAE;iBAChC,OAAO,EAAE,CAAC;YAEf,oEAAoE;YACpE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACtC,I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AI,CAAC,IAAI,CAAC;YAChB,MAAM,cAAc,GAAG,cAAc,KAAK,sBAAsB,CAAC,UAAU;mBACpE,cAAc,KAAK,sBAAsB,CAAC,WAAW;gBACxD,CAAC,CAAC,IAAI,CAAC,IAAI;gBACX,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YACjB,wDAAwD;YACxD,MAAM,CAAC,GAAG,cAAc,CACpB,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,eAAe,CAAC,MAAM,CACxD,aAAa,CAAC,CAAC;kBACT,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAC1D,CACJ,CAAC;YACF,MAAM,CAAC,GAAG,cAAc,CACpB,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,aAAa,CAAC,MAAM,CACtD,aAAa,CAAC,CAAC;kBACT,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,MAAM,CAAC,GAAG,CACzD,CACJ,CAAC;YACF,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;SACnB;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ","sourcesContent":["import type { WaferMap } from '../..';\nimport { PointCoordinates, WaferMapOriginLocation } from '../../types';\n\n/**\n * HoverHandler deals with user interactions and events like hovering\n */\nexport class HoverHandler {\n public constructor(private readonly wafermap: WaferMap) {}\n\n /**\n * @internal\n */\n public connect(): void {\n this.wafermap.addEventListener('mousemove', this.onMouseMove);\n this.wafermap.addEventListener('mouseout', this.onMouseOut);\n }\n\n /**\n * @internal\n */\n public disconnect(): void {\n this.wafermap.removeEventListener('mousemove', this.onMouseMove);\n this.wafermap.removeEventListener('mouseout', this.onMouseOut);\n }\n\n private readonly onMouseMove = (event: MouseEvent): void => {\n if (!this.wafermap.isExperimentalUpdate()) {\n return;\n }\n // get original mouse position in case we are in zoom.\n const invertedPoint = this.wafermap.transform.invert([\n event.offsetX,\n event.offsetY\n ]);\n const dieCoordinates = this.calculateDieCoordinates({\n x: invertedPoint[0],\n y: invertedPoint[1]\n });\n if (dieCoordinates === undefined) {\n this.wafermap.hoverDie = undefined;\n return;\n }\n const colIndex = this.wafermap\n .diesTable!.getChild('colIndex')!\n .toArray();\n const rowIndex = this.wafermap\n .diesTable!.getChild('rowIndex')!\n .toArray();\n\n // will replace iterating with arquero filtering after fixing errors\n for (let i = 0; i < colIndex.length; i++) {\n if (\n colIndex[i] === dieCoordinates.x\n && rowIndex[i] === dieCoordinates.y\n ) {\n this.wafermap.hoverDie = {\n index: i,\n x: dieCoordinates.x,\n y: dieCoordinates.y\n };\n return;\n }\n }\n this.wafermap.hoverDie = undefined;\n };\n\n private readonly onMouseOut = (_event: MouseEvent): void => {\n this.wafermap.hoverDie = undefined;\n };\n\n private calculateDieCoordinates(\n mousePosition: PointCoordinates\n ): PointCoordinates | undefined {\n if (this.wafermap.isExperimentalUpdate()) {\n const originLocation = this.wafermap.originLocation;\n const xRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.topLeft\n ? Math.floor\n : Math.ceil;\n const yRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.bottomRight\n ? Math.ceil\n : Math.floor;\n // go to x and y scale to get the x,y values of the die.\n const x = xRoundFunction(\n this.wafermap.experimentalDataManager.horizontalScale.invert(\n mousePosition.x\n - this.wafermap.experimentalDataManager.margin.left\n )\n );\n const y = yRoundFunction(\n this.wafermap.experimentalDataManager.verticalScale.invert(\n mousePosition.y\n - this.wafermap.experimentalDataManager.margin.top\n )\n );\n return { x, y };\n }\n return undefined;\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ColorScale } from '../../types';
|
|
2
|
+
import type { WaferMap } from '../..';
|
|
3
|
+
/**
|
|
4
|
+
* Prerendering prepares render-ready dies data to be used by the rendering module
|
|
5
|
+
*/
|
|
6
|
+
export declare class Prerendering {
|
|
7
|
+
private readonly wafermap;
|
|
8
|
+
get labelsFontSize(): number;
|
|
9
|
+
get colorScale(): ColorScale;
|
|
10
|
+
private _colorScale;
|
|
11
|
+
private _labelsFontSize;
|
|
12
|
+
private readonly fontSizeFactor;
|
|
13
|
+
private readonly colorScaleResolution;
|
|
14
|
+
constructor(wafermap: WaferMap);
|
|
15
|
+
update(): void;
|
|
16
|
+
private calculateColorScale;
|
|
17
|
+
private calculateLabelsFontSize;
|
|
18
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { scaleLinear } from 'd3-scale';
|
|
2
|
+
import { ticks } from 'd3-array';
|
|
3
|
+
import { WaferMapColorScaleMode } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Prerendering prepares render-ready dies data to be used by the rendering module
|
|
6
|
+
*/
|
|
7
|
+
export class Prerendering {
|
|
8
|
+
get labelsFontSize() {
|
|
9
|
+
return this._labelsFontSize;
|
|
10
|
+
}
|
|
11
|
+
get colorScale() {
|
|
12
|
+
return this._colorScale;
|
|
13
|
+
}
|
|
14
|
+
constructor(wafermap) {
|
|
15
|
+
this.wafermap = wafermap;
|
|
16
|
+
this.fontSizeFactor = 0.8;
|
|
17
|
+
this.colorScaleResolution = 10;
|
|
18
|
+
}
|
|
19
|
+
update() {
|
|
20
|
+
this._labelsFontSize = this.calculateLabelsFontSize(this.wafermap.experimentalDataManager.dieDimensions, this.wafermap.maxCharacters);
|
|
21
|
+
this._colorScale = this.calculateColorScale();
|
|
22
|
+
}
|
|
23
|
+
calculateColorScale() {
|
|
24
|
+
if (this.wafermap.colorScaleMode === WaferMapColorScaleMode.linear) {
|
|
25
|
+
const values = this.wafermap.colorScale.values.map(item => +item);
|
|
26
|
+
const d3ColorScale = scaleLinear()
|
|
27
|
+
.domain(values)
|
|
28
|
+
.range(this.wafermap.colorScale.colors);
|
|
29
|
+
let min = values[0];
|
|
30
|
+
let max = values[0];
|
|
31
|
+
values.forEach(value => {
|
|
32
|
+
if (value < min) {
|
|
33
|
+
min = value;
|
|
34
|
+
}
|
|
35
|
+
if (value > max) {
|
|
36
|
+
max = value;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
// the linear color scale will not be infinite but will be limited by the color scale resolution
|
|
40
|
+
const valueSamples = ticks(min, max, values.length * this.colorScaleResolution);
|
|
41
|
+
return valueSamples.map(value => {
|
|
42
|
+
return {
|
|
43
|
+
color: d3ColorScale(value),
|
|
44
|
+
value
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// ordinal color categories have to be sorted by value
|
|
49
|
+
return this.wafermap.colorScale.colors
|
|
50
|
+
.map((color, index) => {
|
|
51
|
+
return {
|
|
52
|
+
color,
|
|
53
|
+
value: +this.wafermap.colorScale.values[index]
|
|
54
|
+
};
|
|
55
|
+
})
|
|
56
|
+
.sort((a, b) => a.value - b.value);
|
|
57
|
+
}
|
|
58
|
+
calculateLabelsFontSize(dieDimensions, maxCharacters) {
|
|
59
|
+
return Math.min(dieDimensions.height, (dieDimensions.width / (Math.max(2, maxCharacters) * 0.5))
|
|
60
|
+
* this.fontSizeFactor);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=prerendering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prerendering.js","sourceRoot":"","sources":["../../../../../src/wafer-map/modules/experimental/prerendering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAIrD;;GAEG;AACH,MAAM,OAAO,YAAY;IACrB,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IASD,YAAoC,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QAHrC,m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,CAAC;oBAC1B,KAAK;iBACR,CAAC;YACN,CAAC,CAAC,CAAC;SACN;QACD,sDAAsD;QACtD,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM;aACjC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAClB,OAAO;gBACH,KAAK;gBACL,KAAK,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAE;aAClD,CAAC;QACN,CAAC,CAAC;aACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAEO,uBAAuB,CAC3B,aAAyB,EACzB,aAAqB;QAErB,OAAO,IAAI,CAAC,GAAG,CACX,aAAa,CAAC,MAAM,EACpB,CAAC,aAAa,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG,GAAG,CAAC,CAAC;cACpD,IAAI,CAAC,cAAc,CAC5B,CAAC;IACN,CAAC;CACJ","sourcesContent":["import { scaleLinear } from 'd3-scale';\nimport { ticks } from 'd3-array';\nimport { WaferMapColorScaleMode } from '../../types';\nimport type { ColorScale, Dimensions } from '../../types';\nimport type { WaferMap } from '../..';\n\n/**\n * Prerendering prepares render-ready dies data to be used by the rendering module\n */\nexport class Prerendering {\n public get labelsFontSize(): number {\n return this._labelsFontSize;\n }\n\n public get colorScale(): ColorScale {\n return this._colorScale;\n }\n\n private _colorScale!: ColorScale;\n\n private _labelsFontSize!: number;\n\n private readonly fontSizeFactor = 0.8;\n private readonly colorScaleResolution = 10;\n\n public constructor(private readonly wafermap: WaferMap) {}\n\n public update(): void {\n this._labelsFontSize = this.calculateLabelsFontSize(\n this.wafermap.experimentalDataManager.dieDimensions,\n this.wafermap.maxCharacters\n );\n this._colorScale = this.calculateColorScale();\n }\n\n private calculateColorScale(): ColorScale {\n if (this.wafermap.colorScaleMode === WaferMapColorScaleMode.linear) {\n const values = this.wafermap.colorScale.values.map(item => +item);\n const d3ColorScale = scaleLinear<string, string>()\n .domain(values)\n .range(this.wafermap.colorScale.colors);\n let min = values[0]!;\n let max = values[0]!;\n values.forEach(value => {\n if (value < min) {\n min = value;\n }\n if (value > max) {\n max = value;\n }\n });\n // the linear color scale will not be infinite but will be limited by the color scale resolution\n const valueSamples = ticks(\n min,\n max,\n values.length * this.colorScaleResolution\n );\n return valueSamples.map(value => {\n return {\n color: d3ColorScale(value),\n value\n };\n });\n }\n // ordinal color categories have to be sorted by value\n return this.wafermap.colorScale.colors\n .map((color, index) => {\n return {\n color,\n value: +this.wafermap.colorScale.values[index]!\n };\n })\n .sort((a, b) => a.value - b.value);\n }\n\n private calculateLabelsFontSize(\n dieDimensions: Dimensions,\n maxCharacters: number\n ): number {\n return Math.min(\n dieDimensions.height,\n (dieDimensions.width / (Math.max(2, maxCharacters) * 0.5))\n * this.fontSizeFactor\n );\n }\n}\n"]}
|
|
@@ -6,18 +6,14 @@ export class WorkerRenderer {
|
|
|
6
6
|
constructor(wafermap) {
|
|
7
7
|
this.wafermap = wafermap;
|
|
8
8
|
}
|
|
9
|
-
updateSortedDiesAndDrawWafer() {
|
|
10
|
-
// redundant function for backwards compatibility
|
|
11
|
-
this.drawWafer();
|
|
12
|
-
}
|
|
13
9
|
drawWafer() {
|
|
14
10
|
// rendering will be implemented in a future PR
|
|
15
11
|
this.renderHover();
|
|
16
12
|
}
|
|
17
13
|
renderHover() {
|
|
18
|
-
this.wafermap.hoverWidth = this.wafermap.
|
|
14
|
+
this.wafermap.hoverWidth = this.wafermap.experimentalDataManager.dieDimensions.width
|
|
19
15
|
* this.wafermap.transform.k;
|
|
20
|
-
this.wafermap.hoverHeight = this.wafermap.
|
|
16
|
+
this.wafermap.hoverHeight = this.wafermap.experimentalDataManager.dieDimensions.height
|
|
21
17
|
* this.wafermap.transform.k;
|
|
22
18
|
this.wafermap.hoverOpacity = this.wafermap.hoverDie === undefined
|
|
23
19
|
? HoverDieOpacity.hide
|
|
@@ -26,17 +22,17 @@ export class WorkerRenderer {
|
|
|
26
22
|
}
|
|
27
23
|
calculateHoverTransform() {
|
|
28
24
|
if (this.wafermap.hoverDie !== undefined) {
|
|
29
|
-
const scaledX = this.wafermap.
|
|
25
|
+
const scaledX = this.wafermap.experimentalDataManager.horizontalScale(this.wafermap.hoverDie.x);
|
|
30
26
|
if (scaledX === undefined) {
|
|
31
27
|
return '';
|
|
32
28
|
}
|
|
33
|
-
const scaledY = this.wafermap.
|
|
29
|
+
const scaledY = this.wafermap.experimentalDataManager.verticalScale(this.wafermap.hoverDie.y);
|
|
34
30
|
if (scaledY === undefined) {
|
|
35
31
|
return '';
|
|
36
32
|
}
|
|
37
33
|
const transformedPoint = this.wafermap.transform.apply([
|
|
38
|
-
scaledX + this.wafermap.
|
|
39
|
-
scaledY + this.wafermap.
|
|
34
|
+
scaledX + this.wafermap.experimentalDataManager.margin.left,
|
|
35
|
+
scaledY + this.wafermap.experimentalDataManager.margin.top
|
|
40
36
|
]);
|
|
41
37
|
return `translate(${transformedPoint[0]}, ${transformedPoint[1]})`;
|
|
42
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-renderer.js","sourceRoot":"","sources":["../../../../../src/wafer-map/modules/experimental/worker-renderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,OAAO,cAAc;IACvB,YAAoC,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;IAAG,CAAC;IAEnD,
|
|
1
|
+
{"version":3,"file":"worker-renderer.js","sourceRoot":"","sources":["../../../../../src/wafer-map/modules/experimental/worker-renderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,MAAM,OAAO,cAAc;IACvB,YAAoC,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AAC,SAAS,CAAC,KAAK,CAAC;gBACnD,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI;gBAC3D,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,MAAM,CAAC,GAAG;aAC7D,CAAC,CAAC;YACH,OAAO,aAAa,gBAAgB,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC;SACtE;QACD,OAAO,EAAE,CAAC;IACd,CAAC;CACJ","sourcesContent":["import type { WaferMap } from '../..';\nimport { HoverDieOpacity } from '../../types';\n\n/**\n * Responsible for drawing the dies inside the wafer map, adding dieText and scaling the canvas\n */\nexport class WorkerRenderer {\n public constructor(private readonly wafermap: WaferMap) {}\n\n public drawWafer(): void {\n // rendering will be implemented in a future PR\n this.renderHover();\n }\n\n public renderHover(): void {\n this.wafermap.hoverWidth = this.wafermap.experimentalDataManager.dieDimensions.width\n * this.wafermap.transform.k;\n this.wafermap.hoverHeight = this.wafermap.experimentalDataManager.dieDimensions.height\n * this.wafermap.transform.k;\n this.wafermap.hoverOpacity = this.wafermap.hoverDie === undefined\n ? HoverDieOpacity.hide\n : HoverDieOpacity.show;\n this.wafermap.hoverTransform = this.calculateHoverTransform();\n }\n\n private calculateHoverTransform(): string {\n if (this.wafermap.hoverDie !== undefined) {\n const scaledX = this.wafermap.experimentalDataManager.horizontalScale(\n this.wafermap.hoverDie.x\n );\n if (scaledX === undefined) {\n return '';\n }\n const scaledY = this.wafermap.experimentalDataManager.verticalScale(\n this.wafermap.hoverDie.y\n );\n if (scaledY === undefined) {\n return '';\n }\n const transformedPoint = this.wafermap.transform.apply([\n scaledX + this.wafermap.experimentalDataManager.margin.left,\n scaledY + this.wafermap.experimentalDataManager.margin.top\n ]);\n return `translate(${transformedPoint[0]}, ${transformedPoint[1]})`;\n }\n return '';\n }\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WaferMapOriginLocation } from '../types';
|
|
2
|
-
import { DataManager } from './data-manager';
|
|
3
2
|
/**
|
|
4
3
|
* HoverHandler deals with user interactions and events like hovering
|
|
5
4
|
*/
|
|
@@ -7,7 +6,7 @@ export class HoverHandler {
|
|
|
7
6
|
constructor(wafermap) {
|
|
8
7
|
this.wafermap = wafermap;
|
|
9
8
|
this.onMouseMove = (event) => {
|
|
10
|
-
if (this.wafermap.
|
|
9
|
+
if (this.wafermap.isExperimentalUpdate()) {
|
|
11
10
|
return;
|
|
12
11
|
}
|
|
13
12
|
const mousePosition = {
|
|
@@ -52,8 +51,7 @@ export class HoverHandler {
|
|
|
52
51
|
this.wafermap.removeEventListener('mouseout', this.onMouseOut);
|
|
53
52
|
}
|
|
54
53
|
calculateDieCoordinates(mousePosition) {
|
|
55
|
-
if (!this.wafermap.
|
|
56
|
-
&& this.wafermap.dataManager instanceof DataManager) {
|
|
54
|
+
if (!this.wafermap.isExperimentalUpdate()) {
|
|
57
55
|
const originLocation = this.wafermap.originLocation;
|
|
58
56
|
const xRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
|
|
59
57
|
|| originLocation === WaferMapOriginLocation.topLeft
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-handler.js","sourceRoot":"","sources":["../../../../src/wafer-map/modules/hover-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,sBAAsB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"hover-handler.js","sourceRoot":"","sources":["../../../../src/wafer-map/modules/hover-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEpE;;GAEG;AACH,MAAM,OAAO,YAAY;IACrB,YAAoC,QAAkB;QAAlB,aAAQ,GAAR,QAAQ,CAAU;QAkBrC,gBAAW,GAAG,CAAC,KAAiB,EAAQ,EAAE;YACvD,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,EAAE;gBAC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AAC,EACf,aAAa,CAAC,CAAC,EACf,CAAC,EACD,CAAC,CACJ,CAAC,IAAI,CAAC;QACP,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE;YACtB,OAAO,IAAI,KAAK,CAAC;SACpB;QACD,OAAO,OAAO,GAAG,CAAC,CAAC;IACvB,CAAC;CACJ","sourcesContent":["import type { WaferMap } from '..';\nimport { PointCoordinates, WaferMapOriginLocation } from '../types';\n\n/**\n * HoverHandler deals with user interactions and events like hovering\n */\nexport class HoverHandler {\n public constructor(private readonly wafermap: WaferMap) {}\n\n /**\n * @internal\n */\n public connect(): void {\n this.wafermap.addEventListener('mousemove', this.onMouseMove);\n this.wafermap.addEventListener('mouseout', this.onMouseOut);\n }\n\n /**\n * @internal\n */\n public disconnect(): void {\n this.wafermap.removeEventListener('mousemove', this.onMouseMove);\n this.wafermap.removeEventListener('mouseout', this.onMouseOut);\n }\n\n private readonly onMouseMove = (event: MouseEvent): void => {\n if (this.wafermap.isExperimentalUpdate()) {\n return;\n }\n const mousePosition: PointCoordinates = {\n x: event.offsetX,\n y: event.offsetY\n };\n\n if (!this.hoversOverDie(mousePosition)) {\n this.wafermap.hoverDie = undefined;\n return;\n }\n // get original mouse position in case we are in zoom.\n const invertedPoint = this.wafermap.transform.invert([\n mousePosition.x,\n mousePosition.y\n ]);\n\n const dieCoordinates = this.calculateDieCoordinates({\n x: invertedPoint[0],\n y: invertedPoint[1]\n });\n if (dieCoordinates === undefined) {\n this.wafermap.hoverDie = undefined;\n return;\n }\n this.wafermap.hoverDie = this.wafermap.dataManager.getWaferMapDie(dieCoordinates);\n };\n\n private readonly onMouseOut = (_event: MouseEvent): void => {\n this.wafermap.hoverDie = undefined;\n };\n\n private calculateDieCoordinates(\n mousePosition: PointCoordinates\n ): PointCoordinates | undefined {\n if (!this.wafermap.isExperimentalUpdate()) {\n const originLocation = this.wafermap.originLocation;\n const xRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.topLeft\n ? Math.floor\n : Math.ceil;\n const yRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft\n || originLocation === WaferMapOriginLocation.bottomRight\n ? Math.floor\n : Math.ceil;\n // go to x and y scale to get the x,y values of the die.\n const x = xRoundFunction(\n this.wafermap.dataManager.invertedHorizontalScale(\n mousePosition.x - this.wafermap.dataManager.margin.left\n )\n );\n const y = yRoundFunction(\n this.wafermap.dataManager.invertedVerticalScale(\n mousePosition.y - this.wafermap.dataManager.margin.top\n )\n );\n return { x, y };\n }\n return undefined;\n }\n\n private hoversOverDie(mousePosition: PointCoordinates): boolean {\n const rgba = this.wafermap.canvasContext.getImageData(\n mousePosition.x,\n mousePosition.y,\n 1,\n 1\n ).data;\n let rgbaSum = 0;\n for (const color of rgba) {\n rgbaSum += color;\n }\n return rgbaSum > 0;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/wafer-map/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,WAAW;CACf,CAAC;AAKX,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC;AAKX,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;CACN,CAAC;AAKX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACZ,CAAC","sourcesContent":["import type { Float64, Int32 } from 'apache-arrow';\n\nexport const WaferMapOriginLocation = {\n bottomLeft: 'bottom-left',\n bottomRight: 'bottom-right',\n topLeft: 'top-left',\n topRight: 'top-right'\n} as const;\n\nexport type WaferMapOriginLocation =\n (typeof WaferMapOriginLocation)[keyof typeof WaferMapOriginLocation];\n\nexport const WaferMapOrientation = {\n top: 'top',\n bottom: 'bottom',\n left: 'left',\n right: 'right'\n} as const;\n\nexport type WaferMapOrientation =\n (typeof WaferMapOrientation)[keyof typeof WaferMapOrientation];\n\nexport const HoverDieOpacity = {\n show: 'show',\n hide: 'hide'\n} as const;\n\nexport type HoverDieOpacity =\n (typeof HoverDieOpacity)[keyof typeof HoverDieOpacity];\n\nexport const WaferMapColorScaleMode = {\n linear: 'linear',\n ordinal: 'ordinal'\n} as const;\n\nexport type WaferMapColorScaleMode =\n (typeof WaferMapColorScaleMode)[keyof typeof WaferMapColorScaleMode];\n\nexport interface WaferMapDie {\n value: string;\n x: number;\n y: number;\n // The metadata field is not used by the wafer-map and is only for optionally storing arbitrary metadata.\n metadata?: unknown;\n tags?: string[];\n}\n\nexport interface HoverDie {\n index: number;\n x: number;\n y: number;\n}\n\nexport interface WaferMapColorScale {\n colors: string[];\n values: string[];\n}\n\nexport interface Dimensions {\n readonly width: number;\n readonly height: number;\n}\n\nexport interface Margin {\n readonly top: number;\n readonly right: number;\n readonly bottom: number;\n readonly left: number;\n}\n\nexport interface DieRenderInfo {\n readonly x: number;\n readonly y: number;\n readonly fillStyle: string;\n readonly text: string;\n}\n\nexport interface PointCoordinates {\n readonly x: number;\n readonly y: number;\n}\n\nexport interface ValidityObject {\n [key: string]: boolean;\n}\nexport interface WaferMapValidity extends ValidityObject {\n readonly invalidGridDimensions: boolean;\n readonly invalidDiesTableSchema: boolean;\n}\n\n// Apache arrow probably should not be using a Record and index types on TypeMap\n// because in strict checking they end up required.\n// See: https://github.com/apache/arrow/issues/12663#issuecomment-1088244575\n// We can work around that issue by using a type alias instead of an interface\n// Where index signatures are looser.\n// See: https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1317901527\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type WaferRequiredFields = {\n colIndex: Int32,\n rowIndex: Int32,\n value: Float64\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/wafer-map/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,WAAW;CACf,CAAC;AAKX,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC;AAKX,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;CACN,CAAC;AAKX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACZ,CAAC","sourcesContent":["import type { Float64, Int32 } from 'apache-arrow';\n\nexport const WaferMapOriginLocation = {\n bottomLeft: 'bottom-left',\n bottomRight: 'bottom-right',\n topLeft: 'top-left',\n topRight: 'top-right'\n} as const;\n\nexport type WaferMapOriginLocation =\n (typeof WaferMapOriginLocation)[keyof typeof WaferMapOriginLocation];\n\nexport const WaferMapOrientation = {\n top: 'top',\n bottom: 'bottom',\n left: 'left',\n right: 'right'\n} as const;\n\nexport type WaferMapOrientation =\n (typeof WaferMapOrientation)[keyof typeof WaferMapOrientation];\n\nexport const HoverDieOpacity = {\n show: 'show',\n hide: 'hide'\n} as const;\n\nexport type HoverDieOpacity =\n (typeof HoverDieOpacity)[keyof typeof HoverDieOpacity];\n\nexport const WaferMapColorScaleMode = {\n linear: 'linear',\n ordinal: 'ordinal'\n} as const;\n\nexport type WaferMapColorScaleMode =\n (typeof WaferMapColorScaleMode)[keyof typeof WaferMapColorScaleMode];\n\nexport interface WaferMapDie {\n value: string;\n x: number;\n y: number;\n // The metadata field is not used by the wafer-map and is only for optionally storing arbitrary metadata.\n metadata?: unknown;\n tags?: string[];\n}\n\nexport interface HoverDie {\n index: number;\n x: number;\n y: number;\n}\n\nexport interface WaferMapColorScale {\n colors: string[];\n values: string[];\n}\n\nexport interface Dimensions {\n readonly width: number;\n readonly height: number;\n}\n\nexport interface Margin {\n readonly top: number;\n readonly right: number;\n readonly bottom: number;\n readonly left: number;\n}\n\nexport interface DieRenderInfo {\n readonly x: number;\n readonly y: number;\n readonly fillStyle: string;\n readonly text: string;\n}\n\nexport interface PointCoordinates {\n readonly x: number;\n readonly y: number;\n}\n\nexport interface ValidityObject {\n [key: string]: boolean;\n}\nexport interface WaferMapValidity extends ValidityObject {\n readonly invalidGridDimensions: boolean;\n readonly invalidDiesTableSchema: boolean;\n}\n\n// Apache arrow probably should not be using a Record and index types on TypeMap\n// because in strict checking they end up required.\n// See: https://github.com/apache/arrow/issues/12663#issuecomment-1088244575\n// We can work around that issue by using a type alias instead of an interface\n// Where index signatures are looser.\n// See: https://github.com/microsoft/TypeScript/issues/15300#issuecomment-1317901527\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type WaferRequiredFields = {\n colIndex: Int32,\n rowIndex: Int32,\n value: Float64\n};\n\ninterface IColorScaleMarker {\n color: string;\n value: number;\n}\n\nexport type ColorScale = IColorScaleMarker[];\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ni/nimble-components",
|
|
3
|
-
"version": "24.1.
|
|
3
|
+
"version": "24.1.6",
|
|
4
4
|
"description": "Styled web components for the NI Nimble Design System",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"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",
|