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

expanded HTML repr when opening notebook #4041

Closed
dcherian opened this issue May 6, 2020 · 16 comments · Fixed by #4053
Closed

expanded HTML repr when opening notebook #4041

dcherian opened this issue May 6, 2020 · 16 comments · Fixed by #4053

Comments

@dcherian
Copy link
Contributor

dcherian commented May 6, 2020

When I open a notebook, the new HTML repr is "expanded":

image

I'm running

jupyter core     : 4.6.3
jupyter-notebook : 6.0.3
qtconsole        : 4.7.2
ipython          : 7.13.0
ipykernel        : 5.2.0
jupyter client   : 6.1.2
jupyter lab      : 2.1.0
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.4
traitlets        : 4.3.3

and see this behaviour with both the notebook and jupyterlab interface; on both chrome and firefox (both on linux).

Is anyone else seeing this?

@aaronspring
Copy link
Contributor

me too on Firefox linux

@jkmacc-LANL
Copy link

Same here, Firefox on a Mac.

@dcherian
Copy link
Contributor Author

dcherian commented May 9, 2020

Maybe @jsignell can help fix this.

@jsignell
Copy link
Contributor

Yeah I can take a look now.

@jsignell
Copy link
Contributor

I can't reproduce:

image

Tried on chrome and firefox on linux. Can you inspect the element in your browser console and see if there is a <style></style> section for the repr? It seems like that might not be getting in properly

@dcherian
Copy link
Contributor Author

Thanks for taking a look @jsignell. Here are some notes I made while trying to reproduce.

  1. I cannot reproduce at all locally with the same browsers. This problem may only occur with ssh tunneling. I tunnel to a remote machine; start a jupyter server; and then connect through a tunnel to that server. The next two points are about the remote notebook.

  2. Looks like there is no style attribute (this is from an older notebook with the problem)
    image

There are two output cells with reprs, both of which are not styled correctly.

  1. Now I run the first cell.
    image

The first cell looks right (and has a style attribute). The second one has auto-updated and looks OK but is missing the style attribute, as well as the click-to-show-data-values functionality.
image

This "auto updating" behaviour is new i.e. wasn't happening last week. I'm on chrome 81 now so maybe all of this is just browser weirdness?

@jsignell
Copy link
Contributor

Huh and if you re-run cell 69 does it render correctly? I'm on chrome 80, but if you were seeing this in firefox as well it seems like it's more likely to be a jupyterlab thing.

@jsignell
Copy link
Contributor

It seems like the auto-update thing works for css, but not for icons.

@dcherian
Copy link
Contributor Author

Yes the repr works perfectly when re-running these cells. The issue here is when I open an existing notebook with reprs in output cells.

I am on firefox beta :/ but yes it could be a jupyterlab thing.

@jsignell
Copy link
Contributor

Does it seem possible that you had originally run it in jlab and then opened it in notebook or vice versa? I've seen html output get kind of messed up under those conditions, but I've never really stopped to debug it thoroughly.

@dcherian
Copy link
Contributor Author

oh yes that is quite likely.

@jsignell
Copy link
Contributor

Hmm. Ok. I'm still not sure why the html would get messed up under that scenario though.

@benbovy
Copy link
Member

benbovy commented May 11, 2020

Might be explained by #1820 (comment) ?

@jsignell
Copy link
Contributor

Yes that seems like the explanation. Thanks @benbovy! I would expect dask to have the same behavior then since they pass in the style tag in the same way.

@benbovy
Copy link
Member

benbovy commented May 11, 2020

Maybe we could use some sort of hack with HTML hidden attribute and some CSS, in order to show the plain text repr when CSS is not injected... Not ideal but at least it would be better than the HTML repr shown without CSS style.

@shoyer
Copy link
Member

shoyer commented May 12, 2020

I’ve seen similar issues with the seeing unformatted CSS in notebooks on Github. I do think some sort of fallback to pure text mode would be great if we could make it work...

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.

6 participants