From 40233974805715f8050d420a8f14ead299e3028a Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Wed, 24 Jan 2024 17:21:31 -0500 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Carson Sievert --- shiny/api-examples/layout_column_wrap/app-express.py | 5 +++-- shiny/api-examples/layout_columns/app-express.py | 3 +-- shiny/api-examples/layout_sidebar/app-express.py | 3 +-- shiny/api-examples/markdown/app-express.py | 2 +- shiny/api-examples/page_sidebar/app-express.py | 3 +-- shiny/api-examples/sidebar/app-express.py | 3 +-- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/shiny/api-examples/layout_column_wrap/app-express.py b/shiny/api-examples/layout_column_wrap/app-express.py index a5731350d..0754d8b74 100644 --- a/shiny/api-examples/layout_column_wrap/app-express.py +++ b/shiny/api-examples/layout_column_wrap/app-express.py @@ -1,7 +1,8 @@ -import shiny from shiny.express import ui -a_card = shiny.ui.card("A simple card") +with ui.hold() as a_card: + with ui.card(): + "A simple card" # Always has 2 columns (on non-mobile) with ui.layout_column_wrap(width=1 / 2): diff --git a/shiny/api-examples/layout_columns/app-express.py b/shiny/api-examples/layout_columns/app-express.py index 1362b01eb..593ba321d 100644 --- a/shiny/api-examples/layout_columns/app-express.py +++ b/shiny/api-examples/layout_columns/app-express.py @@ -1,7 +1,6 @@ from model_plots import * # model plots and cards -from shiny import render -from shiny.express import input, ui +from shiny.express import input, render, ui ui.page_opts(title="Model Dashboard") diff --git a/shiny/api-examples/layout_sidebar/app-express.py b/shiny/api-examples/layout_sidebar/app-express.py index 93e80442f..10482a396 100644 --- a/shiny/api-examples/layout_sidebar/app-express.py +++ b/shiny/api-examples/layout_sidebar/app-express.py @@ -1,8 +1,7 @@ import matplotlib.pyplot as plt import numpy as np -from shiny import render -from shiny.express import input, ui +from shiny.express import input, render, ui with ui.layout_sidebar(): with ui.sidebar(): diff --git a/shiny/api-examples/markdown/app-express.py b/shiny/api-examples/markdown/app-express.py index 11cb38c87..f1db29501 100644 --- a/shiny/api-examples/markdown/app-express.py +++ b/shiny/api-examples/markdown/app-express.py @@ -1,4 +1,4 @@ -from shiny.express import input, ui +from shiny.express import ui ui.markdown( """ diff --git a/shiny/api-examples/page_sidebar/app-express.py b/shiny/api-examples/page_sidebar/app-express.py index 54696d6fd..1b0beab3d 100644 --- a/shiny/api-examples/page_sidebar/app-express.py +++ b/shiny/api-examples/page_sidebar/app-express.py @@ -1,8 +1,7 @@ import matplotlib.pyplot as plt import numpy as np -from shiny import render -from shiny.express import input, ui +from shiny.express import input, render, ui ui.page_opts(page_fn=page_fixed) diff --git a/shiny/api-examples/sidebar/app-express.py b/shiny/api-examples/sidebar/app-express.py index 16665fd13..17e80bb47 100644 --- a/shiny/api-examples/sidebar/app-express.py +++ b/shiny/api-examples/sidebar/app-express.py @@ -1,5 +1,4 @@ -from shiny import render -from shiny.express import input, ui +from shiny.express import input, render, ui ui.page_opts(fillable=True)