-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy path01-svg.html
86 lines (64 loc) · 1.47 KB
/
01-svg.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>SVG</title>
<script src="https://d3js.org/d3.v4.min.js"></script>
<style type="text/css">
svg {
border: 1px solid #ccc;
}
text {
font-family: Times New Roman;
font-size: 36pt;
}
circle {
fill: firebrick;
}
rect {
fill: steelblue;
}
path {
fill: none;
stroke: none;
}
path#path1 {
stroke: purple;
stroke-width: 4px;
}
path#path2 {
fill: orange;
}
path#path3 {
fill: pink;
stroke: red;
stroke-width: 2px;
}
</style>
</head>
<body>
<h1>Scalable Vector Graphics</h1>
<svg width="800" height="600">
<text x="400" y="100">Hello, World!</text>
<g class="rects">
<rect x="400" y="400" width="100" height="100"/>
<rect x="480" y="300" width="50" height="70"/>
<rect x="520" y="420" width="120" height="30"/>
</g>
<g class="circles" transform="translate(50,50)">
<circle cx="50" cy="50" r="10"/>
<circle cx="80" cy="30" r="20"/>
<circle cx="60" cy="70" r="5"/>
</g>
<g class="paths">
<!-- M = move-to, L = line-to, Z = close polygon -->
<path id="path1" d="M50,500L150,500L100,414.4"/>
<path id="path2" d="M105,400L205,400L155,314.4Z"/>
<path id="path3" d="M160,500L260,500L210,414.4Z"/>
</g>
</svg>
<script type="text/javascript">
// D3 code can go here
</script>
</body>
</html>