damianavila / RISE

RISE: "Live" Reveal.js Jupyter/IPython Slideshow Extension
Other
3.66k stars 414 forks source link

Scrolling not activated "on the fly" when executing cell with an output making the slide longer. #647

Open vmonteco opened 7 months ago

vmonteco commented 7 months ago

Versions :

Summary/TL;DR :

I'm trying to make a presentation using Rise on a notebook. The scrollbar doesn't appear with the presentation flow so far as cells are interpreted to a long output that resizes the slide. How could I achieve that ?

Expected behaviors :

With fragments :

With long fragment appearing (space)

Scrollbar appears, making the slide scrollable.

With long fragments disappearing (space

Scrollbar disappears, making the slide non-scrollable.

With outputs :

Long output appearing

Scrollbar appears, making the slide scrollable.

Long output disappearing

Scrollbar disappears, making the slide non-scrollable.

Observed behavior :

With fragments :

With long fragment appearing (space)

Scrollbar doesn't appear, thus the slide isn't made scrollable.

With long fragments disappearing (space

N/A

With outputs :

Long output appearing

Scrollbar doesn't appear, thus the slide isn't made scrollable.

Long output disappearing

N/A

Partial workaround :

Without changing code, the only workaround I found is to change to an other slide and then to come back to the previous one (The scrollbar would appear).

Possible (and quick) solution for fragments :

In main.js, these changes at L647 make the scrollbar toggled by long fragments (dis)appearance.

              Reveal.addEventListener('fragmentshown', function(event) {
                setScrollingSlide();  /* Added line */
                autoSelectHook();
              });
              Reveal.addEventListener('fragmenthidden', function(event) {
                setScrollingSlide();  /* Added line */
                autoSelectHook();
              });

Lack of solution for outputs :

However, I didn't find a solution for outputs guess it could be more complicated as managing cells output events is probably not present by default in reveal.js.

I don't know the project very well, but interpreting cells doesn't seem to dispatch the slidechanged event that could be caught by RISE.

Would one have any idea to provide for this specific point ?