You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,53 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [UNRELEASED]
9
9
10
+
11
+
12
+
## [0.3.2] - 2024-04-16
13
+
14
+
* Fixed a bug with multiple altair outputs not working inside a `@shiny.render.ui` decorator. (#140)
15
+
*`@render_widget` no longer errors out when giving a `altair.FacetChart` class. (#142)
16
+
*`@render_widget` no longer fails to serialize `decimal.Decimal` objects. (#138)
17
+
18
+
## [0.3.1] - 2024-03-01
19
+
20
+
* Widgets no longer have a "flash" of incorrect size when first rendered. (#133)
21
+
*`@render_widget` now works properly with `Widget`s that aren't `DOMWidget`s (i.e., widgets that aren't meant to be displayed directly). As a result, you can now use `@render_widget` to gain a reference to the widget instance, and then use that reference to update the widget's value. (#133)
22
+
23
+
## [0.3.0] - 2024-01-25
24
+
25
+
* The `@render_widget` decorator now attaches a `widget` (and `value`) attribute to the function it decorates. This allows for easier access to the widget instance (or value), and eliminates the need for `register_widget` (which is now soft deprecated). (#119)
26
+
* Added decorators for notable packages that require coercion to the `Widget` class: `@render_altair`, `@render_bokeh`, `@render_plotly`, and `@render_pydeck`. Using these decorators (over `@render_widget`) helps with typing on the `widget` attribute. (#119)
27
+
* The `.properties()` method on `altair.Chart` object now works as expected again. (#129)
28
+
* Reduce default plot margins on plotly graphs.
29
+
30
+
## [0.2.4] - 2023-11-20
31
+
32
+
* Fixed several issues with filling layout behavior introduced in 0.2.3. (#124, #125)
33
+
*`reactive_read()` now throws a more informative error when attempting to read non-existing or non-trait attributes. (#120)
34
+
35
+
## [0.2.3] - 2023-11-13
36
+
37
+
* Widgets now `fill` inside of a `fillable` container by default. For examples, see the [ipyleaflet](https://github.com/posit-dev/py-shinywidgets/blob/main/examples/ipyleaflet/app.py), [plotly](https://github.com/posit-dev/py-shinywidgets/blob/main/examples/plotly/app.py), or other [output](https://github.com/posit-dev/py-shinywidgets/blob/main/examples/outputs/app.py) examples. If this intelligent filling isn't desirable, either provide a `height` or `fillable=False` on `output_widget()`. (#115)
38
+
*`as_widget()` uses the new `altair.JupyterChart()` to coerce `altair.Chart()` into a `ipywidgets.widgets.Widget` instance. (#113)
39
+
40
+
## [0.2.2] - 2023-10-31
41
+
42
+
*`@render_widget` now builds on `shiny`'s `render.transformer` infrastructure, and as a result, it works more seamlessly in `shiny.express` mode. (#110)
43
+
* Closed #104: Officially support for Python 3.7.
44
+
45
+
## [0.2.1] - 2023-05-15
46
+
47
+
* Actually export `as_widget()` (it was mistakenly not exported in 0.2.0).
48
+
49
+
## [0.2.0] - 2023-04-13
50
+
51
+
* Closed #43: Fixed an issue where widgets would sometimes not load in a dynamic UI context. (#91, #93)
10
52
* Closed #14: Added a `bokeh_dependency()` function to simplify use of bokeh widgets. (#85)
53
+
* Closed #89: Exported `as_widget()`, which helps to coerce objects into ipywidgets, and is especially helpful for creating ipywidget objects before passing to `register_widget()` (this way, the ipywidget can then be updated in-place and/or used as a reactive value (`reactive_read()`)). (#90)
54
+
* Closed #94: New `SHINYWIDGETS_CDN` and `SHINYWIDGETS_CDN_ONLY` environment variables were added to more easily specify the CDN provider. Also, the default provider has changed from <unpkg.com> to <cdn.jsdelivr.net/npm> (#95)
55
+
* A warning is no longer issued (by default) when the path to a local widget extension is not found. This is because, if an internet connection is available, the widget assests are still loaded via CDN. To restore the previous behavior, set the `SHINYWIDGETS_EXTENSION_WARNING` environment variable to `"true"`. (#95)
56
+
* Closed #86: Fixed an issue with `{ipyleaflet}` sometimes becoming unresponsive due to too many mouse move event messages being sent to the server. (#98)
including `height` and `width`. So, given a `Widget` instance `w`, you should be able to
179
-
do something like:
180
-
181
-
```py
182
-
w.layout.height ="600px"
183
-
w.layout.width ="80%"
184
-
```
185
-
186
-
### How do I hide/show a widget?
187
-
188
-
As mentioned above, a `Widget` class should have a `layout` attribute, which can be
189
-
used to set all sorts of CSS styles, including display and visibility. So, if you wanted
190
-
to hide a widget and still have space allocated for it:
191
-
192
-
```py
193
-
w.layout.visibility ="hidden"
194
-
```
195
-
196
-
Or, to not give it any space:
197
-
198
-
```py
199
-
w.layout.display ="none"
200
-
```
201
-
202
-
### Can I render widgets that contain other widgets?
203
-
204
-
Yes! In fact this a crucial aspect to how packages like `{ipyleaflet}` work. In
205
-
`{ipyleaflet}`'s case, each [individual marker is a widget](https://ipyleaflet.readthedocs.io/en/latest/layers/circle_marker.html) which gets attached to a `Map()` via `.add_layer()`.
206
-
207
-
### Does `{shinywidgets}` work with Shinylive?
208
-
209
-
Shinylive allows some Shiny apps to be statically served (i.e., run entirely in the
210
-
browser). [py-shinylive](https://github.com/rstudio/py-shinylive) does have some special
211
-
support for `{shinywidgets}` and it's dependencies, which should make most widgets work
212
-
out-of-the-box.
213
-
214
-
In some cases, the package(s) that you want to use may not come pre-bundled with
215
-
`{shinywidgets}`; and in that case, you can [include a `requirements.txt`
216
-
file](https://shinylive.io/py/examples/#extra-packages) to pre-install those other
217
-
packages
218
-
219
-
## Troubleshooting
220
-
221
-
If after [installing](#installation)`{shinywidgets}`, you have trouble rendering widgets,
222
-
first try running the "hello world" ipywidgets [example](https://github.com/rstudio/py-shinywidgets/blob/main/examples/ipywidgets/app.py). If that doesn't work, it could be that you have an unsupported version
223
-
of a dependency like `{ipywidgets}` or `{shiny}`.
224
-
225
-
If you can run the "hello world" example, but "3rd party" widget(s) don't work, first
226
-
check that the extension is properly configured with `jupyter nbextension list`. Even if
227
-
the extension is properly configured, it still may not work right away, especially if
228
-
that widget requires initialization code in a notebook environment. In this case,
229
-
`{shinywidgets}` probably won't work without providing the equivalent setup information to
230
-
Shiny. Some known cases of this are:
231
-
232
-
#### bokeh
233
-
234
-
To use `{bokeh}` in notebook, you have to run `bokeh.io.output_notebook()`. The
235
-
equivalent thing in Shiny is to include the following in the UI definition:
236
-
237
-
```py
238
-
from shiny import ui
239
-
from shinywidgets import bokeh_dependencies
240
-
241
-
app_ui = ui.page_fluid(
242
-
bokeh_dependencies(),
243
-
# ...
244
-
)
245
-
```
246
-
```
247
-
#### Other widgets?
248
-
249
-
Know of another widget that requires initialization code? [Please let us know about
0 commit comments