-
Notifications
You must be signed in to change notification settings - Fork 7
/
Weedmaps.html
47 lines (47 loc) · 1.59 KB
/
Weedmaps.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex">
<meta name="googlebot" content="noindex">
<title>
Weedmaps
</title>
<style>
table {
border-collapse: collapse;
border: 2px black solid;
}
td {
border: 1px black solid;
padding: 5px;
}
</style>
</head>
<body>
<a href="/Current/Weedmaps_MMJScrape.csv" id="File">Weedmaps_MMJScrape.csv</a>
<script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
d3.text("/Current/Weedmaps_MMJScrape.csv", function(data) {
var parsedCSV = d3.dsv("^", "text/plain").parse(data);
var header = ["Company", "PhoneNumber", "Address", "City", "State", "ZipCode", "Website"];
var table = d3.select("body").append("table");
var th = table.append("tr")
.selectAll("th").data(header).enter()
.append("th")
.text(function(column) { return column; });
var tr = table.selectAll("tr").data(parsedCSV).enter().append("tr");
tr.append("td").text(function(d) { return d.Company; });
tr.append("td").text(function(d) { return d.PhoneNumber; });
tr.append("td").text(function(d) { return d.Address; });
tr.append("td").text(function(d) { return d.City; });
tr.append("td").text(function(d) { return d.State; });
tr.append("td").text(function(d) { return d.ZipCode; });
tr.append("td")
.append("a")
.attr("href", function(d) { return d.Website; })
.text(function(d) { return d.Website; });
});
</script>
</body>
</html>