@@ -59,6 +59,36 @@ const dataset = ref([
5959 },
6060 ])
6161
62+ const alternateDataset = ref ([
63+ {
64+ name: " Alternate datapoint" ,
65+ series: [12 , 19 , 16 , 15 , 9 , 17 , 44 , 13 , 40 ],
66+ comments: [" " , " " , " " , " " , " This is a comment that can be long, or that can be short but it depends." ],
67+ type: " line" ,
68+ smooth: false ,
69+ useArea: false ,
70+ dataLabels: true ,
71+ },
72+ ])
73+
74+ function alterDataset () {
75+ dataset .value [0 ].series = [0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 ]
76+ }
77+
78+ const alternateConfig = ref ({
79+ chart: {
80+ title: {
81+ text: ' Alternate version'
82+ }
83+ }
84+ })
85+
86+ const isPropsToggled = ref (false );
87+
88+ function toggleProps () {
89+ isPropsToggled .value = ! isPropsToggled .value
90+ }
91+
6292// const dataset = ref([
6393// {
6494// name: "Series 1",
@@ -479,6 +509,8 @@ function selectX(selectedX) {
479509 <button @click =" toggleTable" >TOGGLE TABLE</button >
480510 <button @click =" toggleLabels" >TOGGLE LABELS</button >
481511 <button @click =" toggleStack" >TOGGLE STACK</button >
512+ <button @click =" toggleProps" >TOGGLE PROPS: {{ isPropsToggled }}</button >
513+ <button @click =" alterDataset" >ALTER DATASET</button >
482514 <div style =" margin : 12px 0 ; color : white " >
483515 Theme:
484516 <select v-model =" currentTheme" @change =" step += 1" >
@@ -491,7 +523,7 @@ function selectX(selectedX) {
491523 </div >
492524
493525 <div style =" width : 600px ; height : 600px ; resize : both ; overflow : auto ; background : white " >
494- <LocalVueUiXy component =" VueUiXy" :dataset =" dataset" :config =" {
526+ <LocalVueUiXy component =" VueUiXy" :dataset =" isPropsToggled ? alternateDataset : dataset" :config =" {
495527 ...config,
496528 responsive: true,
497529 }" >
@@ -508,11 +540,11 @@ function selectX(selectedX) {
508540 </template >
509541 </LocalVueUiXy >
510542 </div >
511- <Box comp =" VueUiXy" :dataset =" dataset" >
543+ <Box comp =" VueUiXy" :dataset =" isPropsToggled ? alternateDataset : dataset" >
512544 <template #title >VueUiXy</template >
513545
514546 <template #local >
515- <LocalVueUiXy :dataset =" dataset" :config =" config" :key =" `local_${step}`" @selectLegend =" selectLegend"
547+ <LocalVueUiXy :dataset =" isPropsToggled ? alternateDataset : dataset" :config =" isPropsToggled ? alternateConfig : config" :key =" `local_${step}`" @selectLegend =" selectLegend"
516548 @selectX =" selectX" ref =" local" >
517549 <!-- <template #svg="{ svg }">
518550 <circle :cx="svg.width / 2" :cy="svg.height / 2" :r="30" fill="#42d392" />
@@ -548,7 +580,7 @@ function selectX(selectedX) {
548580 </template >
549581
550582 <template #VDUI-local >
551- <LocalVueDataUi component =" VueUiXy" :dataset =" dataset" :config =" config" :key =" `VDUI-lodal_${step}`"
583+ <LocalVueDataUi component =" VueUiXy" :dataset =" isPropsToggled ? alternateDataset: dataset" :config =" isPropsToggled ? alternateConfig : config" :key =" `VDUI-lodal_${step}`"
552584 @selectLegend =" selectLegend" @selectX =" selectX" ref =" vduiLocal" >
553585 <template #svg =" { svg } " >
554586 <circle :cx =" svg.width / 2" :cy =" svg.height / 2" :r =" 30" fill =" #42d392" />
@@ -578,7 +610,7 @@ function selectX(selectedX) {
578610 </template >
579611
580612 <template #build >
581- <VueUiXy :dataset =" dataset" :config =" config" :key =" `build_${step}`" @selectLegend =" selectLegend"
613+ <VueUiXy :dataset =" isPropsToggled ? alternateDataset : dataset" :config =" isPropsToggled ? alternateConfig : config" :key =" `build_${step}`" @selectLegend =" selectLegend"
582614 @selectX =" selectX" ref =" build" >
583615 <template #svg =" { svg } " >
584616 <circle :cx =" svg.width / 2" :cy =" svg.height / 2" :r =" 30" fill =" #42d392" />
@@ -608,7 +640,7 @@ function selectX(selectedX) {
608640 </template >
609641
610642 <template #VDUI-build >
611- <VueDataUi component =" VueUiXy" :dataset =" dataset" :config =" config" :key =" `VDUI-build_${step}`"
643+ <VueDataUi component =" VueUiXy" :dataset =" isPropsToggled ? alternateDataset : dataset" :config =" isPropsToggled ? alternateConfig : config" :key =" `VDUI-build_${step}`"
612644 @selectLegend =" selectLegend" @selectX =" selectX" ref =" vduiBuild" >
613645 <template #svg =" { svg } " >
614646 <circle :cx =" svg.width / 2" :cy =" svg.height / 2" :r =" 30" fill =" #42d392" />
0 commit comments