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<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Gaugeous</title>
</head>
<body>
<div id="app">
<div>
<h1>Gaugeous</h1>
<div id="GaugeContainer"></div>
</div>
</div>
<script type="module" src="/src/index.ts"></script>
<script type="module">
import { SimpleGauge } from "./src/index.ts";
const gaugevalues = {
value: 60,
max: 100,
};
const gauge = new SimpleGauge(gaugevalues);
const gauge2values = {
value: 20,
max: 100,
};
const gauge2 = new SimpleGauge(gauge2values, {
type: "none",
colors: {
backgroundColor: "#FAE4E4",
strokeColor: "black",
fillColors: "blue",
},
width: 200,
height: 20,
radius: 5,
});
const gaugeContainer = document.getElementById("GaugeContainer");
gauge.render(gaugeContainer);
gauge2.render(gaugeContainer);
</script>
<style>
#GaugeContainer {
display: flex;
flex-direction: column;
justify-content: space-between;
}
</style>
</body>
</html>