Skip to content

Commit 864a665

Browse files
committed
Fix - VueUiDonut - Mute transitions when startAnimation is running for polar mode
1 parent a294330 commit 864a665

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

TestingArena/ArenaVueUiDonut.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const model = ref([
141141
{ key: 'style.chart.layout.labels.hollow.average.value.rounding', def: 0, type: 'number', min: 0, max: 6, label: ['hollow', 'average', 'value', 'is', 'rounding'], category: 'labels' },
142142
{ key: 'style.chart.layout.donut.strokeWidth', def: 64, type: 'range', min: 3, max: 130, label: 'thickness', category: 'donut' },
143143
{ key: 'style.chart.layout.donut.borderWidth', def: 1, type: 'range', min: 0, max: 36, label: ['border', 'is', 'thickness'], category: 'donut' },
144-
{ key: 'style.chart.layout.donut.useShadow', def: false, type: 'checkbox' },
144+
{ key: 'style.chart.layout.donut.useShadow', def: true, type: 'checkbox' },
145145
{ key: 'style.chart.layout.donut.shadowColor', def: '#1A1A1A', type: 'color' },
146146
{ key: 'style.chart.legend.show', def: true, type: 'checkbox', label: 'show', category: 'legend' },
147147
{ key: 'style.chart.legend.backgroundColor', def: '#FFFFFF20', type: 'color', label: 'backgroundColor', category: 'legend' },

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@
110110
"vitest": "^3.1.1",
111111
"vue": "^3.5.14"
112112
}
113-
}
113+
}

src/components/vue-ui-donut.cy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ describe('<VueUiDonut />', () => {
6969
'path',
7070
'pattern',
7171
'patternIndex',
72+
'seriesIndex',
7273
'proportion',
7374
'ratio',
7475
'separator',
75-
'seriesIndex',
76+
'ghost',
7677
'startX',
7778
'startY',
7879
'value'

src/components/vue-ui-donut.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ const immutableSet = computed(() => {
291291
absoluteValues: serie.values,
292292
comment: serie.comment || '',
293293
patternIndex: i,
294+
seriesIndex: i,
295+
ghost: false,
294296
pattern: `pattern_${uid.value}_${i}`
295297
}
296298
})
@@ -957,25 +959,27 @@ defineExpose({
957959
<path v-for="(arc, i) in noGhostDonut" class="vue-ui-donut-arc-path" :data-cy="`donut-arc-${i}`"
958960
:d="arc.arcSlice" :fill="setOpacity(arc.color, 80)"
959961
:stroke="FINAL_CONFIG.style.chart.backgroundColor"
960-
:stroke-width="FINAL_CONFIG.style.chart.layout.donut.borderWidth" :filter="getBlurFilter(i)" />
962+
:stroke-width="FINAL_CONFIG.style.chart.layout.donut.borderWidth" :filter="getBlurFilter(i)"
963+
964+
/>
961965
</template>
962966

963967
<template v-if="total && FINAL_CONFIG.type === 'polar'">
964968
<g v-if="currentDonut.length > 1">
965969
<path v-for="(arc, i) in noGhostDonut" :stroke="FINAL_CONFIG.style.chart.backgroundColor"
966970
:d="polarAreas[i].path" fill="#FFFFFF"
967971
:style="{
968-
transition: isFirstLoad ? '' : 'all 0.1s ease-in-out'
972+
transition: isFirstLoad ? 'none' : 'all 0.1s ease-in-out'
969973
}"
970974
/>
971975
<g v-if="FINAL_CONFIG.style.chart.layout.donut.useShadow">
972-
<path data-cy="polar-shadow" v-for="(_arc, i) in currentDonut" class="vue-ui-donut-arc-path"
976+
<path data-cy="polar-shadow" v-for="(_arc, i) in noGhostDonut" class="vue-ui-donut-arc-path"
973977
:d="polarAreas[i].path" :fill="'transparent'"
974978
:stroke="FINAL_CONFIG.style.chart.backgroundColor"
975979
:stroke-width="FINAL_CONFIG.style.chart.layout.donut.borderWidth"
976980
:filter="`url(#drop_shadow_${uid})`"
977981
:style="{
978-
transition: isFirstLoad ? '' : 'all 0.1s ease-in-out'
982+
transition: isFirstLoad ? 'none' : 'all 0.1s ease-in-out'
979983
}"
980984
/>
981985
</g>
@@ -988,7 +992,7 @@ defineExpose({
988992
:stroke-width="FINAL_CONFIG.style.chart.layout.donut.borderWidth"
989993
:filter="getBlurFilter(i)"
990994
:style="{
991-
transition: isFirstLoad ? '' : 'all 0.1s ease-in-out'
995+
transition: isFirstLoad ? 'none' : 'all 0.1s ease-in-out'
992996
}"
993997
/>
994998
</g>
@@ -998,7 +1002,7 @@ defineExpose({
9981002
:stroke="FINAL_CONFIG.style.chart.backgroundColor"
9991003
:stroke-width="FINAL_CONFIG.style.chart.layout.donut.borderWidth" :filter="getBlurFilter(i)"
10001004
:style="{
1001-
transition: isFirstLoad ? '' : 'all 0.1s ease-in-out'
1005+
transition: isFirstLoad ? 'none' : 'all 0.1s ease-in-out'
10021006
}"
10031007
/>
10041008
</g>
@@ -1023,7 +1027,8 @@ defineExpose({
10231027
<circle data-cy="donut-gradient-hollow"
10241028
v-if="FINAL_CONFIG.style.chart.useGradient && FINAL_CONFIG.type === 'classic'" :cx="svg.width / 2"
10251029
:cy="svg.height / 2" :r="/* This might require adjustments */minSize <= 0 ? 10 : minSize"
1026-
:fill="`url(#gradient_${uid})`" />
1030+
:fill="`url(#gradient_${uid})`"
1031+
/>
10271032

10281033
<!-- TOOLTIP TRAPS -->
10291034
<template v-if="total">

0 commit comments

Comments
 (0)