forked from rubui/CMPS165_Final_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.html
More file actions
338 lines (281 loc) · 15.1 KB
/
Copy pathgraph.html
File metadata and controls
338 lines (281 loc) · 15.1 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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Houseplants Care Guide</title>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<!-- d3.js v4 import -->
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-legend/2.25.6/d3-legend.js"></script>
<!-- Bootstrap import -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Custom Sylesheet -->
<link href="style.css" rel="stylesheet" />
</head>
<body>
<div id="main" style="width:1545px; margin:0 auto;">
<!-- Title -->
<h1 style="padding-top: 20px">California Houseplants Care Guide</h1>
<p style="text-align: center"> Taking care of indoor house plants is an endeavor that many try go get into, but a budding plant enthusiast may be overwhelmed by the plethora of options regarding plant care. Here, we have a simple visualization of some popular indoor house plants and some of the characteristics we thought planters would be interested in knowing. This includes whether the plant purifies air, can be hung, and if it is pet friendly (i.e., non-toxic to dogs and cats). This visualization can be used as a simple buyer's guide by showing various plants and their needs which the buyer can judge against their own lifestyle.
</p>
<br>
<!-- Row to handle graph and filters -->
<div class="row">
<!-- Left sidebar (Static Tooltip) -->
<div class="col-md-3">
<!-- Static tooltip title -->
<div class=row>
<div class="container">
<br>
<h3 class="filter-block" style="text-align: center">Detailed Information</h3>
<div class="sub-filter" style="padding-top: 5px; padding-bottom: 10px">
<h6 class="sub-filter" style="color: darkgray">View more details about a clicked plant below!</h6>
</div>
</div>
</div>
<!-- Static Tooltip -->
<div class="static-tooltip">
<div id="plant-head" class="nickname"> Select a Plant <br><text style="text-align: center; color: darkgray"> Scientific Name<br></text></div>
<div style="height: 150px;padding-left: 10px">
<div class="pic-container" style="float:left;">
<img class='resize_fit_center' />
</div>
<div id="habit-tip" style=" float: center;padding-top:10px;">
<b>Plant Habit </b><br><br><b>Type</b> <br>
</div>
</div>
<div style=" float: left;text-align: left;font-weight:bold; font-size: 10pt">
Sunlight: <br> Soil Indicator: <br> Water Amount: <br> Height: <br> Spread
<br> Indoor Flowering: <br> Bloom Period: <br> Bloom Description: <br> Humidity: <br> Air Purifying: <br> Soil PH:<br>
</div>
<div id="static-tip-data" style="float: right;text-align: right;font-size: 10pt"> </div>
</div>
</div>
<!-- Middle Column -->
<div class="col-md-8">
<!-- Display graph here -->
<div class="row" id="display" style="height=600px"></div>
<!--Spacer Row-->
<div class="row"><br></div>
<!-- Row for buttons -->
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-3 graph-toggle">
<input type="radio" name="options" id="option1" checked>
<label for="option1" class="btn"> Water vs. Sun</label>
</div>
<div class="col-md-3 graph-toggle">
<input type="radio" name="options" id="option2">
<label for="option2" class="btn"> Height vs. Spread</label>
</div>
<div class="col-md-3"></div>
</div>
<!-- Row for button description -->
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8 ">
<h6 class="sub-filter" style="color: darkgray; padding-top: 10px">Toggle between these two buttons to see how plants rank in terms of relative care effort and to see how big they'll be in your home! </h6>
</div>
<div class="col-md-2"></div>
</div>
</div>
<!-- Sidebar for filters and toggles and tooltip (?) -->
<div class="col-md-1" id="sidebar">
<br>
<div class="filters">
<text class="filter-block">Search Filters</text>
<!-- Section Title -->
<div class="sub-filter" style="padding-top: 10px">
<h6 class="sub-filter">Characteristics</h6>
</div>
<!-- Filter Checkboxes -->
<div class="row" style="padding-left: 10px">
<label class="custom-control material-checkbox">
<input type="checkbox" class="material-control-input" id="airp">
<span class="material-control-indicator"></span>
<span class="material-control-description">Air Purifying</span>
</label>
</div>
<div class="row" style="padding-left: 10px">
<label class="custom-control material-checkbox">
<input type="checkbox" class="material-control-input" id="hung">
<span class="material-control-indicator"></span>
<span class="material-control-description">Hanging Plants</span>
</label>
</div>
<div class="row" style="padding-left: 10px">
<label class="custom-control material-checkbox">
<input type="checkbox" class="material-control-input" id="flowers">
<span class="material-control-indicator"></span>
<span class="material-control-description">Flowers Indoors</span>
</label>
</div>
<div>
<!-- Section Title -->
<div class="sub-filter" style="padding-top: 10px">
<h6 class="sub-filter">Pet Friendly</h6>
</div>
<div class="row" style="padding-left: 10px">
<div>
<label class="custom-control material-checkbox">
<input type="checkbox" class="material-control-input" id="dogs">
<span class="material-control-indicator"></span>
<span class="material-control-description">Dogs</span>
</label>
</div>
<div style="padding-left:10pt">
<label class="custom-control material-checkbox">
<input type="checkbox" class="material-control-input" id="cats">
<span class="material-control-indicator"></span>
<span class="material-control-description">Cats</span>
</label>
</div>
</div>
</div>
</div>
<!-- Spacing between filters and legend -->
<br><br><br><br>
<!-- Legend -->
<div class="row">
<div class="legend" style="padding-top: 5px">Legend</div>
</div>
</div>
</div>
<!-- place .js src here -->
<script src="//d3js.org/d3.v4.min.js"></script>
<script src="tooltip.js"></script>
<script src="directed_graph.js"></script>
<script src="selection.js"></script>
<script type="text/javascript">
// Loading data csv
d3.csv("plants_clean_40.csv", function(error, d) {
var data = d;
var button_flag = true;
var svg = d3.select("#display")
.append("svg")
.attr("class", "force-scale")
.attr("width", 1020)
.attr("height", 600);
//creating the tooltip div
var div = d3.select("#display").append("div")
.attr("class", "tooltip")
.attr("id", "sun-soil-water")
.style("opacity", 0);
div.append("div")
.attr('class', 'nickname');
div.append('div')
.attr('class', 'sci_name');
div.append("div")
.html('<br>');
div.append('div')
.attr('class', 'tooltip-text')
.attr('id', 'sun');
div.append('div')
.attr('class', 'tooltip-text')
.attr('id', 'soil');
div.append('div')
.attr('class', 'tooltip-text')
.attr('id', 'water');
var div = d3.select("#display").append("div")
.attr("class", "tooltip")
.attr("id", "spread-height")
.style("opacity", 0);
div.append("div")
.attr('class', 'nickname');
div.append('div')
.attr('class', 'sci_name');
div.append("div")
.html('<br>');
div.append('div')
.attr('class', 'tooltip-text')
.attr('id', 'height');
div.append('div')
.attr('class', 'tooltip-text')
.attr('id', 'spread');
// run functions here
directed_graph(data, svg, button_flag);
select_handler();
});
</script>
<br>
<hr>
<br>
<!-- Group Members -->
<div class="group_members">
<h3 class="sources_header" style="line-height: 50px">
Group Members</h3>
<ul class="list-unstyled" style="text-align: center">
<li>Rebecca Bui (rubui@ucsc.edu)</li>
<li>Melanie Lum (mhlum@ucsc.edu)</li>
<li>Conor Rogers (cojaroge@ucsc.edu)</li>
<li>Rishita Roy (riroy@ucsc.edu)</li>
</ul>
<p style="text-align: center">In collaboration with Suresh K. Lodha, Karthik Balakrishnan, Christopher Bui, and Janesh Chhabra</p>
<p style="text-align: center; line-height: 8px">Site is hosted on GitHub Pages <a href="https://rubui.github.io/CMPS165_Final_Project/graph.html">here</a>. </p>
<br>
</div>
<!-- Designed For -->
<div class="group_members">
<h3 class="sources_header" style="line-height: 50px">
Designed For</h3>
<p style="text-align: center">CMPS 165: Data Programming for Visualization, Spring 2018</p>
<br>
</div>
<br>
<!-- Resources -->
<div class="row" id="sources">
<div class="col-md-3 ">
<h4 class="sources_header" style="text-align: center">Files</h4>
<ul class="sources_list">
<li><a href="https://github.com/rubui/CMPS165_Final_Project">GitHub Repository Link</a></li>
<li>index.html</li>
<li>graph.html</li>
<li>directed_graph.js</li>
<li>selections.js</li>
<li>tooltip.js</li>
<li>style.css</li>
<li>plants_clean_40.csv</li>
<li>images folder</li>
</ul>
</div>
<div class="col-md-3">
<h4 class="sources_header" style="text-align: center">Visual Sources</h4>
<ul class="sources_list">
<li><a href="https://hannabrahman.github.io/Data-Visualization/">Influential Women</a></li>
<li><a href="http://zachd.github.io/food-facts/">Food Facts</a></li>
</ul>
</div>
<div class="col-md-3">
<h4 class="sources_header" style="text-align: center">Code Sources</h4>
<ul class="sources_list">
<li><a href="http://bl.ocks.org/ericandrewlewis/dc79d22c74b8046a5512">Circles on Axis in a Force Layout</a></li>
<li><a href="http://vallandingham.me/bubble_charts_with_d3v4.html">Bubble Charts with D3v4</a></li>
<li><a href="http://bl.ocks.org/tomgp/d59de83f771ca2b6f1d4">SVG arrow heads</a></li>
<li><a href="https://bazinga612.github.io/CMPS263FinalProject-EndangeredSpecies/">Endangered Species Spotlight</a></li>
<li><a href="https://bootsnipp.com/snippets/aM32E">Material Checkboxes</a></li>
</ul>
</div>
<div class="col-md-3">
<h4 class="sources_header" style="text-align: center">Data Sources</h4>
<ul class="sources_list">
<li><a href="https://plants.usda.gov/adv_search.html">USDA Plants Dataset</a></li>
<li><a href="https://img.buzzfeed.com/buzzfeed-static/static/2015-03/19/12/enhanced/webdr13/enhanced-1008-1426782359-1.jpg?downsize=715:*&output-format=auto&output-quality=auto">House Plant Watering Chart</a></li>
<li><a href="http://www.missouribotanicalgarden.org/plantfinder/plantfindersearch.aspx">Missouri Botanical Garden Database</a></li>
<li><a href="https://www.bhg.com/">Better Homes Garden</a></li>
<li><a href="https://garden.org/plants/">The National Gardening Association Database</a></li>
<li><a href="https://www.houseplantsexpert.com/">House Plants Expert</a></li>
<li><a href="https://www.rhs.org.uk/">RHS</a></li>
<li><a href="https://www.aspca.org/pet-care/animal-poison-control/toxic-and-non-toxic-plants">ASPCA</a></li>
<li><a href="https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19930073077.pdf">Interior Landscape Plants for Indoor Air Pollution Abatement</a></li>
</ul>
</div>
<br><br><br><br><br><br>
</div>
<br>
</div>
</body>
</html>