Skip to content

Commit

Permalink
Fix Shiny WebApp (#1127)
Browse files Browse the repository at this point in the history
* Use requirements.txt.in

* Include webapp/color_and_brightness.py

* Fix Shiny WebApp

* Install shinylive in CI
  • Loading branch information
basnijholt authored Dec 5, 2024
1 parent 4739863 commit 8fb9493
Show file tree
Hide file tree
Showing 6 changed files with 535 additions and 89 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy-webapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:

- name: Install Dependencies
run: |
pip install -r webapp/requirements-locked.txt
pip install -r webapp/requirements.txt
pip install shinylive
- name: Build the WebAssembly app
run: |
Expand Down
14 changes: 6 additions & 8 deletions webapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,9 @@ def plot_color_temp(inputs: dict[str, Any], sleep_mode: bool) -> plt.Figure:

# Shiny UI
app_ui = ui.page_fluid(
shinyswatch.theme.sandstone(),
ui.panel_title("🌞 Adaptive Lighting Simulator WebApp 🌛"),
ui.layout_sidebar(
ui.panel_sidebar(
ui.sidebar(
ui.input_switch("adapt_until_sleep", "adapt_until_sleep", value=False),
ui.input_switch("sleep_mode", "sleep_mode", value=False),
ui.input_slider("min_brightness", "min_brightness", 1, 100, 30, post="%"),
Expand Down Expand Up @@ -277,13 +276,12 @@ def plot_color_temp(inputs: dict[str, Any], sleep_mode: bool) -> plt.Figure:
post=" hr",
),
),
ui.panel_main(
ui.markdown(desc_top),
ui.output_plot(id="brightness_plot"),
ui.output_plot(id="color_temp_plot"),
ui.markdown(desc_bottom),
),
ui.markdown(desc_top),
ui.output_plot(id="brightness_plot"),
ui.output_plot(id="color_temp_plot"),
ui.markdown(desc_bottom),
),
theme=shinyswatch.theme.sandstone,
)


Expand Down
Loading

0 comments on commit 8fb9493

Please sign in to comment.