-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinteraction.html
379 lines (351 loc) · 11.4 KB
/
interaction.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
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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<!DOCTYPE HTML>
<!--
Spectral by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>Systems Engineering HCI</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="assets/css/main.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
</head>
<body>
<!-- Page Wrapper -->
<div id="page-wrapper">
<!-- Header -->
<header id="header">
<h1><a href="index.html">Systems Engineering HCI</a></h1>
<nav id="nav">
<ul>
<li class="special">
<a href="#menu" class="menuToggle"><span>Menu</span></a>
<div id="menu">
<ul>
<li><a href="index.html">Overview</a></li>
<li><a href="survey.html">User Survey</a></li>
<li><a href="requirements.html">Requirements</a></li>
<li><a href="persona1.html">Persona 1</a></li>
<li><a href="persona2.html">Persona 2</a></li>
<li><a href="scenario.html">Scenario</a></li>
<li><a href="storyboard.html">Storyboard</a></li>
<li><a href="iteration.html">Iteration</a></li>
<li><a href="sketches.html">Sketches</a></li>
<li><a href="alternatives.html">Alternatives</a></li>
<li><a href="interaction.html">User Interaction 1</a></li>
<li><a href="interaction2.html">User Interaction 2</a></li>
<li><a href="evaluation.html">Evaluation</a></li>
<li><a href="architectures.html">System Architecture</a></li>
<li><a href="citations.html">References</a></li>
</ul>
</div>
</li>
</ul>
</nav>
</header>
<!-- Main -->
<article id="main">
<header>
<h2>User Interaction 1 - User Interface Add-Ons</h2>
</header>
<section class="wrapper style5">
<div class="inner">
<section>
<h4>Interacting with the graph prototype</h4>
<p>For the first part of out prototype, our team decided to begin by sketching some of ways in which the user can interact with the graphing tools. Thus,
in the sketches below, one can see the steps the user should take in order to see the data gathered in the past week and how the graph should look like:</p>
<hr />
</section>
<section>
<div class="12u"><span class="image fit"><img src="images/poza1.jpg" alt="" /></span></div>
<hr />
</section>
<section>
<h4>Chart.js</h4>
<p> After changing the design of our initial sketches, we decided to add a "Remove" button for the Actual Production line instead of using a check-box. This could later be changed, as too many buttons
could make the UI harder to navigate. </p>
<p> We used the library Chart.js to implement the interactive Prototype of the graph. The user can now click the "Add Actual Production" or the "Remove Actual Production" buttons to
show or hide the Actual Production line and the "1 hour" button to show the Revenue and Price Prediction for the next hour. For now, just this
button is implemented and can be clicked multiple times to show a further prediction. Nevertheless, the current prediction lines are plotted
using randomized data, which is due to be replaced with a proper dataset at a later stage of the project. One of the main aims is to also improve
the accuracy of the prediction lines using machine learning algorithms.</p>
<hr />
</section>
<section>
<div class="chart-container" style="position: relative; height:45vh; width:100%; margin-bottom: 100px">
<canvas id="chart" style="margin: 0 auto;"></canvas>
</div>
<ul class="actions">
<li style="padding: 10px; padding-top: 0px">
<button id="remove" onClick="this.disabled = true;">Add Actual Production</button>
<button id="add" type="button" disabled>Remove Actual Production</button>
</li>
<li style="padding: 10px; padding-top: 0px">
<button id="1day">3 hours</button>
<button id="2days" onClick="this.disabled = true;">1 day</button>
<button id="1week" onClick="this.disabled = true;">1week</button>
<button id="1month" onClick="this.disabled = true;">1month</button>
</li>
<li style="padding: 10px; padding-top: 0px">
<button id="remove1" type="button" disabled>Remove 3 hours</button>
</li>
</ul>
</section>
</div>
</section>
</article>
</div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.scrollex.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
<script src="assets/js/main.js"></script>
<script src="Chart.js/dist/Chart.js"></script>
<script src="Chart.js/samples/utils.js"></script>
</body>
<script>
var HOURS = ["00:00","3:00","6:00","9:00","12:00", "15:00", "18:00", "21:00", "24:00"];
var ctx = document.getElementById("chart");
var chart = new Chart(ctx, {
type: 'line',
data: {
labels: ["00:00","3:00","6:00","9:00","12:00", "15:00", "18:00", "21:00", "24:00"],
datasets: [{
label: "Production Forecast",
backgroundColor: '#cc65fe',
borderColor: '#cc65fe',
data: [{
x: 10,
y: 10
}, {
x: 15,
y: 20
}, {
x: 25,
y: 25
}, {
x: 30,
y: 30
}, {
x: 27,
y: 27
}, {
x: 21,
y: 21
}, {
x: 18,
y: 18
}, {
x: 15,
y: 15
}, {
x: 10,
y: 10
}
],
fill: false,
cubicInterpolationMode: 'default',
}, {
label: "Solar Energy Price",
fill: false,
backgroundColor: '#36a2eb',
borderColor: '#36a2eb',
data: [
{
x: 10,
y: 20
}, {
x: 15,
y: 15
}, {
x: 15,
y: 15
}, {
x: 15,
y: 20
}, {
x: 15,
y: 20
}, {
x: 15,
y: 20
}, {
x: 15,
y: 20
}, {
x: 15,
y: 20
}, {
x: 15,
y: 20
}
],
}]
},
options: {
responsive: true,
title: {
display: true,
text: 'Solar Energy Revenue',
fontSize: 30,
padding: 20
},
tooltips: {
mode: 'index',
intersect: false,
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Hours'
}
}],
yAxes: [{
ticks:{
min: 0,
max: 40
},
display: true,
scaleLabel: {
display: true,
labelString: 'Price'
}
}]
}
}
});
document.getElementById('remove').addEventListener('click', function () {
this.disabled = true;
document.getElementById('add').disabled = false;
var set = {
label: 'Actual Production',
backgroundColor: '#eb101f',
borderColor: '#eb101f',
fill: false,
data: [
{
x: 15,
y: 22
},
{
x: 15,
y: 27
},
{
x: 15,
y: 28
},
{
x: 15,
y: 23
},
{
x: 15,
y: 23
},
{
x: 15,
y: 23
},
{
x: 15,
y: 23
},
{
x: 15,
y: 23
},
{
x: 15,
y: 23
}
]
}
chart.data.datasets.push(set);
chart.update();
});
document.getElementById('add').addEventListener('click', function () {
this.disabled = true;
document.getElementById('remove').disabled = false;
var set = {
label: 'Actual Production',
backgroundColor: '#eb101f',
borderColor: '#eb101f',
fill: false,
data: [
{
x: 15,
y: 22
},
{
x: 15,
y: 27
},
{
x: 15,
y: 28
},
{
x: 15,
y: 23
},
{
x: 15,
y: 23
},
{
x: 15,
y: 23
},
{
x: 15,
y: 23
},
{
x: 15,
y: 23
},
{
x: 15,
y: 23
}
]
}
chart.data.datasets.pop(set);
chart.update();
});
document.getElementById('1day').addEventListener('click', function () {
document.getElementById('remove1').disabled = false;
document.getElementById('2days').disabled = true;
document.getElementById('1week').disabled = true;
document.getElementById('1month').disabled = true;
var hour = HOURS[chart.data.labels.length % HOURS.length];
chart.data.labels.push([hour]);
chart.data.datasets.forEach(function (dataset) {
dataset.data.push(randomScalingFactor());
});
chart.update();
});
document.getElementById('remove1').addEventListener('click', function () {
chart.data.labels.splice(-1, 1);
chart.data.datasets.forEach(function (dataset, datasetIndex) {
dataset.data.pop();
});
chart.update();
});
chart.canvas.parentNode.style.height = '500px';
</script>
</html>