@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.
@@ -5812,22 +5812,37 @@ no.getOrCreate().withPrefix("nimble").register(dv())
5812
5812
  const hv=U`
5813
5813
  <div class="wafer-map-container">
5814
5814
  <svg class="svg-root ${e=>e.orientation}">
5815
- <g class="zoom-container">
5816
- <svg class="circle-base" version="1.1" x="0px" y="0px" viewbox="1 .45 20 21">
5817
- <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"/>
5815
+ <g class="zoom-container">
5816
+ <svg
5817
+ class="circle-base"
5818
+ version="1.1"
5819
+ x="0px"
5820
+ y="0px"
5821
+ viewBox="1 .45 20 21"
5822
+ >
5823
+ <path
5824
+ class="circle-drawing-path"
5825
+ d="m 21 12 a 10 10 330 1 1 0 -1.98 a 1 1 0 0 0 0 2"
5826
+ />
5818
5827
  </svg>
5819
5828
  </g>
5820
5829
  </svg>
5821
- <div class="wafer-map-area" style="left: 0px; top: 0px">
5822
- <canvas width=500 height="500" ${Se("canvas")}>
5830
+ <div class="wafer-map-area">
5831
+ <canvas class="wafer-map-canvas" ${Se("canvas")}></canvas>
5823
5832
  </div>
5824
5833
  </div>
5825
5834
  `,uv=ve`
5826
- .wafer-map-container {
5835
+ :host {
5836
+ display: inline-block;
5827
5837
  width: 500px;
5828
5838
  height: 500px;
5839
+ }
5840
+
5841
+ .wafer-map-container {
5842
+ width: 100%;
5843
+ padding-bottom: 100%;
5829
5844
  position: relative;
5830
- display: flex;
5845
+ display: inline-block;
5831
5846
  justify-content: center;
5832
5847
  align-items: center;
5833
5848
  }
@@ -5835,6 +5850,7 @@ const hv=U`
5835
5850
  .svg-root {
5836
5851
  width: 100%;
5837
5852
  height: 100%;
5853
+ position: absolute;
5838
5854
  }
5839
5855
 
5840
5856
  .svg-root.top {
@@ -5856,13 +5872,14 @@ const hv=U`
5856
5872
  .zoom-container {
5857
5873
  width: 100%;
5858
5874
  height: 100%;
5875
+ position: absolute;
5859
5876
  }
5860
5877
 
5861
5878
  .circle-base {
5862
5879
  width: 100%;
5863
5880
  height: 100%;
5864
5881
  position: absolute;
5865
- fill: white;
5882
+ fill: transparent;
5866
5883
  }
5867
5884
 
5868
5885
  .circle-drawing-path {
@@ -5874,6 +5891,16 @@ const hv=U`
5874
5891
 
5875
5892
  .wafer-map-area {
5876
5893
  position: absolute;
5894
+ justify-content: center;
5895
+ align-items: center;
5896
+ width: 100%;
5897
+ height: 100%;
5898
+ }
5899
+
5900
+ .wafer-map-canvas {
5901
+ display: inline-block;
5902
+ width: 100%;
5903
+ height: 100%;
5877
5904
  }
5878
5905
  `,pv="bottom-left",gv="bottom-right",vv="top-left",mv="top",bv="linear",fv="ordinal"
5879
5906
  function wv(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function xv(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function yv(e){let t,i,o
@@ -6042,8 +6069,10 @@ let s=bb(o)
6042
6069
  return null===s?this.emptyDieColor:(s=new db(s.r,s.g,s.b,this.calculateOpacity(e,i)),s.toStringWebRGBA())}}class wb{constructor(e,t,i,o,s,n,r,a,l){this.computations=new nb(e,t,i),this.prerendering=new fb(e,o,s,this.computations.horizontalScale,this.computations.verticalScale,n,r,a,l,this.computations.dieDimensions,this.computations.margin)}get containerDimensions(){return this.computations.containerDimensions}get dieDimensions(){return this.computations.dieDimensions}get radius(){return this.computations.radius}get margin(){return this.computations.margin}get horizontalScale(){return this.computations.horizontalScale}get verticalScale(){return this.computations.verticalScale}get labelsFontSize(){return this.prerendering.labelsFontSize}get diesRenderInfo(){return this.prerendering.diesRenderInfo}get mainCircleLocation(){return{x:this.computations.containerDimensions.width/2,y:this.computations.containerDimensions.height/2}}}class xb{constructor(e,t){this.waferData=e,this.context=t.getContext("2d")}drawWafer(){const e=this.waferData.diesRenderInfo,t=this.waferData.dieDimensions
6043
6070
  for(const i of e){this.context.fillStyle=i.fillStyle,this.context?.fillRect(i.x,i.y,t.width,t.height),this.context.font=this.waferData.labelsFontSize.toString(),this.context.fillStyle="#ffffff",this.context.textAlign="center"
6044
6071
  const e=this.context.measureText("M")
6045
- this.context.fillText(i.text,i.x+t.width/2,i.y+t.height/2+e.width/2)}}clearCanvas(){this.context.clearRect(0,0,this.waferData.containerDimensions.width,this.waferData.containerDimensions.height)}}class yb extends St{constructor(){super(...arguments),this.quadrant=vv,this.orientation=mv,this.maxCharacters=4,this.dieLabelsHidden=!1,this.dieLabelsSuffix="",this.colorScaleMode=bv,this.highlightedValues=[],this.dies=[],this.colorScale={colors:[],values:[]},this.renderQueued=!1}connectedCallback(){super.connectedCallback(),this.queueRender()}render(){this.renderQueued=!1,this.dataManager=new wb(this.dies,this.quadrant,{width:500,height:500},this.colorScale,this.highlightedValues,this.colorScaleMode,this.dieLabelsHidden,this.dieLabelsSuffix,this.maxCharacters)
6046
- new xb(this.dataManager,this.canvas).drawWafer()}quadrantChanged(){this.queueRender()}orientationChanged(){this.queueRender()}maxCharactersChanged(){this.queueRender()}dieLabelsHiddenChanged(){this.queueRender()}dieLabelsSuffixChanged(){this.queueRender()}colorScaleModeChanged(){this.queueRender()}highlightedValuesChanged(){this.queueRender()}diesChanged(){this.queueRender()}colorScaleChanged(){this.queueRender()}queueRender(){this.$fastController.isConnected&&(this.renderQueued||(this.renderQueued=!0,u.queueUpdate((()=>this.render()))))}}e([oe],yb.prototype,"quadrant",void 0),e([oe],yb.prototype,"orientation",void 0),e([oe({attribute:"max-characters",converter:te})],yb.prototype,"maxCharacters",void 0),e([oe({attribute:"die-labels-hidden",mode:"boolean"})],yb.prototype,"dieLabelsHidden",void 0),e([oe({attribute:"die-labels-suffix"})],yb.prototype,"dieLabelsSuffix",void 0),e([oe({attribute:"color-scale-mode"})],yb.prototype,"canvas",void 0),e([m],yb.prototype,"colorScaleMode",void 0),e([m],yb.prototype,"highlightedValues",void 0),e([m],yb.prototype,"dies",void 0),e([m],yb.prototype,"colorScale",void 0)
6072
+ this.context.fillText(i.text,i.x+t.width/2,i.y+t.height/2+e.width/2)}}clearCanvas(e,t){this.context.clearRect(0,0,e,t)}}class yb extends St{constructor(){super(...arguments),this.quadrant=vv,this.orientation=mv,this.maxCharacters=4,this.dieLabelsHidden=!1,this.dieLabelsSuffix="",this.colorScaleMode=bv,this.highlightedValues=[],this.dies=[],this.colorScale={colors:[],values:[]},this.renderQueued=!1}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((e=>{const t=e[0]
6073
+ if(void 0===t)return
6074
+ const{height:i,width:o}=t.contentRect
6075
+ this.canvasSideLength=Math.min(i,o)})),this.resizeObserver.observe(this),this.queueRender()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this)}render(){this.renderQueued=!1,void 0!==this.canvasSideLength&&0!==this.canvasSideLength&&(this.renderer?.clearCanvas(this.canvasSideLength,this.canvasSideLength),this.dataManager=new wb(this.dies,this.quadrant,{width:this.canvasSideLength,height:this.canvasSideLength},this.colorScale,this.highlightedValues,this.colorScaleMode,this.dieLabelsHidden,this.dieLabelsSuffix,this.maxCharacters),this.renderer=new xb(this.dataManager,this.canvas),this.renderer.drawWafer())}quadrantChanged(){this.queueRender()}orientationChanged(){this.queueRender()}maxCharactersChanged(){this.queueRender()}dieLabelsHiddenChanged(){this.queueRender()}dieLabelsSuffixChanged(){this.queueRender()}colorScaleModeChanged(){this.queueRender()}highlightedValuesChanged(){this.queueRender()}diesChanged(){this.queueRender()}colorScaleChanged(){this.queueRender()}canvasSideLengthChanged(){void 0!==this.canvasSideLength&&0!==this.canvasSideLength&&(this.canvas.width=this.canvasSideLength,this.canvas.height=this.canvasSideLength),this.queueRender()}queueRender(){this.$fastController.isConnected&&(this.renderQueued||(this.renderQueued=!0,u.queueUpdate((()=>this.render()))))}}e([oe],yb.prototype,"quadrant",void 0),e([oe],yb.prototype,"orientation",void 0),e([oe({attribute:"max-characters",converter:te})],yb.prototype,"maxCharacters",void 0),e([oe({attribute:"die-labels-hidden",mode:"boolean"})],yb.prototype,"dieLabelsHidden",void 0),e([oe({attribute:"die-labels-suffix"})],yb.prototype,"dieLabelsSuffix",void 0),e([oe({attribute:"color-scale-mode"})],yb.prototype,"canvas",void 0),e([m],yb.prototype,"canvasSideLength",void 0),e([m],yb.prototype,"colorScaleMode",void 0),e([m],yb.prototype,"highlightedValues",void 0),e([m],yb.prototype,"dies",void 0),e([m],yb.prototype,"colorScale",void 0)
6047
6076
  const $b=yb.compose({baseName:"wafer-map",template:hv,styles:uv})
6048
6077
  no.getOrCreate().withPrefix("nimble").register($b())}()
6049
6078
  //# sourceMappingURL=all-components-bundle.min.js.map