forked from jonoxia/tp-dataviz-prototype
/
plot.html
191 lines (162 loc) · 7.7 KB
/
plot.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<!-- Use the .htaccess and remove these lines to avoid edge case issues.
More info: h5bp.com/i/378 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<!-- Mobile viewport optimized: h5bp.com/viewport -->
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/charts.css">
<!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->
<!-- All JavaScript at the bottom, except this Modernizr build.
Modernizr enables HTML5 elements & feature detects for optimal performance.
Create your own custom Modernizr build: www.modernizr.com/download/ -->
<script src="js/libs/modernizr-2.5.2.min.js"></script>
</head>
<body>
<!-- Prompt IE 6 users to install Chrome Frame. Remove this if you support IE 6.
chromium.org/developers/how-tos/chrome-frame-getting-started -->
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
</style>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">Desktop Heatmap 2012 Study</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Chart Builder</a></li>
<li class="active"><a href="#">Please send bug reports to isegall@mozilla.com</a></li>
</ul>
<p class="navbar-text pull-right">Logged in as <a href="#">UX</a></p>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list" id="variables_menu">
<li class="nav-header" >ingredients</li>
<!-- <li class="active"><a href="#">Link</a></li>-->
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span2" id="drop-targets-container">
<div class="dragtarget" id="x-axis-target">X-axis <span class="valbox"></span>
<span id="x-axis-sort">Sorted by: <select id="x-axis-sort">
<option>Default</option>
<option>Most to Least</option>
<option>Alphabetical</option>
</select></span>
</div>
<div class="dragtarget" id="y-axis-target">Y-axis <span class="valbox"></span>
<span id="y-axis-sort">Sorted by: <select id="y-axis-sort">
<option>Default</option>
<option>Most to Least</option>
<option>Alphabetical</option>
</select></span>
</div>
<div class="dragtarget" id="color-target">Color <span class="valbox"></span></div>
<div class="dragtarget" id="lattice-x-target">Lattice X <span class="valbox"></span></div>
<div class="dragtarget" id="lattice-y-target">Lattice Y <span class="valbox"></span></div>
<span id="output"></span>
</div>
<div class="span8">
<div id="imagearea"></div>
<span id="x-axis-scale">X Scale: <select id="x-axis-scale-menu">
<option value = "linear">Linear</option>
<option value = "log">Logarithmic</option>
</select></span>
<span id="y-axis-scale">Y Scale: <select id="y-axis-scale-menu">
<option value = "linear">Linear</option>
<option value = "log">Logarithmic</option>
</select></span>
<p><a class="btn btn-primary btn-large">share</a></p>
</div><!--/span-->
</div><!--/row-->
<footer>
<p>did this satisfy your needs? <a href="yes">yes</a> <a href="no">no</a></p>
</footer>
<!-- JavaScript at the bottom for fast page loading -->
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
<script src="js/libs/jquery-ui-1.8.17.custom.min.js"></script>
<!-- scripts concatenated and minified via build script -->
<!-- TODO I don't really understand how Boilerplate wants us to include scripts -->
<script src="js/plugins.js"></script>
<script src="js/script.js"></script>
<!-- end scripts -->
<script>
$(document).ready(function() {
makeattrmenu();
});
function makeattrmenu() {
$.getJSON("data/desktop_heatmap_2012_variables.json", function(varJson) {
console.log("I got the variables file");
$.getJSON("data/desktop_heatmap_2012_users.json", function(userData) {
console.log("I got the users file");
var menu = $("#variables_menu");
menu.empty();
var variables = varJson.variablez;
var eventNames = varJson.event_names;
$.each(variables, function(key, val) {
var newItem = $('<li></li>');
newItem.addClass([val.datatype].join(' ')).html(val.name).attr("variable", val.id);
newItem.on("mouseover", function() {
$("#output").html(val.description);
});
// add popup menu
if (val.customizable == "event_names") {
var select = $('<select></select>');
for (var e in eventNames) {
select.append($('<option>' + eventNames[e] + '</option>'));
}
select.addClass("event_names_select");
select.bind("change", function(e) { console.log('You pickd ' + select.val()); });
newItem.append(select);
}
menu.append(newItem);
});
// dynamically create hidden variables for each event_names:
$.each(eventNames, function(key, val) {
variables.push( { "datatype": "integer",
"semantics": "per_user",
"id": "numUses_" + val,
"name": "Use Count Of " + val,
"description": "Number of times " + val + " was used."
});
});
initDragGui(variables, eventNames, userData);
});
});
}
</script>
<script src="js/bootstrap.js"></script>
<script src="js/dragui.js"></script>
<script src="js/omniplotter.js"></script>
<script src="js/libs/d3.v2.js"></script>
</body>
</html>