Viola apps
Environment requirements
Your conda environment (used in JHub Apps Launcher's App creation form) must have the following packages for successful app deployment:
jhsingle-native-proxy
>= 0.8.2voila
>= 0.5.6- Other libraries used in the app
note
In some cases, you may need ipywidgets
Example application
To deploy the Voila Basic Example using JHub Apps, you can use the following code and environment:
Code (Jupyter Notebook)
In a Jupyter Notebook, copy the following lines of code into a cell.
voila-basic-slider.ipynb
import ipywidgets as widgets
slider = widgets.FloatSlider(description='x')
text = widgets.FloatText(disabled=True, description='x^2')
def compute(*ignore):
text.value = str(slider.value ** 2)
slider.observe(compute, 'value')
slider.value = 4
widgets.VBox([slider, text])
You will see a basic slider app as shown in this screenshot:
Environment specification
Use the following spec to create a conda environment wherever JHub Apps is deployed. If using Nebari, use this spec to create an environment with conda-store.
channels:
- conda-forge
dependencies:
- ipywidgets
- jhsingle-native-proxy>=0.8.2
- pandas
- python
- pip
- pip:
- voila==0.5.6
- ipykernel
note
When viola (>=0.5.6) is available on Conda Forge, it can be moved outside of the pip section of the dependencies