Multi Layer App in Panel

Hello Panel Community!
I discovered Panel this week, and found It quite useful, I want to know the different way to build a multi-layer App using Panel, and if there is any custom templates to use for beginners.

1 Like

Hi @Ouma

Welcome to the community.

If by multi-layer App you mean an app with multiple sub-apps. Then the most straightforward approach is

  1. Use panel serve to serve multiple files at multiple endpoints. See Launching a server on the commandline in https://panel.holoviz.org/user_guide/Deploy_and_Export.html
  2. Use panel.serve to serve multiple panels at multiple endpoints
  3. Create an app where you can select a new sub-app in a dropdown menu or by clicking a button. Change to the new sub-app by replacing the content of a panel.Column with the new sub-app. This is basically the principle behind awesome-panel.org. You might be able to reuse the code but it would probably not be a plug and play experience :slight_smile: https://github.com/marcskovmadsen/awesome-panel.
2 Likes

hi OUMA @Ouma

There is some example code for you :slight_smile:
method2:
botton = pn.widgets.Button(name = ‘go to next py file’)
botton.js_on_click(code=“window.location=‘next py file’”)
method 3:
button1 = pn.widgets.Button(name=‘button1’)
w1 = pn.widgets.TextInput(name=‘Text:’)
button2 = pn.widgets.Button(name=‘button2’)
w2 = pn.widgets.FloatSlider(name=‘Slider’)
column = pn.Column(button1, w1)
def click1(event):
column.clear()
column.append(button2)
column.append(w2)
def click2(event):
column.clear()
column.append(button1)
column.append(w1)
button1.on_click(click1)
button2.on_click(click2)
column

Hope this will help you.
Kind regards
Victor