Skip to content

Commit 5ec03c0

Browse files
authored
fix: address regressions (#620)
1 parent 2e8d908 commit 5ec03c0

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

app/components/PackageDownloadAnalytics.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,16 @@ const rootEl = shallowRef<HTMLElement | null>(null)
1919
2020
const { width } = useElementSize(rootEl)
2121
22-
onMounted(() => {
22+
const chartKey = ref(0)
23+
24+
onMounted(async () => {
2325
rootEl.value = document.documentElement
2426
resolvedMode.value = colorMode.value === 'dark' ? 'dark' : 'light'
27+
requestAnimationFrame(() => {
28+
requestAnimationFrame(() => {
29+
chartKey.value += 1
30+
})
31+
})
2532
})
2633
2734
const { colors } = useCssVariables(
@@ -543,6 +550,7 @@ const config = computed(() => {
543550
show: false, // As long as a single package is displayed
544551
},
545552
tooltip: {
553+
teleportTo: '#chart-modal',
546554
borderColor: 'transparent',
547555
backdropFilter: false,
548556
backgroundColor: 'transparent',
@@ -687,7 +695,12 @@ const config = computed(() => {
687695
</div>
688696

689697
<ClientOnly v-if="inModal && chartData.dataset">
690-
<VueUiXy :dataset="chartData.dataset" :config="config" class="[direction:ltr]">
698+
<VueUiXy
699+
:dataset="chartData.dataset"
700+
:config="config"
701+
class="[direction:ltr]"
702+
:key="chartKey"
703+
>
691704
<template #menuIcon="{ isOpen }">
692705
<span v-if="isOpen" class="i-carbon:close w-6 h-6" aria-hidden="true" />
693706
<span v-else class="i-carbon:overflow-menu-vertical w-6 h-6" aria-hidden="true" />

0 commit comments

Comments
 (0)