Skip to content

Commit a5e086c

Browse files
committed
Dev environment - Added VueUiSparkbar testing arena
1 parent 47cdb0a commit a5e086c

File tree

2 files changed

+112
-1
lines changed

2 files changed

+112
-1
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<script setup>
2+
import { ref, computed } from "vue";
3+
import LocalVueUiSparkbar from '../src/components/vue-ui-sparkbar.vue';
4+
import LocalVueDataUi from '../src/components/vue-data-ui.vue';
5+
import Box from "./Box.vue";
6+
import convertArrayToObject from "./convertModel";
7+
8+
const dataset = ref([
9+
{
10+
name: "quality",
11+
value: 61.953,
12+
rounding: 2,
13+
suffix: "%",
14+
prefix: 'P'
15+
},
16+
{
17+
name: "popularity",
18+
value: 2.0412,
19+
rounding: 2,
20+
suffix: "%",
21+
prefix: 'P'
22+
},
23+
{
24+
name: "maintenance",
25+
value: 33.3291,
26+
rounding: 2,
27+
suffix: "%",
28+
prefix: 'P'
29+
},
30+
]);
31+
32+
const model = ref([
33+
{ key: 'style.backgroundColor', def: '#FFFFFF', type: 'color'},
34+
{ key: 'style.fontFamily', def: 'inherit', type: 'text'},
35+
{ key: 'style.animation.show', def: true, type: 'checkbox'},
36+
{ key: 'style.animation.animationFrames', def: 60, type: 'number', min: 0, max: 300},
37+
{ key: 'style.layout.independant', def: true, type: 'checkbox'},
38+
{ key: 'style.layout.percentage', def: true, type: 'checkbox'},
39+
{ key: 'style.layout.target', def: 200, type: 'number', min: 50, max: 200},
40+
{ key: 'style.gutter.backgroundColor', def: '#e1e5e8', type: 'color'},
41+
{ key: 'style.gutter.opacity', def: 100, type: 'range', min: 0, max: 100},
42+
{ key: 'style.bar.gradient.show', def: true, type: 'checkbox'},
43+
{ key: 'style.bar.gradient.intensity', def: 40, type: 'range', min: 0, max: 100},
44+
{ key: 'style.bar.gradient.underlayerColor', def: '#FFFFFF', type: 'color'},
45+
{ key: 'style.labels.fontSize', def: 16, type: 'number', min: 8, max: 48},
46+
{ key: 'style.labels.name.position', def: 'top', type: 'select', options: ['left', 'top']},
47+
{ key: 'style.labels.name.width', def: '100%', type: 'text'},
48+
{ key: 'style.labels.name.color', def: '#1A1A1A', type: 'color'},
49+
{ key: 'style.labels.name.bold', def: false, type: 'checkbox'},
50+
{ key: 'style.labels.value.show', def: true, type: 'checkbox'},
51+
{ key: 'style.labels.value.bold', def: true, type: 'checkbox'},
52+
{ key: 'style.gap', def: 4, type: 'number', min: 0, max: 24}
53+
])
54+
55+
const config = computed(() => convertArrayToObject(model.value));
56+
57+
const step = ref(0)
58+
59+
</script>
60+
61+
<template>
62+
<Box>
63+
<template #title>VueUiSparkbar</template>
64+
65+
<template #local>
66+
<LocalVueUiSparkbar :dataset="dataset" :config="config" :key="`local_${step}`">
67+
</LocalVueUiSparkbar>
68+
</template>
69+
70+
<template #VDUI-local>
71+
<LocalVueDataUi component="VueUiSparkbar" :dataset="dataset" :config="config" :key="`VDUI-lodal_${step}`">
72+
</LocalVueDataUi>
73+
</template>
74+
75+
<template #build>
76+
<VueUiSparkbar :dataset="dataset" :config="config" :key="`build_${step}`">
77+
</VueUiSparkbar>
78+
</template>
79+
80+
<template #VDUI-build>
81+
<VueDataUi component="VueUiSparkbar" :dataset="dataset" :config="config" :key="`VDUI-build_${step}`">
82+
</VueDataUi>
83+
</template>
84+
85+
<template #knobs>
86+
<div
87+
style="display: flex; flex-direction: row; flex-wrap:wrap; align-items:center; width: 100%; color: #CCCCCC; gap:24px;">
88+
<div v-for="knob in model">
89+
<label style="font-size: 10px">{{ knob.key }}</label>
90+
<div
91+
style="display:flex; flex-direction:row; flex-wrap: wrap; align-items:center; gap:6px; height: 40px">
92+
<input v-if="!['none', 'select'].includes(knob.type)" :step="knob.step" :type="knob.type" :min="knob.min ?? 0"
93+
:max="knob.max ?? 0" v-model="knob.def" @change="step += 1">
94+
<select v-if="knob.type === 'select'" v-model="knob.def" @change="step += 1">
95+
<option v-for="opt in knob.options">{{ opt }}</option>
96+
</select>
97+
</div>
98+
</div>
99+
</div>
100+
</template>
101+
102+
<template #config>
103+
{{ config }}
104+
</template>
105+
</Box>
106+
</template>

src/App.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import ArenaVueUiHeatmap from "../TestingArena/ArenaVueUiHeatmap.vue";
1717
import ArenaVueUiScatter from "../TestingArena/ArenaVueUiScatter.vue";
1818
import ArenaVueUiCandlestick from "../TestingArena/ArenaVueUiCandlestick.vue";
1919
import ArenaVueUiSparkline from "../TestingArena/ArenaVueUiSparkline.vue";
20+
import ArenaVueUiSparkbar from "../TestingArena/ArenaVueUiSparkbar.vue";
2021
2122
const showOldArena = ref(false);
2223
@@ -37,9 +38,10 @@ const components = ref([
3738
"VueUiScatter",
3839
"VueUiCandlestick",
3940
"VueUiSparkline",
41+
"VueUiSparkbar"
4042
]);
4143
42-
const selectedComponent = ref(components.value[15]);
44+
const selectedComponent = ref(components.value[16]);
4345
4446
</script>
4547

@@ -100,4 +102,7 @@ const selectedComponent = ref(components.value[15]);
100102

101103
<!-- 15 -->
102104
<ArenaVueUiSparkline v-if="selectedComponent === 'VueUiSparkline'" />
105+
106+
<!-- 16 -->
107+
<ArenaVueUiSparkbar v-if="selectedComponent === 'VueUiSparkbar'" />
103108
</template>

0 commit comments

Comments
 (0)