question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bring back the functionality needed to embed separate Bokeh roots within React

See original GitHub issue

BokehJS 0.12.16 has embed/add_model_from_session function that can be used to embed an arbitrary root anywhere. In particular, I use it to embed separate components of the same document in different parts of a React application.

Commit 3eaa05a6fcef60abc7680d8b4465da0032750a35 removed this function, and I don’t think that right now there’s a way to embed separate roots without embedding the whole document at once.

Note that this comment may also be relevant: https://github.com/bokeh/bokeh/pull/7708#discussion_r235605875

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
rsdenijscommented, Jun 30, 2021

Just want to concur that the ability to dynamically embed new roots them at arbitrary locations on the page would be very helpful. It would allow the user to use bit and pieces of Bokeh in a non-bokeh layout. If there is a workaround for this I would love to know!

3reactions
bryevdvcommented, Dec 13, 2018

Ok I think adding a JS API to perform the same function as the template embedding (only explicitly and selectively, instead of automatically) is reasonably actionable. In fact it’s possible that such an API or something close already exists and we simply need to expose or document it better.

This is predicated on caring primarily about being able to control when/where individual roots are injected, but being insensitive to when/how the document is loaded (i.e. it should not be of explicit concern to users to control) Basically, sessions and documents should always be considered together (a session is simply the communication to support ongoing synchronizing an entire document)

I’ll try to write a small self-contained example that works on 0.12.16 sometime soon.

This is useful but I am also after a mockup/proposal of what would ideally liked to be had, that could evolve into an integration test

cc @mattpap

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proper integration between bokeh and react/create react app
Many apps out there are written in react, and it seems like it would ... Bring back the functionality needed to embed separate...
Read more >
Embedding bokeh chart in reactjs frontend - Stack Overflow
In my opinion the easiest way is to use BokehJS on your frontend and Bokeh.embed.json_item on your backend . The typical process would...
Read more >
Embedding Bokeh into a ReactJS app using BokehJS
Generate a Bokeh plot in python as you normally would. · Pass the resulting Bokeh plot object to the json_item function call, which...
Read more >
Python and Bokeh: Part II. The beginner's guide to creating…
In second part of our tutorial series on Bokeh visualization library we explore Bokeh applications and how to serve them using Bokeh server....
Read more >
Integrating Bokeh Visualizations in Django Application
For that, we will be importing components from bokeh.embed which returns the individual components. The function bokeh.embed.components() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found