How do I properly implement Shiny for Python Modules in Quarto? #12189
-
DescriptionI'm attempting to use Shiny for Python modules in a Quarto Dashboard. It needs access to the session to run properly. I'm looking for guidance or examples of using Shiny for Python modules in Quarto Dashboard. The UI portion of the module runs, but I can't seem to get the server function to run as it needs access to the Shiny session. Main qmd:
map_view.py:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
Could you properly format your post using code blocks for code and terminal outputs? Thanks. Did you take a look at the documentation? https://quarto.org/docs/dashboards/interactivity/shiny-python/index.html |
Beta Was this translation helpful? Give feedback.
-
Updated. Yes, I've read and re-read the docs multiple times and it does not use modules for code examples or reference their usage. Also, it's not clear to me how modules in Shiny for R would work in Quarto Dashboards either. What I'm trying to understand is how the session object gets passed to modules in a Quarto Dashboard format using a shiny runtime. I previously tried building a traditional I then attempted to assign a session object and pass that to the module, but that threw an error that I think it's 100%b reasonable if "Shiny modules aren't intended for Quarto interactive Dashboards in either R or Python." But I don't see docs or discussion saying it's not possible. |
Beta Was this translation helpful? Give feedback.
-
I'll pursue the question elsewhere. Thanks for your time. |
Beta Was this translation helpful? Give feedback.
I wrote up an explanation and provided a workaround here: #12210 (comment)
The workaround is basically to write Shiny Core code.