I wonder if it is possible to combine panels’ template with tabs. I.e. how to include tabs definitions in template and how to control them? Say there is a simple panel:
tmpl = pn.Template(template)
tmpl.add_variable('app_title_1', '<h1>App with first plot</h1>')
tmpl.add_variable('app_title_2', '<h2>App with second plot</h2>')
tmpl.add_panel('A', hv.Curve([1, 2, 3]))
tmpl.add_panel('B', hv.Curve([4, 5, 6]))
tmpl.servable();
What I want is to place curve of panel B in a new tab. Following solution will not work. What is the right one?
Unfortunately Templates cannot be nested inside other Panel components. They declare the overall layout of the different components on a website as HTML and you can’t nest multiple HTML documents. I’ve been working on a Panel component which can be inserted inside other components but it will work a little differently. You can monitor the progress here: https://github.com/holoviz/panel/pull/1343
Woow, that would be sooo Great, you’re doing a good job !!! Actually I found it tricky to insert, delate or simply change the panel objects dynamically, without having to change each time the structure of my template.
BUT PLEASE NOTE that if you don’t need to change the type of Pane from for example Markdown to HoloViews then it is more performant to replace the .object of the Pane. So do this if you can.