forked from antvis/GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
62 lines (52 loc) · 1.27 KB
/
index.html
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
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<title>GUI UMD Demo</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
height: 100%;
}
#container {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="https://unpkg.com/@antv/g@next/dist/index.umd.js" type="application/javascript"></script>
<script src="https://unpkg.com/@antv/g-canvas@next/dist/index.umd.js" type="application/javascript"></script>
<script src="./dist/gui.min.js" type="application/javascript"></script>
<script>
const { Canvas } = window.G;
const { Renderer } = window.G.Canvas2D;
const { Button } = window.GUI;
// create a renderer
const canvasRenderer = new Renderer();
// create a canvas
const canvas = new Canvas({
container: 'container',
width: 600,
height: 500,
renderer: canvasRenderer,
});
// create a simple button
const button = new Button({
style: {
x: 50,
y: 50,
text: 'Simple Button',
},
});
canvas.appendChild(button);
</script>
</body>
</html>