@dataloop-ai/components 0.17.42 → 0.17.43

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.17.42",
3
+ "version": "0.17.43",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -96,8 +96,9 @@
96
96
  <span v-else>
97
97
  {{ label }}
98
98
  </span>
99
- <dl-tooltip> {{ labelStrings[index] }}</dl-tooltip>
100
99
  </span>
100
+ <dl-tooltip self="top middle">
101
+ {{ labelStrings[index] }}</dl-tooltip>
101
102
  </span>
102
103
  </div>
103
104
  <dl-brush
@@ -250,7 +251,7 @@ export default defineComponent({
250
251
  return this.tooltipState?.visible
251
252
  },
252
253
  visibleLabels(): DlConfusionMatrixLabel[] {
253
- if (isObject(this.labels[0])) {
254
+ if (this.labels[0]) {
254
255
  const arr = this.labels as DlConfusionMatrixLabel[]
255
256
  return arr.slice(
256
257
  this.currentBrushState.min,
@@ -328,9 +329,9 @@ export default defineComponent({
328
329
  ctx.matrix.length / (brush.max - brush.min),
329
330
  ctx.$refs.matrix
330
331
  )
331
- const scroll = brush.min * getCellWidth() + 2
332
+ const scroll = brush.min * (getCellWidth() - 2)
332
333
  const container = ctx.$refs.matrixWrapper
333
- container.scroll(scroll, scroll)
334
+ container.scroll(scroll, 0)
334
335
  ctx.currentBrushState = brush
335
336
  ctx.resizeYAxis()
336
337
  },
@@ -416,6 +417,9 @@ export default defineComponent({
416
417
  line-height: 100px;
417
418
  overflow: hidden;
418
419
  text-overflow: ellipsis;
420
+ &--text {
421
+ font-size: 12px;
422
+ }
419
423
  }
420
424
  }
421
425
  .y-axis {
@@ -428,6 +432,7 @@ export default defineComponent({
428
432
  line-height: var(--cell-dimensions);
429
433
  overflow: hidden;
430
434
  text-overflow: ellipsis;
435
+ font-size: 12px;
431
436
  }
432
437
  }
433
438
  .y-axis-outer {
@@ -461,7 +466,7 @@ export default defineComponent({
461
466
  grid-template-columns: repeat(var(--matrix-rows), 1fr);
462
467
 
463
468
  &__cell {
464
- font-size: 80%;
469
+ font-size: 60%;
465
470
  cursor: pointer;
466
471
  border: 1px solid var(--dl-color-separator);
467
472
  box-sizing: border-box;
@@ -8,44 +8,55 @@
8
8
  <script lang="ts">
9
9
  import { defineComponent } from 'vue-demi'
10
10
  import { DlConfusionMatrix } from '../components'
11
- export default defineComponent({
12
- components: {
13
- DlConfusionMatrix
14
- },
15
- setup() {
16
- const matrix = []
17
- const labels = []
18
- const size = 10
19
11
 
20
- const getLink = (number: number) => {
21
- return `www.confusion-matrix.com/cell-${number}`
22
- }
12
+ const getLink = (number: number) => {
13
+ return `www.confusion-matrix.com/cell-${number}`
14
+ }
15
+
16
+ const getMatrix = (size: number) => {
17
+ const newMatrix = []
23
18
 
24
- for (let i = 0; i < size; i++) {
25
- const row = []
26
- for (let j = 0; j < size; j++) {
27
- const value = Math.floor(Math.random() * 10)
28
- row.push({
29
- value,
30
- link: getLink(value)
31
- })
32
- }
33
- matrix.push(row)
19
+ for (let i = 0; i < size; i++) {
20
+ const row = []
21
+ for (let j = 0; j < size; j++) {
22
+ const value = Math.floor(Math.random() * 10)
23
+ row.push({
24
+ value,
25
+ link: getLink(value)
26
+ })
34
27
  }
28
+ newMatrix.push(row)
29
+ }
30
+ return newMatrix
31
+ }
35
32
 
36
- // const items = [
37
- // { title: 'Van', image: 'https://picsum.photos/200/200' },
38
- // { title: 'Truck', image: 'https://picsum.photos/200/200' },
39
- // { title: 'Motorcycle', image: 'https://picsum.photos/200/200'},
40
- // { title: 'Car', image: 'https://picsum.photos/200/200'},
41
- // { title: 'Bus', image: 'https://picsum.photos/200/200'}
42
- // ]
33
+ const getLabels = (size: number) => {
34
+ const items = ['Van', 'Truck', 'Motorcycle', 'Car', 'Bus']
43
35
 
44
- const items = ['Van', 'Truck', 'Motorcycle', 'Car', 'Bus']
36
+ // const items = [
37
+ // { title: 'Van', image: 'https://picsum.photos/200/200' },
38
+ // { title: 'Truck', image: 'https://picsum.photos/200/200' },
39
+ // { title: 'Motorcycle', image: 'https://picsum.photos/200/200'},
40
+ // { title: 'Car', image: 'https://picsum.photos/200/200'},
41
+ // { title: 'Bus', image: 'https://picsum.photos/200/200'}
42
+ // ]
43
+ const newLabels = []
45
44
 
46
- for (let i = 0; i < size; i++) {
47
- labels.push(items[Math.floor(Math.random() * items.length)])
48
- }
45
+ for (let i = 0; i < size; i++) {
46
+ newLabels.push(items[Math.floor(Math.random() * items.length)])
47
+ }
48
+
49
+ return newLabels
50
+ }
51
+
52
+ export default defineComponent({
53
+ components: {
54
+ DlConfusionMatrix
55
+ },
56
+ setup() {
57
+ const SIZE = 10
58
+ const matrix = getMatrix(SIZE)
59
+ const labels = getLabels(SIZE)
49
60
 
50
61
  return { matrix, labels, getLink }
51
62
  }