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

Cell container width as a percentage instead of a fixed size of 1140px #1909

Closed
dustyny opened this issue Nov 18, 2016 · 17 comments
Closed

Cell container width as a percentage instead of a fixed size of 1140px #1909

dustyny opened this issue Nov 18, 2016 · 17 comments

Comments

@dustyny
Copy link

dustyny commented Nov 18, 2016

While the fixed size works well on small screens like laptops, it wastes too much screen real estate on larger higher resolution displays. On a 27 inch, 4/5k display the majority of the screen is unused; yet you still have to scroll left and right to see the output of a cell (data table) or data visualizations are displayed in a smaller harder to read size.

I'd recommend changing the Cell's fixed size of 1140px to an adaptive display of 85%. This is the size I manually set every time I open a Notebook and it works very well.

# 1140px
by default 2016-11-18 at 4 05 07 pm

# 85%
by default 2016-11-18 at 4 06 11 pm

@szeitlin
Copy link

szeitlin commented Dec 8, 2016

can you share the code you use to fix this? I'm having a miserable time with the broken scrollbar when trying to view dataframes with lots of columns, this would probably help.

@dustyny
Copy link
Author

dustyny commented Dec 8, 2016 via email

@takluyver
Copy link
Member

I suspect the 1140px width comes from somewhere in the Bootstrap styles, or something else we load from an external source, unfortunately. Our styles are written in a series of less files, which are then compiled to CSS, pulling in pieces from third party sources.

You can probably set a permanent override in ~/.jupyter/custom/custom.css. You might need a !important on it to force it to take precedence over other rules. The !important tag is a blunt instrument in CSS terms, so it might mess something else up a bit.

I'm not sure what the best default is here. For wrappable text, it's generally agreed that you want to limit the maximum width, because it's hard to read very long lines. E.g. Github issues is only taking ~1/3 the width of my screen for this comment, even on a laptop. But I can see that for things like large tables this is frustrating.

@szeitlin
Copy link

szeitlin commented Dec 9, 2016

I ended up doing this:

from IPython.core.display import display, HTML display(HTML("<style>.container { width:100% !important; }</style>"))

@ellisonbg
Copy link
Contributor

Tagging this with the JupyterLab milestone as this is already implemented there. We are not likely to change this in the classic notebook.

@ostrokach
Copy link

In case someone stumbles on this issue from google, the Table of Contents (2) nbextension already provides this feature, as long as you enable the option: "Widen the display area to fit the browser window (may be useful with sidebar option)".

@parrt
Copy link

parrt commented Nov 21, 2017

The nbextension still leaves mucho left/right gutter. thanks for the hack. It's a pity about the two column format. It would be tricky to implement properly lining things up, but a two column format would be most useful so you could see all of your code on the left and output on the right. All of the visual difference tools have solved this but...

@cshuler
Copy link

cshuler commented Jan 25, 2018

I just copied and pasted this code into Jypyter, and now I do the same for every notebook I work on. You can fiddle with the percentages to change things around a bit.

from IPython.display import display, HTML

display(HTML(data="""

<style> div#notebook-container { width: 95%; } div#menubar-container { width: 85%; } div#maintoolbar-container { width: 99%; } </style>

"""))

@ruffsl
Copy link

ruffsl commented Mar 15, 2018

For those of you who would like to achieve edge to edge notebooks, you can do so with by customizing the CSS content:
https://gist.github.com/paulochf/f6c9ed0b39f85dd85270#gistcomment-2251286

.container {
    width: 100% !important;
}

@kannes
Copy link

kannes commented Jan 9, 2019

Considering that writing long lines of code is not good practise, I recommend against this.

@ruffsl
Copy link

ruffsl commented Jan 9, 2019

@kannes , I not sure preventing poor code style is a sufficient reason to prevent dynamic max widths of figure cells. I often use the above workarounds to enable my svg and interactive figures to span the width of my display when working with intricate and detailed plots, e.g. Geo maps or financial tends. If I want the cell width change back to being modestly fixed width, then I just as soon resize my browser window on my desktop, or change my browser zoom factor, or just toggle off the workaround for that time.

@dustyny
Copy link
Author

dustyny commented Feb 27, 2019

This debate has been answered. All the open source (and some closed) notebooks are now using full screen width cells. Jupyter Lab included. I do believe it should be back ported to Jupyter Notebooks for forwards compatibility.

@jasongrout
Copy link
Member

For completeness, there is discussion in JupyterLab about a way to limit the max width: jupyterlab/jupyterlab#600

@dustyny
Copy link
Author

dustyny commented Feb 27, 2019

yes there will always be people who will push for regressing a UI/UX to a previous state. Typically a user base will always have a group of people who are averse to change, especially when a UI deviates from the point in time where they learned the application. That's a typical reaction that any product manager or front end developer will be very familiar with.

The industry as a whole has settled on full width cells as a standard. This is the outcome of open source and privately funded development that included people who have expertise in UX/UI design. It is important to be consistent with industry standards and benefit from lessons learned by other projects.

You can see examples of this in:
Jupyter Lab
Zeppelin
Databricks
Google Cloud Datalab
Hue
Data Science Workbench

That said, limiting cell width does not enforce coding standards in anyway. A UI is not where this problem is typically solved. That is what a linter is for. If coding standards is a concern there are existing plugins that are better suited to handle that problem and they should be used instead of trying to create a pseudo solution in a UI.

@ellisonbg
Copy link
Contributor

This is exactly the type of UX design challenge that led to the creation of JupyterLab.

(Now it has its own problem–see comment of @jasongrout above on JupyterLab not limiting the width).

To help the experience of the classic notebook though, I am fine with classic notebook moving to the 85% model. Although, this width is used across the different pages (text editor, file browser, terminal) and should be unified.

@florom
Copy link

florom commented Aug 19, 2021

Hi Dev-Team,

great work!

Unfortunatly you cannot increase it to over 100%.
this picture shows 110%
The cell does not increase accordingly the whole window does.

image

Is there a method for this too?

Thanks.

@jtpio
Copy link
Member

jtpio commented Mar 6, 2025

Closing as Notebook 7.3 introduced a View > Enable Full Width Notebook menu entry to configure the notebook to take up the full width of the page:

Image

@jtpio jtpio closed this as completed Mar 6, 2025
@jtpio jtpio modified the milestones: JupyterLab, 7.3.x Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests