Skip to content

Commit fc69d70

Browse files
committed
VueUiSparkStackbar minor bug fix
1 parent c0e5836 commit fc69d70

File tree

7 files changed

+12
-13
lines changed

7 files changed

+12
-13
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.0.93",
4+
"version": "2.0.94",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue components library",
77
"keywords": [

src/App.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,17 +1918,14 @@ const stackDataset = ref([
19181918
{
19191919
name: "Vue",
19201920
value: 258,
1921-
color: ""
19221921
},
19231922
{
19241923
name: "Javascript",
19251924
value: 36,
1926-
color: ""
19271925
},
19281926
{
19291927
name: "Other",
19301928
value: 16,
1931-
color: ""
19321929
},
19331930
]);
19341931
@@ -3226,7 +3223,7 @@ function selectBar(bar) {
32263223
const tableHeatmapDataset = ref([
32273224
{
32283225
name: "Serie 1",
3229-
values: [-100, "test", 0, 100, 150, 50, 25]
3226+
values: [-100, "test", 0, 100, 150, 50, 25, 10, 20, 30, 10, 20, 30, 10]
32303227
},
32313228
{
32323229
name: "Serie 2",

src/components/vue-ui-sparkstackbar.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ const stackConfig = computed(() => {
4242
});
4343
});
4444
45-
const safeDatasetCopy = ref(props.dataset.map(d => {
45+
const safeDatasetCopy = ref(props.dataset.map((d, i ) => {
4646
return {
4747
...d,
4848
value: stackConfig.value.style.animation.show ? 0 : d.value || 0,
49+
color: d.color ? convertColorToHex(d.color) : palette[i] || palette[i % palette.length]
4950
}
5051
}));
5152
@@ -89,7 +90,7 @@ onMounted(() => {
8990
return {
9091
...d,
9192
value: d.value += chunkSet[i],
92-
color: convertColorToHex(d.color) || palette[i] || palette[i % palette.length],
93+
color: d.color ? convertColorToHex(d.color) : palette[i] || palette[i % palette.length]
9394
}
9495
});
9596
requestAnimationFrame(animate)
@@ -98,8 +99,8 @@ onMounted(() => {
9899
return {
99100
...d,
100101
value: d.value || 0,
102+
color: d.color ? convertColorToHex(d.color) : palette[i] || palette[i % palette.length],
101103
id: createUid(),
102-
color: convertColorToHex(d.color) || palette[i] || palette[i % palette.length],
103104
}
104105
})
105106
}

src/components/vue-ui-table-heatmap.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ defineExpose({
200200
</script>
201201

202202
<template>
203-
<div ref="tableContainer" :style="`width:100%; container-type: inline-size;padding-top:${tableConfig.userOptions.show ? '36px' : ''}`" :class="{ 'vue-ui-responsive' : isResponsive }" :id="`table_heatmap_${uid}`">
203+
<div ref="tableContainer" :style="`width:100%; overflow-x:auto; container-type: inline-size;padding-top:${tableConfig.userOptions.show ? '36px' : ''}`" :class="{ 'vue-ui-responsive' : isResponsive }" :id="`table_heatmap_${uid}`">
204204
<UserOptions
205205
ref="details"
206206
:key="`user_option_${step}`"

src/default_configs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3631,7 +3631,7 @@
36313631
"showMedian": false,
36323632
"head": {
36333633
"backgroundColor": "#FFFFFF",
3634-
"values": ["Series", "JAN", "FEB", "MAR", "APR", "MAY", "JUL"]
3634+
"values": []
36353635
}
36363636
},
36373637
"userOptions": {

src/lib.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export function hslToRgb(h, s, l) {
277277
}
278278

279279
export function shiftHue(hexColor, shiftAmount) {
280+
280281
const hexToRgb = (hex) => ({
281282
r: parseInt(hex.substring(1, 3), 16),
282283
g: parseInt(hex.substring(3, 5), 16),
@@ -335,7 +336,7 @@ export function shiftHue(hexColor, shiftAmount) {
335336
};
336337
};
337338

338-
const rgbColor = hexToRgb(hexColor);
339+
const rgbColor = hexToRgb(hexColor || "#000000");
339340
const hslColor = rgbToHsl(rgbColor);
340341
hslColor.h += shiftAmount;
341342
hslColor.h = (hslColor.h + 1) % 1;

0 commit comments

Comments
 (0)