Closed pckroon closed 11 months ago
@reactive.Effect
is for triggering side-effect actions (not returning a value for display in an output). Try changing:
@reactive.Effect
to
@output("value")
@render.text
That makes a uniformly grey page, with the following console output:
INFO: Started server process [1317270]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: 127.0.0.1:59456 - "GET / HTTP/1.1" 200 OK
INFO: ('127.0.0.1', 59466) - "WebSocket /websocket/" [accepted]
SEND: {"config": {"workerId": "", "sessionId": "e5fc3c14e345e05874667c332cadba15e40864a8292e50f3eaa7957908e5cb08", "user": null}}
INFO: connection open
RECV: {"method":"init","data":{".clientdata_output_slider_width":1896,".clientdata_output_slider_height":0,".clientdata_output_slider_bg":"rgb(255, 255, 255)",".clientdata_output_slider_fg":"rgb(33, 37, 41)",".clientdata_output_slider_accent":"rgb(13, 110, 253)",".clientdata_output_slider_font":{"families":["system-ui","-apple-system","Segoe UI","Roboto","Helvetica Neue","Noto Sans","Liberation Sans","Arial","sans-serif","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"],"size":"16px"},".clientdata_output_slider_hidden":false,".clientdata_output_value_hidden":false,".clientdata_pixelratio":1,".clientdata_url_protocol":"http:",".clientdata_url_hostname":"127.0.0.1",".clientdata_url_port":"8000",".clientdata_url_pathname":"/",".clientdata_url_search":"",".clientdata_url_hash_initial":"",".clientdata_url_hash":"",".clientdata_singletons":""}}
SEND: {"busy": "busy"}
SEND: {"busy": "busy"}
_send_error_response: 'str' object has no attribute '__name__'
remove_session: e5fc3c14e345e05874667c332cadba15e40864a8292e50f3eaa7957908e5cb08
INFO: connection closed
Ack, whoops, sorry, it needs to be @output(id="value")
, not @output("value")
That works! The example where I got my initial code in https://github.com/rstudio/py-shinywidgets/blob/main/examples/ipywidgets/app.py should probably be changed?
That works! The example where I got my initial code in https://github.com/rstudio/py-shinywidgets/blob/main/examples/ipywidgets/app.py should probably be changed?
Sounds like it, would you be interested in making a PR for that?
FTR I put the corrected example on shinylive here in order to see it working.
Sounds like it, would you be interested in making a PR for that?
Sure, I'll have some time later this week.
Hi all,
I'm still running into #56, so as directed I'm opening a new issue.
For the code below, the slider is there and works, but there is no string 'The value of the slider is: {reactive_read(s, 'value')}' to be found.