Shiny

Latest version: v0.9.0

Safety actively analyzes 622043 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.9.0

Breaking Changes

* `render.data_frame` return values of `DataTable` and `DataGrid` had their parameter of `row_selection: Literal["single", "multiple"]` become deprecated. Please use `selection_mode="row"` or `selection_mode="rows"` instead. (1198)

* The `col_widths` argument of `ui.layout_columns()` now sets the `sm` breakpoint by default, rather than the `md` breakpoint. For example, `col_widths=(12, 6, 6)` is now equivalent to `{"sm": (12, 6, 6)}` rather than `{"md": (12, 6, 6)}`. (1222)

New features

* `Session` objects now have a `set_message_handler(name, fn)` method that allows you to register a message handler function that will be called when a request message with the given name is received from the client (via `Shiny.shinyapp.makeRequest()` (JS)). (1253)

* Experimental: `render.data_frame` return values of `DataTable` and `DataGrid` support `editable=True` to enable editing of the data table cells. (1198)

* `ui.card()` and `ui.value_box()` now take an `id` argument that, when provided, is used to report the full screen state of the card or value box to the server. For example, when using `ui.card(id = "my_card", full_screen = TRUE)` you can determine if the card is currently in full screen mode by reading the boolean value of `input.my_card_full_screen()`. (1215, 1266)

* Added support for using `shiny.express` in Quarto Dashboards. (1217)

* `ui.value_box()`, `ui.layout_columns()` and `ui.layout_column_wrap()` now all have `min_height` and `max_height` arguments. These are useful in filling layouts, like `ui.page_fillable()`, `ui.page_sidebar(fillable=True)` or `ui.page_navbar(fillable=True)`. For example, you can use `ui.layout_columns(min_height=300, max_height=500)` to ensure that a set of items (likely arranged in a row of columns) are always between 300 and 500 pixels tall. (1223)

* Added an error console which displays errors in the browser's UI. This is enabled by default when running applications locally, and can be disabled with `shiny run --no-dev-mode`. It is not enabled for applications that are deployed to a server. (1060)

* `shiny create` was updated to include some additional templates as well as an option to choose from the new [templates website](https://shiny.posit.co/py/templates/). (#1273, 1277, 1274)

* `shiny.express.ui.page_opts()` now accepts additional keyword arguments that are passed to the underlying page layout chosen by `shiny.ui.page_auto()`. (1314)

Bug fixes

* On Windows, Shiny Express app files are now read in as UTF-8. (1203)

* `input_dark_mode()` now accepts a `style` argument that can be used to customize the appearance and position of the dark mode toggle switch. (1207)

* Calling `ui.update_selectize()` with `choices` and `selected` now clears the current selection before updating the choices and selected value. (1221)

* Fixed an issue that could happen with a `ui.card()` or `ui.value_box()` that is rendered dynamically via `render.ui` when an updated card replaces a card that the user has expanded into full screen mode. Now the full screen state is reset for the new card or value box. If you want to update a card without potentially exiting the full-screen mode, update specific parts of the card using `ui.output_ui()` or `ui.output_text()`. (1221)

* `ui.layout_columns()` now correctly applies the `row_heights` at the `xs` breakpoint, if supplied. (1222)

* `ui.panel_conditional()` now adds the `.shiny-panel-conditional` class to the `<div>` element wrapping the conditional panel contents. (1257)

* `ui.panel_conditional()` no longer results in unwanted double padding when the parent container uses `gap` for spacing multiple elements (e.g., when used in `ui.layout_columns()`, `ui.page_fillable()`, etc). (1266)

* Error messages now use `var(--bs-danger)` instead of `var(--bs-danger-text-emphasis)` for the text color. (1266)

Other changes

* The fill CSS used by fillable containers (i.e. when `fillable=True`) now uses a [CSS cascade layer](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_layers) named `htmltools` to reduce the precedence order of the fill CSS. (#1228)

0.8.1

Breaking Changes

* `ui.page_sidebar()` now places the `title` element in a `.navbar` container that matches the structure of `page_navbar()`. This ensures that the title elements of `page_sidebar()` and `page_navbar()` have consistent appearance. (1176)

Bug fixes

* Shiny now compiles the Bootstrap 5-based stylesheets for component styles imported from https://github.com/rstudio/shiny. (#1191)

* Fixed the CSS for `ui.output_ui()` to avoid unwanted double padding when its parent container uses `gap` for spacing multiple elements (e.g., `ui.layout_columns()`, `ui.page_fillable()`, etc). (1176)

Other changes

* Closed 1178: Removed run-time dependency on asgiref. (1183)

* The uvicorn and click packages are no longer needed when running on Emscripten. (1187)

* We adjusted the shadows used for cards and popovers. Cards now use a slightly smaller shadow and the same shadow style is also now used by popovers. (1176)

* We increased the spacing between elements just slightly. This change is most noticeable in the `layout_columns()` or `layout_column_wrap()` component. In these and other components, you can use `gap` and `padding` arguments to choose your own values, or you can set the `$bslib-spacer` (Sass) or `--bslib-spacer` (CSS) variable. (1176)

0.8.0

Breaking Changes

* Page-level sidebars used in `ui.page_sidebar()` and `ui.page_navbar()` will now default to being initially open but collapsible on desktop devices and always open on mobile devices. You can adjust this default choice by setting `ui.sidebar(open=)`. (1129)

* `ui.sidebar()` is now a thin wrapper for the internal `ui.Sidebar` class. The `ui.Sidebar` class has been updated to store the sidebar's contents and settings and to delay rendering until the sidebar HTML is actually used. Because most users call `ui.sidebar()` instead of using the class directly, this change is not expected to affect many apps. (1129)

New features

* Added `ui.input_dark_mode()`, a toggle switch that allows users to switch between light and dark mode. By default, when `ui.input_dark_mode()` is added to an app, the app's color mode follows the users's system preferences, unless the app author sets the `mode` argument. When `ui.input_dark_mode(id=)` is set, the color mode is reported to the server, and server-side color mode updating is possible using `ui.update_dark_mode()`. (1149)

* `ui.sidebar(open=)` now accepts a dictionary with keys `desktop` and `mobile`, allowing you to independently control the initial state of the sidebar at desktop and mobile screen sizes. (1129)

* Closed 984: In Shiny Express apps, if there is a `"www"` subdirectory in the app's directory, Shiny will serve the files in that directory as static assets, mounted at `/`. (1170)

* For Shiny Express apps, added `express.app_opts()`, which allows setting application-level options, like `static_assets` and `debug`. (1170)

* Closed 1079: For Shiny Express apps, automatically run a `globals.py` file in the same directory as the app file, if it exists. The code in `globals.py` will be run with the session context set to `None`. (1172)

Bug fixes

* Fixed `input_task_button` not working in a Shiny module. (1108)

* Fixed several issues with `page_navbar()` styling. (1124)

* Fixed `Renderer.output_id` to not contain the module namespace prefix, only the output id. (1130)

* Fixed gap-driven spacing between children in fillable `nav_panel()` containers. (1152)

* Fixed 1138: An empty value in a date or date range input would cause an error; now it is treated as `None`. (1139)

Other changes

* `render.data_frame` now properly fills its container by default. (1126)

* We improved the accessibility of the full screen toggle button in cards created with `ui.card(full_screen=True)`. Full-screen cards are now also supported on mobile devices. (1129)

* When entering and exiting full-screen card mode, Shiny now emits a client-side custom `bslib.card` event that JavaScript-oriented users can use to react to the full screen state change. (1129)

* The sidebar's collapse toggle now has a high `z-index` value to ensure it always appears above elements in the main content area of `ui.layout_sidebar()`. The sidebar overlay also now receives the same high `z-index` on mobile layouts. (1129)

* Updated example apps to use lower-case versions of `reactive.Calc`->`reactive.calc`, `reactive.Effect`->`reactive.effect`, and `reactive.Value`->`reactive.value`. (1164)

* Closed 1081: The `expressify()` function now has an option `has_docstring`. This allows the decorator to be used with functions that contain a docstring. (1163)

* Replaced use of `sys.stderr.write()` with `print(file=sys.stderr)`, because on some platforms `sys.stderr` can be `None`. (1131)

* Replaced soon-to-be deprecated `datetime` method calls when handling `shiny.datetime` inputs. (1146)

0.7.1

Bug fixes

* Fixed `render.download` not working in Express. (1085)

* `express.ui.hold()` can now accept any type of object, instead of just `TagChild` objects. (1089)

* Fixed an issue where `input_selectize` would not initialize correctly when created within a Shiny module. (1091)

0.7.0

Breaking Changes

* Closed 938: `page_sidebar()` and `page_navbar()` now use `fillable=False` by default. (990)

New features

* Added `shiny.ui.input_task_button()` for creating buttons that launch longer-running tasks than `shiny.ui.input_action_button()` was designed for. Task buttons give visual feedback that the task is running, and cannot be clicked again until the task is complete. (907)

* Added `extended_task` decorator for creating long-running tasks that can be cancelled. (907)

* Added `render.download` as a replacement for `session.download`, which is now deprecated. (977)

* Added `ui.output_code()`, which is currently an alias for `ui.output_text_verbatim()`. (997)

* Added `render.code`, which is an alias for `render.text`, but in Express mode, it displays the result using `ui.output_code()`. (997)

* Added `App.on_shutdown` method for registering a callback to be called when the app is shutting down. (907)

* You can now pass options to `ui.input_selectize` see the [selectize.js](https://selectize.dev/docs/API/selectize) docs for available options. (#914, 158)

* `ui.input_selectize` gains the `remove_button` argument which allows you to control the visibility of the remove button.

Bug fixes

* CLI command `shiny create`... (965)
* has added a `-d`/`--dir` flag for saving to a specific output directory
* will raise an error if if will overwrite existing files
* prompt users to install `requirements.txt`

* Fixed `js-react` template build error. (965)

* Fixed 1007: Plot interaction with plotnine provided incorrect values. (999)

Developer features

* Output renderers should now be created with the `shiny.render.renderer.Renderer` class. This class should contain either a `.transform(self, value)` method (common) or a `.render(self)` (rare). These two methods should return something can be converted to JSON. In addition, `.default_ui(self, id)` should be implemented by returning `htmltools.Tag`-like content for use within Shiny Express. To make your own output renderer, please inherit from the `Renderer[IT]` class where `IT` is the type (excluding `None`) required to be returned from the App author. (964)
* Legacy renderers that will be removed in the near future:
* `shiny.render.RenderFunction`
* `shiny.render.RenderFunctionAsync`
* `shiny.render.transformer.OutputRenderer`
* `shiny.render.transformer.OutputRendererSync`
* `shiny.render.transformer.OutputRendererAsync`

Other changes

* Pinned Starlette to version <0.35.0; versions 0.35.0 and 0.35.1 caused problems when deploying on Posit Connect. (1009
)

0.6.1.1

Bug fixes

* Fixed 935: `shiny create` required the `requests` package, but it was not listed as a dependency. It now uses `urllib` instead, which is part of the Python standard library. (940)

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.