@dataloop-ai/components 0.17.118 → 0.17.120

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.118",
3
+ "version": "0.17.120",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -76,7 +76,10 @@
76
76
  </div>
77
77
  </div>
78
78
  </div>
79
- <div class="x-axis">
79
+ <div
80
+ class="x-axis"
81
+ style="margin-top: 10px"
82
+ >
80
83
  <span
81
84
  v-for="(label, index) in visibleLabels"
82
85
  ref="xAxis"
@@ -86,7 +89,9 @@
86
89
  !labelImages[0]
87
90
  ? `transform: rotate(${
88
91
  rotateXLabels ? '70' : '0'
89
- }deg);`
92
+ }deg); line-height: ${
93
+ rotateXLabels ? 100 : 10
94
+ }px`
90
95
  : ''
91
96
  }`"
92
97
  >
@@ -226,6 +231,9 @@ export default defineComponent({
226
231
  x: string
227
232
  y: string
228
233
  visible?: boolean
234
+ value?: number
235
+ yLabel?: string
236
+ xLabel?: string
229
237
  } | null>(null)
230
238
  const currentBrushState = ref<{ min: number; max: number }>({
231
239
  min: 0,
@@ -291,14 +299,14 @@ export default defineComponent({
291
299
  flattenedMatrix(): DlConfusionMatrixCell[] {
292
300
  return flattenConfusionMatrix(this.matrix, this.labelStrings)
293
301
  },
294
- matrixStyles(): object {
302
+ matrixStyles(): Record<string, number | string> {
295
303
  return {
296
304
  '--matrix-rows': this.matrix.length,
297
305
  '--cell-dimensions': `${this.cellWidth}px`,
298
306
  '--general-color': this.getCellBackground()
299
307
  }
300
308
  },
301
- tooltipStyles(): object {
309
+ tooltipStyles(): Record<string, number | string> {
302
310
  return {
303
311
  left: `${this.tooltipState?.x + 10}px`,
304
312
  top: `${this.tooltipState?.y + 15}px`
@@ -320,7 +328,8 @@ export default defineComponent({
320
328
  currentBrushState() {
321
329
  const longest = Math.max(
322
330
  ...this.visibleLabels.map(
323
- (el: DlConfusionMatrixLabel) => el.title.length
331
+ (el: DlConfusionMatrixLabel) =>
332
+ (isObject(el) ? el.title : `${el}`).length
324
333
  )
325
334
  )
326
335
  this.rotateXLabels = longest * 12 > getCellWidth()
@@ -372,7 +381,7 @@ export default defineComponent({
372
381
  const yAxis = this.$refs.yAxis as HTMLElement
373
382
  yAxis.style.height = `${getCellWidth() * this.matrix.length}px`
374
383
  },
375
- handleMatrixScroll(e: MouseEvent) {
384
+ handleMatrixScroll(e: MouseEvent | UIEvent) {
376
385
  const target = e.target as HTMLElement
377
386
  ;(this.$refs.yAxisOuter as HTMLElement).scroll(0, target.scrollTop)
378
387
  },
@@ -445,7 +454,6 @@ export default defineComponent({
445
454
  max-height: 100px;
446
455
  &__element {
447
456
  width: var(--cell-dimensions);
448
- line-height: 100px;
449
457
  overflow: hidden;
450
458
  text-overflow: ellipsis;
451
459
  &--text {
@@ -203,7 +203,7 @@ export const useSuggestions = (
203
203
  localSuggestions = getOperators(ops)
204
204
 
205
205
  if (!operator) {
206
- const dotSeparated = matchedField.split('.')
206
+ const dotSeparated = matchedField.split('.').filter((el) => el)
207
207
  let fieldOf = schema
208
208
  for (const key of dotSeparated) {
209
209
  fieldOf = fieldOf[key] as Schema
@@ -457,7 +457,7 @@ const getDataType = (
457
457
  ): string | string[] | null => {
458
458
  const aliasedKey = getAliasObjByAlias(aliases, key)?.key ?? key
459
459
 
460
- const nestedKey = aliasedKey.split('.')
460
+ const nestedKey = aliasedKey.split('.').filter((el) => el)
461
461
 
462
462
  let value = schema[nestedKey[0]] as Schema
463
463
  if (!value) return null