Skip to content

Commit 9e20fcb

Browse files
committed
fix: follow the rabbit
1 parent a0f85a6 commit 9e20fcb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/components/Compare/FacetBarChart.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ const isDarkMode = computed(() => resolvedMode.value === 'dark')
7676
7777
const dataset = computed<VueUiHorizontalBarDatasetItem[]>(() => {
7878
if (props.facetLoading) return []
79-
8079
return props.packages.map((name, index) => {
80+
const rawValue = props.values[index]?.raw
8181
return {
8282
name: insertLineBreaks(applyEllipsis(name)),
83-
value: (props.values[index]?.raw ?? 0) as number,
83+
value: typeof rawValue === 'number' ? rawValue : 0,
8484
color: isListedFramework(name) ? getFrameworkColor(name) : undefined,
8585
formattedValue: props.values[index]?.display,
8686
}
@@ -209,7 +209,7 @@ const config = computed<VueUiHorizontalBarConfig>(() => {
209209

210210
<template>
211211
<div class="font-mono facet-bar">
212-
<ClientOnly v-if="dataset">
212+
<ClientOnly v-if="dataset.length">
213213
<VueUiHorizontalBar :key="chartKey" :dataset :config>
214214
<template #menuIcon="{ isOpen }">
215215
<span v-if="isOpen" class="i-lucide:x w-6 h-6" aria-hidden="true" />

0 commit comments

Comments
 (0)