davidbrochart / akernel

Asynchronous Python Jupyter kernel
MIT License
72 stars 5 forks source link

Improvement: highlight updating cells in reactive mode #24

Closed stefaneidelloth closed 3 years ago

stefaneidelloth commented 3 years ago

If a cell takes a while to calculate it would be nice to highlight updating/stale cells.

Cells 1 and 3 should be marked while cell 2 is working: image

Maybe with colors similar to nbsafety: https://nbsafety.org/docs/#Running image

Or with grey gutter line like in observablehq: https://observablehq.com/d/797362a5c2538221 image

davidbrochart commented 3 years ago

Cells 1 and 3 should be marked while cell 2 is working

There might be a misunderstanding here. The reactive mode is not cell-based, meaning that the time.sleep in cell 2 doesn't matter because it's not part of a's assignment. b and c are only linked to a change in a's value. So if in another cell you have a = 100, b and c will update immediately (the sleep won't be executed again). That being said, yes I think it could be possible to highlight a's dependencies (and sub-dependencies) whenever it is assigned to, until they are updated. Thanks for sharing the idea!

davidbrochart commented 3 years ago

Done in https://github.com/davidbrochart/ipyx/pull/8. You can try it with pip install ipyx==0.1.4.