@ni/nimble-components 16.1.4 → 16.1.5

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.
@@ -26472,24 +26472,39 @@ Instead styling against the role which is more general and likely a better appro
26472
26472
  const template = html `
26473
26473
  <div class="wafer-map-container">
26474
26474
  <svg class="svg-root ${x => x.orientation}">
26475
- <g class="zoom-container">
26476
- <svg class="circle-base" version="1.1" x="0px" y="0px" viewbox="1 .45 20 21">
26477
- <path class="circle-drawing-path" d="m 21 12 a 10 10 330 1 1 0 -1.98 a 1 1 0 0 0 0 2"/>
26475
+ <g class="zoom-container">
26476
+ <svg
26477
+ class="circle-base"
26478
+ version="1.1"
26479
+ x="0px"
26480
+ y="0px"
26481
+ viewBox="1 .45 20 21"
26482
+ >
26483
+ <path
26484
+ class="circle-drawing-path"
26485
+ d="m 21 12 a 10 10 330 1 1 0 -1.98 a 1 1 0 0 0 0 2"
26486
+ />
26478
26487
  </svg>
26479
26488
  </g>
26480
26489
  </svg>
26481
- <div class="wafer-map-area" style="left: 0px; top: 0px">
26482
- <canvas width=500 height="500" ${ref('canvas')}>
26490
+ <div class="wafer-map-area">
26491
+ <canvas class="wafer-map-canvas" ${ref('canvas')}></canvas>
26483
26492
  </div>
26484
26493
  </div>
26485
26494
  `;
26486
26495
 
26487
26496
  const styles = css `
26488
- .wafer-map-container {
26497
+ :host {
26498
+ display: inline-block;
26489
26499
  width: 500px;
26490
26500
  height: 500px;
26501
+ }
26502
+
26503
+ .wafer-map-container {
26504
+ width: 100%;
26505
+ padding-bottom: 100%;
26491
26506
  position: relative;
26492
- display: flex;
26507
+ display: inline-block;
26493
26508
  justify-content: center;
26494
26509
  align-items: center;
26495
26510
  }
@@ -26497,6 +26512,7 @@ Instead styling against the role which is more general and likely a better appro
26497
26512
  .svg-root {
26498
26513
  width: 100%;
26499
26514
  height: 100%;
26515
+ position: absolute;
26500
26516
  }
26501
26517
 
26502
26518
  .svg-root.top {
@@ -26518,13 +26534,14 @@ Instead styling against the role which is more general and likely a better appro
26518
26534
  .zoom-container {
26519
26535
  width: 100%;
26520
26536
  height: 100%;
26537
+ position: absolute;
26521
26538
  }
26522
26539
 
26523
26540
  .circle-base {
26524
26541
  width: 100%;
26525
26542
  height: 100%;
26526
26543
  position: absolute;
26527
- fill: white;
26544
+ fill: transparent;
26528
26545
  }
26529
26546
 
26530
26547
  .circle-drawing-path {
@@ -26536,6 +26553,16 @@ Instead styling against the role which is more general and likely a better appro
26536
26553
 
26537
26554
  .wafer-map-area {
26538
26555
  position: absolute;
26556
+ justify-content: center;
26557
+ align-items: center;
26558
+ width: 100%;
26559
+ height: 100%;
26560
+ }
26561
+
26562
+ .wafer-map-canvas {
26563
+ display: inline-block;
26564
+ width: 100%;
26565
+ height: 100%;
26539
26566
  }
26540
26567
  `;
26541
26568
 
@@ -29390,8 +29417,8 @@ Instead styling against the role which is more general and likely a better appro
29390
29417
  this.context.fillText(die.text, die.x + dimensions.width / 2, die.y + dimensions.height / 2 + aproxTextHeight.width / 2);
29391
29418
  }
29392
29419
  }
29393
- clearCanvas() {
29394
- this.context.clearRect(0, 0, this.waferData.containerDimensions.width, this.waferData.containerDimensions.height);
29420
+ clearCanvas(width, height) {
29421
+ this.context.clearRect(0, 0, width, height);
29395
29422
  }
29396
29423
  }
29397
29424
 
@@ -29417,16 +29444,31 @@ Instead styling against the role which is more general and likely a better appro
29417
29444
  }
29418
29445
  connectedCallback() {
29419
29446
  super.connectedCallback();
29447
+ this.resizeObserver = new ResizeObserver(entries => {
29448
+ const entry = entries[0];
29449
+ if (entry === undefined)
29450
+ return;
29451
+ const { height, width } = entry.contentRect;
29452
+ this.canvasSideLength = Math.min(height, width);
29453
+ });
29454
+ this.resizeObserver.observe(this);
29420
29455
  this.queueRender();
29421
29456
  }
29457
+ disconnectedCallback() {
29458
+ super.disconnectedCallback();
29459
+ this.resizeObserver.unobserve(this);
29460
+ }
29422
29461
  /**
29423
29462
  * @internal
29424
29463
  */
29425
29464
  render() {
29426
29465
  this.renderQueued = false;
29427
- this.dataManager = new DataManager(this.dies, this.quadrant, { width: 500, height: 500 }, this.colorScale, this.highlightedValues, this.colorScaleMode, this.dieLabelsHidden, this.dieLabelsSuffix, this.maxCharacters);
29428
- const renderer = new RenderingModule(this.dataManager, this.canvas);
29429
- renderer.drawWafer();
29466
+ if (this.canvasSideLength === undefined || this.canvasSideLength === 0)
29467
+ return;
29468
+ this.renderer?.clearCanvas(this.canvasSideLength, this.canvasSideLength);
29469
+ this.dataManager = new DataManager(this.dies, this.quadrant, { width: this.canvasSideLength, height: this.canvasSideLength }, this.colorScale, this.highlightedValues, this.colorScaleMode, this.dieLabelsHidden, this.dieLabelsSuffix, this.maxCharacters);
29470
+ this.renderer = new RenderingModule(this.dataManager, this.canvas);
29471
+ this.renderer.drawWafer();
29430
29472
  }
29431
29473
  quadrantChanged() {
29432
29474
  this.queueRender();
@@ -29455,6 +29497,14 @@ Instead styling against the role which is more general and likely a better appro
29455
29497
  colorScaleChanged() {
29456
29498
  this.queueRender();
29457
29499
  }
29500
+ canvasSideLengthChanged() {
29501
+ if (this.canvasSideLength !== undefined
29502
+ && this.canvasSideLength !== 0) {
29503
+ this.canvas.width = this.canvasSideLength;
29504
+ this.canvas.height = this.canvasSideLength;
29505
+ }
29506
+ this.queueRender();
29507
+ }
29458
29508
  queueRender() {
29459
29509
  if (!this.$fastController.isConnected) {
29460
29510
  return;
@@ -29493,6 +29543,9 @@ Instead styling against the role which is more general and likely a better appro
29493
29543
  attribute: 'color-scale-mode'
29494
29544
  })
29495
29545
  ], WaferMap.prototype, "canvas", void 0);
29546
+ __decorate$1([
29547
+ observable
29548
+ ], WaferMap.prototype, "canvasSideLength", void 0);
29496
29549
  __decorate$1([
29497
29550
  observable
29498
29551
  ], WaferMap.prototype, "colorScaleMode", void 0);