-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tutorial Request] Flask Bootstrap + Multiple Bokeh plots #141
Comments
hey @ethen8181, yea of course I love getting requests on here. I'm looking forward to doing more Bokeh tutorials but kinda waiting for the 1.0 release because so much of the API is changing and a lot of the code will have to be rewritten. Even the 0.12.5 to 0.12.6 release deprecated something I wrote in the Flask tutorial. What would you like to see as far as Flask+Flask_bootstrap posts? Setting up and using it? Good practices for using a bootstrap-type library? |
Good to know! I am looking for a how to embed multiple Bokeh plots in Flask (using flask_bootstrap) post, not so much on the how to set up flask or use flask_bootstrap. I had a go at it by modifying your tutorial, and managed to get 1 Bokeh plot on there, but failed to get multiple bokeh plots to work. So thought you might had experience doing related things. |
hmm I don't have time to check this out myself right now but did you double the line |
Yeah, so I tried the following: # p1 is a single plot, and this renders fine
plot_script, plot_div = components(p1)
# but when I tried to add multiple plots it just gives me a blank screen
# 1. gridplot doesn't work
# https://bokeh.pydata.org/en/latest/docs/user_guide/layout.html#grids-layout-for-plots
grid = gridplot([[p1, p2], [p3, p4]])
plot_script, plot_div = components(grid)
# 2. passing multiple plots to components also didn't work
# https://bokeh.pydata.org/en/latest/docs/user_guide/embed.html#components
plot_script, plot_div = components((p1, p2, p3, p4))
# 3. looping through components and then embedding all individual script and div
plot_divs = []
plot_scripts = []
for p in (p1, p2, p3, p4):
plot_script, plot_div = components(p)
plot_divs.append(plot_div)
plot_scripts.append(plot_script) The problem is there's no error message, it's just no plots would show up ... |
unfortunately I looked through my Bokeh projects and haven't had to put multiple plots on a single page so I haven't had this issue. if I have time I'd love to give it a try but for a faster response it's worth dropping a note to the Bokeh devs (https://github.com/bokeh/bokeh) with your attempts and the lack of documentation around what seems like it would be a straightforward bit to code |
Gotcha, thanks ~~ |
Hello,
Hello Matt, |
sorry @martinh85, I have not had time to look into it further. Bokeh has evolved a lot since I wrote this post so at some point I'll need to completely refactor what's in it to keep it up to date |
thanks anyway Matt |
Hi, Matt. Not sure if a tutorial request is allowed here. First of all, thanks for creating the Responsive Bar Charts with Bokeh, Flask and Python 3 tutorial, it was really insightful! I was wondering if you're planning to do a flask + flask_bootstrap and multiple bokeh plots tutorial ~ this is something that I would love to see ~~
The text was updated successfully, but these errors were encountered: