vscode-R
vscode-R copied to clipboard
Update on AG Grid data viewer, and use infinite row model for dynamic data loading
What problem did you solve?
-
Fixed the issue that multiple data viewer would open by calling
View()for the same data. The fix introduceddataview_uuid, and check whether the same window has been opened or not. It will create a window if it has been closed, but refresh the window if it has been opened already. -
Changed the AG Grid data viewer to
infiniterow model, which allows dynamic data loading, even for very large data. The changes include- implementation of server side data fetching, sorting and filtering by sending requests to an R session. The change was made to
showDataViewunder/src/session.ts; - update of
dataview_table()in/R/session/vsc.Rto manage the request for sorting and filtering based on AG Grid options and data types, such asnumber (numeric),text (character),date (Date),boolean (logical); - setting cache block size at 100 when scrolling down the data viewer;
- making R's
data.tablea required package to be installed.; - removal of pagination setting in AG Grid, but not yet from vscode-R setting;
- data viewer UI updates
- row Id column
(row)now shows row number from 1 to N even after sorting and filtering. The header name(row)was replaced by(# filtered rows) / (# total rows)- Boolean column initially showed as "true/false" has been changed to "TRUE/FALSE". This is treated as a numeric column, and onlyEqualsoption is enabled, with hint to use 1 for TRUE, and 0 for FALSE when apply a filter on this column. - filtering pane is now below header name so that one could see what have been filtered with what values.
- implementation of server side data fetching, sorting and filtering by sending requests to an R session. The change was made to
Would love to hear your feedbacks on this and whether this change would be something you consider to incorporate.
(If you have)Screenshot
https://github.com/user-attachments/assets/9dd1e7db-1128-4428-bca9-86206ad1702f
- with
n = 1e7
https://github.com/user-attachments/assets/b8dd5bc7-4953-45b6-a2f9-5957ecf89a46
- with
n = 1e8
https://github.com/user-attachments/assets/da52288a-3754-4a2d-9293-8d0eca1d9020
- Data loading has been improved with a cached version for data fetching, sorting and filtering in the data viewer.
- A data viewer would be rebuilt if
View()is called again. Otherwise, it may not reflect in-memory changes if data is updated usingdata.tablepackage. - Both data name and an expression in
View()is allowed, with maximum 500 width cut off.
- [x] To fix errors in checks
- [x] To allow POSIXct date/time filed as date in the data viewer
- [x] To remove pagination and row limit from extension options.
I think I have made all the changes I want. Would like someone interested in this to take a look, and provide feedback on errors I missed.