-
Notifications
You must be signed in to change notification settings - Fork 15
Fix render of PDF chart images #171
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
Comments
This seems to be a hard nut to crack... I have spent most of today trying to figure this out but can't find something that works well:
I'm not sure what to try next (maybe saving to disk or using vlconvert) but I need a break to focus on a few other things for the rest of the day. I'll open an issue in the jupyter book repo as well. |
As an update I am able to display them now, but have no way to control size and resolution, and I'm not sure my current workaround will allow for that. |
After some additional hours on this, it seems like the main issue is that jupyterbook's latex output does not play nicely with SVGs. If it did, I think all we need would be to enable the svg renderer and be done with it. I posted more details and asked for help in executablebooks/MyST-NB#370 (comment) |
I've heard nothing from the Juptyer Book community regarding displaying SVGs in the pdflatex build, so it seems like this is not a priority for them. I have worked with one of the other altair developers to have a solution directly via altair instead that allows us to see high dpi pngs in the book, but we are depending on a new version of an external package being released before bringing the feature into altair. It seems like this could happen within a month, so I just wanted to check in what is the timeline on having this fixed (we could get low resolution images already if we just want to play around with things). |
Thanks for all your efforts @joelostblom -- I think holding off for a month on the PDF build is just fine. We can wait for the altair fix while working on the actual content of the book. I imagine getting the PDF build looking nice will take a week or so in total once content is settled, so not a big deal if I can only start on that in a month. |
@joelostblom just following up on this since you're mostly done your sweep through all the chapters / worksheets / tutorials. Any update? |
Yup! We just merged this functionality into Altair in vega/altair#3163. The new release (5.1) should be cut this week. We need to silently set something like this at the beginning of each notebook only for the PDF build (adjusting
I am thinking we can either do it by putting that line in the ipython startup file in the docker container, or if this for some reason does not work with jupyter book execution, we could create a hidden cell at the top of each notebook and drop a unique string pattern as a comment there and then use |
@joelostblom there should be a way to check for the PDF vs HTML build idiomatically in python during build... I would at least check for that before going the |
Also, if that isn't the case, here's a better option than
with
do similar with the HTML version and then in the source files just check the |
Clever idea, thank you! Too bad I spent time on the plane with my |
@joelostblom I've got the PDF build working now (just run
build_pdf.sh
), but all the charts don't render properly. They all look like:Perhaps you know the fix for this? I tried playing with stuff here but no luck.
The text was updated successfully, but these errors were encountered: