Right, this would entail new development for sure, which is my suggestion for opening a GH discussion. cc also @Philipp_Rudiger who I believe is also interested in more document-level events.
Edit: I guess for completeness I will mention the terrible option, which is that a Python callback for document init is currently available. Presumably that callback could set some random property value just in order to then trigger a CustomJS callback in the client. I don’t think this is an especially good idea.
It seems I don’t have permissions to create a discussion. Can you give me permissions? Otherwise, if you can create the discussion I could comment there.
You are the second person to report this, I’m really at a loss as to what might be going on. There are no settings I can find related to GH disucssions permissions and GH docs explicity state that “anyone with access to the repository” should be able to post. I guess I will have to open a support ticket with GH about it.
I am not sure flexbox does what I am after. I want to keep the current grid layout, with scaling, unless the browser window becomes “vertical”. Or, better said, until a minimum width, for which scaling makes the plots too small, is hit. Like here:
This sounds like a hybrid between flexbox and gridbox, because it is a grid that flexes only after a certain width threshold is hit.
The grid on the app above has a certain layout that follows a certain logic and it makes sense to retain the grid as it is (scaled) until a certain width threshold is hit, below which we accept graceful degradation, i.e., we sacrifice the grid layout for readability because scaling would not longer help.
As there is no progress on the github discussion yet and I understand such things take time to implement properly, could you please share how to use a python callback for document init?
Then how would that call back allow me to pull the window size from the Javascript world? It would maybe toggle state on a hidden Toggle that was connected to a CustomJS callback, that would in turn invoke the call back that sets the layout?
This is not perfect but is much better than before. There are absolutely no performance problems on reflowing the layouts like I am doing here:
If we had a window resize event that could do some work after the user finishes resizing the window the situation would be much improved. Any ideas about that?
Just wanted to leave you a note about the window size versus reflow topic: the method you provided above is proven to work. It enabled much progress on making the Bokeh app more mobile friendly whereas keeping the python code clean and tidy, and not mixed with the HTML.
You will see that there is a funky loading behavior that is caused by the necessity of using the DocumentReady callback hack, instead of having the window size from the beginning. Having the window size at the python side and having access to a window resize event would clean up the situation.
That said, what we are doing now is much better than nothing It makes a big difference for mobile browsing.