Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* We've deprecated several card-related `shiny.experimental.ui` functions that were moved to the main `shiny.ui` namespace in v0.6.0. Both `card()` and `card_body()` are no longer experimental and can be called via `shiny.ui.card()` and `shiny.ui.card_body()` directly. `shiny.experimental.ui.card_title()` is now deprecated, but can be replaced with `shiny.ui.tags.h5()` or `shiny.ui.card_header()`. (#1543)

* The following deprecated functions have now been removed (#1546):
* `shiny.ui.panel_sidebar()` was deprecated in v0.6.0; use `shiny.ui.sidebar()` instead.
* `shiny.ui.panel_main()` was deprecated in v0.6.0; instead pass items directly to `shiny.ui.layout_sidebar()`.
* `shiny.ui.navset_pill_card()` was deprecated in v0.6.0; use `shiny.ui.navset_card_pill()` instead.
* `shiny.ui.navset_tab_card()` was deprecated in v0.6.0; use `shiny.ui.navset_card_tab()` instead.
* `shiny.ui.nav()` was deprecated in v0.6.1; use `shiny.ui.nav_panel()` instead.

### New features

* Added a new `shiny.ui.Chat` class for building conversational interfaces with fully customizable and performant response generation. (#1453)
Expand Down
3 changes: 0 additions & 3 deletions docs/_quartodoc-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ quartodoc:
- title: Deprecated
desc: ""
contents:
- ui.panel_main
- ui.panel_sidebar
- ui.nav
- render.transformer.output_transformer
- render.transformer.resolve_value_fn
- title: Experimental
Expand Down
6 changes: 3 additions & 3 deletions docs/_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ def prefix_bare_functions_with_func(s: str) -> str:
The See Also section in the Shiny docs has bare function references, ones that lack
a leading :func: and backticks. This function fixes them.

If there are bare function references, like "~shiny.ui.panel_sidebar", this will
If there are bare function references, like "~shiny.ui.sidebar", this will
prepend with :func: and wrap in backticks.

For example, if the input is this:
"~shiny.ui.panel_sidebar :func:`~shiny.ui.panel_sidebar`"
"~shiny.ui.sidebar :func:`~shiny.ui.sidebar`"
This function will return:
":func:`~shiny.ui.panel_sidebar` :func:`~shiny.ui.panel_sidebar`"
":func:`~shiny.ui.sidebar` :func:`~shiny.ui.sidebar`"
"""

def replacement(match: re.Match[str]) -> str:
Expand Down
48 changes: 23 additions & 25 deletions examples/cpuinfo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
ui.busy_indicators.use(spinners=False, pulse=False),
ui.h3("CPU Usage %", class_="mt-2"),
ui.layout_sidebar(
ui.panel_sidebar(
ui.sidebar(
ui.input_select(
"cmap",
"Colormap",
Expand All @@ -71,33 +71,31 @@
ui.input_switch("hold", "Freeze output", value=False),
class_="mb-3",
),
ui.panel_main(
ui.div(
{"class": "card mb-3"},
ui.div(
{"class": "card mb-3"},
ui.div(
{"class": "card-body"},
ui.h5({"class": "card-title mt-0"}, "Graphs"),
ui.output_plot("plot", height=f"{ncpu * 40}px"),
),
ui.div(
{"class": "card-footer"},
ui.input_numeric("sample_count", "Number of samples per graph", 50),
),
{"class": "card-body"},
ui.h5({"class": "card-title mt-0"}, "Graphs"),
ui.output_plot("plot", height=f"{ncpu * 40}px"),
),
ui.div(
{"class": "card"},
ui.div(
{"class": "card-body"},
ui.h5({"class": "card-title m-0"}, "Heatmap"),
),
ui.div(
{"class": "card-body overflow-auto pt-0"},
ui.output_table("table"),
),
ui.div(
{"class": "card-footer"},
ui.input_numeric("table_rows", "Rows to display", 5),
),
{"class": "card-footer"},
ui.input_numeric("sample_count", "Number of samples per graph", 50),
),
),
ui.div(
{"class": "card"},
ui.div(
{"class": "card-body"},
ui.h5({"class": "card-title m-0"}, "Heatmap"),
),
ui.div(
{"class": "card-body overflow-auto pt-0"},
ui.output_table("table"),
),
ui.div(
{"class": "card-footer"},
ui.input_numeric("table_rows", "Rows to display", 5),
),
),
),
Expand Down
6 changes: 2 additions & 4 deletions shiny/api-examples/page_fixed/app-core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@

app_ui = ui.page_fixed(
ui.layout_sidebar(
ui.panel_sidebar(
ui.sidebar(
ui.input_slider("n", "N", min=0, max=100, value=20),
),
ui.panel_main(
ui.output_plot("plot"),
),
ui.output_plot("plot"),
),
)

Expand Down
8 changes: 3 additions & 5 deletions shiny/api-examples/todo_list/app-core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
shinyswatch.theme.minty(),
ui.panel_title("Shiny TodoMVC"),
ui.layout_sidebar(
ui.panel_sidebar(
ui.sidebar(
ui.input_text("todo_input_text", "", placeholder="Todo text"),
ui.input_action_button("add", "Add to-do"),
),
ui.panel_main(
ui.output_text("cleared_tasks"),
ui.div(id="tasks", style="margin-top: 0.5em"),
),
ui.output_text("cleared_tasks"),
ui.div(id="tasks", style="margin-top: 0.5em"),
),
)

Expand Down
5 changes: 0 additions & 5 deletions shiny/express/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,6 @@
"shiny.ui": (
"column", # Deprecated in favor of layout_columns
"row", # Deprecated in favor of layout_columns
"nav", # Deprecated in favor of nav_panel
"navset_pill_card", # Deprecated
"navset_tab_card", # Deprecated
"page_bootstrap",
"page_fixed",
"page_sidebar",
Expand All @@ -314,8 +311,6 @@
"page_fluid",
"page_auto",
"page_output",
"panel_main", # Deprecated
"panel_sidebar", # Deprecated
"showcase_bottom",
"showcase_left_center",
"showcase_top_right",
Expand Down
12 changes: 0 additions & 12 deletions shiny/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
from ._markdown import markdown
from ._modal import modal, modal_button, modal_remove, modal_show
from ._navs import (
nav,
nav_control,
nav_menu,
nav_panel,
Expand All @@ -122,11 +121,8 @@
navset_card_underline,
navset_hidden,
navset_pill,
# Deprecated
navset_pill_card,
navset_pill_list,
navset_tab,
navset_tab_card,
navset_underline,
)
from ._notification import notification_remove, notification_show
Expand Down Expand Up @@ -155,8 +151,6 @@
from ._sidebar import (
Sidebar,
layout_sidebar,
panel_main,
panel_sidebar,
sidebar,
update_sidebar,
)
Expand Down Expand Up @@ -189,8 +183,6 @@
"sidebar",
"layout_sidebar",
"update_sidebar",
"panel_sidebar",
"panel_main",
# _layout
"layout_columns",
"layout_column_wrap",
Expand Down Expand Up @@ -299,10 +291,6 @@
"navset_pill_list",
"navset_hidden",
"navset_bar",
# # Deprecated
"navset_pill_card",
"navset_tab_card",
"nav",
# _notification
"notification_show",
"notification_remove",
Expand Down
5 changes: 0 additions & 5 deletions shiny/ui/_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ def panel_well(*args: TagChild | TagAttrs, **kwargs: TagAttrValue) -> Tag:
-------
:
A UI element.

See Also
--------
* :func:`~shiny.ui.panel_sidebar`
* :func:`~shiny.ui.panel_main`
"""
return div({"class": "well"}, *args, **kwargs)

Expand Down
78 changes: 0 additions & 78 deletions shiny/ui/_navs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
"navset_pill_list",
"navset_hidden",
"navset_bar",
# Deprecated - 2023-08-15
"navset_pill_card",
"navset_tab_card",
"nav",
)

import collections.abc
Expand All @@ -27,7 +23,6 @@

from htmltools import MetadataNode, Tag, TagAttrs, TagChild, TagList, css, div, tags

from .._deprecated import warn_deprecated
from .._docstring import add_example, no_example
from .._namespaces import resolve_id_or_none
from .._utils import private_random_int
Expand Down Expand Up @@ -1367,76 +1362,3 @@ def navset_title(

def nav_random_int() -> str:
return private_random_int(1000, 1000000)


##############################################
# Deprecated
##############################################
# Deprecated 2023-08-15
def navset_pill_card(
*args: NavSetArg,
id: Optional[str] = None,
selected: Optional[str] = None,
header: TagChild = None,
footer: TagChild = None,
placement: Literal["above", "below"] = "above",
) -> NavSetCard:
"""Deprecated. Please use `navset_card_pill()` instead of `navset_pill_card()`."""
warn_deprecated(
"`navset_pill_card()` is deprecated. "
"This method will be removed in a future version, "
"please use :func:`~shiny.ui.navset_card_pill` instead."
)
return navset_card_pill(
*args,
id=id,
selected=selected,
header=header,
footer=footer,
placement=placement,
)


# Deprecated 2023-08-15
def navset_tab_card(
*args: NavSetArg,
id: Optional[str] = None,
selected: Optional[str] = None,
header: TagChild = None,
footer: TagChild = None,
) -> NavSetCard:
"""Deprecated. Please use `navset_card_tab()` instead of `navset_tab_card()`."""
warn_deprecated(
"`navset_tab_card()` is deprecated. "
"This method will be removed in a future version, "
"please use :func:`~shiny.ui.navset_card_tab` instead."
)
return navset_card_tab(
*args,
id=id,
selected=selected,
header=header,
footer=footer,
)


# Deprecated 2023-12-07
@no_example()
def nav(
title: TagChild,
*args: TagChild,
value: Optional[str] = None,
icon: TagChild = None,
) -> NavPanel:
"""Deprecated. Please use `nav_panel()` instead of `nav()`."""
warn_deprecated(
"`nav()` is deprecated. "
"This method will be removed in a future version, "
"please use :func:`~shiny.ui.nav_panel` instead."
)
return nav_panel(
title,
*args,
value=value,
icon=icon,
)
Loading