Vscode-r: Enhance the data viewer

Created on 26 Dec 2020  路  6Comments  路  Source: Ikuyadeu/vscode-R

Currently, we are using DataTables in the WebView as the data viewer with session watcher enabled. It has the following capabilities (but we are not using all of them at the moment):

  • Sorting a column
  • Always show column header on page top
  • Different background color of odd/even rows
  • Highlight row on hover
  • Highlight rows on click
  • Search text and filter rows over the entire table
  • Paging (not used yet)

There are some alternative data viewer widgets that could provide more power features such as column filtering by value or range (like in RStudio), multi-column ordering. I guess we could investigate into this and see if we could provide a more powerful data viewer.

More powerful alternatives:

feature-request

Most helpful comment

@renkun-ken if the viewer could honor light+dark or the vscode theme it would be incredible. it's a bit blinding cracking it open at night

All 6 comments

@renkun-ken if the viewer could honor light+dark or the vscode theme it would be incredible. it's a bit blinding cracking it open at night

As the related work, vscode-jupyter implements similar function by the react and tsx.
Imitating it is cost, but safe for the license issue.

@Ikuyadeu I support the idea of porting the vscode-jupyter data viewer. I filed a related issue in vscode-jupyter: https://github.com/microsoft/vscode-jupyter/issues/4604

When I run View(mtcars) in a Jupyter notebook in VS Code Insiders, I get the following error:

ERROR: Error in View(mtcars): 'View()' not yet supported in the Jupyter R kernel

My hope is that the 'not yet' in the error implies that adding R support for the data viewer could already be a priority for vscode-jupyter, in which case porting to vscode-R may be significantly easier if R data structures have already been specified.

For anyone who has not yet done so, I would encourage you to upvote R here: https://github.com/microsoft/vscode-jupyter/issues/1536

To follow up on the issue I raised in vscode-jupyter, this very helpful response from a Microsoft employee points to two files that might be a useful starting point: https://github.com/microsoft/vscode-jupyter/issues/4604#issuecomment-772043821

@renkun-ken you might want to try canvas based grids:

https://github.com/TonyGermaneri/canvas-datagrid

https://github.com/fin-hypergrid/core

Handsontable looks really good, but I am not sure their licensing is suitable for vscode extensions needs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

renkun-ken picture renkun-ken  路  3Comments

nathaneastwood picture nathaneastwood  路  6Comments

Victsz picture Victsz  路  5Comments

MaTo04 picture MaTo04  路  5Comments

michaelHL picture michaelHL  路  5Comments