We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ec03c0 commit f3e22f2Copy full SHA for f3e22f2
1 file changed
app/components/PackageDownloadAnalytics.vue
@@ -21,14 +21,21 @@ const { width } = useElementSize(rootEl)
21
22
const chartKey = ref(0)
23
24
+function nextAnimationFrame(): Promise<void> {
25
+ return new Promise(resolve => {
26
+ requestAnimationFrame(() => resolve())
27
+ })
28
+}
29
+
30
onMounted(async () => {
31
rootEl.value = document.documentElement
32
resolvedMode.value = colorMode.value === 'dark' ? 'dark' : 'light'
- requestAnimationFrame(() => {
- chartKey.value += 1
- })
33
34
+ // If the chart is painted too early, built-in auto-sizing does not adapt to the final container size
35
+ await nextAnimationFrame()
36
37
38
+ chartKey.value += 1
39
})
40
41
const { colors } = useCssVariables(
0 commit comments