Shiny 1.0.0
New features
-
Added a new
shiny.ui.Chatclass for building conversational interfaces with fully customizable and performant response generation. (#1453) -
Expose
shiny.playwright,shiny.run, andshiny.pytestmodules that allow users to testing their Shiny apps. (#1448, #1456, #1481)shiny.playwrightcontainscontrollerandexpectsubmodules.controllerwill contain many classes to interact with (and verify!) your Shiny app using Playwright.expectcontains expectation functions that enhance standard Playwright expectation methods.shiny.runcontains therun_shiny_appcommand and the return typeShinyAppProc.ShinyAppProccan be used to type the Shiny app pytest fixtures.shiny.pytestcontains pytest test fixtures. Thelocal_apppytest fixture is automatically available and runs a siblingapp.pyfile. Where ascreate_app_fixture(PATH_TO_APP)allows for a relative path to a Shiny app to be instantiated from a different folder.
-
Added CLI command
shiny add testto add a test file to an existing Shiny app. (#1461) -
@render.data_frame,render.DataGrid, andrender.DataTablenow supportpolarsdata frames (#1474). -
@render.data_frame,render.DataGrid, andrender.DataTableare now type aware. This means that the data frame renderer object's.data()and.data_view()methods will return the same type of data given the the renderer. E.g. If aDataGridwrapping apolarsdata frame is returned to the renderer function,.data_view()will returnpolarsdata. (#1502) -
@render.data_frame'srender.DataGridandrender.DataTableadded support for cell styling with the newstyles=parameter. This parameter can receive a style info object (or a list of style info objects), or a function that accepts a data frame and returns a list of style info objects. Each style info object can contain therowsandcolslocations where the inlinestyleand/or CSSclassshould be applied. (#1475) -
@render.data_framehas added a few new methods:.data_view_rows()is a reactive value representing the sorted and filtered row numbers. This value wrapsinput.<ID>_data_view_rows()(#1374).sort()is a reactive value representing the sorted column information (dictionaries containingcol: intanddesc: bool). This value wrapsinput.<ID>_sort(). (#1374).filter()is a reactive value representing the filtered column information (dictionaries containingcol: intandvaluewhich is either a string or a length 2 array of at least one non-Nonenumber). This value wrapsinput.<ID>_filter(). (#1374).update_sort(sort=)allows app authors to programmatically update the sorting of the data frame. (#1374).update_filter(filter=)allows app authors to programmatically update the filtering of the data frame. (#1374)
-
@render.data_framenow accepts both a non-"none"selection_modevalue andeditable=True. (#1454, #1534) -
@render.data_frame's<ID>.cell_selection()no longer returns aNonevalue and now always returns a dictionary containing both therowsandcolskeys. This is done to achieve more consistent author code when working with cell selection. When the value'stype="none", bothrowsandcolsare empty tuples. Whentype="row",colsrepresents all column numbers of the data. In the future, whentype="col",rowswill represent all row numbers of the data. These extra values are not available ininput.<ID>_cell_selection()as they are independent of cells being selected and are removed to reduce information being sent to and from the browser. (#1376) -
Relative imports, like
from . import utils, now can be used in Shiny Express apps. (#1464) -
ui.Themeallows you to create custom themes for your Shiny app by recompiling Bootstrap and Shiny's Sass files with your own customizations. Themes created withui.Themecan be passed directly to thethemeargument ofexpress.ui.page_opts()(Shiny Express) orui.page_*()functions (Shiny Core) to apply the theme to the entire app. This feature requires the libsass package which can be installed withpip install libsass. (#1358) -
ui.card_body()can be used to wrap the contents of elements inui.card(), allowing you to change parameters likefillableorpaddingandgapfor groups of elements in the card. (#1506)
Other changes
-
ui.input_action_button()andui.update_action_button()gain adisabledargument. When the button is disabled, it appears grayed out and cannot be clicked. (#1465) -
The main content area of
ui.page_sidebar()andui.page_navbar()with a page-levelsidebarnow have a minimum height and width to avoid squashed content in fillable layouts. The minimum height and width are controllable via--bslib-page-main-min-{width,height}CSS variables. (#1436) -
Added a new option to place an always-open sidebar above the main content on mobile screens by providing
open={"mobile": "always-above"}toui.sidebar(). (#1436)
Bug fixes
-
Fixed #1440: When a Shiny Express app with a
www/subdirectory was deployed to shinyapps.io or a Connect server, it would not start correctly. (#1442) -
Fixed #1498: Update table related TypeScript dependencies to their latest versions. This fixed an issue where the Row Virtualizer would scroll to the end when hidden. This would cause the DOM to update numerous times, locking up the browser tab for multiple seconds. (#1524, #1550)
-
The return type for the data frame patch function now returns a list of
render.CellPatchobjects (which supporthtmltools.TagNodefor thevalueattribute). These values will be set inside the data frame's.data_view()result. This also means that.cell_patches()will be a list ofrender.CellPatchobjects. (#1526) -
Made sure all
@render.data_framecells that have been edited are now restored back to ready state to handle the off chance that the returned patches are at different locations the the original edit patches. (#1529) -
remove_all_fill(tag)no longer modifies the originaltaginput and instead returns a modified copy oftag. (#1538)
Deprecations
-
The following deprecated functions have now been removed (#1546):
shiny.ui.panel_sidebar()was deprecated in v0.6.0; useshiny.ui.sidebar()instead.shiny.ui.panel_main()was deprecated in v0.6.0; instead pass items directly toshiny.ui.layout_sidebar().shiny.ui.navset_pill_card()was deprecated in v0.6.0; useshiny.ui.navset_card_pill()instead.shiny.ui.navset_tab_card()was deprecated in v0.6.0; useshiny.ui.navset_card_tab()instead.shiny.ui.nav()was deprecated in v0.6.1; useshiny.ui.nav_panel()instead.
-
@render.data_frame,render.DataGrid, andrender.DataTablehave deprecated support for data frame types that arepandascompatible. Please call.to_pandas()on your data before it is returned to the renderer (#1502). Currently, bothpolarsandpandasdata frames are supported (#1474). If you'd like to add support for a new data frame type, please open an issue or a pull request. -
@render.data_frame's.cell_selection()will no longer returnNonewhen the selection mode is"none". In addition, missingrowsorcolsinformation will be populated with appropiate values. This allows for consistent handling of the cell selection object. (#1374) -
@render.data_frame's input valueinput.<ID>_data_view_indices()has been deprecated. Please use<ID>.data_view_rows()to retrieve the same information. (#1377) -
@render.data_frame's input valueinput.<ID>_column_sort()has been deprecated. Please use<ID>.sort()to retrieve the same information. (#1374) -
@render.data_frame's input valueinput.<ID>_column_filter()has been deprecated. Please use<ID>.filter()to retrieve the same information. (#1374) -
Deprecated functions in
shiny.experimentalhave been removed. By and large, these functions are now available in the mainshinynamespace. (#1540) -
We've deprecated several card-related
shiny.experimental.uifunctions that were moved to the mainshiny.uinamespace in v0.6.0. Bothcard()andcard_body()are no longer experimental and can be called viashiny.ui.card()andshiny.ui.card_body()directly.shiny.experimental.ui.card_title()is now deprecated, but can be replaced withshiny.ui.tags.h5()orshiny.ui.card_header(). (#1543)