vue-chrts 0.0.114 → 0.0.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/extensions.json +3 -0
- package/auto-imports.d.ts +58 -0
- package/components.d.ts +46 -0
- package/image.png +0 -0
- package/index.html +14 -0
- package/index.js +2 -0
- package/package.json +1 -4
- package/src/components/Area/AreaChart.vue +141 -0
- package/src/components/Area/index.ts +1 -0
- package/src/components/AreaStacked/AreaStackedChart.vue +51 -0
- package/{dist/components/AreaStacked/index.d.ts → src/components/AreaStacked/index.ts} +1 -1
- package/src/components/Bar/BarChart.vue +130 -0
- package/src/components/Bar/index.ts +1 -0
- package/src/components/Crosshair/Crosshair.vue +46 -0
- package/src/components/Crosshair/index.ts +1 -0
- package/src/components/Donut/DonutChart.vue +71 -0
- package/src/components/Donut/index.ts +1 -0
- package/src/components/Line/LineChart.vue +94 -0
- package/src/components/Line/index.ts +1 -0
- package/src/components/Tooltip.vue +17 -0
- package/src/components.ts +6 -0
- package/src/index.ts +6 -0
- package/src/shims-vue.d.ts +1 -0
- package/src-demo/AdminTemplate.vue +5 -0
- package/src-demo/App.vue +37 -0
- package/src-demo/AreaChartPage.vue +125 -0
- package/src-demo/BarChartPage.vue +166 -0
- package/src-demo/DashboardTemplate.vue +687 -0
- package/src-demo/Homepage.vue +325 -0
- package/src-demo/LineChartPage.vue +140 -0
- package/src-demo/assets/main.css +34 -0
- package/src-demo/components/Progress/Progress.vue +42 -0
- package/src-demo/components/Progress/index.ts +1 -0
- package/src-demo/components/Status/Status.vue +95 -0
- package/src-demo/components/Status/index.ts +1 -0
- package/src-demo/components/charts.ts +37 -0
- package/src-demo/components/index.ts +49 -0
- package/src-demo/data/AreaChartData.ts +294 -0
- package/src-demo/data/BarChartData.ts +79 -0
- package/src-demo/data/IncomeExpenseData.ts +189 -0
- package/src-demo/data/InvestmentData.ts +352 -0
- package/src-demo/data/RevenueData.ts +58 -0
- package/src-demo/data/VisitorsData.ts +260 -0
- package/src-demo/elements/Button.vue +13 -0
- package/src-demo/elements/Card.vue +17 -0
- package/src-demo/elements/Dropdown.vue +112 -0
- package/src-demo/elements/Logo.vue +8 -0
- package/src-demo/elements/Table.vue +363 -0
- package/src-demo/elements/TopBar.vue +40 -0
- package/src-demo/index.ts +58 -0
- package/tsconfig.json +11 -0
- package/vite.config.ts +59 -0
- package/dist/components/Area/AreaChart.vue.d.ts +0 -37
- package/dist/components/Area/index.d.ts +0 -1
- package/dist/components/AreaStacked/AreaStackedChart.vue.d.ts +0 -18
- package/dist/components/Bar/BarChart.vue.d.ts +0 -37
- package/dist/components/Bar/index.d.ts +0 -1
- package/dist/components/Crosshair/Crosshair.vue.d.ts +0 -38
- package/dist/components/Crosshair/index.d.ts +0 -1
- package/dist/components/Donut/DonutChart.vue.d.ts +0 -31
- package/dist/components/Donut/index.d.ts +0 -1
- package/dist/components/Line/LineChart.vue.d.ts +0 -28
- package/dist/components/Line/index.d.ts +0 -1
- package/dist/components/Tooltip.vue.d.ts +0 -14
- package/dist/components.d.ts +0 -6
- package/dist/index.cjs +0 -502
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -9615
- package/dist/index.js.map +0 -1
- /package/{dist → public}/vite.svg +0 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import TopBar from "./elements/TopBar.vue";
|
|
3
|
+
import Logo from "./elements/Logo.vue";
|
|
4
|
+
|
|
5
|
+
import { Status as BaseStatus } from "./components/Status";
|
|
6
|
+
import { LineChart as BaseLine } from "./../src/components";
|
|
7
|
+
import { Progress as BaseProgress } from "./components/Progress";
|
|
8
|
+
import { BarChart as BaseBar } from "./../src/components";
|
|
9
|
+
import { AreaChart as BaseArea } from "./../src/components";
|
|
10
|
+
import { DonutChart as BaseDonut } from "./../src/components";
|
|
11
|
+
|
|
12
|
+
import DashboardTemplate from "./DashboardTemplate.vue";
|
|
13
|
+
|
|
14
|
+
import { PaginationPosition } from "./../src";
|
|
15
|
+
|
|
16
|
+
import Button from "./elements/Button.vue";
|
|
17
|
+
import Card from "./elements/Card.vue";
|
|
18
|
+
import Table from "./elements/Table.vue";
|
|
19
|
+
|
|
20
|
+
import { h } from "vue";
|
|
21
|
+
import { CurveType } from "@unovis/ts";
|
|
22
|
+
import { InvestmentData, categories } from "./data/InvestmentData";
|
|
23
|
+
|
|
24
|
+
import {
|
|
25
|
+
RevenueData,
|
|
26
|
+
RevenueDataSmall,
|
|
27
|
+
categories as RevenueCategories,
|
|
28
|
+
} from "./data/RevenueData";
|
|
29
|
+
|
|
30
|
+
const loggedIn = false;
|
|
31
|
+
|
|
32
|
+
const DonutData = [
|
|
33
|
+
{
|
|
34
|
+
color: "#60A5FA",
|
|
35
|
+
name: "Blue",
|
|
36
|
+
value: 50,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
color: "#CBD5E1",
|
|
40
|
+
name: "Gray",
|
|
41
|
+
value: 20,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
color: "#00DC82",
|
|
45
|
+
name: "Green",
|
|
46
|
+
value: 30,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
const columns = [
|
|
51
|
+
{
|
|
52
|
+
accessorKey: "name",
|
|
53
|
+
header: "name",
|
|
54
|
+
cell: ({ row }: any) => {
|
|
55
|
+
return h(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
class: "flex items-center gap-4",
|
|
59
|
+
},
|
|
60
|
+
[
|
|
61
|
+
h(
|
|
62
|
+
"span",
|
|
63
|
+
{
|
|
64
|
+
style: {
|
|
65
|
+
width: "0.75rem",
|
|
66
|
+
height: "0.75rem",
|
|
67
|
+
backgroundColor: row.original.color,
|
|
68
|
+
display: "block",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
""
|
|
72
|
+
),
|
|
73
|
+
h("span", {}, `${row.getValue("name")}`),
|
|
74
|
+
]
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
accessorKey: "value",
|
|
80
|
+
header: "value",
|
|
81
|
+
cell: ({ row }: any) => `${row.getValue("value")}`,
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
</script>
|
|
85
|
+
<template>
|
|
86
|
+
<TopBar></TopBar>
|
|
87
|
+
<div class="max-w-7xl mx-auto py-4">
|
|
88
|
+
<header class="py-24 sm:py-24 relative px-4 lg:px-0">
|
|
89
|
+
<div class="flex items-center justify-center mb-4">
|
|
90
|
+
<Logo />
|
|
91
|
+
</div>
|
|
92
|
+
<h1
|
|
93
|
+
class="text-6xl font-bold tracking-tight text-gray-900 dark:text-white text-center max-w-3xl mx-auto"
|
|
94
|
+
>
|
|
95
|
+
Vue components to build charts and dashboards
|
|
96
|
+
</h1>
|
|
97
|
+
<p
|
|
98
|
+
class="mt-6 text-lg tracking-tight text-gray-600 dark:text-gray-400 text-center max-w-xl mx-auto"
|
|
99
|
+
>
|
|
100
|
+
Powerful & Accessible Vue Components for Dashboards & Charts. Built with
|
|
101
|
+
Tailwind CSS and Nuxt UI.
|
|
102
|
+
</p>
|
|
103
|
+
<div class="flex items-center gap-4 mt-8 justify-center">
|
|
104
|
+
<RouterLink v-if="!loggedIn" to="/auth/login">
|
|
105
|
+
<Button
|
|
106
|
+
color="primary"
|
|
107
|
+
icon="i-heroicons:arrow-right-20-solid"
|
|
108
|
+
:trailing="true"
|
|
109
|
+
size="lg"
|
|
110
|
+
>
|
|
111
|
+
Sign in
|
|
112
|
+
</Button>
|
|
113
|
+
</RouterLink>
|
|
114
|
+
<RouterLink v-else to="/dashboard">
|
|
115
|
+
<Button
|
|
116
|
+
icon="i-heroicons:arrow-right-20-solid"
|
|
117
|
+
:trailing="true"
|
|
118
|
+
size="lg"
|
|
119
|
+
>
|
|
120
|
+
Dashboard
|
|
121
|
+
</Button>
|
|
122
|
+
</RouterLink>
|
|
123
|
+
<RouterLink to="/overview">
|
|
124
|
+
<Button icon="i-heroicons:swatch" size="lg"> Overview </Button>
|
|
125
|
+
</RouterLink>
|
|
126
|
+
</div>
|
|
127
|
+
</header>
|
|
128
|
+
|
|
129
|
+
<div class="grid grid-cols-12 gap-8 mb-8">
|
|
130
|
+
<div class="col-span-8">
|
|
131
|
+
<Card>
|
|
132
|
+
<template #header>
|
|
133
|
+
<h2 class="heading-2">Multi line chart</h2>
|
|
134
|
+
<p class="text-gray-500">Website visitors per device</p>
|
|
135
|
+
</template>
|
|
136
|
+
<BaseLine
|
|
137
|
+
:data="InvestmentData"
|
|
138
|
+
:height="322"
|
|
139
|
+
:pagination-poisition="PaginationPosition.Bottom"
|
|
140
|
+
:categories="categories"
|
|
141
|
+
:y-num-ticks="8"
|
|
142
|
+
:x-formatter="(i: number): string => `${InvestmentData[i].date}`"
|
|
143
|
+
:curve-type="CurveType.MonotoneX"
|
|
144
|
+
/>
|
|
145
|
+
</Card>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div class="col-span-4">
|
|
149
|
+
<Card>
|
|
150
|
+
<template #header>
|
|
151
|
+
<h2 class="heading-2">Donut Chart Example</h2>
|
|
152
|
+
<p class="text-gray-500">Color Distribution</p>
|
|
153
|
+
</template>
|
|
154
|
+
<BaseDonut
|
|
155
|
+
:data="DonutData.map((i) => i.value)"
|
|
156
|
+
:height="200"
|
|
157
|
+
:labels="DonutData"
|
|
158
|
+
:hide-pagination="true"
|
|
159
|
+
:radius="0"
|
|
160
|
+
>
|
|
161
|
+
<div class="absolute text-center">
|
|
162
|
+
<div class="font-semibold dark:text-white">Label</div>
|
|
163
|
+
<div class="text-gray-500">2 seconds ago</div>
|
|
164
|
+
</div>
|
|
165
|
+
</BaseDonut>
|
|
166
|
+
<div class="mt-4 p-0">
|
|
167
|
+
<Table
|
|
168
|
+
:data="DonutData"
|
|
169
|
+
:columns="columns"
|
|
170
|
+
:enable-sorting="false"
|
|
171
|
+
:enable-pagination="false"
|
|
172
|
+
:enable-filtering="false"
|
|
173
|
+
:enable-row-selection="true"
|
|
174
|
+
:table-size="'md'"
|
|
175
|
+
:striped="true"
|
|
176
|
+
:hover="true"
|
|
177
|
+
:bordered="false"
|
|
178
|
+
:pagination-position="'bottom'"
|
|
179
|
+
:page-size-options="[5, 10, 20, 50]"
|
|
180
|
+
:initial-page-size="10"
|
|
181
|
+
>
|
|
182
|
+
</Table>
|
|
183
|
+
</div>
|
|
184
|
+
</Card>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
<div class="grid grid-cols-12 gap-8 mb-8">
|
|
189
|
+
<div class="col-span-5">
|
|
190
|
+
<Card class="h-full">
|
|
191
|
+
<Card>
|
|
192
|
+
<div class="space-y-2 mb-4">
|
|
193
|
+
<p class="text-gray-500 mb-1">NuxtLabs</p>
|
|
194
|
+
<div class="flex items-center justify-between">
|
|
195
|
+
<h2 class="text-xl dark:text-white font-bold">$75.1K</h2>
|
|
196
|
+
<div class="flex items-center gap-2 text-sm">
|
|
197
|
+
<div>+$1.1K</div>
|
|
198
|
+
<div class="text-gray-500">+9.1%</div>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<BaseArea
|
|
204
|
+
:data="RevenueDataSmall"
|
|
205
|
+
:height="50"
|
|
206
|
+
:categories="RevenueCategories"
|
|
207
|
+
:y-axis="['value']"
|
|
208
|
+
:hide-legend="true"
|
|
209
|
+
:hide-tooltip="true"
|
|
210
|
+
:y-formatter="() => ''"
|
|
211
|
+
:x-formatter="() => ''"
|
|
212
|
+
/>
|
|
213
|
+
|
|
214
|
+
<template #footer>
|
|
215
|
+
<div class="flex justify-end text-sm items-center gap-2">
|
|
216
|
+
<span>View more</span>
|
|
217
|
+
<svg
|
|
218
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
219
|
+
viewBox="0 0 24 24"
|
|
220
|
+
fill="currentColor"
|
|
221
|
+
class="size-4"
|
|
222
|
+
>
|
|
223
|
+
<path
|
|
224
|
+
fill-rule="evenodd"
|
|
225
|
+
d="M16.72 7.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1 0 1.06l-3.75 3.75a.75.75 0 1 1-1.06-1.06l2.47-2.47H3a.75.75 0 0 1 0-1.5h16.19l-2.47-2.47a.75.75 0 0 1 0-1.06Z"
|
|
226
|
+
clip-rule="evenodd"
|
|
227
|
+
/>
|
|
228
|
+
</svg>
|
|
229
|
+
</div>
|
|
230
|
+
</template>
|
|
231
|
+
</Card>
|
|
232
|
+
</Card>
|
|
233
|
+
</div>
|
|
234
|
+
<div class="col-span-7">
|
|
235
|
+
<Card class="h-full">
|
|
236
|
+
<BaseStatus></BaseStatus>
|
|
237
|
+
|
|
238
|
+
<template #footer>
|
|
239
|
+
<h2 class="heading-2">Advanced visualizations</h2>
|
|
240
|
+
<p class="text-gray-500">
|
|
241
|
+
Tracker, Bar Lists, and many more components to visualize complex
|
|
242
|
+
use cases gracefully.
|
|
243
|
+
</p>
|
|
244
|
+
</template>
|
|
245
|
+
</Card>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<Card>
|
|
250
|
+
<div class="grid grid-cols-12 gap-4 mb-8">
|
|
251
|
+
<div class="col-span-4 space-y-4">
|
|
252
|
+
<Card>
|
|
253
|
+
<BaseProgress
|
|
254
|
+
color="#05DF72"
|
|
255
|
+
label="Storage used"
|
|
256
|
+
value="1.85GB"
|
|
257
|
+
:total="10"
|
|
258
|
+
:progress="1.85"
|
|
259
|
+
unit="GB"
|
|
260
|
+
></BaseProgress>
|
|
261
|
+
</Card>
|
|
262
|
+
<Card>
|
|
263
|
+
<BaseProgress
|
|
264
|
+
color="#05DF72"
|
|
265
|
+
label="Weekly active users"
|
|
266
|
+
value="250"
|
|
267
|
+
:total="512"
|
|
268
|
+
:progress="250"
|
|
269
|
+
></BaseProgress>
|
|
270
|
+
</Card>
|
|
271
|
+
<Card>
|
|
272
|
+
<BaseProgress
|
|
273
|
+
color="#05DF72"
|
|
274
|
+
label="Current costs"
|
|
275
|
+
value="$293.5"
|
|
276
|
+
:total="300"
|
|
277
|
+
:progress="293.5"
|
|
278
|
+
></BaseProgress>
|
|
279
|
+
</Card>
|
|
280
|
+
</div>
|
|
281
|
+
<div class="col-span-8">
|
|
282
|
+
<Card>
|
|
283
|
+
<template #header>
|
|
284
|
+
<h2 class="heading-2">Beautiful Bar Chart</h2>
|
|
285
|
+
<p class="text-gray-500">
|
|
286
|
+
Tracker, Bar Lists, and many more components to visualize
|
|
287
|
+
complex use cases gracefully.
|
|
288
|
+
</p>
|
|
289
|
+
</template>
|
|
290
|
+
|
|
291
|
+
<BaseBar
|
|
292
|
+
:data="RevenueData"
|
|
293
|
+
:height="306"
|
|
294
|
+
:categories="RevenueCategories"
|
|
295
|
+
:y-axis="['value']"
|
|
296
|
+
:hide-legend="true"
|
|
297
|
+
:y-formatter="(i: number) => i"
|
|
298
|
+
:x-formatter="(i: number): string => {
|
|
299
|
+
return `${RevenueData[i].date }`;
|
|
300
|
+
}"
|
|
301
|
+
:x-num-ticks="12"
|
|
302
|
+
/>
|
|
303
|
+
</Card>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
</Card>
|
|
307
|
+
|
|
308
|
+
<div class="max-w-7xl mx-auto my-48 space-y-4">
|
|
309
|
+
<h2
|
|
310
|
+
class="text-4xl font-bold tracking-tight text-gray-900 dark:text-white text-center"
|
|
311
|
+
>
|
|
312
|
+
Awesome templates for Nuxt
|
|
313
|
+
</h2>
|
|
314
|
+
|
|
315
|
+
<p class="text-white/50 text-center">
|
|
316
|
+
With awesome templates for your next projects, you can create
|
|
317
|
+
beautiful-looking products with ease.
|
|
318
|
+
</p>
|
|
319
|
+
|
|
320
|
+
<div class="mt-8 py-6 px-12 ring-4 rounded-xl ring-border">
|
|
321
|
+
<DashboardTemplate></DashboardTemplate>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
</template>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { LineChart } from "../src/components";
|
|
3
|
+
import { AreaStackedChart } from "../src/components";
|
|
4
|
+
|
|
5
|
+
import Card from "./elements/Card.vue";
|
|
6
|
+
|
|
7
|
+
const chartData = [
|
|
8
|
+
{ month: "January", desktop: 186, mobile: 186 },
|
|
9
|
+
{ month: "February", desktop: 305, mobile: 305 },
|
|
10
|
+
{ month: "March", desktop: 237, mobile: 237 },
|
|
11
|
+
{ month: "April", desktop: 260, mobile: 209 },
|
|
12
|
+
{ month: "May", desktop: 209, mobile: 209 },
|
|
13
|
+
{ month: "June", desktop: 250, mobile: 214 },
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
import { CurveType } from "@unovis/ts";
|
|
17
|
+
import {
|
|
18
|
+
AreaChartData1,
|
|
19
|
+
AreaChartData2,
|
|
20
|
+
AreaChartData3,
|
|
21
|
+
AreaChartData4,
|
|
22
|
+
categories2,
|
|
23
|
+
categories3,
|
|
24
|
+
categories4,
|
|
25
|
+
categories5,
|
|
26
|
+
} from "./data/AreaChartData";
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div class="space-y-8 pb-24 pt-8">
|
|
31
|
+
<div class="max-w-7xl mx-auto space-y-4">
|
|
32
|
+
<div class="mb-8 space-y-4">
|
|
33
|
+
<h1 class="text-4xl font-bold">Line Chart</h1>
|
|
34
|
+
<p class="text-lg font-medium text-gray-500">
|
|
35
|
+
Charts to effectively display trends and changes in data over time by connecting data points with lines.
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="grid grid-cols-3 gap-4 max-w-7xl mx-auto py-4">
|
|
41
|
+
<Card>
|
|
42
|
+
<template #header>
|
|
43
|
+
<h2 class="heading-2 capitalize">Line Chart multiple lines</h2>
|
|
44
|
+
<!-- <p class="text-gray-500">Website visitors per device</p> -->
|
|
45
|
+
</template>
|
|
46
|
+
<LineChart
|
|
47
|
+
:data="chartData"
|
|
48
|
+
:height="200"
|
|
49
|
+
y-label="Number of visits"
|
|
50
|
+
:x-num-ticks="2"
|
|
51
|
+
:categories="categories3"
|
|
52
|
+
:x-formatter="(i: number): string => `${AreaChartData1[i].date}`"
|
|
53
|
+
:curve-type="CurveType.MonotoneX"
|
|
54
|
+
/>
|
|
55
|
+
</Card>
|
|
56
|
+
|
|
57
|
+
<Card>
|
|
58
|
+
<template #header>
|
|
59
|
+
<h2 class="heading-2 capitalize">Line Chart with single line</h2>
|
|
60
|
+
</template>
|
|
61
|
+
<LineChart
|
|
62
|
+
:data="AreaChartData2"
|
|
63
|
+
:height="200"
|
|
64
|
+
x-label="Time"
|
|
65
|
+
y-label="Temperature"
|
|
66
|
+
:categories="categories2"
|
|
67
|
+
:y-num-ticks="4"
|
|
68
|
+
:x-num-ticks="7"
|
|
69
|
+
:x-formatter="(i: number): string => `${AreaChartData2[i].hour}`"
|
|
70
|
+
:curve-type="CurveType.Basis"
|
|
71
|
+
/>
|
|
72
|
+
</Card>
|
|
73
|
+
|
|
74
|
+
<Card>
|
|
75
|
+
<template #header>
|
|
76
|
+
<h2 class="heading-2 capitalize">Line Chart multiple steps</h2>
|
|
77
|
+
</template>
|
|
78
|
+
<LineChart
|
|
79
|
+
:data="chartData"
|
|
80
|
+
:height="200"
|
|
81
|
+
y-label="Number of visits"
|
|
82
|
+
:x-num-ticks="2"
|
|
83
|
+
:categories="categories3"
|
|
84
|
+
:x-formatter="(i: number): string => `${AreaChartData1[i].date}`"
|
|
85
|
+
:curve-type="CurveType.Step"
|
|
86
|
+
/>
|
|
87
|
+
</Card>
|
|
88
|
+
|
|
89
|
+
<Card>
|
|
90
|
+
<template #header>
|
|
91
|
+
<h2 class="heading-2 capitalize">Line Chart natrual</h2>
|
|
92
|
+
</template>
|
|
93
|
+
<LineChart
|
|
94
|
+
:data="AreaChartData4"
|
|
95
|
+
:height="200"
|
|
96
|
+
x-label="Month"
|
|
97
|
+
y-label="Score"
|
|
98
|
+
:categories="categories5"
|
|
99
|
+
:y-num-ticks="4"
|
|
100
|
+
:x-num-ticks="7"
|
|
101
|
+
:x-formatter="(i: number): string => `${AreaChartData2[i].hour}`"
|
|
102
|
+
:curve-type="CurveType.Natural"
|
|
103
|
+
/>
|
|
104
|
+
</Card>
|
|
105
|
+
|
|
106
|
+
<Card>
|
|
107
|
+
<template #header>
|
|
108
|
+
<h2 class="heading-2 capitalize">Line Chart step</h2>
|
|
109
|
+
</template>
|
|
110
|
+
<LineChart
|
|
111
|
+
:data="AreaChartData4"
|
|
112
|
+
:height="200"
|
|
113
|
+
x-label="Month"
|
|
114
|
+
y-label="Score"
|
|
115
|
+
:categories="categories5"
|
|
116
|
+
:y-num-ticks="4"
|
|
117
|
+
:x-num-ticks="4"
|
|
118
|
+
:x-formatter="(i: number): string => `${AreaChartData2[i].hour}`"
|
|
119
|
+
:curve-type="CurveType.Step"
|
|
120
|
+
/>
|
|
121
|
+
</Card>
|
|
122
|
+
|
|
123
|
+
<Card>
|
|
124
|
+
<template #header>
|
|
125
|
+
<h2 class="heading-2 capitalize">Line Chart Default</h2>
|
|
126
|
+
</template>
|
|
127
|
+
<LineChart
|
|
128
|
+
:data="chartData"
|
|
129
|
+
:height="200"
|
|
130
|
+
x-label="Month"
|
|
131
|
+
y-label="Score"
|
|
132
|
+
:categories="categories5"
|
|
133
|
+
:x-formatter="(i: number): string => {
|
|
134
|
+
return `${AreaChartData2[i].hour}`;
|
|
135
|
+
}"
|
|
136
|
+
/>
|
|
137
|
+
</Card>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
@import "tailwindcss";
|
|
3
|
+
|
|
4
|
+
@variant dark (&:where(.dark, .dark *));
|
|
5
|
+
|
|
6
|
+
@theme {
|
|
7
|
+
--color-background: oklch(100 0 0);
|
|
8
|
+
--color-border: oklch(92% 0 0);
|
|
9
|
+
--color-card: oklch(100% 0 0);
|
|
10
|
+
--color-primary: oklch(79.14% 0.2091 151.66);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@utility heading-2 {
|
|
14
|
+
@apply text-xl dark:text-white my-2 font-bold;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
.dark {
|
|
19
|
+
color: white;
|
|
20
|
+
--color-background: oklch(.205 0 0);
|
|
21
|
+
--color-card: oklch(.225 0 0);
|
|
22
|
+
--color-border: oklch(.269 0 0);
|
|
23
|
+
|
|
24
|
+
--vis-axis-grid-color: rgba(255, 255, 255, 0.1) !important;
|
|
25
|
+
--vis-tooltip-background-color: #121212 !important;
|
|
26
|
+
--vis-tooltip-border-color: none !important;
|
|
27
|
+
--vis-tooltip-text-color: rgba(255, 255, 255, 0.5) !important;
|
|
28
|
+
--vis-axis-tick-label-color: rgba(255, 255, 255, 0.5) !important;
|
|
29
|
+
--vis-legend-label-color: rgba(255, 255, 255, 0.75) !important;
|
|
30
|
+
|
|
31
|
+
--vis-axis-label-color: rgba(255, 255, 255, 0.5) !important;
|
|
32
|
+
--vis-legend-label-color: rgba(255, 255, 255, 0.5) !important;
|
|
33
|
+
|
|
34
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
interface StorageProps {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
unit?: string;
|
|
7
|
+
progress: number;
|
|
8
|
+
total: number;
|
|
9
|
+
color: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const props = defineProps<StorageProps>()
|
|
13
|
+
|
|
14
|
+
const percentage = computed(() => {
|
|
15
|
+
return ((props.progress / props.total) * 100).toFixed(1);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const width = computed(() => {
|
|
19
|
+
return `${(props.progress / props.total) * 100}%`;
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div class="space-y-2">
|
|
25
|
+
<div class="space-y-2">
|
|
26
|
+
<p class="text-gray-500 mb-1">
|
|
27
|
+
{{ label }}
|
|
28
|
+
</p>
|
|
29
|
+
<h2 class="text-xl dark:text-white font-bold">
|
|
30
|
+
{{ value }}
|
|
31
|
+
</h2>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="flex items-center justify-between text-sm font-medium dark:text-gray-500 mt-2">
|
|
35
|
+
<div>{{ percentage }}%</div>
|
|
36
|
+
<div>{{ progress }} of {{ total }}{{ unit }}</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="dark:bg-white/5 bg-gray-100 rounded-full h-3">
|
|
39
|
+
<div class="rounded-full h-full" :style="{ width, backgroundColor: color }"></div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Progress } from './Progress.vue';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
|
|
4
|
+
const domain = ref("example.com");
|
|
5
|
+
const uptime = ref("99.9% uptime");
|
|
6
|
+
|
|
7
|
+
const outages = ref([
|
|
8
|
+
{ hour: 0, status: "online" },
|
|
9
|
+
{ hour: 1, status: "online" },
|
|
10
|
+
{ hour: 2, status: "online" },
|
|
11
|
+
{ hour: 3, status: "online" },
|
|
12
|
+
{ hour: 4, status: "online" },
|
|
13
|
+
{ hour: 5, status: "online" },
|
|
14
|
+
{ hour: 6, status: "online" },
|
|
15
|
+
{ hour: 7, status: "online" },
|
|
16
|
+
{ hour: 8, status: "online" },
|
|
17
|
+
{ hour: 9, status: "online" },
|
|
18
|
+
{ hour: 10, status: "online" },
|
|
19
|
+
{ hour: 11, status: "offline" },
|
|
20
|
+
{ hour: 12, status: "online" },
|
|
21
|
+
{ hour: 13, status: "online" },
|
|
22
|
+
{ hour: 14, status: "online" },
|
|
23
|
+
{ hour: 15, status: "online" },
|
|
24
|
+
{ hour: 16, status: "online" },
|
|
25
|
+
{ hour: 17, status: "online" },
|
|
26
|
+
{ hour: 18, status: "online" },
|
|
27
|
+
{ hour: 19, status: "online" },
|
|
28
|
+
{ hour: 20, status: "online" },
|
|
29
|
+
{ hour: 21, status: "online" },
|
|
30
|
+
{ hour: 22, status: "online" },
|
|
31
|
+
{ hour: 23, status: "online" },
|
|
32
|
+
|
|
33
|
+
{ hour: 0, status: "online" },
|
|
34
|
+
{ hour: 1, status: "online" },
|
|
35
|
+
{ hour: 2, status: "online" },
|
|
36
|
+
{ hour: 3, status: "online" },
|
|
37
|
+
{ hour: 4, status: "online" },
|
|
38
|
+
{ hour: 5, status: "online" },
|
|
39
|
+
{ hour: 6, status: "online" },
|
|
40
|
+
{ hour: 7, status: "online" },
|
|
41
|
+
{ hour: 8, status: "online" },
|
|
42
|
+
{ hour: 9, status: "online" },
|
|
43
|
+
{ hour: 10, status: "online" },
|
|
44
|
+
{ hour: 11, status: "online" },
|
|
45
|
+
{ hour: 12, status: "online" },
|
|
46
|
+
{ hour: 13, status: "online" },
|
|
47
|
+
{ hour: 14, status: "online" },
|
|
48
|
+
{ hour: 15, status: "online" },
|
|
49
|
+
{ hour: 16, status: "online" },
|
|
50
|
+
{ hour: 17, status: "online" },
|
|
51
|
+
{ hour: 18, status: "online" },
|
|
52
|
+
{ hour: 19, status: "online" },
|
|
53
|
+
{ hour: 20, status: "online" },
|
|
54
|
+
{ hour: 21, status: "online" },
|
|
55
|
+
{ hour: 22, status: "online" },
|
|
56
|
+
{ hour: 23, status: "online" },
|
|
57
|
+
{ hour: 0, status: "online" },
|
|
58
|
+
{ hour: 1, status: "online" },
|
|
59
|
+
]);
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<template>
|
|
63
|
+
<div class="ring ring-border divide-y divide-(--ui-border) rounded-xl shadow-sm">
|
|
64
|
+
<div class="flex items-center justify-between p-4">
|
|
65
|
+
<div class="flex items-center gap-2">
|
|
66
|
+
<svg
|
|
67
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
68
|
+
fill="none"
|
|
69
|
+
viewBox="0 0 24 24"
|
|
70
|
+
stroke-width="1.5"
|
|
71
|
+
stroke="currentColor"
|
|
72
|
+
class="size-6 text-primary"
|
|
73
|
+
>
|
|
74
|
+
<path
|
|
75
|
+
stroke-linecap="round"
|
|
76
|
+
stroke-linejoin="round"
|
|
77
|
+
d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
|
|
78
|
+
/>
|
|
79
|
+
</svg>
|
|
80
|
+
|
|
81
|
+
<span class="font-medium">{{ domain }}</span>
|
|
82
|
+
</div>
|
|
83
|
+
<span class="text-sm dark:text-gray-400">{{ uptime }}</span>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div class="p-4">
|
|
87
|
+
<div
|
|
88
|
+
v-for="(outage, index) in outages"
|
|
89
|
+
:key="index"
|
|
90
|
+
class="w-2.5 h-8 first:rounded-tl first:rounded-bl last:rounded-tr last:rounded-br ml-[3px] inline-block"
|
|
91
|
+
:class="outage.status === 'online' ? 'bg-primary' : 'bg-white'"
|
|
92
|
+
></div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Status } from './Status.vue';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// charts.ts
|
|
2
|
+
import { AreaChart } from "./Area/index";
|
|
3
|
+
import { AreaStackedChart } from "./AreaStacked/index";
|
|
4
|
+
import { BarChart } from "./Bar/index";
|
|
5
|
+
import { DonutChart } from "./Donut/index";
|
|
6
|
+
import { LineChart, PaginationPosition } from "./Line/index";
|
|
7
|
+
|
|
8
|
+
// Export the component prop types
|
|
9
|
+
import type { AreaChartProps } from './Area';
|
|
10
|
+
import type { AreaStackedChartProps } from './AreaStacked';
|
|
11
|
+
import type { BarChartProps } from './Bar';
|
|
12
|
+
import type { DonutChartProps } from './Donut';
|
|
13
|
+
import type { LineChartProps } from './Line';
|
|
14
|
+
|
|
15
|
+
export type AreaChartType = typeof AreaChart;
|
|
16
|
+
export type AreaStackedChartType = typeof AreaStackedChart;
|
|
17
|
+
export type BarChartType = typeof BarChart;
|
|
18
|
+
export type DonutChartType = typeof DonutChart;
|
|
19
|
+
export type LineChartType = typeof LineChart;
|
|
20
|
+
export type PaginationPositionType = typeof PaginationPosition;
|
|
21
|
+
|
|
22
|
+
export type {
|
|
23
|
+
AreaChartProps,
|
|
24
|
+
AreaStackedChartProps,
|
|
25
|
+
BarChartProps,
|
|
26
|
+
DonutChartProps,
|
|
27
|
+
LineChartProps
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
AreaChart,
|
|
32
|
+
AreaStackedChart,
|
|
33
|
+
BarChart,
|
|
34
|
+
DonutChart,
|
|
35
|
+
LineChart,
|
|
36
|
+
PaginationPosition,
|
|
37
|
+
};
|