Skip to content

Commit 084d51e

Browse files
committed
Build v2.1.34
1 parent 95962f6 commit 084d51e

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-data-ui",
33
"private": false,
4-
"version": "2.1.33",
4+
"version": "2.1.34",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue 3 components library for eloquent data storytelling",
77
"keywords": [

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4820,7 +4820,7 @@ const pillConfig = ref({
48204820
</template>
48214821
</Box>
48224822

4823-
<Box @copy="copyConfig(PROD_CONFIG.vue_ui_sparkstackbar)">
4823+
<Box open @copy="copyConfig(PROD_CONFIG.vue_ui_sparkstackbar)">
48244824
<template #title>
48254825
<BaseIcon name="chartSparkStackbar" />
48264826
VueUiSparkStackbar

src/components/vue-ui-sparkstackbar.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const safeDatasetCopy = ref(props.dataset.map((d, i ) => {
5353
}
5454
}));
5555
56+
const isLoading = ref(true);
57+
5658
onMounted(() => {
5759
if(objectIsEmpty(props.dataset)) {
5860
error({
@@ -80,6 +82,7 @@ onMounted(() => {
8082
const chunkSet = props.dataset.map((d, i) => d.value / chunks);
8183
const total = props.dataset.map(d => d.value || 0).reduce((a, b) => a + b, 0);
8284
let start = 0;
85+
isLoading.value = true;
8386
8487
function animate() {
8588
start += (total / chunks);
@@ -93,6 +96,7 @@ onMounted(() => {
9396
});
9497
requestAnimationFrame(animate)
9598
} else {
99+
isLoading.value = false;
96100
safeDatasetCopy.value = props.dataset.map((d,i) => {
97101
return {
98102
...d,
@@ -209,6 +213,7 @@ function selectDatapoint(datapoint, index) {
209213
:height="svg.height"
210214
:width="drawableDataset.map(ds => ds.width).reduce((a, b) => a + b, 0)"
211215
:fill="stackConfig.style.bar.gradient.underlayerColor"
216+
:class="{'animated': !isLoading}"
212217
/>
213218
<rect
214219
v-for="(rect, i) in drawableDataset" :key="`stack_${i}`"
@@ -220,6 +225,7 @@ function selectDatapoint(datapoint, index) {
220225
:fill="stackConfig.style.bar.gradient.show ? `url(#stack_gradient_${i}_${uid})` : rect.color"
221226
:stroke="stackConfig.style.backgroundColor"
222227
stroke-linecap="round"
228+
:class="{'animated': !isLoading}"
223229
/>
224230
</g>
225231
</svg>
@@ -247,6 +253,7 @@ function selectDatapoint(datapoint, index) {
247253
:style="`font-size:${stackConfig.style.legend.fontSize}px;`"
248254
:class="{'vue-ui-sparkstackbar-legend-item': true, 'vue-ui-sparkstackbar-legend-item-unselected': segregated.includes(i)}"
249255
@click="segregate(i); selectDatapoint(rect, i)"
256+
250257
>
251258
<div style="display:flex;flex-direction:row;align-items:center;gap:4px;justify-content:center" >
252259
<svg
@@ -297,7 +304,7 @@ function selectDatapoint(datapoint, index) {
297304
.vue-ui-sparkstackbar-legend-item-unselected {
298305
opacity: 0.3;
299306
}
300-
rect {
307+
rect.animated {
301308
transition: all 0.3s ease-in-out !important;
302309
}
303310
</style>

0 commit comments

Comments
 (0)