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

use react-virtuoso with Jupyter #5844

Merged
merged 41 commits into from
Apr 24, 2022
Merged

use react-virtuoso with Jupyter #5844

merged 41 commits into from
Apr 24, 2022

Conversation

williamstein
Copy link
Contributor

@williamstein williamstein commented Apr 8, 2022

I learned https://virtuoso.dev/ really well recently, due to needing it for my version of slate.js. It turns out to be ideal for implementing virtualized windowing for Jupyter notebooks, and with very, very little work, actually works really well. Virtuoso is a genuinely nontrivial "deep" library -- not just an obvious thing at all.

This PR switches our Jupyter to use this for rendering, but doesn't yet implementing anything related to scroll state, which is kind of tedious (but pretty similar to what I did already for editors/slate, so won't be hard). I'm going to make using this an easy toggle in the View menu of Jupyter with the state stored in the notebook metadata, rather than an account setting or something dumb like that. The default will be enabled though.

My motivation for this is the notebook here: https://nbviewer.org/url/archive.org/download/musing_math/Volume_Solutions_To_Snub_Dodecahedron.ipynb
Trying to scroll through it (via the up/down keys - not actually scrolling) is incredibly painful. There's a huge amount mathematical formulas rendered throughout, and just moving the selection from one cell to another with the normal way of rendering, causes tons of expensive layout computations, which makes it unusably slow (I think Mathjax is a little better in this regard). It's not even a lot of cells, and loading and scrolling with the scrollbar is fine. However, with the way react-virtualized renders things, moving around is VERY fast - as snappy as can be.

…t when clicking the bell) to (1) be a modern functional component, and (2) use Virtuoso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant