This repository was archived by the owner on May 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample1.html
More file actions
65 lines (60 loc) · 1.58 KB
/
example1.html
File metadata and controls
65 lines (60 loc) · 1.58 KB
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
<html>
<head>
<title>MAS.S70 | D3 workshop</title>
<link href="https://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet">
<style>
body {
margin: 0;
padding: 3%;
font-family: 'PT Sans', sans-serif;
}
.page {
margin: 0 auto;
max-width: 800px;
width: 90%;
}
h1 {
font-weight: normal;
text-rendering: optimizeLegibility;
}
</style>
</head>
<body>
<div class="page">
<h1>Drawing Circles | Variables, Selections</h1>
<br />
<h2> Static SVG </h2>
<p>
We render some plain SVG circles
</p>
<svg id="svg1" width="720" height="120">
</svg>
<br />
<h2> SVG manipulated by D3</h2>
<p>
We use D3 to do three things to these circles
<ol>
<li>Change color to blue</li>
<li>Make circles bigger</li>
<li>Move them to not overlap</li>
<li>Bonus: Make the circles change colors every second</li>
</ol>
</p>
<svg id="svg2" width="720" height="120">
</svg>
<h2> Exercise: repeat the previous section, but using rectangles!</h2>
<svg id="svg3" width="720" height="120">
</svg>
</div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
// Select all the circles
// 1: Color the circles
// 2: Change the radius
// 3: Change the positions
// 4: Bonus (hint - use setInterval)
// Your code for doing the same thing with rectangles
// ...
</script>
</body>
</html>