Skip to content

Commit 79bce79

Browse files
committed
fix: remove forced chart re-render operations
1 parent 00a2cf1 commit 79bce79

1 file changed

Lines changed: 1 addition & 23 deletions

File tree

app/components/Package/DownloadAnalytics.vue

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,9 @@ const rootEl = shallowRef<HTMLElement | null>(null)
1919
2020
const { width } = useElementSize(rootEl)
2121
22-
const chartKey = ref(0)
23-
24-
let chartRemountTimeoutId: ReturnType<typeof setTimeout> | null = null
25-
2622
onMounted(() => {
2723
rootEl.value = document.documentElement
2824
resolvedMode.value = colorMode.value === 'dark' ? 'dark' : 'light'
29-
30-
// If the chart is painted too early, built-in auto-sizing does not adapt to the final container size
31-
chartRemountTimeoutId = setTimeout(() => {
32-
chartKey.value += 1
33-
chartRemountTimeoutId = null
34-
}, 10)
35-
})
36-
37-
onBeforeUnmount(() => {
38-
if (chartRemountTimeoutId !== null) {
39-
clearTimeout(chartRemountTimeoutId)
40-
chartRemountTimeoutId = null
41-
}
4225
})
4326
4427
const { colors } = useCssVariables(
@@ -705,12 +688,7 @@ const config = computed(() => {
705688
</div>
706689

707690
<ClientOnly v-if="inModal && chartData.dataset">
708-
<VueUiXy
709-
:dataset="chartData.dataset"
710-
:config="config"
711-
class="[direction:ltr]"
712-
:key="chartKey"
713-
>
691+
<VueUiXy :dataset="chartData.dataset" :config="config" class="[direction:ltr]">
714692
<template #menuIcon="{ isOpen }">
715693
<span v-if="isOpen" class="i-carbon:close w-6 h-6" aria-hidden="true" />
716694
<span v-else class="i-carbon:overflow-menu-vertical w-6 h-6" aria-hidden="true" />

0 commit comments

Comments
 (0)