Replies: 1 comment 1 reply
-
We do plan on having row and column cursors. And also per row / column styles. refreshing regions will make it more performant, so we can repaint only the parts of the widget that change. We would consider a PR, but bear in mind we have plans for this and will get to it within a few weeks. Let us know if you need any pointers! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've been adapting a version of the built-in DataTable widget for my own use, so that it will highlight a full row or column under the cursor, as opposed to just an individual cell.
It looks like this might have been planned functionality at one point? (i.e. when the CursorType type is defined) So I was thinking about trying to rework my version and open a PR to add this functionality into the core DataTable widget, if there's any interest in this feature.
However, my understanding is that the built-in DataTable widget is intended to render smoothly for pretty huge datasets out of the box, and I'm wondering if this is why only cell highlighting is currently enabled. That is, the simplest implementation of the row highlight functionality would just slightly tweak the
_render_line
logic and setrepaint=True
on the reactivecursor_cell
property:textual/src/textual/widgets/_data_table.py
Line 198 in 3f76131
While this works fine for small tables (which is my current use-case), I'm guessing it wouldn't be performant for larger tables as it will force a repaint of the whole thing each time. I think something more performant could be done by calculating visible regions for update and using the
refresh(region)
function to trigger a more targeted repaint. But there are more and less complicated ways of implementing this, so it would be good to understand what level of optimisation is important for this widget. I was wondering if Textual has any budgets for performance when rendering large DataTables, that I could take a look at?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions