graphPaname/app/routes.py

28 lines
691 B
Python
Raw Normal View History

2020-06-12 20:03:25 +02:00
from flask import render_template
from app import app
2020-06-12 22:49:49 +02:00
from app.forms import DatasetForm
2020-06-13 20:57:21 +02:00
from app.processing import process_data
2020-06-12 20:03:25 +02:00
@app.route("/")
@app.route("/index")
def index():
return render_template("index.html", title="Home Page")
@app.route("/data")
def data():
2020-06-12 22:49:49 +02:00
form = DatasetForm()
if form.validate_on_submit():
return render_template("visualization.html", form=form, title="Visualization")
return render_template("data.html", title="Data", form=form)
@app.route("/visualization")
2020-06-13 20:57:21 +02:00
def visualization(form):
plot, map = process_data(form.dataset)
return render_template(
"visualization.html", title="Visualization", plot=plot, map=map
)