-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·171 lines (154 loc) · 3.55 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<meta charset="utf-8">
<style>
h3{
font-family: "impact";
width:100%;
}
#hi{
color:#009933;
}
#score{
color:rgb(182,77,90);
}
.state{
fill: none;
stroke: #a9a9a9;
stroke-width: 1;
}
.state:hover{
fill-opacity:0.5;
}
#tooltip {
position: absolute;
text-align: center;
padding: 10px;
margin: 5px;
font: 12px sans-serif;
background:rgba(0,0,0,0.9);
border: 1px;
border-radius: 2px;
pointer-events: none;
opacity:0;
color:white;
}
#tooltip h4{
margin:0;
font-size:15px;
}
#tooltip table{
table-layout:fixed;
}
#tooltip tr td{
padding:0;
margin:0;
}
#tooltip tr td:nth-child(1){
width:200px;
}
#tooltip tr td:nth-child(2){
text-align:center;
}
#wine{
width:300px;
white-space:pre-wrap;
font-size:12px;
}
#wine h4{
text-align:center;
}
#wine tr {
height: 5px;
}
.button:active {
box-shadow: 0 5px #666;
transform: translateY(4px);
}
button{
border-radius: 12px;
padding: 5px 12px;
font-size: 12px;
color: rgb(182,77,90);
font-weight: bold;
margin-right:10px;
}
body{
height:100%;
}
#left{
width:50%;
margin:0;
float: left;
position:fixed;
margin-left:10px;
height:100%;
}
#right{
z-index:-1;
display:inline-block;
width:45%;
float:right;
position:relative;
margin-right:50px;
height:100%;
}
.chart{
height: 350px; width: 100%;display: inline-block;
}
#rating{
height: 15px;
width:60%;
background-color: #e9cace;
background-image: linear-gradient(to right, #faf4f5 ,rgb(182, 77, 90), #56242a);
}
#produce{
height: 15px;
width:60%;
background-color: #e9cace;
background-image: linear-gradient(to right, #faf4f5 ,rgb(233, 202, 206),rgb(182, 77, 90), #56242a);
}
.idk{
margin:0;font-size:15px;color:black;
}
#yi{
display:none;
}
#before{
display:inline-block;
font-family:impact;
margin-left:40%;
text-align:center;
z-index:-1;
font-size:30px;
}
</style>
<body>
<h3 style="text-align:center;color:rgb(182,77,90);">U.S Wine visualization</h3>
<div id="left">
<p id="before">Loading...</p>
<svg width="100%" height="60%" id="statesvg"></svg> <!-- svg to hold the map. -->
<div id="tooltip"></div> <!-- div to hold tooltip. -->
<p style="margin:0;font-size:13px">*hover over or click a state to see its wine production</p>
<button id="quantity" class="button" > States by Wine Production </button>
<button id="quality" class="button"> States by Average Wine Rating </button>
<div id="yi">
<p style="margin-top:10px;margin-bottom:0;font-size:15px;">Average Rating</p>
<div id="rating"></div>
<p class="idk">82<span style="display:inline-block; width: 300px;"></span>89</p>
</div>
<div id="er">
<p style="margin-top:10px;margin-bottom:0;font-size:15px;">Wine Production</p>
<div id="produce"></div>
<p class="idk">0<span style="display:inline-block; width: 300px;"></span>5000+</p>
</div>
</div>
<div id="right">
<div id="bestchart" class = "chart"></div>
<div id="cheapchart"class = "chart"></div>
</div>
<script src="js/uStates1.js"></script> <!-- creates uStates. -->
<script src="js/d3.v4.min.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<script src="js/wine.js"></script>
</body>