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
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,10 @@ All notable changes to shinywidgets will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [UNRELEASED]
9
+
10
+
*`as_widget()` uses the new `altair.JupyterChart()` to coerce `altair.Chart()` into a `ipywidgets.widgets.Widget` instance. (#120)
11
+
8
12
## [0.2.2] - 2023-10-31
9
13
10
14
*`@render_widget` now builds on `shiny`'s `render.transformer` infrastructure, and as a result, it works more seamlessly in `shiny.express` mode. (#110)
Copy file name to clipboardExpand all lines: README.md
+8-27Lines changed: 8 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,18 +18,19 @@ See the [using ipywidgets section](https://shiny.rstudio.com/py/docs/ipywidgets.
18
18
19
19
### What ipywidgets are supported?
20
20
21
-
In theory, shinywidgets supports any instance that inherits from `{ipywidgets}`' `Widget` class.
21
+
In theory, shinywidgets supports any instance that inherits from `{ipywidgets}`' `Widget` class. That is, if `isinstance(obj, ipywidgets.widgets.Widget)` returns `True` for some object `obj`, then `{shinywidgets}` should be able to render it.
22
22
23
-
That said, `{shinywidgets}` can also "directly" render objects that don't inherit from `Widget`, but have a known way of coercing into a `Widget` instance. This list currently includes:
23
+
`{shinywidgets}` can also render objects that don't inherit from `Widget`, but have a known way of coercing into a `Widget` instance. This list currently includes:
24
24
25
-
* Altair charts (via the [vega](https://pypi.org/project/vega/) package).
26
-
* Bokeh widgets (via the [jupyter_bokeh](https://github.com/bokeh/jupyter_bokeh) package).
* Pydeck's `Deck` class (via it's `.show()` method).
28
+
* Bokeh widgets (via the [jupyter_bokeh](https://github.com/bokeh/jupyter_bokeh) package).
29
+
* Bokeh widgets are a bit of a special case, as they require some extra setup to work in Shiny. See the [Bokeh widgets aren't displaying, what gives?](#bokeh-widgets-arent-displaying-what-gives) section below for more details.
29
30
30
-
[See here](https://github.com/rstudio/py-shinywidgets/blob/main/shinywidgets/_as_widget.py) for more details on how these objects are coerced into `Widget` instances, and if you know of other packages that should be added to this list, please [let us know](https://github.com/rstudio/py-shinywidgets/issues/new)
31
+
[See here](https://github.com/rstudio/py-shinywidgets/blob/main/shinywidgets/_as_widget.py) for more details on how these objects are coerced into `Widget` instances, and if you know of other packages that should be added to this list, please [let us know](https://github.com/rstudio/py-shinywidgets/issues/new).
31
32
32
-
### Bokeh widgets aren't displaying, what gives?
33
+
### Bokeh setup
33
34
34
35
Similar to how you have to run `bokeh.io.output_notebook()` to run `{bokeh}` in notebook, you also have to explicitly bring the JS/CSS dependencies to the Shiny app, which can be done this way:
35
36
@@ -94,26 +95,6 @@ that widget requires initialization code in a notebook environment. In this case
94
95
`{shinywidgets}` probably won't work without providing the equivalent setup information to
95
96
Shiny. Some known cases of this are:
96
97
97
-
#### bokeh
98
-
99
-
To use `{bokeh}` in notebook, you have to run `bokeh.io.output_notebook()`. The
100
-
equivalent thing in Shiny is to include the following in the UI definition:
101
-
102
-
```py
103
-
from shiny import ui
104
-
from shinywidgets import bokeh_dependencies
105
-
106
-
app_ui = ui.page_fluid(
107
-
bokeh_dependencies(),
108
-
# ...
109
-
)
110
-
```
111
-
112
-
113
-
#### Other widgets?
114
-
115
-
Know of another widget that requires initialization code? [Please let us know about
0 commit comments