Skip to content
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

Print option? #7

Open
roxchkplusony opened this issue Apr 27, 2023 · 10 comments · May be fixed by #10
Open

Print option? #7

roxchkplusony opened this issue Apr 27, 2023 · 10 comments · May be fixed by #10
Labels
enhancement New feature or request

Comments

@roxchkplusony
Copy link

I'm wondering if it's possible to make the output cell renderable to export formats like HTML, PDF, etc. Essentially, can we turn the display into SVG, PNG, or JPEG, and embed them?

@krassowski krassowski added the enhancement New feature or request label Apr 27, 2023
@krassowski
Copy link
Owner

Thanks for opening this. The output is implemented in SVG format, so it should be also possible to add an option to export it to a standalone file (HTML, SVG). Once HTML/SVG is exported one could use browser's ability to convert anything into PDF if needed. Speaking of which, one could also export entire notebook/file to PDF using nbconvert's webpdf (see https://nbconvert.readthedocs.io/en/latest/install.html).

How do you imagine the export function should be exposed?

@roxchkplusony
Copy link
Author

I'm pretty new to the area. I just noticed that Instead I get the following:
Cursor_and_Superpowered

@krassowski
Copy link
Owner

What version of JupyterLab are you using? Or are you using Jupyter Notebook? Did you try reloading/restarting it after installation?

@roxchkplusony
Copy link
Author

JupyterLab v3.6.3. This works fine inside lab. The HTML, PDF, etc, look like the screenshot.

@krassowski
Copy link
Owner

Sorry, I did not get that this is a screenshot of exported notebook. Does it also happen with webpdf export specifically (as compared to standard pdf export)?

@roxchkplusony
Copy link
Author

Sorry, I did not get that this is a screenshot of exported notebook. Does it also happen with webpdf export specifically (as compared to standard pdf export)?

Just gave it a try and it came back with the same object pointer kind of result. I ran:

jupyter nbconvert --to webpdf --allow-chromium-download Untitled.ipynb

@krassowski
Copy link
Owner

Thanks for testing! I will take a look. Last suggestion: are your notebooks trusted? Could you try trusting them manually (Trust notebook from command palette, then save) before exporting?

@roxchkplusony
Copy link
Author

Thanks for testing! I will take a look. Last suggestion: are your notebooks trusted? Could you try trusting them manually (Trust notebook from command palette, then save) before exporting?

It says "Notebook already signed"

@jonvitale
Copy link

Any update here, I just see a reference object when I try to show my dag.

@krassowski krassowski linked a pull request Aug 29, 2023 that will close this issue
@krassowski
Copy link
Owner

I opened a draft PR #10 - in principle it works but in practice it either only renders 50% of the time, or there are problems with sizing (depending on whether the model gets updated with delay/in update method or in render method):

Screenshot from 2023-08-29 11-52-12

The problem is that the dagitty internal logic to resize only triggers after the node is attached. This will require some method to make dagitty resize to the image synchronously.

I am not sure how svg will render in standard PDFs but it certainly does well html and webpdf export.

@roxchkplusony roxchkplusony closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
@krassowski krassowski reopened this Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants