-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
298 lines (287 loc) · 12.6 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
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title>Build a decision tree</title>
<link rel="stylesheet" href="css/make-ml-model.css"/>
<link rel="stylesheet" href="css/svg-form.css"/>
<link rel="stylesheet" href="css/switch.css"/>
<link rel="stylesheet" href="css/red.css"/>
<script src="js/d3.v5.min.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/interact.js/1.0.2/interact.min.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<img src="img/learning-72-Pink-300px.png" class="logo"/>
<h3>Build and test your own decision tree model<br/><span style="font-size: 0.6em;">( <a style="text-decoration:underline;" href="" onClick="viewInstructions()">View Instructions</a> | <a id="groupcsv" style="text-decoration:underline;" href="data/csvs/Group_1.csv">Download card data (csv)</a> | <a id="grouppdf" style="text-decoration:underline;" href="data/Group_1.pdf">Download cards (pdf)</a> )</span></h3>
<!-- main flex container -->
<!-- cards -->
<div id="cards-wrapper">
<div class="switch-wrapper" style="text-align: right;">
<span style="color:black;">Training set</span>
<label class="switch" value="Switch sets">
<input id="setSwitch" type="checkbox" onclick="toggleSet()">
<span class="slider round"></span>
</label>
<span style="color:black;">Evaluation set</span>
</div>
<div id='training-set' class='invisbox-small'></div>
<div id='evaluation-set' class="invisbox-small" style="display: none;">
<card id="evaluation-button" onClick="startInput()" style="margin: 2px;">
<h3>Add evaluation card</h3>
</card>
</div>
</div>
<div class="invisbox-big" id="decision-tree-wrapper">
<div class="switch-wrapper" style="text-align: right;">
<span style="color:black;">Enable drag</span>
<label class="switch" value="Enable Drag">
<input id="myCheck" type="checkbox" onclick="toggleDrag()">
<span class="slider round"></span>
</label>
<div>
<div id="canvas" class="dropzone" style="width: 100%; height: 100%; margin: auto;">
<div style="margin: auto;">
<svg style="display:none;">
<symbol id="sort-box" width="100%" height="300" preserveAspectRatio="none">
<rect width="100%" height="300" style="fill:silver;stroke-width:3;stroke:none" />
<text x="50%" y="50%" fill="white" dominant-baseline="middle" text-anchor="middle">CARDS</text>
</symbol>
</svg>
<!-- html form -->
<form>
<div class="container">
<!-- ROW 1 -->
<!-- first sort factor ................................ -->
<div class="flex-container">
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny">
<select id="factor1" name="factor1">
<option value="" disabled selected>Select factor</option>
<option value="Bathrooms">Bathrooms</option>
<option value="Bedrooms">Bedrooms</option>
<option value="Year built">Year built</option>
<option value="Elevation">Elevation</option>
<option value="Square Footage">Square Footage</option>
<option value="Price">Price</option>
<option value="Price per sqft">Price per sqft</option>
</select>
</div>
<div class="invisbox-tiny">
<img src="../classification/elements/decision-neat.svg" width="100%"/>
</div>
<div class="invisbox-med">
</div>
</div>
<!-- ROW 2 ................................ -->
<div class="flex-container">
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny condition-left">
<label for="condition1a"><=</label>
<input type="text" placeholder="condition1a" id="condition1a" name="condition1a" style="max-width: 70%;">
</div>
<div class="invisbox-tiny">
<img src="../classification/elements/neat-arrow-left.svg" width="100%"/>
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny">
<img src="../classification/elements/neat-arrow-right.svg" width="100%"/>
</div>
<div class="invisbox-tiny condition-right">
<label for="condition1b" style="font-size: 1.4em;">></label>
<input disabled type="text" placeholder="condition1b" id="condition1b" name="condition1b" style="max-width: 70%; background-color: silver;">
</div>
<div class="invisbox-tiny">
</div>
</div>
<!-- ROW 3 ................................ -->
<div class="flex-container">
<div class="invisbox-fill">
<textarea name="notes1" rows="4" cols="20">Write your notes here</textarea>
</div>
<div class="invisbox-fill">
<svg width="100%" height="300" preserveAspectRatio="none">
<rect width="100%" height="300" style="fill:silver;stroke-width:3;stroke:none" />
<text x="50%" y="50%" fill="white" dominant-baseline="middle" text-anchor="middle">CARDS</text>
</svg>
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-fill">
<svg width="100%" height="300" preserveAspectRatio="none">
<rect width="100%" height="300" style="fill:silver;stroke-width:3;stroke:none" />
<text x="50%" y="50%" fill="white" dominant-baseline="middle" text-anchor="middle">CARDS</text>
</svg>
</div>
<div class="invisbox-fill">
<textarea name="notes2" rows="4" cols="20">Write your notes here</textarea>
</div>
</div>
<!-- ROW 4 -->
<div class="flex-container">
<div class="invisbox-tiny">
<select id="factor2a" name="factor2b">
<option value="" disabled selected>Select factor (optional)</option>
<option value="Bathrooms">Bathrooms</option>
<option value="Bedrooms">Bedrooms</option>
<option value="Year built">Year built</option>
<option value="Elevation">Elevation</option>
<option value="Square Footage">Square Footage</option>
<option value="Price">Price</option>
<option value="Price per sqft">Price per sqft</option>
</select>
</div>
<div class="invisbox-tiny">
<img src="../classification/elements/decision-neat.svg" width="100%"/>
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny">
<select id="factor2b" name="factor2b">
<option value="" disabled selected>Select factor (optional)</option>
<option value="Bathrooms">Bathrooms</option>
<option value="Bedrooms">Bedrooms</option>
<option value="Year built">Year built</option>
<option value="Elevation">Elevation</option>
<option value="Square Footage">Square Footage</option>
<option value="Price">Price</option>
<option value="Price per sqft">Price per sqft</option>
</select>
</div>
<div class="invisbox-tiny">
<img src="../classification/elements/decision-neat.svg" width="100%"/>
</div>
<div class="invisbox-tiny">
</div>
</div>
<!-- ROW 5 -->
<div class="flex-container">
<div class="invisbox-tiny">
<img src="../classification/elements/neat-arrow-left.svg" width="100%"/>
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny">
<img src="../classification/elements/neat-arrow-right.svg" width="100%"/>
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny">
<img src="../classification/elements/neat-arrow-left.svg" width="100%"/>
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny">
<img src="../classification/elements/neat-arrow-right.svg" width="100%"/>
</div>
</div>
<!-- ROW 6 -->
<div class="flex-container">
<div class="invisbox-tiny condition">
<label for="condition2aa"><=</label>
<input type="text" placeholder="condition2aa" id="condition2aa" name="condition2aa" style="max-width: 70%;">
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny condition">
<label for="condition2ab">></label>
<input disabled type="text" placeholder="condition2ab" id="condition2ab" name="condition2ab" style="max-width: 70%; background-color: silver">
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny condition">
<label for="condition2ba"><=</label>
<input type="text" placeholder="condition2ba" id="condition2ba" name="condition2ba" style="max-width: 70%;">
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-tiny condition">
<label for="condition2bb">></label>
<input disabled type="text" placeholder="condition2bb" id="condition2bb" name="condition2bb" style="max-width: 70%; background-color: silver">
</div>
</div>
<!-- ROW 7 -->
<div class="flex-container">
<div class="invisbox-fill">
<svg width="100%" height="300" preserveAspectRatio="none">
<rect width="100%" height="300" style="fill:silver;stroke-width:3;stroke:none" />
<text x="50%" y="50%" fill="white" dominant-baseline="middle" text-anchor="middle">CARDS</text>
</svg>
</div>
<div class="invisbox-fill">
<svg width="100%" height="300" preserveAspectRatio="none">
<rect width="100%" height="300" style="fill:silver;stroke-width:3;stroke:none" />
<text x="50%" y="50%" fill="white" dominant-baseline="middle" text-anchor="middle">CARDS</text>
</svg>
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-fill">
<svg width="100%" height="300" preserveAspectRatio="none">
<rect width="100%" height="300" style="fill:silver;stroke-width:3;stroke:none" />
<text x="50%" y="50%" fill="white" dominant-baseline="middle" text-anchor="middle">CARDS</text>
</svg>
</div>
<div class="invisbox-fill">
<svg width="100%" height="300" preserveAspectRatio="none">
<rect width="100%" height="300" style="fill:silver;stroke-width:3;stroke:none" />
<text x="50%" y="50%" fill="white" dominant-baseline="middle" text-anchor="middle">CARDS</text>
</svg>
</div>
</div>
<!-- ROW 8 -->
<div class="flex-container">
<div class="invisbox-fill">
<textarea name="notes3" rows="3" cols="15">Write your notes here</textarea>
</div>
<div class="invisbox-fill">
<textarea name="notes4" rows="3" cols="15">Write your notes here</textarea>
</div>
<div class="invisbox-tiny">
</div>
<div class="invisbox-fill">
<textarea name="notes5" rows="3" cols="15">Write your notes here</textarea>
</div>
<div class="invisbox-fill">
<textarea name="notes6" rows="3" cols="15">Write your notes here</textarea>
</div>
</div>
</div>
</form>
<!-- end of html form -->
</div>
</div>
</div>
</div>
</body>
<script src="js/make-ml-model.js"></script>
<script src="js/switch.js"></script>
<script src="js/cards.js"></script>
<script type="text/javascript">
var redCount = 0;
var redDone = [];
var maxRedCount = 20;
var group = 1;
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
group = urlParams.get('group');
if (!group) {
group = 1;
}
$('document').ready(function(){
getBlueCards(group,"blue");
document.getElementById("groupcsv").href="data/csvs/Group_" + group + ".csv";
document.getElementById("grouppdf").href="data/pdfs/Group_" + group + ".pdf";
$('#condition1a').on('change', onchange);
$('#condition2aa').on('change', onchange);
$('#condition2ba').on('change', onchange);
});
</script>
</html>