Skip to content

Commit 2cf6331

Browse files
committed
Renaming
1 parent eff71c7 commit 2cf6331

File tree

9 files changed

+60
-60
lines changed

9 files changed

+60
-60
lines changed

shiny/api-examples/nav_insert/app-core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def server(input: Inputs, output: Outputs, session: Session):
2525
@reactive.event(input.add)
2626
def _():
2727
id = "Dynamic-" + str(input.add())
28-
ui.nav_insert(
28+
ui.insert_nav_panel(
2929
"tabs",
3030
ui.nav_panel(id, id),
3131
target="s2",
@@ -35,13 +35,13 @@ def _():
3535
@reactive.effect()
3636
@reactive.event(input.removeFoo)
3737
def _():
38-
ui.nav_remove("tabs", target="Foo")
38+
ui.remove_nav_panel("tabs", target="Foo")
3939

4040
@reactive.effect()
4141
@reactive.event(input.addFoo)
4242
def _():
4343
n = str(input.addFoo())
44-
ui.nav_insert(
44+
ui.insert_nav_panel(
4545
"tabs",
4646
ui.nav_panel("Foo-" + n, "This is the new Foo-" + n + " tab", value="Foo"),
4747
target="Menu",

shiny/api-examples/nav_insert/app-express.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _():
2525
with ui.hold() as new_panel:
2626
with ui.nav_panel(id, value=id):
2727
pass
28-
ui.nav_insert(
28+
ui.insert_nav_panel(
2929
"tabs",
3030
new_panel,
3131
target="s2",
@@ -35,7 +35,7 @@ def _():
3535
@reactive.effect()
3636
@reactive.event(input.removeFoo)
3737
def _():
38-
ui.nav_remove("set", target="Foo")
38+
ui.remove_nav_panel("set", target="Foo")
3939

4040
@reactive.effect()
4141
@reactive.event(input.addFoo)
@@ -44,7 +44,7 @@ def _():
4444
with ui.hold() as new_panel:
4545
with ui.nav_panel("Foo-" + n, value="Foo"):
4646
"This is the new Foo-" + n + " tab"
47-
ui.nav_insert(
47+
ui.insert_nav_panel(
4848
"tabs",
4949
new_panel[0],
5050
target="Menu",

shiny/api-examples/nav_show/app-core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@ def server(input: Inputs, output: Outputs, session: Session):
3131
@reactive.effect()
3232
@reactive.event(input.hideTab)
3333
def _():
34-
ui.nav_hide("tabs", target="Foo")
34+
ui.hide_nav_panel("tabs", target="Foo")
3535

3636
@reactive.effect()
3737
@reactive.event(input.showTab)
3838
def _():
39-
ui.nav_show("tabs", target="Foo")
39+
ui.show_nav_panel("tabs", target="Foo")
4040

4141
@reactive.effect()
4242
@reactive.event(input.hideMenu)
4343
def _():
44-
ui.nav_hide("tabs", target="More")
44+
ui.hide_nav_panel("tabs", target="More")
4545

4646
@reactive.effect()
4747
@reactive.event(input.showMenu)
4848
def _():
49-
ui.nav_show("tabs", target="More")
49+
ui.show_nav_panel("tabs", target="More")
5050

5151

5252
app = App(app_ui, server)

shiny/api-examples/nav_show/app-express.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@
2727
@reactive.effect()
2828
@reactive.event(input.hideTab)
2929
def _():
30-
ui.nav_hide("tabs", target="Foo")
30+
ui.hide_nav_panel("tabs", target="Foo")
3131

3232
@reactive.effect()
3333
@reactive.event(input.showTab)
3434
def _():
35-
ui.nav_show("tabs", target="Foo")
35+
ui.show_nav_panel("tabs", target="Foo")
3636

3737
@reactive.effect()
3838
@reactive.event(input.hideMenu)
3939
def _():
40-
ui.nav_hide("tabs", target="More")
40+
ui.hide_nav_panel("tabs", target="More")
4141

4242
@reactive.effect()
4343
@reactive.event(input.showMenu)
4444
def _():
45-
ui.nav_show("tabs", target="More")
45+
ui.show_nav_panel("tabs", target="More")

shiny/express/ui/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@
109109
notification_remove,
110110
nav_spacer,
111111
navbar_options,
112-
nav_hide,
113-
nav_insert,
114-
nav_remove,
115-
nav_show,
112+
hide_nav_panel,
113+
insert_nav_panel,
114+
remove_nav_panel,
115+
show_nav_panel,
116116
Progress,
117117
Theme,
118118
value_box_theme,
@@ -166,7 +166,7 @@
166166
)
167167

168168
from ._insert import (
169-
nav_insert,
169+
insert_nav_panel,
170170
)
171171

172172
__all__ = (
@@ -297,9 +297,9 @@
297297
"navset_hidden",
298298
"navset_pill",
299299
"navset_pill_list",
300-
"nav_hide",
301-
"nav_remove",
302-
"nav_show",
300+
"hide_nav_panel",
301+
"remove_nav_panel",
302+
"show_nav_panel",
303303
"navset_tab",
304304
"navset_underline",
305305
"navbar_options",

shiny/express/ui/_insert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
@add_example()
19-
def nav_insert(
19+
def insert_nav_panel(
2020
id: str,
2121
title: str,
2222
*args: TagChild,
@@ -60,7 +60,7 @@ def nav_insert(
6060
:func:`~shiny.session.get_current_session`.
6161
"""
6262

63-
from ...ui import nav_insert, nav_panel
63+
from ...ui import insert_nav_panel, nav_panel
6464

6565
panel = nav_panel(
6666
title,
@@ -69,7 +69,7 @@ def nav_insert(
6969
icon=icon,
7070
)
7171

72-
nav_insert(
72+
insert_nav_panel(
7373
id=id,
7474
nav_panel=panel,
7575
target=target,

shiny/ui/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@
129129
navset_underline,
130130
)
131131
from ._navs_dynamic import (
132-
nav_hide,
133-
nav_insert,
134-
nav_remove,
135-
nav_show,
132+
hide_nav_panel,
133+
insert_nav_panel,
134+
remove_nav_panel,
135+
show_nav_panel,
136136
)
137137
from ._notification import notification_remove, notification_show
138138
from ._output import (
@@ -303,10 +303,10 @@
303303
"navset_pill_list",
304304
"navset_hidden",
305305
"navset_bar",
306-
"nav_hide",
307-
"nav_insert",
308-
"nav_remove",
309-
"nav_show",
306+
"hide_nav_panel",
307+
"insert_nav_panel",
308+
"remove_nav_panel",
309+
"show_nav_panel",
310310
"navbar_options",
311311
# _notification
312312
"notification_show",

shiny/ui/_navs_dynamic.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
__all__ = (
2-
"nav_insert",
3-
"nav_remove",
4-
"nav_hide",
5-
"nav_show",
2+
"insert_nav_panel",
3+
"remove_nav_panel",
4+
"hide_nav_panel",
5+
"show_nav_panel",
66
)
77

88
import sys
@@ -22,7 +22,7 @@
2222

2323

2424
@add_example()
25-
def nav_insert(
25+
def insert_nav_panel(
2626
id: str,
2727
nav_panel: Union[NavSetArg, str],
2828
target: Optional[str] = None,
@@ -58,8 +58,8 @@ def nav_insert(
5858
5959
See Also
6060
--------
61-
~nav_remove
62-
~nav_show
61+
~remove_nav_panel
62+
~show_nav_panel
6363
~nav_hide
6464
~shiny.ui.nav_panel
6565
"""
@@ -92,7 +92,7 @@ def nav_insert(
9292
session._send_message_sync({"shiny-insert-tab": msg})
9393

9494

95-
def nav_remove(id: str, target: str, session: Optional[Session] = None) -> None:
95+
def remove_nav_panel(id: str, target: str, session: Optional[Session] = None) -> None:
9696
"""
9797
Remove a nav item from a navigation container.
9898
@@ -108,8 +108,8 @@ def nav_remove(id: str, target: str, session: Optional[Session] = None) -> None:
108108
109109
See Also
110110
--------
111-
~nav_insert
112-
~nav_show
111+
~insert_nav_panel
112+
~show_nav_panel
113113
~nav_hide
114114
~shiny.ui.nav_panel
115115
"""
@@ -124,7 +124,7 @@ def nav_remove(id: str, target: str, session: Optional[Session] = None) -> None:
124124

125125

126126
@add_example()
127-
def nav_show(
127+
def show_nav_panel(
128128
id: str, target: str, select: bool = False, session: Optional[Session] = None
129129
) -> None:
130130
"""
@@ -133,9 +133,9 @@ def nav_show(
133133
Parameters
134134
----------
135135
id
136-
The ``id`` of the relevant navigation container (i.e., ``navset_*()`` object).
136+
The `id` of the relevant navigation container (i.e., `navset_*()` object).
137137
target
138-
The ``value`` of an existing :func:`shiny.ui.nav` item to show.
138+
The `value` of an existing :func:`shiny.ui.nav` item to show.
139139
select
140140
Whether the nav item's content should also be shown.
141141
session
@@ -144,14 +144,14 @@ def nav_show(
144144
145145
Note
146146
----
147-
For ``nav_show()`` to be relevant/useful, a :func:`shiny.ui.nav` item must
147+
For `show_nav_panel()` to be relevant/useful, a :func:`shiny.ui.nav` item must
148148
have been hidden using :func:`~nav_hide`.
149149
150150
See Also
151151
--------
152152
~nav_hide
153-
~nav_insert
154-
~nav_remove
153+
~insert_nav_panel
154+
~remove_nav_panel
155155
~shiny.ui.nav_panel
156156
"""
157157

@@ -170,7 +170,7 @@ def nav_show(
170170
session._send_message_sync({"shiny-change-tab-visibility": msg})
171171

172172

173-
def nav_hide(id: str, target: str, session: Optional[Session] = None) -> None:
173+
def hide_nav_panel(id: str, target: str, session: Optional[Session] = None) -> None:
174174
"""
175175
Hide a navigation item
176176
@@ -186,9 +186,9 @@ def nav_hide(id: str, target: str, session: Optional[Session] = None) -> None:
186186
187187
See Also
188188
--------
189-
~nav_show
190-
~nav_insert
191-
~nav_remove
189+
~show_nav_panel
190+
~insert_nav_panel
191+
~remove_nav_panel
192192
~shiny.ui.nav_panel
193193
"""
194194

tests/playwright/shiny/components/dynamic_navs/app.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def server(input: Inputs, output: Outputs, session: Session):
2929
@reactive.event(input.add)
3030
def _():
3131
id = "Dynamic-" + str(input.add())
32-
ui.nav_insert(
32+
ui.insert_nav_panel(
3333
"tabs",
3434
ui.nav_panel(id, id),
3535
target="s2",
@@ -39,13 +39,13 @@ def _():
3939
@reactive.effect()
4040
@reactive.event(input.removeFoo)
4141
def _():
42-
ui.nav_remove("tabs", target="Foo")
42+
ui.remove_nav_panel("tabs", target="Foo")
4343

4444
@reactive.effect()
4545
@reactive.event(input.addFoo)
4646
def _():
4747
n = str(input.addFoo())
48-
ui.nav_insert(
48+
ui.insert_nav_panel(
4949
"tabs",
5050
ui.nav_panel("Foo-" + n, "Foo-" + n, value="Foo"),
5151
target="Menu",
@@ -56,22 +56,22 @@ def _():
5656
@reactive.effect()
5757
@reactive.event(input.hideTab)
5858
def _():
59-
ui.nav_hide("tabs", target="Foo")
59+
ui.hide_nav_panel("tabs", target="Foo")
6060

6161
@reactive.effect()
6262
@reactive.event(input.showTab)
6363
def _():
64-
ui.nav_show("tabs", target="Foo")
64+
ui.show_nav_panel("tabs", target="Foo")
6565

6666
@reactive.effect()
6767
@reactive.event(input.hideMenu)
6868
def _():
69-
ui.nav_hide("tabs", target="Menu")
69+
ui.hide_nav_panel("tabs", target="Menu")
7070

7171
@reactive.effect()
7272
@reactive.event(input.showMenu)
7373
def _():
74-
ui.nav_show("tabs", target="Menu")
74+
ui.show_nav_panel("tabs", target="Menu")
7575

7676

7777
app = App(app_ui, server)

0 commit comments

Comments
 (0)