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

JSON display objects not rendered properly in notebook #5446

Open
norweeg opened this issue May 13, 2020 · 7 comments
Open

JSON display objects not rendered properly in notebook #5446

norweeg opened this issue May 13, 2020 · 7 comments

Comments

@norweeg
Copy link

norweeg commented May 13, 2020

A minimal example of the problem:

from IPython.display import display, JSON
json_dict = {"my data":{1:"this", 2:"is", 3:"a", 4:"test"}}
display(JSON(json_dict, expanded=True))

in notebook, this outputs:
image

in jupyterlab, however, this renders correctly as:
image

Jupyter version:
image

Also occurs in Jupyter running in python 3.7. Multiple browsers (Chrome, Edge) and multiple systems tested.

@marscher
Copy link

marscher commented May 3, 2021

Is this going to be supported? I have a code supporting both notebook and lab environments, but the different behaviour here gives me a headage.

@kevin-bates
Copy link
Member

I would hope this could be addressed as part of item 2 in our README notice.

@kevin-bates
Copy link
Member

Here's some more information relative to my previous comment: jupyterlab/jupyterlab#9869

@iorlas
Copy link

iorlas commented Oct 13, 2022

@kevin-bates Alright-alright. I know this ticket might be quite old, but really, this issue arise in the IntelliJ IDEA, so I guess it is their issue. But I'm not sure what they have to do. Should they change the frontend? Which frontend should they use then?

@kevin-bates
Copy link
Member

Hi @iorlas. I see that the README notice item referenced above has been removed due to the recent progress that's been made toward a Notebook 7 release - so I'm including it here for completeness:

  1. To address JupyterLab feature parity issues. As part of this effort, we are also working on a better notebook-only experience in JupyterLab for users who prefer the UI of the classic Jupyter Notebook.

I can't speak to the IntelliJ IDEA integration, but the Notebook 7 release should address this issue since it will be using the Lab framework and will offer an option to display the "classic" interface. Notebook 7.0.0a7 is available and can be installed via pip install --pre notebook. Integrators will likely want to wait until the target release is generally available, but, to address this particular issue (as well as others), they will want to use NB7.

@leorochael
Copy link

I came here from Google Colaboratory, where:

  • display(JSON(json_dict, expanded=True))

just renders as:

  • <IPython.core.display.JSON object>

I'm wondering if there is any functionality that I can call by hand from IPython.display module to produce some html from the JSON rendering.

@norweeg
Copy link
Author

norweeg commented Nov 13, 2024

I came here from Google Colaboratory, where:

  • display(JSON(json_dict, expanded=True))

just renders as:

  • <IPython.core.display.JSON object>

I'm wondering if there is any functionality that I can call by hand from IPython.display module to produce some html from the JSON rendering.

maybe try the panel JSON widget instead? https://panel.holoviz.org/reference/panes/JSON.html

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

No branches or pull requests

5 participants