-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
68 lines (58 loc) · 1.78 KB
/
app.py
File metadata and controls
68 lines (58 loc) · 1.78 KB
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
import matplotlib
matplotlib.use('Agg')
from flask import Flask, render_template, request
from src.run_examples import *
import matplotlib.pyplot as plt, mpld3
import mpld3
from mpld3 import plugins
app = Flask(__name__)
@app.route('/')
def index():
return render_template("index.html")
@app.route('/_example-null')
def exampleNULL():
return mpld3.fig_to_html(run_example_NULL())
@app.route('/_example-0')
def example0():
a = request.args.get('a', 0.6, type=float)
r = request.args.get('r', 0, type=float)
return mpld3.fig_to_html(run_example_0(a, r))
@app.route('/_example-1')
def example1():
a = request.args.get('a', 5, type=float)
r = request.args.get('r', 0, type=float)
return mpld3.fig_to_html(run_example_1(a, r))
@app.route('/_example-2')
def example2():
a = request.args.get('a', 0.2, type=float)
r = request.args.get('r', 0, type=float)
return mpld3.fig_to_html(run_example_2(a, r))
@app.route('/_example-3')
def example3():
a = request.args.get('a', 10, type=float)
r = request.args.get('r', 0, type=float)
return mpld3.fig_to_html(run_example_3(a, r))
@app.route('/_example-4')
def example4():
a = request.args.get('a', 5, type=float)
b = request.args.get('b', 0.2, type=float)
c = request.args.get('c', 10, type=float)
r = request.args.get('r', 0, type=float)
return mpld3.fig_to_html(run_example_4(a, b, c, r))
@app.route('/_example-5')
def example5():
a = request.args.get('a', 5, type=float)
b = request.args.get('b', 0.2, type=float)
c = request.args.get('c', 10, type=float)
x = request.args.get('x', None, type=float)
y = request.args.get('y', None, type=float)
if x == None or y == None:
x = 0
y = 0
return mpld3.fig_to_html(run_example_play(a,b,c,x,y))
@app.before_first_request
def setup():
#startup_calculations()
pass
if __name__ == "__main__":
app.run()