@@ -38,6 +38,7 @@ import { usePrinter } from "../usePrinter";
3838import { useConfig } from " ../useConfig" ;
3939import PackageVersion from " ../atoms/PackageVersion.vue" ;
4040import PenAndPaper from " ../atoms/PenAndPaper.vue" ;
41+ import { useUserOptionState } from " ../useUserOptionState" ;
4142
4243const { vue_ui_donut_evolution: DEFAULT_CONFIG } = useConfig ();
4344
@@ -163,6 +164,8 @@ const FINAL_CONFIG = computed({
163164 }
164165});
165166
167+ const { userOptionsVisible , setUserOptionsVisibility , keepUserOptionState } = useUserOptionState ({ config: FINAL_CONFIG .value });
168+
166169function prepareConfig () {
167170 const mergedConfig = useNestedProp ({
168171 userConfig: props .config ,
@@ -581,7 +584,7 @@ defineExpose({
581584< / script>
582585
583586< template>
584- < div ref= " donutEvolutionChart" : class = " `vue-ui-donut-evolution ${isFullscreen ? 'vue-data-ui-wrapper-fullscreen' : ''} ${FINAL_CONFIG.useCssAnimation ? '' : 'vue-ui-dna'}`" : style= " `font-family:${FINAL_CONFIG.style.fontFamily};width:100%; text-align:center;background:${FINAL_CONFIG.style.chart.backgroundColor}`" : id= " uid" >
587+ < div ref= " donutEvolutionChart" : class = " `vue-ui-donut-evolution ${isFullscreen ? 'vue-data-ui-wrapper-fullscreen' : ''} ${FINAL_CONFIG.useCssAnimation ? '' : 'vue-ui-dna'}`" : style= " `font-family:${FINAL_CONFIG.style.fontFamily};width:100%; text-align:center;background:${FINAL_CONFIG.style.chart.backgroundColor}`" : id= " uid" @mouseenter = " () => setUserOptionsVisibility(true) " @mouseleave = " () => setUserOptionsVisibility(false) " >
585588 < PenAndPaper
586589 v- if = " FINAL_CONFIG.userOptions.buttons.annotator"
587590 : parent= " donutEvolutionChart"
@@ -618,7 +621,7 @@ defineExpose({
618621 < UserOptions
619622 ref= " details"
620623 : key= " `user_options_${step}`"
621- v- if = " FINAL_CONFIG.userOptions.show && isDataset"
624+ v- if = " FINAL_CONFIG.userOptions.show && isDataset && (keepUserOptionState ? true : userOptionsVisible) "
622625 : backgroundColor= " FINAL_CONFIG.style.chart.backgroundColor"
623626 : color= " FINAL_CONFIG.style.chart.color"
624627 : isPrinting= " isPrinting"
@@ -641,6 +644,9 @@ defineExpose({
641644 @generateImage= " generateImage"
642645 @toggleTable= " toggleTable"
643646 @toggleAnnotator= " toggleAnnotator"
647+ : style= " {
648+ visibility: keepUserOptionState ? userOptionsVisible ? 'visible' : 'hidden' : 'visible'
649+ }"
644650 >
645651 < template #optionPdf v- if = " $slots.optionPdf" >
646652 < slot name= " optionPdf" / >
0 commit comments