From f2f9a8a68f04f2eb3207bd6d3c0862e3691bf713 Mon Sep 17 00:00:00 2001 From: Karan Gathani Date: Wed, 31 Jul 2024 15:44:24 +0530 Subject: [PATCH 1/3] Add server function to navset docs --- shiny/api-examples/nav_menu/app-core.py | 11 ++- shiny/api-examples/nav_menu/app-express.py | 11 ++- shiny/api-examples/nav_panel/app-basic.py | 16 ---- shiny/api-examples/nav_panel/app-core.py | 81 ++++--------------- shiny/api-examples/nav_panel/app-express.py | 11 --- shiny/api-examples/nav_spacer/app-core.py | 12 ++- shiny/api-examples/nav_spacer/app-express.py | 10 ++- shiny/api-examples/navset_bar/app-core.py | 12 ++- shiny/api-examples/navset_bar/app-express.py | 10 ++- .../api-examples/navset_card_pill/app-core.py | 12 ++- .../navset_card_pill/app-express.py | 10 ++- .../api-examples/navset_card_tab/app-core.py | 12 ++- .../navset_card_tab/app-express.py | 10 ++- .../navset_card_underline/app-core.py | 12 ++- .../navset_card_underline/app-express.py | 10 ++- shiny/api-examples/navset_pill/app-core.py | 12 ++- shiny/api-examples/navset_pill/app-express.py | 10 ++- .../api-examples/navset_pill_list/app-core.py | 12 ++- .../navset_pill_list/app-express.py | 10 ++- shiny/api-examples/navset_tab/app-core.py | 12 ++- shiny/api-examples/navset_tab/app-express.py | 10 ++- .../api-examples/navset_underline/app-core.py | 12 ++- .../navset_underline/app-express.py | 10 ++- 23 files changed, 176 insertions(+), 152 deletions(-) delete mode 100644 shiny/api-examples/nav_panel/app-basic.py diff --git a/shiny/api-examples/nav_menu/app-core.py b/shiny/api-examples/nav_menu/app-core.py index 3b96625e7..aa4f81219 100644 --- a/shiny/api-examples/nav_menu/app-core.py +++ b/shiny/api-examples/nav_menu/app-core.py @@ -1,4 +1,4 @@ -from shiny import App, ui +from shiny import App, render, ui app_ui = ui.page_fluid( ui.navset_card_pill( @@ -8,13 +8,18 @@ ui.nav_panel("B", "Panel B content"), ui.nav_panel("C", "Panel C content"), ), - id="card_pill", + id="selected_card_pill", ), + ui.h5("Selected:"), + ui.output_code("debug"), + # TODO-karan: Add server function to display the selected tab content for remaining navsets. ) def server(input, output, session): - pass + @render.code + def debug(): + return input.selected_card_pill() app = App(app_ui, server) diff --git a/shiny/api-examples/nav_menu/app-express.py b/shiny/api-examples/nav_menu/app-express.py index 50d70e552..f8ce42feb 100644 --- a/shiny/api-examples/nav_menu/app-express.py +++ b/shiny/api-examples/nav_menu/app-express.py @@ -1,6 +1,6 @@ -from shiny.express import ui +from shiny.express import input, render, ui -with ui.navset_card_pill(id="card_pill"): +with ui.navset_card_pill(id="selected_card_pill"): with ui.nav_menu("Nav Menu items"): with ui.nav_panel("A"): "Page A content" @@ -8,3 +8,10 @@ "Page B content" with ui.nav_panel("C"): "Page C content" +ui.h5("Selected:") +# TODO-karan: Add server function to display the selected tab content for remaining navsets. + + +@render.code +def _(): + return input.selected_card_pill() diff --git a/shiny/api-examples/nav_panel/app-basic.py b/shiny/api-examples/nav_panel/app-basic.py deleted file mode 100644 index bc5b797c2..000000000 --- a/shiny/api-examples/nav_panel/app-basic.py +++ /dev/null @@ -1,16 +0,0 @@ -from shiny import App, Inputs, ui - -app_ui = ui.page_fixed( - ui.panel_title("Basic Nav Example"), - ui.navset_tab( - ui.nav_panel("One", "First tab content."), - ui.nav_panel("Two", "Second tab content."), - ), -) - - -def server(input: Inputs): - pass - - -app = App(app_ui, server) diff --git a/shiny/api-examples/nav_panel/app-core.py b/shiny/api-examples/nav_panel/app-core.py index db7650f65..00f9a9768 100644 --- a/shiny/api-examples/nav_panel/app-core.py +++ b/shiny/api-examples/nav_panel/app-core.py @@ -1,74 +1,23 @@ -from typing import List - -from shiny import App, Inputs, Outputs, Session, reactive, ui -from shiny.types import NavSetArg - - -def nav_controls(prefix: str) -> List[NavSetArg]: - return [ - ui.nav_panel("a", prefix + ": tab a content"), - ui.nav_panel("b", prefix + ": tab b content"), - ui.nav_panel("c", prefix + ": tab c content"), - ui.nav_spacer(), - ui.nav_menu( - "Links", - ui.nav_control( - ui.a( - "Shiny", - href="https://shiny.posit.co/py/", - target="_blank", - ) - ), - "----", - "Plain text", - "----", - ui.nav_control( - ui.a( - "Posit", - href="https://posit.co", - target="_blank", - ) +from shiny import App, Inputs, ui + +app_ui = ui.page_fluid( + ui.navset_bar( + ui.nav_panel("Page 1", "Page 1 content"), + ui.nav_panel( + "Page 2", + ui.navset_card_underline( + ui.nav_panel("Tab 1", "Tab 1 content"), + ui.nav_panel("Tab 2", "Tab 2 content"), + ui.nav_panel("Tab 3", "Tab 3 content"), ), - align="right", - ), - ] - - -app_ui = ui.page_navbar( - *nav_controls("page_navbar"), - title="page_navbar()", - id="navbar_id", - footer=ui.div( - {"style": "width:80%;margin: 0 auto"}, - ui.tags.style( - """ - h4 { - margin-top: 3em; - } - """ ), - ui.h4("navset_tab()"), - ui.navset_tab(*nav_controls("navset_tab()")), - ui.h4("navset_pill()"), - ui.navset_pill(*nav_controls("navset_pill()")), - ui.h4("navset_underline()"), - ui.navset_underline(*nav_controls("navset_underline()")), - ui.h4("navset_card_tab()"), - ui.navset_card_tab(*nav_controls("navset_card_tab()")), - ui.h4("navset_card_pill()"), - ui.navset_card_pill(*nav_controls("navset_card_pill()")), - ui.h4("navset_card_underline()"), - ui.navset_card_underline(*nav_controls("navset_card_underline()")), - ui.h4("navset_pill_list()"), - ui.navset_pill_list(*nav_controls("navset_pill_list()")), - ) + title="Nav Panel Example", + ), ) -def server(input: Inputs, output: Outputs, session: Session): - @reactive.effect - def _(): - print("Current navbar page: ", input.navbar_id()) +def server(input: Inputs): + pass app = App(app_ui, server) diff --git a/shiny/api-examples/nav_panel/app-express.py b/shiny/api-examples/nav_panel/app-express.py index a5d57a81b..fcb4016fa 100644 --- a/shiny/api-examples/nav_panel/app-express.py +++ b/shiny/api-examples/nav_panel/app-express.py @@ -13,14 +13,3 @@ "Tab 2 content" with ui.nav_panel("Tab 3"): "Tab 3 content" - -ui.nav_spacer() - -with ui.nav_menu("Links", align="right"): - with ui.nav_control(): - ui.a("Shiny", href="https://shiny.posit.co/py/", target="_blank") - "----" - "Plain text" - "----" - with ui.nav_control(): - ui.a("Posit", href="https://posit.co", target="_blank") diff --git a/shiny/api-examples/nav_spacer/app-core.py b/shiny/api-examples/nav_spacer/app-core.py index fb53616be..9cb6b4db5 100644 --- a/shiny/api-examples/nav_spacer/app-core.py +++ b/shiny/api-examples/nav_spacer/app-core.py @@ -1,4 +1,4 @@ -from shiny import App, ui +from shiny import App, render, ui app_ui = ui.page_fluid( ui.navset_underline( @@ -6,13 +6,17 @@ ui.nav_spacer(), ui.nav_panel("B", "Panel B content"), ui.nav_panel("C", "Panel C content"), - id="navset_underline", - ) + id="selected_navset_underline", + ), + ui.h5("Selected:"), + ui.output_code("debug"), ) def server(input, output, session): - pass + @render.code + def debug(): + return input.selected_navset_underline() app = App(app_ui, server) diff --git a/shiny/api-examples/nav_spacer/app-express.py b/shiny/api-examples/nav_spacer/app-express.py index 555697a77..dd9b2e806 100644 --- a/shiny/api-examples/nav_spacer/app-express.py +++ b/shiny/api-examples/nav_spacer/app-express.py @@ -1,6 +1,6 @@ -from shiny.express import ui +from shiny.express import input, render, ui -with ui.navset_underline(): +with ui.navset_underline(id="selected_navset_underline"): with ui.nav_panel("Tab 1"): "Tab 1 content" ui.nav_spacer() @@ -8,3 +8,9 @@ "Tab 2 content" with ui.nav_panel("Tab 3"): "Tab 3 content" +ui.h5("Selected:") + + +@render.code +def _(): + return input.selected_navset_underline() diff --git a/shiny/api-examples/navset_bar/app-core.py b/shiny/api-examples/navset_bar/app-core.py index fbfd47e75..eaba1834b 100644 --- a/shiny/api-examples/navset_bar/app-core.py +++ b/shiny/api-examples/navset_bar/app-core.py @@ -1,4 +1,4 @@ -from shiny import App, ui +from shiny import App, render, ui app_ui = ui.page_fluid( ui.navset_bar( @@ -14,14 +14,18 @@ ui.a("Shiny", href="https://shiny.posit.co", target="_blank") ), ), - id="tab", + id="selected_navset_bar", title="Navset Bar", - ) + ), + ui.h5("Selected:"), + ui.output_code("debug"), ) def server(input, output, session): - pass + @render.code + def debug(): + return input.selected_navset_bar() app = App(app_ui, server) diff --git a/shiny/api-examples/navset_bar/app-express.py b/shiny/api-examples/navset_bar/app-express.py index 8ca935e0e..8e42d5e6e 100644 --- a/shiny/api-examples/navset_bar/app-express.py +++ b/shiny/api-examples/navset_bar/app-express.py @@ -1,6 +1,6 @@ -from shiny.express import ui +from shiny.express import input, render, ui -with ui.navset_bar(title="Navset Bar", id="tab"): +with ui.navset_bar(title="Navset Bar", id="selected_navset_bar"): with ui.nav_panel("A"): "Panel A content" @@ -18,3 +18,9 @@ "Description:" with ui.nav_control(): ui.a("Shiny", href="https://shiny.posit.co", target="_blank") +ui.h5("Selected:") + + +@render.code +def _(): + return input.selected_navset_bar() diff --git a/shiny/api-examples/navset_card_pill/app-core.py b/shiny/api-examples/navset_card_pill/app-core.py index b88bb0197..41d881730 100644 --- a/shiny/api-examples/navset_card_pill/app-core.py +++ b/shiny/api-examples/navset_card_pill/app-core.py @@ -1,4 +1,4 @@ -from shiny import App, ui +from shiny import App, render, ui app_ui = ui.page_fluid( ui.navset_card_pill( @@ -14,13 +14,17 @@ ui.a("Shiny", href="https://shiny.posit.co", target="_blank") ), ), - id="tab", - ) + id="selected_navset_card_pill", + ), + ui.h5("Selected:"), + ui.output_code("debug"), ) def server(input, output, session): - pass + @render.code + def debug(): + return input.selected_navset_card_pill() app = App(app_ui, server) diff --git a/shiny/api-examples/navset_card_pill/app-express.py b/shiny/api-examples/navset_card_pill/app-express.py index d934b5cbe..cf6354d76 100644 --- a/shiny/api-examples/navset_card_pill/app-express.py +++ b/shiny/api-examples/navset_card_pill/app-express.py @@ -1,6 +1,6 @@ -from shiny.express import ui +from shiny.express import input, render, ui -with ui.navset_card_pill(id="tab"): +with ui.navset_card_pill(id="selected_navset_card_pill"): with ui.nav_panel("A"): "Panel A content" @@ -18,3 +18,9 @@ "Description:" with ui.nav_control(): ui.a("Shiny", href="https://shiny.posit.co", target="_blank") +ui.h5("Selected:") + + +@render.code +def _(): + return input.selected_navset_card_pill() diff --git a/shiny/api-examples/navset_card_tab/app-core.py b/shiny/api-examples/navset_card_tab/app-core.py index d314ddb35..c7f974dbf 100644 --- a/shiny/api-examples/navset_card_tab/app-core.py +++ b/shiny/api-examples/navset_card_tab/app-core.py @@ -1,4 +1,4 @@ -from shiny import App, ui +from shiny import App, render, ui app_ui = ui.page_fluid( ui.navset_card_tab( @@ -14,13 +14,17 @@ ui.a("Shiny", href="https://shiny.posit.co", target="_blank") ), ), - id="tab", - ) + id="selected_navset_card_tab", + ), + ui.h5("Selected:"), + ui.output_code("debug"), ) def server(input, output, session): - pass + @render.code + def debug(): + return input.selected_navset_card_tab() app = App(app_ui, server) diff --git a/shiny/api-examples/navset_card_tab/app-express.py b/shiny/api-examples/navset_card_tab/app-express.py index 97c3f0570..09fb15fb9 100644 --- a/shiny/api-examples/navset_card_tab/app-express.py +++ b/shiny/api-examples/navset_card_tab/app-express.py @@ -1,6 +1,6 @@ -from shiny.express import ui +from shiny.express import input, render, ui -with ui.navset_card_tab(id="tab"): +with ui.navset_card_tab(id="selected_navset_card_tab"): with ui.nav_panel("A"): "Panel A content" @@ -18,3 +18,9 @@ "Description:" with ui.nav_control(): ui.a("Shiny", href="https://shiny.posit.co", target="_blank") +ui.h5("Selected:") + + +@render.code +def _(): + return input.selected_navset_card_tab() diff --git a/shiny/api-examples/navset_card_underline/app-core.py b/shiny/api-examples/navset_card_underline/app-core.py index 40996cb64..3c3be4ba7 100644 --- a/shiny/api-examples/navset_card_underline/app-core.py +++ b/shiny/api-examples/navset_card_underline/app-core.py @@ -1,4 +1,4 @@ -from shiny import App, ui +from shiny import App, render, ui app_ui = ui.page_fluid( ui.navset_card_underline( @@ -14,13 +14,17 @@ ui.a("Shiny", href="https://shiny.posit.co", target="_blank") ), ), - id="tab", - ) + id="selected_navset_card_underline", + ), + ui.h5("Selected:"), + ui.output_code("debug"), ) def server(input, output, session): - pass + @render.code + def debug(): + return input.selected_navset_card_underline() app = App(app_ui, server) diff --git a/shiny/api-examples/navset_card_underline/app-express.py b/shiny/api-examples/navset_card_underline/app-express.py index 467acc081..64ea19dc1 100644 --- a/shiny/api-examples/navset_card_underline/app-express.py +++ b/shiny/api-examples/navset_card_underline/app-express.py @@ -1,6 +1,6 @@ -from shiny.express import ui +from shiny.express import input, render, ui -with ui.navset_card_underline(id="tab"): +with ui.navset_card_underline(id="selected_navset_card_underline"): with ui.nav_panel("A"): "Panel A content" @@ -18,3 +18,9 @@ "Description:" with ui.nav_control(): ui.a("Shiny", href="https://shiny.posit.co", target="_blank") +ui.h5("Selected:") + + +@render.code +def _(): + return input.selected_navset_card_underline() diff --git a/shiny/api-examples/navset_pill/app-core.py b/shiny/api-examples/navset_pill/app-core.py index 4be31b113..af8c7f71e 100644 --- a/shiny/api-examples/navset_pill/app-core.py +++ b/shiny/api-examples/navset_pill/app-core.py @@ -1,4 +1,4 @@ -from shiny import App, ui +from shiny import App, render, ui app_ui = ui.page_fluid( ui.navset_pill( @@ -14,13 +14,17 @@ ui.a("Shiny", href="https://shiny.posit.co", target="_blank") ), ), - id="tab", - ) + id="selected_navset_pill", + ), + ui.h5("Selected:"), + ui.output_code("debug"), ) def server(input, output, session): - pass + @render.code + def debug(): + return input.selected_navset_pill() app = App(app_ui, server) diff --git a/shiny/api-examples/navset_pill/app-express.py b/shiny/api-examples/navset_pill/app-express.py index b367d5072..e8c3b6dea 100644 --- a/shiny/api-examples/navset_pill/app-express.py +++ b/shiny/api-examples/navset_pill/app-express.py @@ -1,6 +1,6 @@ -from shiny.express import ui +from shiny.express import input, render, ui -with ui.navset_pill(id="tab"): +with ui.navset_pill(id="selected_navset_pill"): with ui.nav_panel("A"): "Panel A content" @@ -18,3 +18,9 @@ "Description:" with ui.nav_control(): ui.a("Shiny", href="https://shiny.posit.co", target="_blank") +ui.h5("Selected:") + + +@render.code +def _(): + return input.selected_navset_pill() diff --git a/shiny/api-examples/navset_pill_list/app-core.py b/shiny/api-examples/navset_pill_list/app-core.py index f67349883..bae81aaf8 100644 --- a/shiny/api-examples/navset_pill_list/app-core.py +++ b/shiny/api-examples/navset_pill_list/app-core.py @@ -1,4 +1,4 @@ -from shiny import App, ui +from shiny import App, render, ui app_ui = ui.page_fluid( ui.navset_pill_list( @@ -14,13 +14,17 @@ ui.a("Shiny", href="https://shiny.posit.co", target="_blank") ), ), - id="tab", - ) + id="selected_navset_pill_list", + ), + ui.h5("Selected:"), + ui.output_code("debug"), ) def server(input, output, session): - pass + @render.code + def debug(): + return input.selected_navset_pill_list() app = App(app_ui, server) diff --git a/shiny/api-examples/navset_pill_list/app-express.py b/shiny/api-examples/navset_pill_list/app-express.py index 38b961593..dcfbac1cf 100644 --- a/shiny/api-examples/navset_pill_list/app-express.py +++ b/shiny/api-examples/navset_pill_list/app-express.py @@ -1,6 +1,6 @@ -from shiny.express import ui +from shiny.express import input, render, ui -with ui.navset_pill_list(id="tab"): +with ui.navset_pill_list(id="selected_navset_pill_list"): with ui.nav_panel("A"): "Panel A content" @@ -18,3 +18,9 @@ "Description:" with ui.nav_control(): ui.a("Shiny", href="https://shiny.posit.co", target="_blank") +ui.h5("Selected:") + + +@render.code +def _(): + return input.selected_navset_pill_list() diff --git a/shiny/api-examples/navset_tab/app-core.py b/shiny/api-examples/navset_tab/app-core.py index bbabfb320..aa9b61478 100644 --- a/shiny/api-examples/navset_tab/app-core.py +++ b/shiny/api-examples/navset_tab/app-core.py @@ -1,4 +1,4 @@ -from shiny import App, ui +from shiny import App, render, ui app_ui = ui.page_fluid( ui.navset_tab( @@ -14,13 +14,17 @@ ui.a("Shiny", href="https://shiny.posit.co", target="_blank") ), ), - id="tab", - ) + id="selected_navset_tab", + ), + ui.h5("Selected:"), + ui.output_code("debug"), ) def server(input, output, session): - pass + @render.code + def debug(): + return input.selected_navset_tab() app = App(app_ui, server) diff --git a/shiny/api-examples/navset_tab/app-express.py b/shiny/api-examples/navset_tab/app-express.py index 1b49ce692..b0d57f032 100644 --- a/shiny/api-examples/navset_tab/app-express.py +++ b/shiny/api-examples/navset_tab/app-express.py @@ -1,6 +1,6 @@ -from shiny.express import ui +from shiny.express import input, render, ui -with ui.navset_tab(id="tab"): +with ui.navset_tab(id="selected_navset_tab"): with ui.nav_panel("A"): "Panel A content" @@ -18,3 +18,9 @@ "Description:" with ui.nav_control(): ui.a("Shiny", href="https://shiny.posit.co", target="_blank") +ui.h5("Selected:") + + +@render.code +def _(): + return input.selected_navset_tab() diff --git a/shiny/api-examples/navset_underline/app-core.py b/shiny/api-examples/navset_underline/app-core.py index 06f67de4b..9fc52e2c0 100644 --- a/shiny/api-examples/navset_underline/app-core.py +++ b/shiny/api-examples/navset_underline/app-core.py @@ -1,4 +1,4 @@ -from shiny import App, ui +from shiny import App, render, ui app_ui = ui.page_fluid( ui.navset_underline( @@ -14,13 +14,17 @@ ui.a("Shiny", href="https://shiny.posit.co", target="_blank") ), ), - id="tab", - ) + id="selected_navset_underline", + ), + ui.h5("Selected:"), + ui.output_code("debug"), ) def server(input, output, session): - pass + @render.code + def debug(): + return input.selected_navset_underline() app = App(app_ui, server) diff --git a/shiny/api-examples/navset_underline/app-express.py b/shiny/api-examples/navset_underline/app-express.py index 0868fc6e6..6a4d05685 100644 --- a/shiny/api-examples/navset_underline/app-express.py +++ b/shiny/api-examples/navset_underline/app-express.py @@ -1,6 +1,6 @@ -from shiny.express import ui +from shiny.express import input, render, ui -with ui.navset_underline(id="tab"): +with ui.navset_underline(id="selected_navset_underline"): with ui.nav_panel("A"): "Panel A content" @@ -18,3 +18,9 @@ "Description:" with ui.nav_control(): ui.a("Shiny", href="https://shiny.posit.co", target="_blank") +ui.h5("Selected:") + + +@render.code +def _(): + return input.selected_navset_underline() From 3aefbedc9e88374eae88f645b6328cc59fef3f0d Mon Sep 17 00:00:00 2001 From: Karan Gathani Date: Wed, 31 Jul 2024 16:13:18 +0530 Subject: [PATCH 2/3] remove code comments --- shiny/api-examples/nav_menu/app-core.py | 1 - shiny/api-examples/nav_menu/app-express.py | 1 - 2 files changed, 2 deletions(-) diff --git a/shiny/api-examples/nav_menu/app-core.py b/shiny/api-examples/nav_menu/app-core.py index aa4f81219..deac3cf7d 100644 --- a/shiny/api-examples/nav_menu/app-core.py +++ b/shiny/api-examples/nav_menu/app-core.py @@ -12,7 +12,6 @@ ), ui.h5("Selected:"), ui.output_code("debug"), - # TODO-karan: Add server function to display the selected tab content for remaining navsets. ) diff --git a/shiny/api-examples/nav_menu/app-express.py b/shiny/api-examples/nav_menu/app-express.py index f8ce42feb..2fe4e3a31 100644 --- a/shiny/api-examples/nav_menu/app-express.py +++ b/shiny/api-examples/nav_menu/app-express.py @@ -9,7 +9,6 @@ with ui.nav_panel("C"): "Page C content" ui.h5("Selected:") -# TODO-karan: Add server function to display the selected tab content for remaining navsets. @render.code From 5c6705c8958a4c9185ca1e5d5499ce1502c64a36 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Thu, 22 Aug 2024 15:55:05 -0400 Subject: [PATCH 3/3] `debug` -> `selected` ids --- shiny/api-examples/nav_menu/app-core.py | 4 ++-- shiny/api-examples/nav_spacer/app-core.py | 4 ++-- shiny/api-examples/navset_bar/app-core.py | 4 ++-- shiny/api-examples/navset_card_pill/app-core.py | 4 ++-- shiny/api-examples/navset_card_tab/app-core.py | 4 ++-- shiny/api-examples/navset_card_underline/app-core.py | 4 ++-- shiny/api-examples/navset_pill/app-core.py | 4 ++-- shiny/api-examples/navset_pill_list/app-core.py | 4 ++-- shiny/api-examples/navset_tab/app-core.py | 4 ++-- shiny/api-examples/navset_underline/app-core.py | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/shiny/api-examples/nav_menu/app-core.py b/shiny/api-examples/nav_menu/app-core.py index deac3cf7d..cb73786e1 100644 --- a/shiny/api-examples/nav_menu/app-core.py +++ b/shiny/api-examples/nav_menu/app-core.py @@ -11,13 +11,13 @@ id="selected_card_pill", ), ui.h5("Selected:"), - ui.output_code("debug"), + ui.output_code("selected"), ) def server(input, output, session): @render.code - def debug(): + def selected(): return input.selected_card_pill() diff --git a/shiny/api-examples/nav_spacer/app-core.py b/shiny/api-examples/nav_spacer/app-core.py index 9cb6b4db5..271105e2c 100644 --- a/shiny/api-examples/nav_spacer/app-core.py +++ b/shiny/api-examples/nav_spacer/app-core.py @@ -9,13 +9,13 @@ id="selected_navset_underline", ), ui.h5("Selected:"), - ui.output_code("debug"), + ui.output_code("selected"), ) def server(input, output, session): @render.code - def debug(): + def selected(): return input.selected_navset_underline() diff --git a/shiny/api-examples/navset_bar/app-core.py b/shiny/api-examples/navset_bar/app-core.py index eaba1834b..403e903f3 100644 --- a/shiny/api-examples/navset_bar/app-core.py +++ b/shiny/api-examples/navset_bar/app-core.py @@ -18,13 +18,13 @@ title="Navset Bar", ), ui.h5("Selected:"), - ui.output_code("debug"), + ui.output_code("selected"), ) def server(input, output, session): @render.code - def debug(): + def selected(): return input.selected_navset_bar() diff --git a/shiny/api-examples/navset_card_pill/app-core.py b/shiny/api-examples/navset_card_pill/app-core.py index 41d881730..96df36430 100644 --- a/shiny/api-examples/navset_card_pill/app-core.py +++ b/shiny/api-examples/navset_card_pill/app-core.py @@ -17,13 +17,13 @@ id="selected_navset_card_pill", ), ui.h5("Selected:"), - ui.output_code("debug"), + ui.output_code("selected"), ) def server(input, output, session): @render.code - def debug(): + def selected(): return input.selected_navset_card_pill() diff --git a/shiny/api-examples/navset_card_tab/app-core.py b/shiny/api-examples/navset_card_tab/app-core.py index c7f974dbf..b42445bd8 100644 --- a/shiny/api-examples/navset_card_tab/app-core.py +++ b/shiny/api-examples/navset_card_tab/app-core.py @@ -17,13 +17,13 @@ id="selected_navset_card_tab", ), ui.h5("Selected:"), - ui.output_code("debug"), + ui.output_code("selected"), ) def server(input, output, session): @render.code - def debug(): + def selected(): return input.selected_navset_card_tab() diff --git a/shiny/api-examples/navset_card_underline/app-core.py b/shiny/api-examples/navset_card_underline/app-core.py index 3c3be4ba7..f65caa8cc 100644 --- a/shiny/api-examples/navset_card_underline/app-core.py +++ b/shiny/api-examples/navset_card_underline/app-core.py @@ -17,13 +17,13 @@ id="selected_navset_card_underline", ), ui.h5("Selected:"), - ui.output_code("debug"), + ui.output_code("selected"), ) def server(input, output, session): @render.code - def debug(): + def selected(): return input.selected_navset_card_underline() diff --git a/shiny/api-examples/navset_pill/app-core.py b/shiny/api-examples/navset_pill/app-core.py index af8c7f71e..defaab604 100644 --- a/shiny/api-examples/navset_pill/app-core.py +++ b/shiny/api-examples/navset_pill/app-core.py @@ -17,13 +17,13 @@ id="selected_navset_pill", ), ui.h5("Selected:"), - ui.output_code("debug"), + ui.output_code("selected"), ) def server(input, output, session): @render.code - def debug(): + def selected(): return input.selected_navset_pill() diff --git a/shiny/api-examples/navset_pill_list/app-core.py b/shiny/api-examples/navset_pill_list/app-core.py index bae81aaf8..6574e7a5b 100644 --- a/shiny/api-examples/navset_pill_list/app-core.py +++ b/shiny/api-examples/navset_pill_list/app-core.py @@ -17,13 +17,13 @@ id="selected_navset_pill_list", ), ui.h5("Selected:"), - ui.output_code("debug"), + ui.output_code("selected"), ) def server(input, output, session): @render.code - def debug(): + def selected(): return input.selected_navset_pill_list() diff --git a/shiny/api-examples/navset_tab/app-core.py b/shiny/api-examples/navset_tab/app-core.py index aa9b61478..e57788c1c 100644 --- a/shiny/api-examples/navset_tab/app-core.py +++ b/shiny/api-examples/navset_tab/app-core.py @@ -17,13 +17,13 @@ id="selected_navset_tab", ), ui.h5("Selected:"), - ui.output_code("debug"), + ui.output_code("selected"), ) def server(input, output, session): @render.code - def debug(): + def selected(): return input.selected_navset_tab() diff --git a/shiny/api-examples/navset_underline/app-core.py b/shiny/api-examples/navset_underline/app-core.py index 9fc52e2c0..e3e43ab84 100644 --- a/shiny/api-examples/navset_underline/app-core.py +++ b/shiny/api-examples/navset_underline/app-core.py @@ -17,13 +17,13 @@ id="selected_navset_underline", ), ui.h5("Selected:"), - ui.output_code("debug"), + ui.output_code("selected"), ) def server(input, output, session): @render.code - def debug(): + def selected(): return input.selected_navset_underline()