Version/Environment :
5.x
Issue:
Panel is a dashboard platform similar to Dash or Shiny. However, there is no Domino documentation specific to Panel for App deployment
Resolution:
Panel has an example provided in their documentation that you can use to start your app. In this case, we are using the Editor version of developing the Panel App:
https://panel.holoviz.org/how_to/editor/editor.html
First, you will need to create an environment that will install the necessary packages for you to use Panel. In this example, I've installed the most basic packages required to run Panel on this image: quay.io/domino/compute-environment-images:ubuntu20-py3.9-r4.2-domino5.5-standard
USER root
RUN pip install panel hvplot
Set it to the default environment for your project by going to your Project > Settings > Hardware & Environment > Compute environment. Click on the environment that you have built with Panel:
You will need to create an app.py inside of your project. This is an example that I used for my app:
import panel as pn import hvplot.pandas from bokeh.sampledata.autompg import autompg columns = list(autompg.columns[:-2]) x = pn.widgets.Select(value='mpg', options=columns, name='x') y = pn.widgets.Select(value='hp', options=columns, name='y') color = pn.widgets.ColorPicker(name='Color', value='#AA0505') pn.Row( pn.Column('## MPG Explorer', x, y, color), pn.bind(autompg.hvplot.scatter, x, y, c=color) ).servable()
An app.sh file needs to be created as well. Put in the following line to start the app:
panel serve app.py --show --autoreload --port 8888 --address 0.0.0.0 --allow-websocket-origin *:80
Click App to publish the app with your preferred Title, Description, and hardware tier. Once the app is running, you should see the following image or something similar below:
Comments
0 comments
Please sign in to leave a comment.