Open cderv opened 8 months ago
If I recall correctly, I started setting a default renderer specifically for CI---on Ubuntu running in headless mode on GHA runners, the default render would be unset, result in an error. As far as I know, this was never a user issue, just our own CI that was failing.
I'm happy to make any changes you recommend! At this point you're more familiar with plotly internals, and any second order effects in quarto or rmarkdown that changes to this code might have. Suggestions welcome :)
This is the result of an investigation for
Context
Plotly in python offers some renderers configurations : https://plotly.com/python/renderers/#interactive-renderers
In Quarto we do some adjustment in Jupyter context - by default we set
notebook_connected
, unless informat: dashboard
where we usenotebook
by default. We then handle the dependencies, and add possibly missingrequire.js
andjQuery
It happens that there is some difference when using reticulate and plotly in Dashboard with Jupyter engine and plotly. So I looked into it to understand.
This raises some questions.
reticulate behavior.
I was curious of which renderers was used in reticulate context. Quarto does not do anything for R on this.
I saw that reticulate is setting a default if none set https://github.com/rstudio/reticulate/blob/b1c33d5797b1478ebddf876f0284ac953b086c0d/R/knitr-engine.R#L567-L576
Though from some test, I don't think this is applied. It seems
browser
is the default one.Page 1
and then
data
is only the<div>
with the id that a script fillsthe dependency happens to be in
capt
, so the captured output as a JSONI don't know if
notebook
is really supposed to work with reticulate and if it is required to make it works, but this raises question on plotly handling to me in knitting context.We should be able to catch dependencies and includes it as
knit_meta
like others. I don't know ifbrowser
renderers is a good default also (or an expected default).Happy to discuss and work on something. I believe there needs to be some adaptation for correct rendering in Quarto context.