holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.68k stars 509 forks source link

Create Templates composed solely of Panel components #7248

Open ahuang11 opened 2 weeks ago

ahuang11 commented 2 weeks ago

@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 commented 2 weeks ago

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

Coderambling commented 2 weeks ago

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

ahuang11 commented 2 weeks ago

Yes, but notebook might be more cramped.

Coderambling commented 2 weeks ago

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?

ahuang11 commented 1 week ago

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.

philippjfr commented 1 week ago

Yes, that can and should absolutely be accommodated.

ahuang11 commented 1 week ago

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.

Coderambling commented 5 days ago

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

Coderambling commented 4 days ago

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