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

Wrap docstrings earlier to avoid lines spilling over in the JupyerLab help pop up #2300

Closed
joelostblom opened this issue Sep 27, 2020 · 2 comments

Comments

@joelostblom
Copy link
Contributor

I suggest shortening the lines of the docstrings so that they wrap nicely in the JupyterLab help popup (Shift + Tab). Here is an example of what I mean (the docstring in the images is not from altair but the behavior is the same as in e.g. the "Attributes" section of alt.Chart).

Current:
image

Suggested:
image

I did this previously for plotly and I believe the exact line width that jupyterlab breaks at is 76, so I can reformat the docstrings to break at 75 to maximize space or 72 if you prefer to follow the pep8 suggestion (I am fine with either, I just don't want the lines to spill over since I think they are hard to read then).

I don't know if this can be automated somehow with black, but if not I can change them all manually if you think this would be a useful change. Are they all in vegalite/v4/api.py?

@joelostblom
Copy link
Contributor Author

I also suggested JupyterLab to change the width of the help pop-up since that would be the more general solution. (and I remembered part of altair is programmatically generated from vegalite so manual modification might not be the way to go here)

@joelostblom
Copy link
Contributor Author

This was just merged in JL master and will be in 3.0 jupyterlab/jupyterlab#9134

So instead of the current popup that looks like this for many altair functions:

image

You will be able to see more of the documentation in both directions:

image

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

1 participant