-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisual.html
35 lines (32 loc) · 909 Bytes
/
visual.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
<!doctype html>
<html>
<head>
<script src="https://d3js.org/d3.v4.min.js"></script>
</head>
<body>
<script>
// d3.select("body").append("div")
// .style("border", "1px black solid")
// .html("hello world");
// d3.select("div")
// .style("background-color", "pink")
// .style("font-size", "24px")
// .attr("id", "newDiv")
// .attr("class", "d3div")
// .on("click", () => {console.log("You clicked a div")});
d3.select("body")
.append("svg")
.style("width", 500)
.style("height", 500);
d3.select("svg")
.selectAll("rect")
.data([15, 50, 22, 8, 100, 10])
.enter()
.append("rect")
.attr("width", 10)
.attr("height", d => d)
.style("opacity", .25)
.attr("x", (d,i) => i * 10);
</script>
</body>
</html>