fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
5k stars 296 forks source link

Occupy full window width #400

Closed aplavin closed 4 years ago

aplavin commented 4 years ago

Currently Pluto notebooks have max-width: 700px set in CSS for the main container. This means both code and output take only 700 pixels of horizontal space - that is less than half of a screen for a typical resolution of 1920px, and even less for higher resolutions. One of the first things I did when started using Pluto is increased max width to effectively infinity, and also set margins to zero using user CSS in browser. Otherwise the plots are almost unusable when two or more are stacked horizontally.

My suggestion is to make something like this the default: occupy all horizontal space user provides to Pluto. It is trivial for a user to reduce the width - just resize the browser window; while making the content wider requires CSS modifications. As a precedent, Jupyter (lab) does exactly this.

fonsp commented 4 years ago

Are you asking why I chose to set a max-width? (It was not by accident)

Otherwise #2

Remember that you are free to resize that window and use the space for something else! You can even open the same notebook twice and have multiple synchronized views

aplavin commented 4 years ago

OK, maybe I just don't understand the intention and reasons behind setting the max-width here. Resizing the window is something I do quite often, and max-width actually hinders this: no matter what the window width, the content (e.g., plots) can never occupy more than 700 pixels. Without max-width resizing the window works as generally expected: content scales to, well, the window width. So with no max-width set the user can choose whether he wants a wide or narrow notebook (and of course can put several views side-by-side, this doesn't depend on max-width setting). This control from the user side is currently unavailable without in-browser CSS tweaks I mentioned.

fonsp commented 4 years ago

Pluto notebooks are documents. On the web, and in print, documents always have a maximum width.

https://en.wikipedia.org/wiki/Line_length

This looks like an interactive article:

image

This looks like 1990:

image

j-fu commented 4 years ago

1993 :-) See https://en.wikipedia.org/wiki/Mosaic_(web_browser)

aplavin commented 4 years ago

My point was that the user can easily make the line length whatever they want (when no max-width is set) by simply resizing the window - as they do with regular code and text editors. Meanwhile, with max-width it is impossible to reasonably include a large figure in the document - it gets scaled down to 700 px, that is a small fraction of a typical monitor.

Clearly, if the authors of pluto are against such change, I'm fine with it. I myself already found how to apply custom CSS to any website, and happily using pluto without width limitations. Just pointing out that not every potential pluto user may know about this possibility, and they would be unable to effectively work with wide plots/tables/code lines/etc.

Just for reference to those who also want to remove the width constraints - put the following line in the "My filters" section of "uBlock Origin" extension if you have it: <your pluto hostname>##main:style(max-width: none !important; margin: 0 !important).

fonsp commented 4 years ago

It's a difference in tastes, we should solve this with #2

ArrowRaider commented 4 years ago

I strongly urge you to reconsider this. It should be trivial to provide an option to toggle between narrow and wide view. I don't think this should depend on themes to be implemented.

dralletje commented 4 years ago

@ArrowRaider if you want you can add this as a cell to your notebook

html"""<style>
main {
    max-width: 100%;
    margin-right: 0;
}
"""

The problem is that once we allow fixed and full width, it is a very slippery slope. There is still active work on the layout, even if adding a narrow/wide option now is trivial, it will still require maintenance and testing when we change the layout.

bgroenks96 commented 3 years ago

I agree that there is far too little use of space on high resolution displays.. Perhaps a compromise here would be to allow the user to define default style settings (maybe a file in the home folder) that would get automatically added to every notebook?

The ability to add the HTML style override is quite nice, but it's a bit annoying having to paste it into every new notebook...