Skip to content

Commit c990869

Browse files
committed
fix: remove chart re-render
keep default minimap refresh button position in mobile
1 parent fa03c4e commit c990869

1 file changed

Lines changed: 6 additions & 26 deletions

File tree

app/components/Package/DownloadAnalytics.vue

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

720703
<ClientOnly v-if="inModal && chartData.dataset">
721-
<VueUiXy
722-
:dataset="chartData.dataset"
723-
:config="config"
724-
class="[direction:ltr]"
725-
:key="chartKey"
726-
>
704+
<VueUiXy :dataset="chartData.dataset" :config="config" class="[direction:ltr]">
727705
<template #menuIcon="{ isOpen }">
728706
<span v-if="isOpen" class="i-carbon:close w-6 h-6" aria-hidden="true" />
729707
<span v-else class="i-carbon:overflow-menu-vertical w-6 h-6" aria-hidden="true" />
@@ -836,8 +814,10 @@ const config = computed(() => {
836814
}
837815
838816
/* Override default placement of the refresh button to have it to the minimap's side */
839-
#download-analytics .vue-data-ui-refresh-button {
840-
top: -0.6rem !important;
841-
left: calc(100% + 2rem) !important;
817+
@media screen and (min-width: 767px) {
818+
#download-analytics .vue-data-ui-refresh-button {
819+
top: -0.6rem !important;
820+
left: calc(100% + 2rem) !important;
821+
}
842822
}
843823
</style>

0 commit comments

Comments
 (0)