-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
405 lines (357 loc) · 17.4 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
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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>phaseportrait</title>
<link rel="stylesheet" href="css/tailwind.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="node_modules/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="node_modules/codemirror/theme/material.css">
<link rel="stylesheet" href="web_backend/css/page.css">
<link rel="stylesheet" href="web_backend/css/boilerplate.css">
<link rel="stylesheet" href="web_backend/css/fbm.css">
<link rel="stylesheet" href="web_backend/css/mpl.css">
<script src="renderer.js"></script>
<script src="web_backend/js/mpl.js"></script>
<script src="web_backend/js/nbagg_mpl.js"></script>
</head>
<body class="dark:bg-gray-600">
<div id="parameters_plot_container" class="
columns-2xs
p-6
flex flex-wrap
mx-auto
max-w-7xl
sm:flex-nowrap sm:max-h-screen
gap-6
overflow-hidden
">
<!-- Form area -->
<div id="parameters_div" class="
container
flex flex-col
p-6
w-full
sm:max-w-[50%] lg:max-w-[40%]
max-h-full
bg-gray-100 dark:bg-gray-800
shadow-lg
rounded-md
">
<div class="flex justify-between">
<h1 class="
text-3xl font-bold leading-7
text-gray-900 dark:text-white
mb-6
">Parameters
</h1>
<button onclick="toggleDarkMode()"
class="flex justify-center items-center rounded-full h-8 w-8 text-white bg-purple-400 hover:bg-purple-600 active:bg-purple-700">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round"
d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"/>
</svg>
</button>
</div>
<form id="formElem" class="w-full h-full overflow-auto pr-3 flex flex-col gap-2 rounded-md">
<!-- Editor -->
<div class="field w-full mb-1">
<label class="label">Function</label>
<textarea name="function" id="codemirror-container"></textarea>
<!-- Polar -->
<div class="w-full flex items-center gap-2 my-3">
<input class="
h-4 w-4
m-0 mr-1
border border-gray-300 rounded-sm bg-white
checked:bg-blue-600 checked:border-blue-600
focus:outline-none
transition duration-200 align-top
bg-no-repeat bg-center bg-contain float-left
cursor-pointer"
type="checkbox" id="Polar">
<label class="inline-block text-gray-800 dark:text-white text-sm select-none" for="Polar">
Polar
</label>
</div>
</div>
<!-- Arguments -->
<div id="dF_args_div" class="container flex flex-col items-center gap-2" style="display: none;">
<div class="w-full flex items-center gap-2 mb-3 mt-1 dark:text-gray-300 text-sm">
<span>Arguments</span>
<span class="w-full h-[1px] bg-gray-200"></span>
</div>
<!-- Args container -->
<!-- TODO: poner bonito. Imagino que habrá que ponérselo al primero de los dF_args. -->
<div class="field w-full flex gap-2 items-center ">
<!-- <label class="label">name</label> -->
<label class="label w-full" style="margin-left: 6%; ">min</label>
<label class="label w-full">value</label>
<label class="label w-full">max</label>
</div>
<div id="dF_args_container" class="container flex flex-col items-center gap-2">
</div>
</div>
<!-- Range -->
<div class="container flex flex-col items-center gap-2">
<div class="w-full flex items-center gap-2 mb-3 mt-1 dark:text-gray-300 text-sm">
<span>Range</span>
<span class="w-full h-[1px] bg-gray-200"></span>
</div>
<!-- x Range -->
<div class="field w-full">
<div class="field w-full flex gap-2 items-center">
<div class="label">x</div>
<div>
<label class="label">min</label>
<input id="x_min" type="number" placeholder="0" class="input">
</div>
<div>
<label class="label">max</label>
<input id="x_max" type="number" placeholder="1" class="input">
</div>
<div>
<label class="label">scale</label>
<input id="xScale" type="text" placeholder="" class="input">
</div>
</div>
<div class="field w-full flex gap-2 items-center">
<div class="label">y</div>
<div>
<input id="y_min" type="number" placeholder="0" class="input">
</div>
<div>
<input id="y_max" type="number" placeholder="1" class="input">
</div>
<div>
<input id="yScale" type="text" placeholder="" class="input">
</div>
</div>
<div id="z_range_div" class="field w-full flex gap-2 items-center" style="display: none">
<div class="label">z</div>
<div>
<input id="z_min" type="number" placeholder="0" class="input">
</div>
<div>
<input id="z_max" type="number" placeholder="1" class="input">
</div>
<div>
<input id="zScale" type="text" placeholder="" class="input">
</div>
</div>
</div>
</div>
<!-- Graph options -->
<div>
<div class="w-full flex gap-2">
<!-- MeshDim -->
<div class="field w-full" style="float: left; width: 48%;">
<label for="MeshDim" class="label">MeshDim</label>
<input id="MeshDim" type="number" placeholder="20" class="input">
</div>
<!-- Density -->
<div class="field w-full" style="float: right; width: 48%;">
<label for="Density" class="label">Density</label>
<input id="Density" type="number" placeholder="1" class="input">
</div>
</div>
<!-- Titulo -->
<div class="field w-full">
<label for="Title" class="label">Title</label>
<input id="Title" type="text" placeholder="Title" class="input">
</div>
<!-- xlabel -->
<div class="field w-full">
<label for="xlabel" class="label">x label</label>
<input id="xlabel" type="text" placeholder="xlabel" class="input">
</div>
<!-- ylabel -->
<div class="field w-full">
<label for="ylabel" class="label">y label</label>
<input id="ylabel" type="text" placeholder="ylabel" class="input">
</div>
<!-- color -->
<div class="field w-full">
<!-- TODO: mejorar la presentación de esta parte -->
<div class="flex justify-between items-center">
<label for="color" class="label">Color</label>
<a target="_blank" class="dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400"
href="https://matplotlib.org/stable/tutorials/colors/colormaps.html">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mt-[-0.5rem]" fill="none"
viewBox="0 0 24 24"
stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</a>
<input class="
h-4 w-4
m-0 mr-1
border border-gray-300 rounded-sm bg-white
checked:bg-blue-600 checked:border-blue-600
focus:outline-none
transition duration-200 align-top
bg-no-repeat bg-center bg-contain float-left
cursor-pointer"
type="checkbox" id="Colorbar">
<label class="inline-block text-gray-800 dark:text-white text-sm select-none" for="Colorbar">
Colorbar
</label>
</div>
<input id="color" type="text" placeholder="rainbow" class="input">
</div>
</div>
<!-- Nullcline -->
<div class="container">
<div class="w-full flex items-center gap-2 my-3 dark:text-gray-300 text-sm">
<span>Nullclines</span>
<span class="w-full h-[1px] bg-gray-200"></span>
</div>
<div class="w-full flex gap-2">
<!-- Offset -->
<div class="field w-full">
<label for="offset" class="label">Offset</label>
<input id="offset" type="number" placeholder="0" class="input">
</div>
<!-- Precision -->
<div class="field w-full">
<label for="precision" class="label">Precision</label>
<input id="precision" type="number" placeholder="0.01" class="input">
</div>
</div>
</div>
</form>
<div class="flex gap-2 mt-2">
<button onclick="get_python_code()" class="action-button bg-green-500 hover:bg-green-600">
<svg class="h-6 w-6 text-white inline-block mr-1" width="24" height="24" viewBox="0 0 24 24"
stroke="currentColor" stroke-width="2" fill="none">
<path stroke-linecap="round" stroke-linejoin="round"
d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
Code
</button>
<button onclick="plot()" class="action-button bg-blue-500 hover:bg-blue-600">
<svg class="h-6 w-6 text-white inline-block mr-1" width="24" height="24" viewBox="0 0 24 24"
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z"/>
<path d="M3 21v-4a4 4 0 1 1 4 4h-4"/>
<path d="M21 3a16 16 0 0 0 -12.8 10.2"/>
<path d="M21 3a16 16 0 0 1 -10.2 12.8"/>
<path d="M10.6 9a9 9 0 0 1 4.4 4.4"/>
</svg>
Plot
</button>
</div>
</div>
<!-- Image and credits area -->
<div class="
container
sm:max-w-[50%] lg:max-w-[60%]
flex flex-col gap-6
pb-6 sm:pb-0
">
<div id="image-area" class="
image-area
p-6
bg-gray-100 dark:bg-gray-800
shadow-lg
rounded-md
">
<!-- Image and full-screen floating button -->
<div class="image-area__container relative">
<div id="loader" class="container flex justify-center items-center py-12 select-none"
style="display: null">
<img src="./icons/phaseportrait_icon.ico" alt="">
</div>
<div id="error" class="container flex justify-center items-center py-12 select-none"
style="display: none">
<img src="./icons/phaseportrait_sadicon.png" alt="">
</div>
<!-- <iframe id="img" src="svg/default.svg" class="
max-w-full
bg-gray-100
dark:rounded-xl"
style="display: flex; border: none;"
frameborder="0"
marginheight="0"
marginwidth="0"
width="100%"
height="650px">
</iframe> -->
<div id="figure" class="rounded-md">
</div>
<!-- Code display -->
<div id="code_div" style="display: none;" class="
container
flex flex-col
max-w-full
z-0
">
<h1 class="
text-3xl font-bold leading-7
text-gray-900 dark:text-white
mb-6
">
Python code
</h1>
<div class="w-full h-full overflow-auto pr-3 flex gap-2 rounded-md">
<!-- Editor -->
<div id="result-code" class="code-display flex flex-col field w-full mb-1">
<textarea name="code" id="codemirror-container-code-display"></textarea>
</div>
</div>
</div>
<button onclick="toggleFullScreenMode()" class="zoom-button m-[-0.5rem]">
<svg class="h-6 w-6 inline-block" width="24" height="24" viewBox="0 0 24 24" stroke-width="2"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z"/>
<path d="M4 8v-2a2 2 0 0 1 2 -2h2"/>
<path d="M4 16v2a2 2 0 0 0 2 2h2"/>
<path d="M16 4h2a2 2 0 0 1 2 2v2"/>
<path d="M16 20h2a2 2 0 0 0 2 -2v-2"/>
</svg>
</button>
</div>
</div>
<!-- Errors area -->
<div id="alerts-container" class="container flex flex-col overflow-auto" style="display: none">
<div onclick="removeAllAlerts()"
class="text-sm ml-auto text-red-600 hover:underline hover:cursor-pointer mb-2">Clear all
</div>
<div id="alerts" class="flex flex-col gap-2 overflow-auto"></div>
</div>
<!-- Credits area -->
<div id="credits-area" class="container flex flex-col items-end mt-auto font-mono text-right">
<div class="block text-gray-500 dark:text-gray-300 text-xs">
CORE by
<a class="hover:underline" target="_blank" href="https://github.com/Loracio">Víctor Loras Herrero</a>
and
<a class="hover:underline" target="_blank" href="https://github.com/QuanticPony">Unai Lería Fortea</a>
</div>
<div class="block text-gray-500 dark:text-gray-300 text-xs">
GUI by
<a class="hover:underline" target="_blank" href="https://github.com/aileria">Aitor Lería Fortea</a>
and
<a class="hover:underline" target="_blank" href="https://github.com/QuanticPony">Unai Lería Fortea</a>
</div>
<a target="_blank" href="https://github.com/phaseportrait" class="
flex gap-2 font-mono
text-blue-600 dark:text-blue-300
hover:underline cursor-pointer
justify-end
mt-2
w-fit
">
<svg class="h-5 w-5" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"
fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z"/>
<path d="M9 19c-4.286 1.35-4.286-2.55-6-3m12 5v-3.5c0-1 .099-1.405-.5-2 2.791-.3 5.5-1.366 5.5-6.04a4.567 4.567 0 0 0 -1.333 -3.21 4.192 4.192 0 00-.08-3.227s-1.05-.3-3.476 1.267a12.334 12.334 0 0 0 -6.222 0C6.462 2.723 5.413 3.023 5.413 3.023a4.192 4.192 0 0 0 -.08 3.227A4.566 4.566 0 004 9.486c0 4.64 2.709 5.68 5.5 6.014-.591.589-.56 1.183-.5 2V21"/>
</svg>
phaseportrait
</a>
</div>
</div>
</div>
</body>
</html>