From a63cbf3b1cfa967226422c8b2f5a94db308a8d83 Mon Sep 17 00:00:00 2001 From: rashmisankepally Date: Wed, 27 Nov 2019 23:04:02 -0500 Subject: [PATCH] Fixed some errors. Now getting secret key errors. --- src/server.py | 2 +- src/static/IRViz.js | 17 +++++++++++++++++ src/templates/viz.html | 12 +++++------- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/server.py b/src/server.py index 4d55c30..d744713 100644 --- a/src/server.py +++ b/src/server.py @@ -130,7 +130,7 @@ def experiment(experiment_id): return r.get(experiment_id+'_statistics').decode('utf-8') -@app.route('/') +@app.route('/', methods=['GET', 'POST']) def hello(): return render_template('viz.html') diff --git a/src/static/IRViz.js b/src/static/IRViz.js index ee922bb..cea68b5 100644 --- a/src/static/IRViz.js +++ b/src/static/IRViz.js @@ -8,9 +8,26 @@ var graphDiv = document.getElementById('tester'), data = [{x: [], y:[]}], layout = {}; +var egDiv = document.getElementById('topslider'); Plotly.newPlot(graphDiv, data, layout); + +$.ajax({ +type: "POST", +url: "upload", +contentType: "application/json", +data: JSON.stringify([data]), +dataType: "json", +success: function (response) { +console.log(Date.now()); +console.log(data) +}, +error: function (error) { +console.log(error); +} +}); + /* $.get("/data", function(data){ console.log(data) diff --git a/src/templates/viz.html b/src/templates/viz.html index 88d5fbb..ff0672e 100644 --- a/src/templates/viz.html +++ b/src/templates/viz.html @@ -8,14 +8,12 @@ - -
abc
- +
- +