-
Notifications
You must be signed in to change notification settings - Fork 2
/
plots.js
183 lines (167 loc) · 4.4 KB
/
plots.js
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<style>
* {
overflow:hidden;
box-sizing: border-box;
margin:0;
padding:0;
}
body {
width:100vw;
height:100vh;
}
header {
height:5%;
width:100%;
background-color:#12389298;
}
main {
width:100%;
max-width:1024px;
height:90%;
margin:auto;
background-color:#ffffff;
position:relative;
}
nav {
width:100%;
height:7%;
border:solid .5px black;
display: grid;
grid-template-columns: repeat(4, 1fr);
font-family: 'Roboto', sans-serif;
}
nav > a {
height:100%;
border:solid .25px black;
grid-column: auto;
text-align: center;
}
#hamburger {
display:none;
position: absolute;
right: 0;
}
section {
overflow-y:auto;
}
footer {
width:100%;
height:5%;
background-color:#0092FF87;
}
.hide {
display:none;
}
/* STYLINGS FOR PHONE */
@media only screen
and (max-device-width : 600px)
and (max-device-height : 1000px) {
nav {
display:none;
height: unset;
width: 30%;
position: absolute;
right: 0;
top: 35px;
}
#hamburger {
display: block;
position: absolute/;
right: 10px;
top: 5px;
}
#hamburger span, #hamburger span:before, #hamburger span:after {
transition: all 500ms ease-in-out;
}
#hamburger.active span {
}
nav > a {
display: block;
height: unset;
}
}
#graphs {
height: 92vh;
overflow: auto;
box-shadow: 0px 0px 11px 0px #888888;
}
</style>
</head>
<body>
<header></header>
<main>
<div id='hamburger'>
<svg height="32px" id="Layer_1" style="enable-background:new 0 0 32 32;" version="1.1" viewBox="0 0 32 32" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/></svg>
</div>
<nav>
<a href='#restrictions'>Restrictions</a>
<a href='#data'>Data</a>
<a href='#schedule'>Schedule</a>
<a href='#options'>Options</a>
</nav>
<section id='restrictions' class='hide'>
bluuuuuuuuuuuuup
</section>
<!--data section with graphs-->
<div id="graphs">
<section id='data'>
<p style="font-size: 3em">Productivity Index: __ %</p>
<p style="font-size: 2em">Percent Time Spent on Websites</p>
<div id="pieChart"></div>
<div id="lineGraph"></div>
</section>
</div>
<section id='schedule' class='hide'>
bleeeeeeeeeeeeeeep
</section>
<section id='options' class='hide'>
blaaaaaaaaaaaaaap
</section>
</main>
<footer></footer>
<script>
var pieChartData = [{
values: [19, 26, 55],
labels: ['Netflix', 'Wikipedia', 'Canvas'],
type: 'pie'
}];
var pitChartLayout = {
height: 400,
width: 500
};
Plotly.newPlot('pieChart', pieChartData, pitChartLayout);
// line graph data
var prodOverTime = {
x: [1, 2, 3, 4],
y: [4, 9, 13, 14],
type: 'scatter',
name: "Productivity over Time"
};
var trace2 = {
x: [1, 2, 3, 4],
y: [16, 5, 11, 9],
type: 'scatter'
};
var lineGraphLayout = {
title: 'Productivity Rating over Time',
xaxis: {
title: '{}s ', // fix this
showgrid: false,
zeroline: false
},
yaxis: {
title: 'Percent',
showline: false
}
};
var lineGraphData = [prodOverTime, trace2];
Plotly.newPlot('lineGraph', lineGraphData, lineGraphLayout);
</script>
</body>
</html>