How to update a title from bokehJS

I have prepared an example to explore that feature I am looking to implement:
change a title once the plot has been drawn

Also looking how to activate the wheel_zoom at the initialisation as it is possible with
bokeh/python

active_scroll: “wheel_zoom”,

Please play with:

Controling font_size seems not possible as well.
title.text_font_size = "10px";

Offhand, seems like a bug, since plot.title = "new title" should be all that’s needed. Maybe @mateusz can chime in.

Same for controls on style of title that have no effect.

plot.title.text_font_size = "10px";

Unfortunately neither title nor any of its properties are currently being listened to for changes.

Activate the wheel_zoom by default is crudely missing.
Tested with last 1.4.0.

Tested with last 2.2.0 release.

Any news on this one.
Inspecting the code didn’t help much.

Is there a GitHub issue for this? Anything that is not in the GitHub tracker does not exist, for practical purposes.

Yes but has been closed…

This one also concerns the topic

@PBrockmann the second issue has nothing to do with the question, and it’s unclear that the first does either (the focus of the issue, the reported error, points to a different, usage, problem, which is why it was closed and referred here). Here is what I would suggest

  • Make a new issue
  • With a complete script that explicitly demonstrates the “missing plumbing”
  • Including a link back to this topic

I’m running into the same issue here, with respect to controlling the plot title via BokehJS.
Added #10774 with a link to this thread.

@oviquezr it’s unclear to me that this is the same issue, because this issue is all over the place, and involves quite old versions. Rather than resurrect an old dead thread, please make a brand new topic and absolutely most importantly: include a complete minimal reproducer that illustrates exactly what your are attempting. (The code in your GH issue is not complete, i.e cannot be copy and pasted and run without modifications)

@Bryan Thanks for the follow-up!

After I saw your note on GH, I tried removing the title def from my constructor call entirely, and things worked as expected. I’m guessing I might have had a typo when I tried setting it with title: new Bokeh.Title({text: "some title"}), because that didn’t seem to work quite right for me last night.

My guess is that the issue I was actually running into would be that the Python and JS flavors behave differently, in that JS isn’t casting the figure constructor’s title:"some title" into plot.title.text, but rather replaces the default Title object with the provided string. This might be more of a documentation issue than a source code issue really, since the Minimal Example in the docs uses the approach that seemingly replaces the Title object. I’m transferring a set of Python plots to JS, to make better use of a websocket connection between our data sources and my team’s dashboard; would be happy to contribute to docs and examples once I get things cleaned up and running, if that were desirable to you and the dev team.

1 Like

@oviquezr updated examples/docs would be great to have, please let me know if I can answer any questions about the docs or docs build etc. The BokehJS is definitely a bit lagged behind in level of development including docs, so all help is very appreciated!

Updating plot.title.text and other properties on a Title instance works, however layout is not affected, so changing e.g. text_font_size may produce awkward results. Updating plot.title doesn’t work at all. Both cases should work.