Created
August 25, 2019 09:21
-
-
Save dradecic/dc55f1586921c1f4895e7cdd4d38e103 to your computer and use it in GitHub Desktop.
Python-Bokeh - Gist 12: Route final
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/', methods=['GET', 'POST']) | |
def chart(): | |
selected_class = request.form.get('dropdown-select') | |
if selected_class == 0 or selected_class == None: | |
survived_chart, title_chart, hist_age = redraw(1) | |
else: | |
survived_chart, title_chart, hist_age = redraw(selected_class) | |
script_survived_chart, div_survived_chart = components(survived_chart) | |
script_title_chart, div_title_chart = components(title_chart) | |
script_hist_age, div_hist_age = components(hist_age) | |
return render_template( | |
'index.html', | |
div_survived_chart=div_survived_chart, | |
script_survived_chart=script_survived_chart, | |
div_title_chart=div_title_chart, | |
script_title_chart=script_title_chart, | |
div_hist_age=div_hist_age, | |
script_hist_age=script_hist_age, | |
selected_class=selected_class | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment