Skip to content

Commit 87eacf7

Browse files
committed
VueUiSparkTrend added new component
1 parent dbdb42d commit 87eacf7

File tree

14 files changed

+559
-20
lines changed

14 files changed

+559
-20
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
![GitHub issues](https://img.shields.io/github/issues/graphieros/vue-data-ui)
1414
![NPM](https://img.shields.io/npm/l/vue-data-ui)
1515
![npm](https://img.shields.io/npm/dt/vue-data-ui)
16-
![Static Badge](https://img.shields.io/badge/components-46-green)
16+
![Static Badge](https://img.shields.io/badge/components-47-green)
1717

1818
[Interactive documentation](https://vue-data-ui.graphieros.com/)
1919

@@ -56,6 +56,7 @@ Available components:
5656
- [VueUiSparkgauge](https://vue-data-ui.graphieros.com/docs#vue-ui-sparkgauge)
5757
- [VueUiSparkline](https://vue-data-ui.graphieros.com/docs#vue-ui-sparkline)
5858
- [VueUiSparkstackbar](https://vue-data-ui.graphieros.com/docs#vue-ui-sparkstackbar)
59+
- [VueUiSparkTrend](https://vue-data-ui.graphieros.com/docs#vue-ui-spark-trend)
5960

6061
## 3d
6162

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

src/App.vue

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import TableHeatmapTest from "./components/vue-ui-table-heatmap.vue";
6161
import AccordionTest from "./components/vue-ui-accordion.vue";
6262
import QuickTest from "./components/vue-ui-quick-chart.vue";
6363
import TestCursor from "./components/vue-ui-cursor.vue";
64+
import TestTrend from "./components/vue-ui-spark-trend.vue";
6465
6566
const dataset = ref([
6667
{
@@ -3301,7 +3302,7 @@ const quickDatasetLine = ref([
33013302
},
33023303
{
33033304
name: 'Serie2',
3304-
values: [5, 6, 7, 6, 7, 8, 7, 8, 9]
3305+
values: [5, 6, 7, 6, -10, 8, 7, 8, 9]
33053306
},
33063307
{
33073308
name: 'Serie3',
@@ -3310,7 +3311,7 @@ const quickDatasetLine = ref([
33103311
])
33113312
33123313
3313-
const quickDatasetSimpleLine = ref([1, 2, 3, 5, 8, 13, 21, 34, 55, 89])
3314+
const quickDatasetSimpleLine = ref([1, 2, 3, 5, -8, 13, 21, 34, 55, 89])
33143315
const quickDatasetSimpleBar = ref([1, 2, -10, -5, 8])
33153316
33163317
const quickDatasetBar = ref([
@@ -3336,8 +3337,28 @@ const quickConfig = ref({
33363337
yAxisLabel: 'This is y axis'
33373338
})
33383339
3339-
const cursorConfig = ref({
3340-
3340+
const cursorConfig = ref({})
3341+
3342+
const pillDataset = ref([0, 1, 2, 3, 5, 8, -13, 21, 34, 55, 89])
3343+
3344+
const pillConfig = ref({
3345+
style: {
3346+
trendLabel: {
3347+
trendType: "global"
3348+
},
3349+
area: {
3350+
opacity: 20
3351+
},
3352+
line: {
3353+
useColorTrend: true
3354+
},
3355+
trendLabel: {
3356+
useColorTrend: true
3357+
},
3358+
dataLabel: {
3359+
useColorTrend: true,
3360+
}
3361+
}
33413362
})
33423363
33433364
</script>
@@ -3479,10 +3500,29 @@ const cursorConfig = ref({
34793500
<BaseIcon name="people" stroke="#42d392" />
34803501
<BaseIcon name="copy" stroke="#42d392" />
34813502
<BaseIcon name="cursor" stroke="#42d392" />
3503+
<BaseIcon name="trend" stroke="#42d392" />
34823504
</div>
34833505
</template>
34843506
</Box>
34853507

3508+
<Box open @copy="copyConfig(PROD_CONFIG.vue_ui_spark_trend)">
3509+
<template #title>
3510+
<BaseIcon name="trend"/>
3511+
VueUiSparkTrend
3512+
</template>
3513+
<template #info>
3514+
</template>
3515+
<template #dev>
3516+
<TestTrend :dataset="pillDataset" :config="pillConfig"/>
3517+
</template>
3518+
<template #prod>
3519+
<VueUiSparkTrend :dataset="pillDataset" :config="pillConfig"/>
3520+
</template>
3521+
<template #config>
3522+
{{ PROD_CONFIG.vue_ui_spark_trend }}
3523+
</template>
3524+
</Box>
3525+
34863526
<Box open @copy="copyConfig(PROD_CONFIG.vue_ui_quick_chart)">
34873527
<template #title>
34883528
<BaseIcon name="vueDataUi"/>

src/atoms/BaseIcon.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script setup>
1+
<script setup>
22
import { computed } from "vue";
33
import { XMLNS } from "../lib";
44
@@ -140,7 +140,8 @@ const icons = computed(() => {
140140
people: `<path fill="none" stroke="${props.stroke}" stroke-width="${props.strokeWidth / 2}" fill="none" d="M 5 1 A 1 1 0 0 0 5 9 A 1 1 0 0 0 5 1 M 15 1 A 1 1 0 0 0 15 9 A 1 1 0 0 0 15 1 M 5 11 A 1 1 0 0 0 5 19 A 1 1 0 0 0 5 11 M 15 11 A 1 1 0 0 0 15 19 A 1 1 0 0 0 15 11 M 3 4 L 3 4 M 7 4 L 7 4 M 3 6 C 4 7 6 7 7 6 M 13 4 L 13 4 M 17 4 L 17 4 M 13 6 C 14 7 16 7 17 6 M 3 14 L 3 14 M 7 14 L 7 14 M 3 16 C 4 17 6 17 7 16 M 13 14 L 13 14 M 17 14 L 17 14 M 13 16 C 14 17 16 17 17 16" stroke-linecap="round" stroke-linejoin="round"/>`,
141141
copy: `<path fill="none" stroke="${props.stroke}" stroke-width="${props.strokeWidth}" fill="none" d="M 18 16 C 18 17 17 18 16 18 L 8 18 C 7 18 6 17 6 16 L 6 8 C 6 7 7 6 8 6 L 16 6 C 17 6 18 7 18 8 L 18 16 M 6 14 L 4 14 C 3 14 2 13 2 12 L 2 4 C 2 3 3 2 4 2 L 12 2 C 13 2 14 3 14 4 L 14 6" stroke-linecap="round" stroke-linejoin="round"/>`,
142142
accordion: `<path fill="none" stroke="${props.stroke}" stroke-width="${props.strokeWidth}" stroke-linecap="round" stroke-linejoin="round" d="M 2 2 L 18 2 L 16 4 L 18 6 L 16 8 L 18 10 L 16 12 L 18 14 L 16 16 L 18 18 L 2 18 L 4 16 L 2 14 L 4 12 L 2 10 L 4 8 L 2 6 L 4 4 L 2 2"/><path stroke="none" fill="${props.stroke}" style="opacity:0.3" stroke-linecap="round" stroke-linejoin="round" d="M 2 2 L 18 2 L 16 4 L 4 4 Z" /><path stroke="none" fill="${props.stroke}" style="opacity:0.3" stroke-linecap="round" stroke-linejoin="round" d="M 2 6 L 18 6 L 16 8 L 4 8 Z" /><path stroke="none" fill="${props.stroke}" style="opacity:0.3" stroke-linecap="round" stroke-linejoin="round" d="M 2 10 L 18 10 L 16 12 L 4 12 Z" /><path stroke="none" fill="${props.stroke}" style="opacity:0.3" stroke-linecap="round" stroke-linejoin="round" d="M 2 14 L 18 14 L 16 16 L 4 16 Z" />`,
143-
cursor: `<path stroke="${props.stroke}" stroke-width="${props.strokeWidth}" fill="none" stroke-linecap="round" stroke-linejoin="round" d="M 6 10 A 1 1 0 0 0 14 10 A 1 1 0 0 0 6 10 M 1 10 L 6 10 M 14 10 L 19 10 M 10 1 L 10 6 M 10 14 L 10 19 M 10 8 L 10 12 M 8 10 L 12 10" />`
143+
cursor: `<path stroke="${props.stroke}" stroke-width="${props.strokeWidth}" fill="none" stroke-linecap="round" stroke-linejoin="round" d="M 6 10 A 1 1 0 0 0 14 10 A 1 1 0 0 0 6 10 M 1 10 L 6 10 M 14 10 L 19 10 M 10 1 L 10 6 M 10 14 L 10 19 M 10 8 L 10 12 M 8 10 L 12 10" />`,
144+
trend: `<path stroke="${props.stroke}" stroke-width="${props.strokeWidth}" fill="none" stroke-linecap="round" stroke-kinejoin="round" d="M 1 6 L 4 4 L 7 6 M 4 4 L 4 13 M 7 16 C 7 16 7 18 9 18 C 12 18 10 9 12 9 C 14 9 14 13 15 13 C 18 14 17.6667 5.6667 19 2"/>`
144145
}
145146
})
146147

src/components/vue-data-ui.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import VueUiTableHeatmap from "./vue-ui-table-heatmap.vue";
4747
import VueUiAccordion from "./vue-ui-accordion.vue";
4848
import VueUiQuickChart from "./vue-ui-quick-chart.vue";
4949
import VueUiCursor from "./vue-ui-cursor.vue";
50+
import VueUiSparkTrend from "./vue-ui-spark-trend.vue";
5051
5152
const props = defineProps({
5253
component: { type: String },
@@ -55,7 +56,7 @@ const props = defineProps({
5556
})
5657
5758
const isError = computed(() => {
58-
return !["VueUi3dBar", "VueUiAgePyramid", "VueUiAnnotator", "VueUiCandlestick", "VueUiChestnut", "VueUiDashboard", "VueUiDigits", "VueUiDonutEvolution", "VueUiDonut", "VueUiGauge", "VueUiGalaxy", "VueUiHeatmap", "VueUiKpi", "VueUiMiniLoader", "VueUiMolecule", "VueUiMoodRadar", "VueUiNestedDonuts", "VueUiOnion", "VueUiQuadrant", "VueUiRadar", "VueUiRating", "VueUiRelationCircle", "VueUiRings", "VueUiScatter", "VueUiScreenshot", "VueUiSkeleton", "VueUiSmiley", "VueUiSparkbar", "VueUiSparkgauge", "VueUiSparkHistogram", "VueUiSparkline", "VueUiSparkStackbar", "VueUiTableSparkline", "VueUiTable", "VueUiThermometer", "VueUiTiremarks", "VueUiVerticalBar", "VueUiWaffle", "VueUiWheel", "VueUiXy", "VueUiTreemap", "VueUiTableHeatmap", "VueUiAccordion", "VueUiQuickChart", "VueUiCursor"].includes(props.component)
59+
return !["VueUi3dBar", "VueUiAgePyramid", "VueUiAnnotator", "VueUiCandlestick", "VueUiChestnut", "VueUiDashboard", "VueUiDigits", "VueUiDonutEvolution", "VueUiDonut", "VueUiGauge", "VueUiGalaxy", "VueUiHeatmap", "VueUiKpi", "VueUiMiniLoader", "VueUiMolecule", "VueUiMoodRadar", "VueUiNestedDonuts", "VueUiOnion", "VueUiQuadrant", "VueUiRadar", "VueUiRating", "VueUiRelationCircle", "VueUiRings", "VueUiScatter", "VueUiScreenshot", "VueUiSkeleton", "VueUiSmiley", "VueUiSparkbar", "VueUiSparkgauge", "VueUiSparkHistogram", "VueUiSparkline", "VueUiSparkStackbar", "VueUiTableSparkline", "VueUiTable", "VueUiThermometer", "VueUiTiremarks", "VueUiVerticalBar", "VueUiWaffle", "VueUiWheel", "VueUiXy", "VueUiTreemap", "VueUiTableHeatmap", "VueUiAccordion", "VueUiQuickChart", "VueUiCursor", "VueUiSparkTrend"].includes(props.component)
5960
});
6061
6162
const vue_ui_3d_bar = ref(null);
@@ -102,6 +103,7 @@ const vue_ui_xy = ref(null);
102103
const vue_ui_table_heatmap = ref(null);
103104
const vue_ui_quick_chart = ref(null);
104105
const vue_ui_cursor = ref(null);
106+
const vue_ui_spark_trend = ref(null);
105107
106108
const emit = defineEmits([
107109
'selectLegend',
@@ -133,7 +135,7 @@ const recalculateHeight = ref(() => null);
133135
134136
onMounted(() => {
135137
if (isError.value) {
136-
throw new Error(`\n\nVue Data UI exception:\nThe provided component "${props.component}" does not exist. Check the spelling.\n\nAvailable components:\n\n. VueUi3dBar\n. VueUiAccordion\n. VueUiAgePyramid\n. VueUiAnnotator\n. VueUiCandlestick\n. VueUiChestnut\n. VueUiCursor\n. VueUiDashboard\n. VueUiDigits\n. VueUiDonutEvolution\n. VueUiDonut\n. VueUiGauge\n. VueUiHeatmap\n. VueUiMiniLoadar\n. VueUiKpi\n. VueUiMolecule\n. VueUiMoodRadar\n. VueUiNestedDonuts\n. VueUiOnion\n. VueUiQuadrant\n. VueUiQuickChart\n. VueUiRadar\n. VueUiRating\n. VueUiRelationCircle\n. VueUiRings\n. VueUiScatter\n. VueUiScreenshot\n. VueUiSkeleton\n. VueUiSmiley\n. VueUiSparkbar\n. VueUiSparkgauge\n. VueUiSparkHistogram\n. VueUiSparkline\n. VueUiSparkStackbar\n. VueUiTableHeatmap\n. VueUiTableSparkline\n. VueUiTable\n. VueUiThermometer\n. VueUiTiremarks\n. VueUiVerticalBar\n. VueUiWaffle\n. VueUiWheel\n. VueUiXy\n\n`)
138+
throw new Error(`\n\nVue Data UI exception:\nThe provided component "${props.component}" does not exist. Check the spelling.\n\nAvailable components:\n\n. VueUi3dBar\n. VueUiAccordion\n. VueUiAgePyramid\n. VueUiAnnotator\n. VueUiCandlestick\n. VueUiChestnut\n. VueUiCursor\n. VueUiDashboard\n. VueUiDigits\n. VueUiDonutEvolution\n. VueUiDonut\n. VueUiGauge\n. VueUiHeatmap\n. VueUiMiniLoadar\n. VueUiKpi\n. VueUiMolecule\n. VueUiMoodRadar\n. VueUiNestedDonuts\n. VueUiOnion\n. VueUiQuadrant\n. VueUiQuickChart\n. VueUiRadar\n. VueUiRating\n. VueUiRelationCircle\n. VueUiRings\n. VueUiScatter\n. VueUiScreenshot\n. VueUiSkeleton\n. VueUiSmiley\n. VueUiSparkbar\n. VueUiSparkgauge\n. VueUiSparkHistogram\n. VueUiSparkline\n. VueUiSparkStackbar\n. VueUiSparkTrend\n. VueUiTableHeatmap\n. VueUiTableSparkline\n. VueUiTable\n. VueUiThermometer\n. VueUiTiremarks\n. VueUiVerticalBar\n. VueUiWaffle\n. VueUiWheel\n. VueUiXy\n\n`)
137139
}
138140
139141
if(vue_ui_quick_chart.value) {
@@ -359,6 +361,13 @@ defineExpose({
359361
The provided component "{{ component }}" does not exist
360362
</div>
361363

364+
<VueUiSparkTrend
365+
v-if="component === 'VueUiSparkTrend'"
366+
:config="config"
367+
:dataset="dataset"
368+
ref="vue_ui_spark_trend"
369+
/>
370+
362371
<VueUiCursor
363372
v-if="component === 'VueUiCursor'"
364373
:config="config"

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,6 @@ defineExpose({
11361136
:stroke="quickConfig.backgroundColor"
11371137
:stroke-width="quickConfig.barStrokeWidth"
11381138
stroke-linecap="round"
1139-
class="quick-animation"
11401139
style="transition: all 0.3s ease-in-out"
11411140
/>
11421141
</template>

0 commit comments

Comments
 (0)