Wrapping bokeh.layouts.rows

Is there a way to make row layouts responsive, that is, if I had 6 plots of fixed size and only 3 fit on my screen, how could I make rows wrap to result in a 3x2 plot? (And if only 2 fit on my screen, then it should wrap to 2x3.)

You may want to check out A Complete Guide to Flexbox | CSS-Tricks - CSS-Tricks
I’m not sure whether it’s possible to do it with the existing bokeh.layouts.row because of how the default render function works, but you always can create a custom Row model that would render itself as a plain

and would use flex-wrap.

Eugene

···

On Monday, November 6, 2017 at 8:36:09 PM UTC+7, Jonas Kubilius wrote:

Is there a way to make row layouts responsive, that is, if I had 6 plots of fixed size and only 3 fit on my screen, how could I make rows wrap to result in a 3x2 plot? (And if only 2 fit on my screen, then it should wrap to 2x3.)

Thanks for a quick response, Eugene. Do you know which method in the Row / Model class I should overwrite to get a plain div? Somehow it is not immediately obvious to me. (This seems to be necessary cause at the moment, divs seem to have inline styling which I couldn’t override with custom css, I believe.)

2017 m. lapkritis 6 d., pirmadienis 08:42:20 UTC-5, Eugene Pakhomov rašė:

···

You may want to check out https://css-tricks.com/snippets/css/a-guide-to-flexbox/#article-header-id-4
I’m not sure whether it’s possible to do it with the existing bokeh.layouts.row because of how the default render function works, but you always can create a custom Row model that would render itself as a plain

and would use flex-wrap.

Eugene

On Monday, November 6, 2017 at 8:36:09 PM UTC+7, Jonas Kubilius wrote:

Is there a way to make row layouts responsive, that is, if I had 6 plots of fixed size and only 3 fit on my screen, how could I make rows wrap to result in a 3x2 plot? (And if only 2 fit on my screen, then it should wrap to 2x3.)

I would try overriding “render” of the parent class LayoutDOMView.

···

On Monday, November 6, 2017 at 9:36:56 PM UTC+7, Jonas Kubilius wrote:

Thanks for a quick response, Eugene. Do you know which method in the Row / Model class I should overwrite to get a plain div? Somehow it is not immediately obvious to me. (This seems to be necessary cause at the moment, divs seem to have inline styling which I couldn’t override with custom css, I believe.)

2017 m. lapkritis 6 d., pirmadienis 08:42:20 UTC-5, Eugene Pakhomov rašė:

You may want to check out https://css-tricks.com/snippets/css/a-guide-to-flexbox/#article-header-id-4
I’m not sure whether it’s possible to do it with the existing bokeh.layouts.row because of how the default render function works, but you always can create a custom Row model that would render itself as a plain

and would use flex-wrap.

Eugene

On Monday, November 6, 2017 at 8:36:09 PM UTC+7, Jonas Kubilius wrote:

Is there a way to make row layouts responsive, that is, if I had 6 plots of fixed size and only 3 fit on my screen, how could I make rows wrap to result in a 3x2 plot? (And if only 2 fit on my screen, then it should wrap to 2x3.)