@dataloop-ai/components 0.19.257 → 0.19.258

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.19.257",
3
+ "version": "0.19.258",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -22,7 +22,7 @@
22
22
  "check-only": "if grep -E -H -r --exclude-dir=.git --exclude-dir=node_modules --exclude=*.json --exclude=*.yml '^(describe|it).only' .; then echo 'Found only in test files' && exit 1; fi"
23
23
  },
24
24
  "dependencies": {
25
- "@dataloop-ai/icons": "^3.0.74",
25
+ "@dataloop-ai/icons": "^3.0.84",
26
26
  "@types/flat": "^5.0.2",
27
27
  "@types/lodash": "^4.14.184",
28
28
  "@types/sortablejs": "^1.15.7",
@@ -204,7 +204,6 @@ import {
204
204
  getGradationValues,
205
205
  validateMatrix,
206
206
  setZoom,
207
- getCellWidth,
208
207
  flattenConfusionMatrix
209
208
  } from './utils'
210
209
  import { debounce, isObject } from 'lodash'
@@ -421,7 +420,7 @@ export default defineComponent({
421
420
  (isObject(el) ? el.title : `${el}`).length
422
421
  )
423
422
  )
424
- this.rotateXLabels = longest * 12 > getCellWidth()
423
+ this.rotateXLabels = longest * 12 > this.getMatrixCellWidth()
425
424
  },
426
425
  handleResizeObserver(options: { dispose?: boolean } = {}) {
427
426
  if (this.isDisposed) return
@@ -466,7 +465,7 @@ export default defineComponent({
466
465
  ctx.matrix.length / (brush.max - brush.min),
467
466
  ctx.$refs.matrix
468
467
  )
469
- const scroll = brush.min * getCellWidth()
468
+ const scroll = brush.min * ctx.getMatrixCellWidth()
470
469
  const container = ctx.$refs.matrixWrapper
471
470
  container.scroll(scroll, 0)
472
471
  ctx.currentBrushState = brush
@@ -476,7 +475,15 @@ export default defineComponent({
476
475
  ),
477
476
  resizeYAxis() {
478
477
  const yAxis = this.$refs.yAxis as HTMLElement
479
- yAxis.style.height = `${getCellWidth() * this.matrix.length}px`
478
+ yAxis.style.height = `${this.getMatrixWidth()}px`
479
+ },
480
+ getMatrixWidth() {
481
+ const matrixElement = this.$refs.matrix as HTMLElement
482
+ const width = matrixElement.getBoundingClientRect().width
483
+ return width
484
+ },
485
+ getMatrixCellWidth() {
486
+ return this.getMatrixWidth() / this.matrix.length
480
487
  },
481
488
  handleMatrixScroll(e: MouseEvent | UIEvent) {
482
489
  const target = e.target as HTMLElement