Skip to content

Commit aea5ba6

Browse files
committed
Minor fixes
1 parent 818b486 commit aea5ba6

File tree

7 files changed

+36
-22
lines changed

7 files changed

+36
-22
lines changed

package-lock.json

Lines changed: 2 additions & 2 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.21",
4+
"version": "2.1.22",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue components library",
77
"keywords": [

src/App.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2635,6 +2635,7 @@ const moodRadarConfig = ref({
26352635
})
26362636
26372637
const donutConfig = ref({
2638+
useCssAnimation: true,
26382639
style: {
26392640
chart: {
26402641
layout: {
@@ -3302,7 +3303,7 @@ const quickDatasetLine = ref([
33023303
},
33033304
{
33043305
name: 'Serie2',
3305-
values: [5, 6, 7, 6, -10, 8, 7, 8, 9]
3306+
values: [5, 6, 7, 6, 5, 8, 7, 8, 9]
33063307
},
33073308
{
33083309
name: 'Serie3',
@@ -3311,7 +3312,7 @@ const quickDatasetLine = ref([
33113312
])
33123313
33133314
3314-
const quickDatasetSimpleLine = ref([1, 2, 3, 5, -8, 13, 21, 34, 55, 89])
3315+
const quickDatasetSimpleLine = ref([1, 2, 3, 5, 8, 13, 21, 34, 55, 89])
33153316
const quickDatasetSimpleBar = ref([1, 2, -10, -5, 8])
33163317
33173318
const quickDatasetBar = ref([
@@ -3321,7 +3322,7 @@ const quickDatasetBar = ref([
33213322
},
33223323
{
33233324
name: 'Serie2',
3324-
values: [5, 6, 7, 6, 7]
3325+
values: [5, 6, -7, 6, 7]
33253326
},
33263327
{
33273328
name: 'Serie3',

src/components/vue-ui-donut.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ function getData() {
144144
const segregated = ref([]);
145145
const rafUp = ref(null);
146146
const rafDown = ref(null);
147+
const isAnimating = ref(false);
147148
148149
function segregate(index) {
149150
const target = immutableSet.value.find((_, idx) => idx === index)
@@ -164,8 +165,10 @@ function segregate(index) {
164165
} else {
165166
return ds
166167
}
167-
})
168+
});
169+
isAnimating.value = false;
168170
} else {
171+
isAnimating.value = true;
169172
initVal += (targetVal * 0.025);
170173
mutableSet.value = mutableSet.value.map((ds, i) => {
171174
if((index === i)) {
@@ -195,8 +198,10 @@ function segregate(index) {
195198
} else {
196199
return ds
197200
}
198-
})
201+
});
202+
isAnimating.value = false;
199203
} else {
204+
isAnimating.value = true;
200205
initVal /= 1.1;
201206
mutableSet.value = mutableSet.value.map((ds, i) => {
202207
if(index === i) {
@@ -463,8 +468,6 @@ const isSafari = computed(() => {
463468
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
464469
})
465470
466-
console.log(isSafari.value)
467-
468471
function selectDatapoint(datapoint, index) {
469472
emit('selectDatapoint', { datapoint, index })
470473
}
@@ -691,7 +694,7 @@ defineExpose({
691694
</text>
692695

693696
<!-- DATALABELS -->
694-
<g v-for="(arc, i) in currentDonut" :filter="getBlurFilter(i)" class="animated">
697+
<g v-for="(arc, i) in currentDonut" :filter="getBlurFilter(i)" :class="{ 'animated': donutConfig.useCssAnimation}">
695698
<g v-if="donutConfig.style.chart.layout.labels.dataLabels.useLabelSlots">
696699
<foreignObject
697700
:x="calcMarkerOffsetX(arc, true).anchor === 'end' ? calcMarkerOffsetX(arc).x - 120 : calcMarkerOffsetX(arc, true).anchor === 'middle' ? calcMarkerOffsetX(arc).x - 60 : calcMarkerOffsetX(arc).x"

src/components/vue-ui-quick-chart.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ const donut = computed(() => {
229229
id: `donut_${i}`
230230
}
231231
})
232-
// .sort((a, b) => b.value - a.value)
233232
.map((ds, i) => {
234233
return {
235234
...ds,
@@ -280,7 +279,6 @@ const donut = computed(() => {
280279
281280
tooltipContent.value = `<div>${html}</div>`;
282281
}
283-
284282
isTooltip.value = true;
285283
}
286284
@@ -382,11 +380,11 @@ const line = computed(() => {
382380
maxSeries: Math.max(...ds.map(d => d.values.length))
383381
}
384382
383+
const scale = calculateNiceScale(extremes.min < 0 ? extremes.min : 0, extremes.max, quickConfig.value.xyScaleSegments)
385384
const absoluteMin = extremes.min < 0 ? Math.abs(extremes.min) : 0;
386-
const absoluteZero = drawingArea.bottom - (absoluteMin / (extremes.max + absoluteMin) * drawingArea.height)
385+
const absoluteZero = drawingArea.bottom - (absoluteMin / (scale.max + absoluteMin) * drawingArea.height)
387386
const slotSize = drawingArea.width / extremes.maxSeries;
388387
389-
const scale = calculateNiceScale(extremes.min < 0 ? extremes.min : 0, extremes.max, quickConfig.value.xyScaleSegments)
390388
391389
const yLabels = scale.ticks.map(t => {
392390
return {
@@ -402,7 +400,7 @@ const line = computed(() => {
402400
coordinates: d.values.map((v,j) => {
403401
return {
404402
x: drawingArea.left + (slotSize * (j + 1)) - (slotSize / 2),
405-
y: drawingArea.bottom - (((v + absoluteMin) / (extremes.max + absoluteMin)) * drawingArea.height),
403+
y: drawingArea.bottom - (((v + absoluteMin) / (scale.max + absoluteMin)) * drawingArea.height),
406404
value: v
407405
}
408406
})
@@ -537,11 +535,11 @@ const bar = computed(() => {
537535
maxSeries: Math.max(...ds.filter(d => !segregated.value.includes(d.id)).map(d => d.values.length))
538536
}
539537
538+
const scale = calculateNiceScale(extremes.min < 0 ? extremes.min : 0, extremes.max, quickConfig.value.xyScaleSegments)
540539
const absoluteMin = extremes.min < 0 ? Math.abs(extremes.min) : 0;
541-
const absoluteZero = drawingArea.bottom - (absoluteMin / (extremes.max + absoluteMin) * drawingArea.height)
540+
const absoluteZero = drawingArea.bottom - (absoluteMin / (scale.max + absoluteMin) * drawingArea.height)
542541
const slotSize = drawingArea.width / extremes.maxSeries;
543542
544-
const scale = calculateNiceScale(extremes.min < 0 ? extremes.min : 0, extremes.max, quickConfig.value.xyScaleSegments)
545543
546544
const yLabels = scale.ticks.map(t => {
547545
return {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('<VueUiXy />', () => {
9494
cy.get(`[data-cy="xy-bar-progression-label-1"]`).should('contain', '-91.67%');
9595

9696
cy.get(`[data-cy="xy-plot-progression-0"]`).should('exist');
97-
cy.get(`[data-cy="xy-plot-progression-label-0"]`).should('contain', '100.00%');
97+
cy.get(`[data-cy="xy-plot-progression-label-0"]`).should('contain', '100%');
9898

9999
for(let i = 0; i < 10; i += 1) {
100100
cy.get(`[data-cy="xy-plot-0-${i}"]`).should('exist');

src/components/vue-ui-xy.vue

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@
173173
:font-size="chartConfig.chart.labels.fontSize"
174174
:fill="serie.color"
175175
>
176-
{{ `${(calcLinearProgression(serie.plots).trend * 100).toFixed(2)}%` }}
176+
{{ dataLabel({
177+
v: calcLinearProgression(serie.plots).trend * 100,
178+
s: '%',
179+
r: 2
180+
}) }}
177181
</text>
178182
</g>
179183
</g>
@@ -223,7 +227,11 @@
223227
:font-size="chartConfig.chart.labels.fontSize"
224228
:fill="serie.color"
225229
>
226-
{{ `${(calcLinearProgression(serie.plots).trend * 100).toFixed(2)}%` }}
230+
{{ dataLabel({
231+
v: calcLinearProgression(serie.plots).trend * 100,
232+
s: '%',
233+
r: 2
234+
}) }}
227235
</text>
228236
</g>
229237
</g>
@@ -294,7 +302,11 @@
294302
:font-size="chartConfig.chart.labels.fontSize"
295303
:fill="serie.color"
296304
>
297-
{{ `${(calcLinearProgression(serie.plots).trend * 100).toFixed(2)}%` }}
305+
{{ dataLabel({
306+
v: calcLinearProgression(serie.plots).trend * 100,
307+
s: '%',
308+
r: 2
309+
}) }}
298310
</text>
299311
</g>
300312
</g>

0 commit comments

Comments
 (0)