shiny 0.6.0
Breaking Changes
shiny.runonly allows positional arguments forapp,host, andport, all other arguments must be specified with keywords.
New features
-
shiny runnow takesreload-includesandreload-excludesto allow you to define which files trigger a reload (#780). -
shiny.runnow passes keyword arguments touvicorn.run(#780). -
The
@outputdecorator is no longer required for rendering functions;@render.xxxdecorators now register themselves automatically. You can still use@outputexplicitly if you need to set specific output options (#747). -
Added support for integration with Quarto (#746).
-
Added
shiny.render.renderer_componentsdecorator to help create new output renderers (#621). -
Added
shiny.experimental.ui.popover(),update_popover(), andtoggle_popover()for easy creation (and server-side updating) of Bootstrap popovers. Popovers are similar to tooltips, but are more persistent, and should primarily be used with button-like UI elements (e.g.input_action_button()or icons) (#680). -
Added CSS classes to UI input methods (#680) .
-
Sessionobjects can now accept an asynchronous (or synchronous) function for.on_flush(fn=),.on_flushed(fn=), and.on_ended(fn=)(#686). -
App()now allowsstatic_assetsto represent multiple paths. To do this, pass in a dictionary instead of a string (#763). -
The
showcase_layoutargument ofvalue_box()now accepts one of three character values:"left center","top right","bottom". (#772) -
value_box()now supports many new themes and styles, or fully customizable themes using the newvalue_box_theme()function. To reflect the new capabilities, we've replacedtheme_colorwith a newthemeargument. The previous argument will continue work as expected, but with a deprecation warning. (#772)In addition to the Bootstrap theme names (
primary,secondary, etc.), you can now use the main Boostrap colors (purple,blue,red, etc.). You can also choose to apply the color to the background or foreground by prepending abg-ortext-prefix to the theme or color name. Finally, we've also added new gradient themes allowing you to pair any two color names asbg-gradient-{from}-{to}(e.g.,bg-gradient-purple-blue).These named color themes aren't limited to value boxes: because they're powered by small utility classes, you can use them anywhere within your bslib-powered UI.
-
Added
shiny.ui.showcase_bottom(), a newshiny.ui.value_box()layout that places the showcase below the value boxtitleandvalue, perfect for a full-bleed plot. (#772)
Bug fixes
shiny runnow respects the user providedreload-dirargument (#765).- Fixed #646: Wrap bare value box value in
<p />tags. (#668) - Fixed #676: The
render.data_frameselection feature was underdocumented and buggy (sometimes returningNoneas a row identifier if the pandas data frame's index had gaps in it). With this release, the selection is consistently a tuple of the 0-based row numbers of the selected rows--orNoneif no rows are selected. (#677) - Added tests to verify that ui input methods, ui labels, ui update (value) methods, and ui output methods work within modules (#696).
- Adjusted the
@render.plotinput type to beobjectto allow for any object (if any) to be returned (#712). - In
layout_column_wrap(), whenwidthis a CSS unit -- e.g.width = "400px"orwidth = "25%"-- andfixed_width = FALSE,layout_column_wrap()will ensure that the columns are at leastwidthwide, unless the parent container is narrower thanwidth. (#772)
Other changes
input_action_button()now defaults to having whitespace around it. (#758)layout_sidebar()now uses an<aside>element for the sidebar's container and a<header>element for the sidebar title. The classes of each element remain the same, but the semantic meaning of the elements is now better reflected in the HTML markup. (#772)layout_sidebar()no longer gives the sidebar main content area therole="main"attribute. (#772)- Improved the style and appearance of the button to enter full screen in
card()s andvalue_box()es to better adapt to Bootstrap's dark mode. (#772)
API changes
- Added
shiny.ui.navset_underline()andshiny.ui.navset_card_underline()whose navigation container is similar toshiny.ui.navset_tab()andshiny.ui.navset_card_tab()respectively, but its active/focused navigation links are styled with an underline. (#772) shiny.ui.layout_column_wrap(width, *args)was rearranged toshiny.ui.layout_column_wrap(*args, width). Now,widthwill default to200pxis no value is provided. (#772)shiny.ui.showcase_left_center()andshiny.ui.showcase_top_right()no longer take two values for thewidthargument. Instead, they now take a single value (e.g.,width = "30%") representing the width of the showcase are in the value box. Furthermore, they've both gainedwidth_full_screenarguments that determine the width of the showcase area when the value box is expanded to fill the screen. (#772)shiny.ui.panel_main()andshiny.ui.panel_sidebar()are deprecated in favor of new API forshiny.ui.layout_sidebar(). Please useshiny.ui.sidebar()to construct asidebar=and supply it toshiny.ui.layout_sidebar(sidebar, *args, **kwargs). (#788)shiny.experimental.ui.toggle_sidebar()has been renamed toshiny.ui.update_sidebar(). It'sopenvalue now only supportsboolvalues. (#788)
API relocations
shiny.ui'snavset_pill_card()andnavset_tab_card()have been renamed tonavset_card_pill()andnavset_card_tab()respectively (#492).
The following methods have been moved from shiny.experimental.ui and integrated into shiny.ui (final locations under shiny.ui are displayed) (#680):
- Sidebar - Sidebar layout or manipulation
sidebar(),page_sidebar(),update_sidebar(),layout_sidebar(),Sidebar
- Filling layout - Allow UI components to expand into the parent container and/or allow its content to expand
page_fillable(),fill.as_fillable_container(),fill.as_fill_item(),fill.remove_all_fill()output_plot(fill=),output_image(fill=),output_ui(fill=, fillable=)
- CSS units - CSS units and padding
css.as_css_unit(),css.as_css_padding(),css.CssUnit
- Tooltip - Hover-based context UI element
tooltip(),update_tooltip()
- Popover - Click-based context UI element
popover(),update_popover()
- Accordion - Vertically collapsible UI element
accordion(),accordion_panel(),insert_accordion_panel(),remove_accordion_panel(),update_accordion(),update_accordion_panel(),Accordion,AccordionPanel
- Card - A general purpose container for grouping related UI elements together
card(),card_header(),card_footer(),CardItem
- Valuebox - Opinionated container for displaying a value and title
valuebox()showcase_left_center()showcase_top_right()
- Navs - Navigation within a page
navset_bar(),navset_tab_card(),navset_pill_card()page_navbar(sidebar=, fillable=, fillable_mobile=, gap=, padding=),navset_card_tab(sidebar=),navset_card_pill(sidebar=),navset_bar(sidebar=, fillable=, gap=, padding=)
- Layout - Layout of UI elements
layout_column_wrap()
- Inputs - UI elements for user input
input_text_area(autoresize=)
If a ported method is called from shiny.experimental.ui, a deprecation warning will be displayed.
Methods still under consideration in shiny.experimental.ui:
card(wrapper=): A function (which returns a UI element) to call on unnamed arguments incard(*args)which are not alreadyshiny.ui.CardItemobjects.card_body(): A container for grouping related UI elements togethercard_image(): A general container for an image within ashiny.ui.card.card_title(): A general container for the "title" of ashiny.ui.card.
API removals
shiny.experimental.ui.FillingLayouthas been removed. (#481)shiny.experimental.ui.toggle_switch()has been made defunct. Please remove it from your code and useshiny.ui.update_switch()instead. (#772)shiny.experimental.ui.as_width_unit()has been made defunct. Please remove it from your code. (#772)shiny.experimental.ui'as_fill_carrier(),is_fill_carrier(),is_fillable_container(), andis_fill_item()have been made defunct. Remove them from your code. (#680, #788)- Support for
min_height=,max_height=, andgap=inshiny.experimental.ui.as_fillable_container()andas_fill_item()has been removed. (#481) shiny.experimental.ui.TagCallablehas been made defunct. Please use its type is equivalent tohtmltools.TagFunction. (#680)