def chart_form(): #print("chart_form logic") if request.method == 'POST': CountryCode = [ request.form['country-1'], request.form['country-2'], request.form['country-3'] ] indicator1 = request.form['indicator-1'] indicator2 = request.form['indicator-2'] country1 = request.form['country-1'] country2 = request.form['country-2'] country3 = request.form['country-3'] startY = request.form['start-year'] endY = request.form['end-year'] cleanedList = [x for x in CountryCode if str(x) != 'NaN'] if (startY == endY and country1 == 'NaN' and country2 == 'NaN' and country3 == 'NaN' and indicator2 == 'NaN' and indicator1 != 'NaN'): return pyecharts(indicator1, startY, endY) elif (startY == endY and country1 == 'NaN' and country2 == 'NaN' and country3 == 'NaN' and indicator2 != 'NaN' and indicator1 != 'NaN'): return chart3(indicator1, indicator2, startY, endY) elif ((int(endY) - int(startY)) > 5 and indicator1 != 'NaN' and indicator2 == 'NaN' and (country1 != 'NaN' or country2 != 'NaN' or country3 != 'NaN')): return chart2(indicator1, cleanedList, startY, endY) elif (startY <= endY and indicator1 != 'NaN' and indicator2 == 'NaN' and (country1 != 'NaN' or country2 != 'NaN' or country3 != 'NaN')): return chart1(indicator1, cleanedList, startY, endY) elif (startY <= endY and indicator1 != 'NaN' and indicator2 != 'NaN' and country1 != 'NaN'): return chart4(indicator1, indicator2, country1, country2, country3, startY, endY) else: return app.send_static_file('chart_form.html') else: return app.send_static_file('chart_form.html')
def loginPage(): html = '<!DOCTYPE html>\n<html>\n<body>\n' html += '<p>Click the button to open a new browser window.</p>' html += '<button onclick="myFunction()">Try it</button>' html += '<script>' html += 'function myFunction(){' # html += 'window.open("https://www.w3schools.com/jsref/met_win_open.asp");' html += 'var w = window.open("", "MsgWindow", "width=200,height=100");' html += 'w.document.write("<p>This is MsgWindow. I am 200px wide and 100px tall!</p>");' html += '}' html += '</script>' html += '</body></html>' # return html # return jsonify("unter construction") return app.send_static_file('login.html')
def fonts_static_proxy(path): print path return app.send_static_file(os.path.join('fonts', path))
def dist_static_proxy(path): # print os.path.join('css', path) return app.send_static_file(os.path.join('dist', path))
def page_not_found(error): return app.send_static_file('404.html')
def gad_gateway_error(error): return app.send_static_file('502.html')
def showTimestamp(timestamp): return app.send_static_file('indexname.html', content=timestamp)
def basic_pages(**kwargs): return app.send_static_file('index.html')
def default(): return app.send_static_file('js/bundle.js')
def js_static_proxy(path): return app.send_static_file(os.path.join('js', path))
def get_data(): return app.send_static_file("data.json")
def index(): print('main directory!!!') return app.send_static_file('index.html')
def img_static_proxy(path): # send_static_file will guess the correct MIME type return app.send_static_file(os.path.join('img', path))
def partials_static_proxy(path): # send_static_file will guess the correct MIME type return app.send_static_file(os.path.join('partials', path))
def libs_static_proxy(path): # send_static_file will guess the correct MIME type return app.send_static_file(os.path.join('bower_components', path))
def not_found(e): return app.send_static_file("index.html")
def frontend_path_files(filepath, extension): print "match file {0}".format(filepath) from server import app return app.send_static_file(os.path.join("{0}.{1}".format(filepath, extension)))
def bundle(): return app.send_static_file('css/default.css')
def frontend_path_files(filepath, extension): print "match file {0}".format(filepath) from server import app return app.send_static_file( os.path.join("{0}.{1}".format(filepath, extension)))
def index(): return app.send_static_file('index.html')
def api_collection_set_geo(): return app.send_static_file( os.path.join('data', 'country-collections.json'))
def hello_world(): return app.send_static_file('untitled.html')
def send_static_file(filename): return app.send_static_file(filename)
def api_collection_set_geo(): return app.send_static_file(os.path.join('data', 'country-collections.json'))
def hello_world(): return app.send_static_file('index.html')
def serve(): return app.send_static_file("index.html")
def requests_error(error): return app.send_static_file('500.html')
def root1(): return app.send_static_file('index.html')