-
Notifications
You must be signed in to change notification settings - Fork 949
Delete html fallback message. #2007
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
Conversation
This reverts jupyter-widgets#1674, since we discovered some problems with the classic notebook and html outputs. Fixes jupyter-widgets#1777 Fixes jupyter-widgets#1951
I'll also add a docs page explaining what to do if you see this, but were hoping to see widgets, basically containing the helpful text here. |
Note: The |
Good point. Can we try it out and see? At least it's informative of what you're missing, instead of boilerplate text that gets repetitive after a while. |
If this is only intended as a stop-gap measure until #1777 / jupyter/notebook#2980 gets fixed, then sure. My preferred long-term solution would be a short HTML entry with a link to an entry in the docs describing the possible causes of seeing the message. Use case where the repr is longer than the current message: pythreejs, e.g. https://github.com/jovyan/pythreejs/blob/master/examples/Animation.ipynb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine as a temporary workaround.
I agree with Vidar about where we want to end up eventually.
ipywidgets/widgets/widget.py
Outdated
@@ -708,7 +708,6 @@ def _ipython_display_(self, **kwargs): | |||
# http://www.iana.org/assignments/media-types/media-types.xhtml. | |||
data = { | |||
'text/plain': repr(self), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to ensure this never gets too big, how about repr(self)[:160]
(or some other appropriate number).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is nice to have the full repr available, I'm just arguing whether that should be the fallback format or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you can always do repr()
to get the full repr, I think chopping it off (and appending an ellipsis) is a good compromise for the fallback.
+1 |
This prevents huge text output when it is a fallback. Length 110 is chosen as it fits on a single line in the classic Notebook.
LGTM |
As long as we agree on the long term solution, I'm happy with the suggested solution. |
Great, thanks! |
This reverts #1674, since we discovered some problems with the classic notebook and html outputs.
Fixes #1777
Fixes #1951