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
In Quarto we do some adjustment in Jupyter context - by default we set notebook_connected, unless in format: dashboard where we use notebook by default. We then handle the dependencies, and add possibly missing require.js and jQuery
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
Looking at the intermediate .md file, I noticed that the plotly js deps was not included in the raw block created. And it is not included as HTML dependencies in includes.
So somehow, it is not catched.
Looking in debug mode, this is what I noticed in such mode plotly_mimetype+notebook. I believe the dependency is something printed as stdout and captured - which is currently un-used.
I did the following at the breakpoint at code above
I 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 if browser 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.
The text was updated successfully, but these errors were encountered:
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
reticulate/R/knitr-engine.R
Lines 567 to 576 in b1c33d5
Though from some test, I don't think this is applied. It seems
browser
is the default one.Changing the value of this to something like
notebook_connected
for example, does not work.Plots does not show. Because plotly.js is not included. This includes also setting to the supposed default
plotly_mimetype+notebook
So I looked at how the plotly output and dependencies are handled in reticulate
This goes in there
reticulate/R/knitr-engine.R
Lines 710 to 716 in b1c33d5
Looking at the intermediate .md file, I noticed that the plotly js deps was not included in the raw block created. And it is not included as HTML dependencies in includes.
So somehow, it is not catched.
Looking in debug mode, this is what I noticed in such mode
plotly_mimetype+notebook
. I believe the dependency is something printed as stdout and captured - which is currently un-used.I did the following at the breakpoint at code above
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.
The text was updated successfully, but these errors were encountered: