textual icon indicating copy to clipboard operation
textual copied to clipboard

DataTable "view" of a larger data set

Open multimeric opened this issue 2 years ago • 4 comments

The DataTable seems to have performance issues with about a million cells. If we reduce the number of cells in memory at one time to a fraction of that, and then lazily load new rows as the user scrolls down, plus delete old rows, it seems like we might solve these performance issues. Not entirely sure though because I'm not sure how the implementation works.

The simplest implementation of this might be via a pagination mechanism where the user has to implement get_chunk() -> Iterable[Row] and the class handles the loading as the user approaches the end of the current chunk . This would also support viewing external data such as in a database or a remote API and avoid having to load everything into memory.

multimeric avatar Feb 27 '23 12:02 multimeric

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

github-actions[bot] avatar Feb 27 '23 12:02 github-actions[bot]

I note that "Lazy loading API" for DataTable is listed in the Roadmap. I might be able to give implementation a go if one of the maintainers is interested.

multimeric avatar Oct 03 '23 06:10 multimeric

Anyone come up with an implementation/workaround for this? Very interested as well

kdkavanagh avatar Apr 08 '24 02:04 kdkavanagh

Could this be used as an interim solution? https://github.com/tconbeer/textual-fastdatatable

max-arnold avatar Apr 09 '24 08:04 max-arnold

This may happen, but not in the short term. A community solution would be great, and we would be happy to help.

willmcgugan avatar Sep 27 '24 12:09 willmcgugan

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

github-actions[bot] avatar Sep 27 '24 12:09 github-actions[bot]