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

Several display in cell causes html export to bug #338

Closed
JulienBrn opened this issue Nov 28, 2024 · 3 comments · Fixed by #344
Closed

Several display in cell causes html export to bug #338

JulienBrn opened this issue Nov 28, 2024 · 3 comments · Fixed by #344

Comments

@JulienBrn
Copy link

I have been using itables with great success in Jupyter notebooks, however, a small bug seems to be occurring when exporting the notebooks to static html (which I regularly do): after the first call to display, all other cell outputs are not rendered (note that all is well rendered from within vscode). This happens both using the vscode export to html button or running nbconvert directly from the command line. I do not know whether this is a nbconvert bug or an itable bug, but since this problem seems to be specifically occurring with itables, I felt I should start here.

The test notenook has the following cells:

import pandas as pd
import itables
itables.init_notebook_mode(all_interactive=True)
df = pd.DataFrame([["some_data"]])
print("this will be rendered")
display(df)
print("this and the following table are not rendred")
display(df)

Image of the rendered html (on firefox)

Screenshot from 2024-11-28 14-09-06

You will find the jupyter file and the converted html file in this archive.
itables_bug.zip

@mwouts
Copy link
Owner

mwouts commented Nov 29, 2024

Thanks for reporting, I will have a look!

@JulienBrn
Copy link
Author

I have looked a bit at the generated html and the problem is that the two divs with class jp-OutputArea-child corresponding to the following code are not within the jp-OutputArea jp-Cell-outputArea div. Moving them within solves the problem.

print("this and the following table are not rendred")
display(df)

Screenshot from 2024-12-04 14-39-03

However, I do not know why these divs are misplaced. Perhaps some javascript in itables is moving them ?

mwouts added a commit that referenced this issue Dec 7, 2024
@mwouts mwouts mentioned this issue Dec 7, 2024
mwouts added a commit that referenced this issue Dec 7, 2024
@mwouts
Copy link
Owner

mwouts commented Dec 7, 2024

Thanks @JulienBrn for looking into this!

I have been able to address this issue by removing some divs elements within the table, see the attached PR - it was just about the loading message!

I am going to release ITables v2.2.4 which should not have this issue anymore.

mwouts added a commit that referenced this issue Dec 7, 2024
mwouts added a commit that referenced this issue Dec 7, 2024
mwouts added a commit that referenced this issue Dec 7, 2024
mwouts added a commit that referenced this issue Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants