Skip to content

Commit 0d21df0

Browse files
committed
Improvement - VueUiWaffle - Improve serie segregating animation timing
1 parent 91fc28c commit 0d21df0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/components/vue-ui-waffle.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ function segregate(uid) {
411411
values: [targetVal]
412412
}
413413
} else {
414-
return ds
414+
return ds;
415415
}
416416
});
417417
isAnimating.value = false;
@@ -428,13 +428,13 @@ function segregate(uid) {
428428
return ds;
429429
}
430430
})
431-
rafUp.value = requestAnimationFrame(animUp)
431+
rafUp.value = requestAnimationFrame(animUp);
432432
}
433433
}
434434
animUp()
435435
} else if(segregated.value.length < legendSet.value.length - 1 && legendSet.value.length > 1) {
436436
function animDown() {
437-
if(initVal < 0.1) {
437+
if(initVal < source / 100) {
438438
cancelAnimationFrame(rafDown.value)
439439
segregated.value.push(uid);
440440
datasetCopy.value = datasetCopy.value.map((ds, i) => {
@@ -450,18 +450,18 @@ function segregate(uid) {
450450
isAnimating.value = false;
451451
} else {
452452
isAnimating.value = true;
453-
initVal /= 1.5;
454-
datasetCopy.value = datasetCopy.value.map((ds, i) => {
453+
initVal /= 1.15;
454+
datasetCopy.value = datasetCopy.value.map(ds => {
455455
if (ds.uid === uid) {
456456
return {
457457
...ds,
458458
values: [initVal]
459459
}
460460
} else {
461-
return ds
461+
return ds;
462462
}
463463
})
464-
rafDown.value = requestAnimationFrame(animDown)
464+
rafDown.value = requestAnimationFrame(animDown);
465465
}
466466
}
467467
animDown();
@@ -487,7 +487,7 @@ const legendSet = computed(() => {
487487
shape: 'square'
488488
}
489489
})
490-
.map((el, i) => {
490+
.map(el => {
491491
return {
492492
...el,
493493
proportion: el.value / datasetCopy.value.map(ds => (ds.values || []).reduce((a,b) => a + b, 0)).reduce((a, b) => a + b, 0),

0 commit comments

Comments
 (0)