Responsive layout with reflow for screen rotations?

There’s not any especially clean way I can think of. Did someone suggest otherwise? Maybe something like:

  • Python DocumentReady sets some property value just to trigger a CustomJS
  • JavaScript CustomJS reads window size and sets as a property value on some other object
  • Python property change callback uses window size
1 Like

Hi @Bryan

I am perfectly aware that no solution is ideal :slight_smile: Just want to check if I was thinking right and from your answer it seems so.

I will test and let you know how it went.

Thanks again.

1 Like

Hello,

So here is the progress on this matter:

Click here using your phone:

https://coviz.io/

and compare to the result on a desktop.

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?

Thanks for great support.

That seems reasonably self-contained so I’d suggest a GitHub Issue.

1 Like

Thanks. Here is the issue:

1 Like

Hi @Bryan ,

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.

We are experimenting with a PWA:

https://coviz.io/pwa/

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 :slight_smile: It makes a big difference for mobile browsing.

Thanks for the support :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.