-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_model.html
633 lines (593 loc) · 22.5 KB
/
index_model.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
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
<!-- This is a tool to calculate simple individual dynamic model solutions. It plots a time series and a phase space trajectory after pushing
the blue button. Next developments should contain:
- further examples for models of different problems and issues.
- debugging of applicants.
- review and improvements of plotly-code to decrease datastorage and to enable more calculation steps
Writer: Fabian Wachsmann
Built on Bootstrap, Jquery and Plotly packages-->
<!DOCTYPE html>
<html>
<head>
<title>A simple customizable model </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> -->
<link rel="stylesheet" href="./bootstrap.min.css">
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> -->
<script src="./jquery-1.12.0.min.js"> </script>
<!-- <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> -->
<script src="./bootstrap.min.js"></script>
<!-- <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> -->
<script src="./plotly-latest.min.js"></script>
<!-- <script type=”text/javascript” src=”http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.js”></script> -->
<script type="text/javascript" src="./jquery.tmpl.js"> </script>
<style type="text/css">
.plhold{
min-height: 400px;
min-width: 300px;
}
td .form-inline input[type="text"]{
max-width: 90px;
}
</style>
</head>
<body>
<div class="container">
<div class="example-box">
<div class="row">
<p>Choose an example set-up or feel free to design your own experiment below!</p>
</div>
<div class="row">
<div class="col-md-3">
<button id="lorenz" type="button" class="btn btn-primary btn-block"> Lorenz-Attractor </button>
</div>
<div class="col-md-3">
<button id="popul" type="button" class="btn btn-primary btn-block"> Populations</button>
</div>
<div class="col-md-3">
<button id="love" type="button" class="btn btn-primary btn-block">Love</button>
</div>
<div class="col-md-3">
<button id="climate" type="button" class="btn btn-primary btn-block">Climate change</button>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<form class="form-inline" role="form">
<p>Name of variable 1:</p>
<div class="input-group">
<span class="input-group-addon" id="addon1">x=</span>
<input id="input1" type="text" value=meadow class="form-control" aria-describedby="addon1" onchange="inp(1);">
</div>
</form>
</div>
<div class="col-md-4">
<form class="form-inline" role="form">
<p>Name of variable 2:</p>
<div class="input-group">
<span class="input-group-addon" id="addon2">y=</span>
<input id="input2" type="text" value=rabbit class="form-control" aria-describedby="addon2" onchange="inp(2);">
</div>
</form>
</div>
<div class="col-md-4">
<form class="form-inline" role="form">
<p>Name of variable 3:</p>
<div class="input-group">
<span class="input-group-addon" id="addon3">z=</span>
<input id="input3" type="text" value=snake class="form-control" aria-describedby="addon3" onchange="inp(3);">
</div>
</form>
</div>
</div>
<h2>Model rules</h2>
<p>Type in the sensitivity parameter for the linear equations! You can choose codependencies by clicking on x,y or z. Additionally you can switch from linear to other functions via the caret.</p>
<table class="table table-hover table-bordered">
<tbody>
<tr>
<td>Change of <strong class="name1">variable 1</strong></td>
<td>=</td>
<td id="fieldcont11"> </td>
<td id="fieldcont12"> </td>
<td id="fieldcont13"> </td>
<td> <form class="form-inline"> <input id="input14" type="text" value=0.01 class="form-control input-sm" > <code>(const)</code> </form> </td>
</tr>
<tr>
<td> Change of <strong class="name2">variable 2</strong></td>
<td>=</td>
<td id="fieldcont21"> </td>
<td id="fieldcont22"> </td>
<td id="fieldcont23"> </td>
<td> <form class="form-inline"> <input id="input24" type="text" value=0.01 class="form-control input-sm" > <code>(const)</code> </form> </td>
</tr>
<tr>
<td> Change of <strong class="name3">variable 3</strong></td>
<td>=</td>
<td id="fieldcont31"> </td>
<td id="fieldcont32"> </td>
<td id="fieldcont33"> </td>
<td> <form class="form-inline"> <input id="input34" type="text" value=0.01 class="form-control input-sm" > <code>(const)</code> </form> </td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#opt" >
Options</a>
</h4>
</div>
<div id="opt" class="panel-collapse collapse in">
<div class="panel-body">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#int" >
Integration Scheme</a>
</h4>
</div>
<div id="int" class="panel-collapse collapse in">
<div class="list-group">
<li class="list-group-item">Forward</li>
<li class="list-group-item">Leap frog</li>
<li class="list-group-item">Crank-Nicolson</li>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#nst" >
Calculation steps</a>
</h4>
</div>
<div id="nst" class="panel-collapse collapse in">
<table class="table table-bordered">
<thead>
<tr>
<th colspan="2">Choose the total calculation number!</th>
</tr>
</thead>
<tbody>
<tr>
<td> <form class="form-inline"> <input class="form-control" type="range" min="100" max="1000" step="10" value="100" onchange="updateText(this.value,'outnst');"> </form></td>
<td> <output id="outnst">100</output> </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title" id="SHF1">
<a data-toggle="collapse" href="#init" >
Initialization:</a>
</h4>
</div>
<div id="init" class="panel-collapse collapse in">
<div class="panel-body">
<table class="table table-bordered">
<thead>
<tr>
<th>Variable</th>
<th>Initial value</th>
<th>Unit</th>
<th> <0? </th>
</tr>
</thead>
<tbody>
<tr>
<td class="name1"></td>
<td> <input id="init1" type="text" value=100 class="form-control input-sm" > </td>
<td> <input id="unit1" type="text" value=Number class="form-control input-sm" ></td>
<td><div class="checkbox">
<label><input id="zero1" type="checkbox" value=""></label>
</div> </td>
</tr>
<tr>
<td class="name2"></td>
<td> <input id="init2" type="text" value=100 class="form-control input-sm" > </td>
<td> <input id="unit2" type="text" value=Number class="form-control input-sm" ></td>
<td><div class="checkbox">
<label><input id="zero2" type="checkbox" value=""></label>
</div> </td>
</tr>
<tr>
<td class="name3"></td>
<td> <input id="init3" type="text" value=100 class="form-control input-sm" > </td>
<td><input id="unit3" type="text" value=Number class="form-control input-sm" ></td>
<td><div class="checkbox">
<label><input id="zero3" type="checkbox" value=""></label>
</div> </td>
</tr>
</tbody>
</table>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#tst" >
Time step</a>
</h4>
</div>
<div id="tst" class="panel-collapse collapse in">
<table class="table table-bordered">
<thead>
<tr>
<th>Choose a value</th>
<th></th>
<th>Time Unit</th>
</tr>
</thead>
<tbody>
<tr>
<td> <form class="form-inline"> <input class="form-control" type="range" min="0" max="5" step="1" value="1" onchange="updateText(this.value,'outtime');"> </form></td>
<td> <output id="outtime">1</output> </td>
<td> <form class="form-inline"> <input id="inputt" type="text" value=s class="form-control input-sm" > </form> </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<button type="button" id="calc" class="btn btn-primary btn-block" data-loading-text="loading">Calculate your own solution!</button>
</div>
<div class="progress">
<div id="pbar" class="progress-bar progress-bar-striped active" role="progressbar"
aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:1%">
1%
</div>
</div>
<div class="row">
<div class="plhold" id="placeholder1" style="display: none" tabindex="-1"></div>
</div>
<div class="row">
<div class="plhold" id="placeholder2" style="display: none" tabindex="-1"></div>
</div>
</div>
<script id="templ" type="text/x-jQuery-tmpl">
<form class="form-inline"> <input id="input${inpid}" type="text" value=-0.01 class="form-control input-sm">
<div class="btn-group">
<button class="btn dropdown-toggle" data-toggle="dropdown"> <code class="codeptop">* (${codephelp[0]})</code> </button>
<ul class="dropdown-menu" id="codep-list${inpid}">
<li class="codep list-group-item-success">(${codephelp[0]})</li>
<li class="codep">(${codephelp[1]})</li>
<li class="codep">(${codephelp[2]})</li>
<li class="codep">(${codephelp[3]})</li>
</ul>
</div>
<div class="btn-group">
<button class="btn dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span></button>
<ul class="dropdown-menu" id="funct-list${inpid}">
<li class="funct list-group-item-success" id="funct0">* linear</li>
<li class="funct" id="funct1">* square</li>
<li class="funct" id="funct2">* log</li>
<li class="funct" id="funct3">* root </li>
<li class="funct" id="funct4">* (1-x) </li>
</ul>
</div>
</form>
</script>
<script type="text/javascript" >
//global variables:
var errs=0;
var Nstep=10;
var step=0;
var tstep=0;
var dimen=3;
var tenden=new Array(dimen);
var newpoint=new Array(dimen);
var oldpoint=new Array(dimen);
//linear multiplicator and codependency function
var linvals = new Array(dimen+1);
var codepfunction = new Array(dimen+1)
for (var i = 0; i < dimen; i++) {
linvals[i] = new Array(dimen);
codepfunction[i]=new Array(dimen);
};
var series1 = [];
var series2 = [];
var series3 = [];
var times = [];
//--BUILD PAGE
//codependencies:
var codepin=[["x","xy","xz","xyz"],
["y","yx","yz","xyz"],
["z","zx","zy","xyz"]];
//accordingly to calculate:
var codepcalchelp=[["oldpoint[0]","oldpoint[0]*oldpoint[1]","oldpoint[0]*oldpoint[2]","oldpoint[0]*oldpoint[1]*oldpoint[2]"],
["oldpoint[1]","oldpoint[1]*oldpoint[0]","oldpoint[1]*oldpoint[2]","oldpoint[0]*oldpoint[1]*oldpoint[2]"],
["oldpoint[2]","oldpoint[2]*oldpoint[0]","oldpoint[2]*oldpoint[1]","oldpoint[0]*oldpoint[1]*oldpoint[2]"]];
//functions:
var funcin=["","<sup>2</sup>","log"," √","(1-x)"];
//Use Template of the table-field with codependencies
for (var i=0; i<dimen; i++) {
for (var j=0; j<dimen; j++) {
var codephelp=codepin[j];
var inpid=(""+(i+1)+(j+1));
$('#templ').tmpl(inpid,codephelp).appendTo(("#fieldcont"+inpid));
};
};
function inp(vari) {
var nameconts = document.getElementsByClassName(("name" + vari));
for (var i=0; i<nameconts.length; i++) {
nameconts[i].innerHTML = document.getElementById(("input" + vari)).value;
};
};
//SET EVENTLISTENERS
//when template is built, eventlisteners start:
$(function(){
//for panels:
$('.list-group-item').on('click',function(e){
var previous = $(this).closest(".list-group").children(".list-group-item-success");
previous.removeClass('list-group-item-success'); // previous list-item
$(e.target).addClass('list-group-item-success'); // activated list-item
});
// for codependencies, similar to panels
$('.codep').on('click',function(e){
var previous = $(this).closest(".dropdown-menu").children(".list-group-item-success");
previous.removeClass('list-group-item-success'); // previous list-item
$(e.target).addClass('list-group-item-success'); // activated list-item
var tochange = $(this).closest('.btn-group').find('.codeptop');
var actother = $(this).closest(".form-inline").find('.funct.list-group-item-success');
tochange.html((actother.html() + $(e.target).html()));
});
// for functions
$('.funct').on('click',function(e){
var previous = $(this).closest(".dropdown-menu").children(".list-group-item-success");
previous.removeClass('list-group-item-success'); // previous list-item
$(e.target).addClass('list-group-item-success'); // activated list-item
var tochange = $(this).closest('.form-inline').find('.codeptop');
var actother = $(this).closest(".form-inline").find('.codep.list-group-item-success');
if($(e.target).attr('id')==="funct0"){tochange.replaceWith(('<code class="codeptop">'+ funcin[0] + actother.html() + '</code'))};
if($(e.target).attr('id')==="funct1"){tochange.replaceWith(('<code class="codeptop">'+ actother.html() + funcin[1] + '</code'))};
if($(e.target).attr('id')==="funct2"){tochange.replaceWith(('<code class="codeptop">'+ funcin[2] + actother.html() + '</code'))};
if($(e.target).attr('id')==="funct3"){tochange.replaceWith(('<code class="codeptop">'+ funcin[3] + actother.html() + '</code'))};
if($(e.target).attr('id')==="funct4"){tochange.replaceWith(('<code class="codeptop">'+ funcin[4] + actother.html() + '</code'))};
});
//Example set-ups:
$('#lorenz').on('click',function () {
var setup=["","","","","Convectionvelocity","Temperaturegradient","Lapserateanomaly","-0.1","0.1","0","0","0.28","-0.01","-0.01","0","0.01","0","-0.026","0","30","Number","","0","Number","","0","Number","","s"];
var allInputs = $('.container').find(':input');
var a=0;
allInputs.each(function(){
if ($.type($(this).attr('id'))!=="undefined") {
$(this).val(setup[a]);
a++;
};
});
$(":checkbox").each(function(){$(this).prop('checked', true)});
$('.dropdown-menu').each(function () {$(this).find(".codep").eq(0).trigger("click");});
$('#codep-list23').find(".codep").eq(1).trigger("click");
$('#codep-list31').find(".codep").eq(1).trigger("click");
$('.dropdown-menu').each(function () {$(this).find(".funct").eq(0).trigger("click");});
$("input[type=range]").eq(0).val(1000);
updateText(1000,'outnst');
});
$('#popul').on('click',function () {
var setup=["","","","","Meadow","Rabbits","Snakes","1","-0.5","0","0","0.5","-0.25","-1","0","0","1","-0.25","0","0.01","Number","","0.01","Number","","0.01","Number","","s"];
var allInputs = $('.container').find(':input');
var a=0;
allInputs.each(function(){
if ($.type($(this).attr('id'))!=="undefined") {
$(this).val(setup[a]);
a++;
};
});
$(":checkbox").each(function(){$(this).prop('checked', false)});
$('.dropdown-menu').each(function () {$(this).find(".codep").eq(0).trigger("click");});
$('#codep-list12').find(".codep").eq(1).trigger("click");
$('#codep-list21').find(".codep").eq(1).trigger("click");
$('#codep-list23').find(".codep").eq(2).trigger("click");
$('#codep-list32').find(".codep").eq(2).trigger("click");
$('.dropdown-menu').each(function () {$(this).find(".funct").eq(0).trigger("click");});
$('#funct-list11').find(".funct").eq(4).trigger("click");
$("input[type=range]").eq(0).val(1000);
updateText(1000,'outnst');
});
$('#love').on('click',function () {
var setup=["","","","","Romeo","Julia","nan","-0.03","0.02","0","0","-0.07","0.03","0","0","0","0","0","0","1","Love","","1","Love","","0.00","Love","","d"];
var allInputs = $('.container').find(':input');
var a=0;
allInputs.each(function(){
if ($.type($(this).attr('id'))!=="undefined") {
$(this).val(setup[a]);
a++;
};
});
$(":checkbox").each(function(){$(this).prop('checked', true)});
$('.dropdown-menu').each(function () {$(this).find(".codep").eq(0).trigger("click");});
$('.dropdown-menu').each(function () {$(this).find(".funct").eq(0).trigger("click");});
$("input[type=range]").eq(0).val(1000);
updateText(1000,'outnst');
});
$('#climate').on('click',function () {
var setup=["","","","","Summed Emissions","Atm. Co2-Anomaly","Glob. Temperature-Anomaly","0","0","0","0.1","0.01","-0.03","0","0.01","0","0.08","-0.03","0","5","GtC","","1.2","PI","","0","K","","y"];
var allInputs = $('.container').find(':input');
var a=0;
allInputs.each(function(){
if ($.type($(this).attr('id'))!=="undefined") {
$(this).val(setup[a]);
a++;
};
});
$(":checkbox").each(function(){$(this).prop('checked', true)});
$('.dropdown-menu').each(function () {$(this).find(".codep").eq(0).trigger("click");});
$('.dropdown-menu').each(function () {$(this).find(".funct").eq(0).trigger("click");});
$('#funct-list32').find(".funct").eq(2).trigger("click");
$("input[type=range]").eq(0).val(1000);
updateText(1000,'outnst');
});
});
// supress submitting by pressing enter
$('.form-control').on('submit',function() {
return false;
});
$('#calc').on('click',function () {
$('#calc').button('loading');
checker();
if (errs>0) {
alert(("You need to fill in the " + errs + " red empty formulars to continue!"));
errs=0;
} else {
initialize();
var zahl=0;
var progint = setInterval(tentimes, 200);
};
function tentimes() {
if (zahl>9) {
clearInterval(progint);
step=0;
plottery();
progplot(90);
setTimeout(function(){plotter3d(); progplot(100); $('#calc').button('reset');},400);
} else {
modelcalc();
zahl++;
};
};
});
function checker() {
var contis = $('.form-control');
for (var a=0; a<contis.length; a++) {
if (contis[a].value==="") {
contis[a].style.backgroundColor = "red";
errs++;
};
};
};
function updateText(val,elem) {
document.getElementById(elem).value=val;
};
function modelcalc() {
for (var z=0; z<0.1*Nstep; z++) {
tforward();
times.push(eval(step*tstep));
series1.push(oldpoint[0]);
series2.push(oldpoint[1]);
series3.push(oldpoint[2]);
overgive();
};
progplot(eval(step/Nstep*80));
};
function progplot(e) {
document.getElementById("pbar").style.width = (e + "%");
document.getElementById("pbar").innerHTML = (e + "%");
};
function initialize() {
series1=[];
series2=[];
series3=[];
times=[];
tstep=document.getElementById("outtime").value;
Nstep=document.getElementById("outnst").value;
for (var j=0; j<dimen; j++) {
oldpoint[j]=parseFloat(document.getElementById(("init" + (j+1))).value);
for (var k=0; k<(dimen+1); k++) {
if (k<dimen) {
var codepindex=$(('#codep-list'+(j+1)+(k+1))).children(".list-group-item-success").index();
var funcindex=$(('#funct-list'+(j+1)+(k+1))).children(".list-group-item-success").index();
codepfunction[j][k]=codepcalchelp[k][codepindex];
if (funcindex===1) { codepfunction[j][k]=("Math.pow(eval("+codepfunction[j][k]+"),2)")};
if (funcindex===2) { codepfunction[j][k]=("Math.log(eval("+codepfunction[j][k]+"))")};
if (funcindex===3) { codepfunction[j][k]=("Math.sqrt(eval("+codepfunction[j][k]+"))")};
if (funcindex===4) { codepfunction[j][k]=('(1-oldpoint[0])*('+codepfunction[j][k]+')')};
};
linvals[j][k]=parseFloat(document.getElementById(("input" + (j+1) + (k+1))).value);
};
};
// alert(codepfunction);
// alert(linvals);
// alert(oldpoint);
};
function tforward() {
for (var j=0; j<dimen; j++) {
tenden[j]=linvals[j][0]*eval(codepfunction[j][0])+linvals[j][1]*eval(codepfunction[j][1])+linvals[j][2]*eval(codepfunction[j][2])+linvals[j][3];
newpoint[j]=oldpoint[j]+parseFloat(eval(tstep*tenden[j]));
if (document.getElementById(("zero" + (j+1))).checked===false){
if (newpoint[j]<0) {
newpoint[j]=0;
};
};
};
// alert(tenden);
// alert(newpoint);
};
function overgive() {
for (var j=0; j<dimen; j++) {
oldpoint[j]=newpoint[j];
};
step++;
};
function plottery() {
var yplottarget=document.getElementById("placeholder1");
$(yplottarget).show();
$(yplottarget).focus();
var varnames= new Array(dimen);
for (var i=0; i<dimen; i++) {
varnames[i]=document.getElementById(("input" + (i + 1))).value;
};
var y1 = {x: times, y: series1, type: 'scatter',name: varnames[0], line: { dash: 'solid', width: 4}};
var y2 = {x: times, y: series2, type: 'scatter',name: varnames[1], line: { dash: 'dashdot', width: 4}};
var y3 = {x: times, y: series3, type: 'scatter',name: varnames[2], line: { dash: 'dot', width: 4}};
var datas=[y1,y2,y3];
var layoutyy = {
title: 'Timeseries',
xaxis: {
title: ("Time [" + document.getElementById("inputt").value + "]")
},
yaxis: {
title: 'Number'
}
};
Plotly.newPlot( yplottarget, datas, layoutyy);
};
function plotter3d() {
var threedplottarget=document.getElementById("placeholder2");
$(threedplottarget).show();
var varnames= new Array(dimen);
for (var i=0; i<dimen; i++) {
varnames[i]=document.getElementById(("input" + (i + 1))).value;
};
var d3 = [{x: series1, y: series2, z: series3, mode: 'lines', marker: {
color: '#bcbd22',
size: 12,
symbol: 'circle',
line: {
color: 'rgb(0,0,0)',
width: 0
}
},
line: {
color: '#bcbd22',
width: 4
},
type: 'scatter3d'}];
var layout3d = {
title: 'Trajectory in phase space',
autosize: false,
width: 800,
height: 500,
margin: {
l: 0,
r: 0,
b: 0,
t: 65
}
};
Plotly.newPlot( threedplottarget, d3,layout3d);
};
</script>
</body>
</html>