-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
30 lines (20 loc) · 729 Bytes
/
app.py
File metadata and controls
30 lines (20 loc) · 729 Bytes
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
# -*- coding: utf-8 -*-
# Create an application with Python and Flask to create and update data
# Juana Valeria Hurtado Rincon 2017
# jvhurtador@gmail.com
from flask import Flask, jsonify, render_template, request
import numpy as np
import base64
app = Flask(__name__)
@app.route('/_update')
def update():
# Edit here the data you want to plot and update
linesData = np.random.rand(10,2).tolist()
barData = list(np.random.rand(1,2)[0])
radarData = list(np.random.rand(1,8)[0])
return jsonify(linesData=linesData, barData=barData, radarData=radarData)
@app.route('/')
def index():
return render_template('index.html')
if __name__ == '__main__':
app.run()