/
DatavizSkeleton.vue
55 lines (52 loc) · 1.43 KB
/
DatavizSkeleton.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<template>
<div class="dataviz-shell">
<form class="form">
<div>
<label for="some-input">Some input : </label>
<select
id="some-input"
name="some-input"
v-model="someInput"
@change="refresh"
>
<option v-for="option in someInputOptionList" :value="option.id" :key="option.id">
{{ option.label }}
</option>
</select>
</div>
<div>
<label for="another-input">Another input : </label>
<input
id="another-input"
name="another-input"
type="range" min="1" max="100"
v-model="anotherInput"
@change="refresh"
/>
</div>
</form>
<p v-if="loading">Loading data.</p>
<p v-else-if="error">An error appeared while loading data.</p>
<p v-else-if="data.length == 0">There is no data available for your selection.</p>
<svg
v-show="data.length != 0"
:id="svgElementId"
:viewBox="viewBox"
>
<!-- If you already know some part of your SVG and
if it don't need some complexe calculations, just write it directly ! -->
<g class="axe-x"></g>
<g class="axe-y"></g>
<g class="data"></g>
</svg>
</div>
</template>
<style>
.dataviz-shell {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>
<script src="./DatavizSkeleton.js"/>