-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path03-svg-and-d3.html
60 lines (52 loc) · 1.45 KB
/
03-svg-and-d3.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
<html>
<head>
<meta charset="utf-8">
<title>D3 and SVG</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
<style>
svg {
background: #f9f9f9;
display: block;
margin: 0 auto;
}
h1 { margin-bottom: 2rem; }
body {
padding-top: 2rem;
padding-bottom: 2rem;
}
h3 {
margin-top: 3rem;
margin-bottom: 1rem;
}
.container {
max-width: 46rem;
}
img.block {
display: block;
border: solid #333 1p;
margin: 0 auto;
}
</style>
</head>
</head>
<body>
<div class="container">
<h1>SVG, meet D3</h1>
<p>We're going to use D3 to control our SVG.</p>
<svg height="500" width="800">
<rect x="0" y="90" width="20" height="20"></rect>
<rect x="0" y="190" width="575" height="20" ></rect>
<rect x="0" y="290" width="375" height="20"></rect>
<rect x="0" y="390" width="400" height="20" ></rect>
<circle cx="700" cy="100" r="20"></circle>
<circle cx="700" cy="200" r="20"></circle>
<circle cx="700" cy="300" r="20"></circle>
<circle cx="700" cy="400" r="20"></circle>
</svg>
<!-- This is D3, our graphing library -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
<!-- Now we include our actual visualization -->
<script src="03-svg-and-d3.js"></script>
</div>
</body>
</html>