Giter Club home page Giter Club logo

Comments (9)

mattmakai avatar mattmakai commented on August 10, 2024

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?

from fullstackpython.com.

ethen8181 avatar ethen8181 commented on August 10, 2024

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.

from fullstackpython.com.

mattmakai avatar mattmakai commented on August 10, 2024

hmm I don't have time to check this out myself right now but did you double the line script, div = components(plot) so it was separated into unique variables for the script and div for 2 separate plots? did it just not display or give a certain error message?

from fullstackpython.com.

ethen8181 avatar ethen8181 commented on August 10, 2024

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 ...

from fullstackpython.com.

mattmakai avatar mattmakai commented on August 10, 2024

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

from fullstackpython.com.

ethen8181 avatar ethen8181 commented on August 10, 2024

Gotcha, thanks ~~

from fullstackpython.com.

martinh85 avatar martinh85 commented on August 10, 2024

Hello,

hmm I don't have time to check this out myself right now but did you double the line script, div = components(plot) so it was separated into unique variables for the script and div for 2 separate plots? did it just not display or give a certain error message?

Hello Matt,
have you found the solution how to handle multiple plots on same page?
https://stackoverflow.com/questions/54734169/bokeh-django-embedding-more-independent-plots-via-components

from fullstackpython.com.

mattmakai avatar mattmakai commented on August 10, 2024

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

from fullstackpython.com.

martinh85 avatar martinh85 commented on August 10, 2024

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

from fullstackpython.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.