Skip to content

Commit d1eb2d8

Browse files
committed
Add remaining components to shiny.express.ui
1 parent 5fa9a52 commit d1eb2d8

File tree

4 files changed

+742
-114
lines changed

4 files changed

+742
-114
lines changed

examples/express/basic_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from shiny import render, ui
2-
from shiny.express import input
1+
from shiny import render
2+
from shiny.express import input, ui
33

44
ui.input_slider("n", "N", 1, 100, 50)
55

examples/express/column_wrap_app.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import matplotlib.pyplot as plt
22
import numpy as np
33

4-
from shiny import render, ui
5-
from shiny.express import input, layout
4+
from shiny import render
5+
from shiny.express import input, ui
66

7-
with layout.layout_column_wrap(width=1 / 2):
8-
with layout.card():
7+
with ui.layout_column_wrap(width=1 / 2):
8+
with ui.card():
99
ui.input_slider("n", "N", 1, 100, 50)
1010

11-
with layout.card():
11+
with ui.card():
1212

1313
@render.plot
1414
def histogram():
1515
np.random.seed(19680801)
1616
x = 100 + 15 * np.random.randn(437)
1717
plt.hist(x, input.n(), density=True)
1818

19-
with layout.card():
19+
with ui.card():
2020

2121
@render.plot
2222
def histogram2():

shiny/express/ui/__init__.py

Lines changed: 300 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,300 @@
1+
from __future__ import annotations
2+
3+
4+
from htmltools import (
5+
TagList,
6+
Tag,
7+
TagChild,
8+
TagAttrs,
9+
TagAttrValue,
10+
tags,
11+
HTML,
12+
head_content,
13+
a,
14+
br,
15+
code,
16+
div,
17+
em,
18+
h1,
19+
h2,
20+
h3,
21+
h4,
22+
h5,
23+
h6,
24+
hr,
25+
img,
26+
p,
27+
pre,
28+
span,
29+
strong,
30+
)
31+
32+
from ...ui import (
33+
AccordionPanel,
34+
AnimationOptions,
35+
CardItem,
36+
card_header,
37+
card_footer,
38+
ShowcaseLayout,
39+
Sidebar,
40+
SliderStepArg,
41+
SliderValueArg,
42+
ValueBoxTheme,
43+
download_button,
44+
download_link,
45+
brush_opts,
46+
click_opts,
47+
dblclick_opts,
48+
help_text,
49+
hover_opts,
50+
include_css,
51+
include_js,
52+
input_action_button,
53+
input_action_link,
54+
input_checkbox,
55+
input_checkbox_group,
56+
input_switch,
57+
input_radio_buttons,
58+
input_date,
59+
input_date_range,
60+
input_file,
61+
input_numeric,
62+
input_password,
63+
input_select,
64+
input_selectize,
65+
input_slider,
66+
input_text,
67+
input_text_area,
68+
insert_accordion_panel,
69+
remove_accordion_panel,
70+
update_accordion,
71+
update_accordion_panel,
72+
update_sidebar,
73+
update_action_button,
74+
update_action_link,
75+
update_checkbox,
76+
update_switch,
77+
update_checkbox_group,
78+
update_radio_buttons,
79+
update_date,
80+
update_date_range,
81+
update_numeric,
82+
update_select,
83+
update_selectize,
84+
update_slider,
85+
update_text,
86+
update_text_area,
87+
update_navs,
88+
update_tooltip,
89+
update_popover,
90+
insert_ui,
91+
remove_ui,
92+
markdown,
93+
modal_button,
94+
modal,
95+
modal_show,
96+
modal_remove,
97+
notification_show,
98+
notification_remove,
99+
output_plot,
100+
output_image,
101+
output_text,
102+
output_text_verbatim,
103+
output_table,
104+
output_ui,
105+
Progress,
106+
output_data_frame,
107+
value_box_theme,
108+
)
109+
110+
from ._cm_components import (
111+
set_page,
112+
sidebar,
113+
layout_sidebar,
114+
layout_column_wrap,
115+
column,
116+
row,
117+
card,
118+
accordion,
119+
accordion_panel,
120+
navset,
121+
navset_card,
122+
nav,
123+
value_box,
124+
panel_well,
125+
panel_conditional,
126+
panel_fixed,
127+
panel_absolute,
128+
page_fluid,
129+
page_fixed,
130+
page_fillable,
131+
page_sidebar,
132+
page_navbar,
133+
)
134+
135+
__all__ = (
136+
# Imports from htmltools
137+
"TagList",
138+
"Tag",
139+
"TagChild",
140+
"TagAttrs",
141+
"TagAttrValue",
142+
"tags",
143+
"HTML",
144+
"head_content",
145+
"a",
146+
"br",
147+
"code",
148+
"div",
149+
"em",
150+
"h1",
151+
"h2",
152+
"h3",
153+
"h4",
154+
"h5",
155+
"h6",
156+
"hr",
157+
"img",
158+
"p",
159+
"pre",
160+
"span",
161+
"strong",
162+
"tags",
163+
# Imports from ...ui
164+
"AccordionPanel",
165+
"AnimationOptions",
166+
"CardItem",
167+
"ShowcaseLayout",
168+
"Sidebar",
169+
"SliderStepArg",
170+
"SliderValueArg",
171+
"ValueBoxTheme",
172+
"card_header",
173+
"card_footer",
174+
"download_button",
175+
"download_link",
176+
"brush_opts",
177+
"click_opts",
178+
"dblclick_opts",
179+
"help_text",
180+
"hover_opts",
181+
"include_css",
182+
"include_js",
183+
"input_action_button",
184+
"input_action_link",
185+
"input_checkbox",
186+
"input_checkbox_group",
187+
"input_switch",
188+
"input_radio_buttons",
189+
"input_date",
190+
"input_date_range",
191+
"input_file",
192+
"input_numeric",
193+
"input_password",
194+
"input_select",
195+
"input_selectize",
196+
"input_slider",
197+
"input_text",
198+
"input_text_area",
199+
"insert_accordion_panel",
200+
"remove_accordion_panel",
201+
"update_accordion",
202+
"update_accordion_panel",
203+
"update_sidebar",
204+
"update_action_button",
205+
"update_action_link",
206+
"update_checkbox",
207+
"update_switch",
208+
"update_checkbox_group",
209+
"update_radio_buttons",
210+
"update_date",
211+
"update_date_range",
212+
"update_numeric",
213+
"update_select",
214+
"update_selectize",
215+
"update_slider",
216+
"update_text",
217+
"update_text_area",
218+
"update_navs",
219+
"update_tooltip",
220+
"update_popover",
221+
"insert_ui",
222+
"remove_ui",
223+
"markdown",
224+
"modal_button",
225+
"modal",
226+
"modal_show",
227+
"modal_remove",
228+
"notification_show",
229+
"notification_remove",
230+
"output_plot",
231+
"output_image",
232+
"output_text",
233+
"output_text_verbatim",
234+
"output_table",
235+
"output_ui",
236+
"Progress",
237+
"output_data_frame",
238+
"value_box_theme",
239+
# Imports from ._cm_components
240+
"set_page",
241+
"sidebar",
242+
"layout_sidebar",
243+
"layout_column_wrap",
244+
"column",
245+
"row",
246+
"card",
247+
"accordion",
248+
"accordion_panel",
249+
"navset",
250+
"navset_card",
251+
"nav",
252+
"value_box",
253+
"panel_well",
254+
"panel_conditional",
255+
"panel_fixed",
256+
"panel_absolute",
257+
"page_fluid",
258+
"page_fixed",
259+
"page_fillable",
260+
"page_sidebar",
261+
"page_navbar",
262+
)
263+
264+
265+
_known_missing = {
266+
# Items from shiny.ui that don't have a counterpart in shiny.express.ui
267+
"shiny.ui": (
268+
"nav_control",
269+
"nav_menu",
270+
"nav_spacer",
271+
"navset_bar",
272+
"navset_card_pill",
273+
"navset_card_tab",
274+
"navset_card_underline",
275+
"navset_hidden",
276+
"navset_pill",
277+
"navset_pill_card",
278+
"navset_pill_list",
279+
"navset_tab",
280+
"navset_tab_card",
281+
"navset_underline",
282+
"page_bootstrap",
283+
"panel_main",
284+
"panel_sidebar",
285+
"panel_title",
286+
"page_output",
287+
"popover",
288+
"showcase_bottom",
289+
"showcase_left_center",
290+
"showcase_top_right",
291+
"tooltip",
292+
),
293+
# Items from shiny.express.ui that don't have a counterpart in shiny.ui
294+
"shiny.express.ui": (
295+
"set_page",
296+
# TODO: Migrate these to shiny.ui
297+
"navset",
298+
"navset_card",
299+
),
300+
}

0 commit comments

Comments
 (0)