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

Dynamically populate the HTML repr #206

Closed
TomNicholas opened this issue Jan 19, 2023 · 4 comments
Closed

Dynamically populate the HTML repr #206

TomNicholas opened this issue Jan 19, 2023 · 4 comments
Labels
html repr HTML representation in a notebook

Comments

@TomNicholas
Copy link
Member

@andersy005, @jbusecke and I noticed that for big trees (hundreds or thousands of nodes) the HTML repr can become very slow to render, potentially locking up your jupyter notebook.

We think that's because the HTML representing the whole tree is pre-rendered in one go, and hidden by defaulting sections to be closed. If your tree contains thousands of nodes that's a lot of HTML to render.

@andersy005 suggested that perhaps the HTML repr should contain some kind of callback, so that the code to render new nodes is only opened

I don't know if that's possible at all, or whether it would work for reprs rendered in non-interactive environments (such as in xarray's static docs pages).

@TomNicholas TomNicholas added the html repr HTML representation in a notebook label Jan 19, 2023
@satyamksharma
Copy link

Hi there can you assign me to this issue

@norlandrhagen
Copy link

This improvement would be great! I recently created a datatree object with ~150 or so nodes and opening the repr was very clunky.

@TomNicholas
Copy link
Member Author

I would love for this to happen but really have no idea how to do it (HTML is not my strong suit!) If anyone else has any time, tips, or examples of similar callbacks in other code then that would be very helpful.

@flamingbear
Copy link
Contributor

closed for pydata/xarray#9350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
html repr HTML representation in a notebook
Projects
None yet
Development

No branches or pull requests

4 participants