-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
133 lines (128 loc) · 3.91 KB
/
index.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<html>
<head>
<meta charset="UTF-8">
<style>
body{
font-family:monospace;
margin:0;
}
div{
text-align: center;
margin-top:170px;
margin-bottom:160px;
}
.tick, .majorTick{
font-size:14px;
font-family:monospace;
}
.line{
fill: none;
stroke-width: 2.5;
}
.xAxis line{
stroke: black;
}
.yAxis line{
stroke-width:1;
stroke-dasharray: 3;
stroke: silver;
}
.majorTick > line{
stroke-width:1;
stroke-dasharray: 3;
stroke: black;
}
.conventionalBars{
fill: olivedrab;
}
.regionShapes, .cityPoints{
stroke-width: 2;
stroke: white;
}
.caption{
font-family: monospace;
fill: black;
text-anchor: start;
font-weight: bold;
text-transform: uppercase;
}
div.tooltip {
background-color: white;
position: absolute;
text-align: center;
min-width: 100px;
padding: 10px;
font: 14px monospace;
pointer-events: none;
z-index:1000;
}
#volumeByRegionContainer .yAxis .domain {
display: none;
}
#intro{
width:100%;
height:100%;
text-align: center;
background-color: gold;
margin:0;
padding-top: 12%;
}
#intro-emoji{
font-size:150px;
margin-bottom:0;
}
a{
color:black;
}
a:visited{
color:black;
}
#footer{
background-color:gold;
margin:auto;
/* width:100vw; */
height: 25px;
padding: 20px 10%;
vertical-align: middle;
font-size:11px;
line-height:20px;
text-align: center;
}
</style>
</head>
<body>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="script.js"></script>
<div id="intro">
<p id="intro-emoji">🥑📈</p>
<p><i>an ode to <a href="http://www.hassavocadoboard.com/retail/volume-and-price-data" target="new"> avocado retail data</a></i></p>
</div>
<div id="nationalPricesContainer">
<h1>Weekly Changes in National Average Price, by Year</h1>
<form id="nationalPricesForm">
<label style="margin-right:0.5em;"><input type=radio name=radio value="conventional" checked>Conventional</label>
<label style="margin-right:0.5em;"><input type=radio name=radio value="organic">Organic</label>
</form>
<svg id="nationalPricesChart"></svg>
</div>
<div id="volumeByRegionContainer">
<h1>Volume (Units) Sold by Region</h1>
<form id="volumeByRegionForm">
<label style="margin-right:0.5em;"><input type=radio name=radio value="conventional" checked>Conventional</label>
<label style="margin-right:0.5em;"><input type=radio name=radio value="organic">Organic</label>
</form>
<svg id="volumeByRegionChart"></svg>
</div>
<div id="avgPriceByRegionContainer">
<h1>2018 Average Prices by Region and City</h1>
<form id="avgPriceByRegionForm">
<label style="margin-right:0.5em;"><input type=radio name=radio value="conventional" checked>Conventional</label>
<label style="margin-right:0.5em;"><input type=radio name=radio value="organic">Organic</label>
</form>
<svg id="avgPriceByRegionChart"></svg>
</div>
<div id="footer">
Created for ITP's 2019 Unconference. <a href="https://github.com/xujenna/d3-unconference-workshop" target="new">See code here</a>.
</div>
</body>
</html>