Firstly - NICE!
Yes. The ids are not static. They are generated by bokeh on the fly. I believe I have an issue somewhere about overriding this that would make this kind of thing easier.
For the div id - you can probably get away without this, just wrap your chart in your own div and then you can manually target this to get the current width/height, for your desired width, you can just use the window.width()
But you do need the element id for: https://github.com/Panzki/specs/blob/gh-pages/js/resize.js#L37
To get this you are going to need the new components method - which I recently updated for this exact use case. https://github.com/bokeh/bokeh/blob/0.9.3/bokeh/embed.py#L38
This is what I did in gtimelog-viz. See:
for where I call the components method.
I then have to do a bit more setup in html templates, but I get access to the element id.
There are other ways you could accomplish the same. Try playing with the components method to see what you get back.
Note that if you call the
components method and also
file_html or something like that different element ids will be created.
Sorry there isn’t better documentation on this - it’s a very new feature.
On Wed, Sep 16, 2015 at 12:10 PM, [email protected] wrote:
first I want to thank you for your time, effort and kindness. I already tinkered arround with the js you provided with the goal of resizing my plots to the complet width of the window.
Here I have a little sample page for testing: http://panzki.github.io/specs/test.html
My customized js can be found here: https://github.com/Panzki/specs/blob/gh-pages/js/resize.js
The problem is that the plots are not resized. One guess of mine is that I used a wrong modell id (or other id). I replaced the placeholders for the ids in the template by hand with the ids I found in my html.
I hope this information will help to find a solution.
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/5d0d64b9-4976-45f7-b9aa-bdbec95a18ab%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.