panel icon indicating copy to clipboard operation
panel copied to clipboard

Create Templates composed solely of Panel components

Open ahuang11 opened this issue 1 year ago • 11 comments

@philippjfr mentioned that the current generation of Panel templates are backed by Jinja2 templates initially because of a limitation in Bokeh where there can't be too many nested shadow roots(?), or else it would lag.

Now, I think this limitation is fixed(?). If so, we can steer away from Jinja2 templates and re-create them using native Panel components, with the benefit that it's usable in notebooks and there's no need to learn a separate template concept. Also, we can experiment with much more variety of templates easily.

The few things that I can think of that are not available are a collapsible sidebar component and ability to swap between light/dark theme.

cc @MarcSkovMadsen

ahuang11 avatar Sep 10 '24 09:09 ahuang11

Related https://github.com/holoviz/panel/issues/7144 https://github.com/holoviz/panel/issues/2677

ahuang11 avatar Sep 10 '24 09:09 ahuang11

That would be awesome! So templates would look the same in a Notebook and in the browser using panel.serve() ?

Coderambling avatar Sep 13 '24 00:09 Coderambling

Yes, but notebook might be more cramped.

ahuang11 avatar Sep 13 '24 09:09 ahuang11

That brings me to my other question: are (some of) the current templates responsive to various screen sizes (including mobile?), and if so, could that be accomodated in Panel-based templates?

Are the current stretch-width, stretch_both etc. properties sufficient to achieve that? I have always found them tricky to work with, but maybe that's just me.

I guess the nice thing here is that Panel templates can be introduced, while initially keeping the current templates intact?

Coderambling avatar Sep 13 '24 14:09 Coderambling

That brings me to my other question: are (some of) the current templates responsive to various screen sizes (including mobile?), and if so, could that be accomodated in Panel-based templates?

No; Panel/Bokeh unfortunately isn't optimized for mobile.

ahuang11 avatar Sep 19 '24 16:09 ahuang11

Yes, that can and should absolutely be accommodated.

philippjfr avatar Sep 19 '24 16:09 philippjfr

Mobile related issues: https://github.com/holoviz/panel/issues/2410 https://github.com/holoviz/panel/issues/2628

Maybe we shouldn't be targeting templates, but rather just Panel layout items.

ahuang11 avatar Sep 19 '24 17:09 ahuang11

Toggle between standard and dark theme should also be supported. Should that be a separate issue? Is it this at the Bokeh level?

Coderambling avatar Sep 25 '24 10:09 Coderambling

Related / could be addressed as part of this project?

Ability to remove header from template.

https://discourse.holoviz.org/t/removing-the-header-bar/2834/5?u=coderambling

Coderambling avatar Sep 26 '24 05:09 Coderambling

This issue has been mentioned on HoloViz Discourse. There might be relevant details there:

https://discourse.holoviz.org/t/how-to-remove-sidebar-and-update-the-webpage-after-template-is-served/8261/8

holovizbot avatar Oct 04 '24 10:10 holovizbot

Does the introduction of the concept of Page in PMUI actually solve / accomodate (some of) the issues and limitations described above?

-No separate template concept needed -Usable in Notebooks -Responsiveness to mobile form factors -More?

https://panel-material-ui.holoviz.org/reference/page/Page.html

Coderambling avatar Jun 04 '25 00:06 Coderambling