## Quand on click ce boutton un affichage ce produit
## Quand on click ce boutton un affichage ce produit
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
# sort of based on https://github.com/voila-dashboards/voila-material/issues/18
# sort of based on https://github.com/voila-dashboards/voila-material/issues/18
importipywidgetsaswidgets
importipywidgetsaswidgets
fromIPython.displayimportdisplay
fromIPython.displayimportdisplay
output=widgets.Output()
output=widgets.Output()
@output.capture(clear_output=False,wait=True)# based on https://github.com/jupyter-widgets/ipywidgets/issues/1846 and https://ipywidgets.readthedocs.io/en/latest/examples/Output%20Widget.html
@output.capture(clear_output=False,wait=True)# based on https://github.com/jupyter-widgets/ipywidgets/issues/1846 and https://ipywidgets.readthedocs.io/en/latest/examples/Output%20Widget.html
Si l'on veut utiliser Bokeh, les choses se complique :
Si l'on veut utiliser Bokeh, les choses se complique :
+ L'interaction avec ipywidget ne fonctionne pas sur voilà aucun affichage
+ L'interaction avec ipywidget ne fonctionne pas sur voilà aucun affichage
+ L'interaction "Bokeh" standard fonctionne sur jupyterlab mais affiche `JavaScript output is disabled in JupyterLab` sur voilà, voir [#108](https://github.com/voila-dashboards/voila/issues/108)
+ L'interaction "Bokeh" standard fonctionne sur jupyterlab mais affiche `JavaScript output is disabled in JupyterLab` sur voilà, voir [#108](https://github.com/voila-dashboards/voila/issues/108)
+ L'interaction en mode bokeh [app embarquée](https://github.com/bokeh/bokeh/blob/2.2.3/examples/howto/server_embed/notebook_embed.ipynb), fonctionne sur jupyter et voilà embarqué dans jupyter mais demande ouvre une websocket sur un port indeterminé => l'enfer pour le reverse proxy
+ L'interaction en mode bokeh [app embarquée](https://github.com/bokeh/bokeh/blob/2.2.3/examples/howto/server_embed/notebook_embed.ipynb), fonctionne sur jupyter et voilà embarqué dans jupyter mais demande ouvre une websocket sur un port indeterminé => l'enfer pour le reverse proxy
**Finalement [#244](https://github.com/voila-dashboards/voila/issues/244#issuecomment-514341910) done la solution : embarquer le code bokeh dans [panel holoviz](https://panel.holoviz.org/user_guide/index.html)**
**Finalement [#244](https://github.com/voila-dashboards/voila/issues/244#issuecomment-514341910) done la solution : embarquer le code bokeh dans [panel holoviz](https://panel.holoviz.org/user_guide/index.html)**
Cela signifie qu'on utilise l'[interaction de panel](https://panel.holoviz.org/user_guide/Interact.html)
Cela signifie qu'on utilise l'[interaction de panel](https://panel.holoviz.org/user_guide/Interact.html)
Voici un exemple "simple"
Voici un exemple "simple" inspiré [de celui-ci](https://panel.holoviz.org/gallery/simple/iris_kmeans.html#simple-gallery-iris-kmeans)