[IPython-User] autoscrolling in html notebook

Brian Granger ellisonbg@gmail....
Sun Jan 22 13:18:39 CST 2012


The situation is a bit more complex.  This past summer, I spent
probably 3-4 days working on the scrolling model for the notebook.  We
spent considerable time studying the scrolling behavior of different
applications.  It was one of the more difficult things to get right.
I can summarize the main issues and explain the model...

* The overarching theme in the scrolling model is that we put the use
in charge of the scrolling.  This means that we don't try to guess
when and where they want the notebook div to be scrolled, we let them
make that decision.
* The reason we went this route is that each time we tried to scroll
the notebook for them, we would sometimes guess wrong leading to very
frustrating behaviors - more frustrating than requiring the user to
scroll it themselves.  It also lead to glitches.
* One difficulty we faced is that browsers make scrolling decisions on
their own based on what element in a div is has focus.  We found that
when we tried to scroll the window, we ended up "arguing" with the
browsers built-in scrolling behavior.  We would scroll up, it would
scroll down - glitchy.  The only way out of this is to *completely*
take over the scrolling ourselves.  Getting that right would be
extremely difficult.
* The other, more fundamental issue, it the asynchronous behavior of
the notebook.  There *are* a few cases where we *do* currently scroll
the notebook for the user.  One case is after the last cell is
executed we scroll the notebook to the bottom.  You should then ask
"wait, then why doesn't my plot show!?"  The answer is that the
scroll-to-the-bottom is done after the code is submitted and the new
cell is created, but *before* the output is returned.  We have no
control over when the output arrives - it could be nearly instant, or
it could take 12 hours.  If we were to wait until output arrives and
then scroll it into view, users will be equally unhappy - the current
thing they were working on would scroll out of view.

Hope this clarifies the notebook scrolling.

Cheers,

Brian

2012/1/20 Zoltán Vörös <zvoros@gmail.com>:
> Hi All,
>
> I was just wondering whether there is a trick to scroll to the bottom of
> the page in the html notebook. What I mean is the following: suppose
> that I have some code that produces a plot. The plot might very well be
> bigger than the screen. If I run the code, what happens is that the
> cursor jumps to the next cell, but that cell will be below the bottom of
> the browser. So, in effect, I don't see the cursor, nor the plot just
> created. Is there a way to make the browser scroll to the proper
> position? By the way, this happens in the opposite direction, too,
> namely, if I move up with the cursor pressing the "Up" arrow diligently,
> when I get to the first, cell, the browser does not move any more, even
> if the cursor is above the top of the visible field
> Cheers,
> Zoltán
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com


More information about the IPython-User mailing list