-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Net Interactive using Svg (or other static) images? #65
Comments
Wow that would definitely be useful. Could you by any chance have a look at the mimetype that the current output is set to? In the issue you linked, this seems to be the catch :
I would guess that the current procedure leads to html, which explains why converting to html works but to a PDF does not. This issue however deeply relates to #21. The plot svg is rendered AFTER the html scaffold is inserted by a javascript function. This means #21 should also fix this issue, as we could then yield the pure svg/jpeg/whatever is of interest without the html around it. |
It makes sense that #21 is limiting things here. On the mimetype, you are correct that it produces html. The current mimetype is here, and if you do
Here's a simple example trying to output svg (without a formatter), and it's calling javascript to produce the image. As you indicated, it would explain why pandoc works with html but not pdf: |
@nhirschey I added a special section in the docs for the new |
@kMutagene thank you! This is amazing and I am incredibly excited to use both new features (regular static png + notebook static png). |
Description
I want to use pandoc to convert a f# .ipynb notebook containing Plotly.NET figures to pdf. However, the conversion does not show any figures in the pdf output. I think that the issue is that Plotly.NET.Interactive renders them using javascript that gets ignored by pandoc.
pandoc notebook.ipynb -o notebook.html
works fine and includes figures. Butpandoc notebook.ipynb -o notebook.pdf
does not have any figures in it.This resolved pandoc issue (jgm/pandoc#6430) suggests that the conversion should be fine in python notebooks using
plotly.io.renderers.default = "svg"
.Can we allow a similar option in Plotly.NET.Interactive? Pandoc interop is useful because .net interactive does not have a way to save the file as a pdf or html file.
Workarounds
A current workaround to get pdf output is to use pandoc to convert to html, then use the browser's save as pdf feature to product a pdf.
The text was updated successfully, but these errors were encountered: