Skip to content

Theme: Data Viewer refactor #7600

Closed
Closed

Description

@mikebessuille

Refactor the Data Viewer; there are many bugs related to the data viewer, so we may need to refactor the component in order to clean up many issues at once. This should be built as a shared component that can be used by the RStudio IDE

### Tasks
- [ ] https://github.com/rstudio/rstudio/issues/10712
- [ ] https://github.com/rstudio/rstudio/issues/9668
- [x] https://github.com/rstudio/rstudio/issues/9623
- [ ] https://github.com/rstudio/rstudio/issues/8922
- [ ] https://github.com/rstudio/rstudio/issues/8355
- [ ] https://github.com/rstudio/rstudio/issues/8262
- [x] https://github.com/rstudio/rstudio/issues/7564
- [ ] https://github.com/rstudio/rstudio/issues/6147
- [ ] https://github.com/rstudio/rstudio/issues/4361
- [ ] https://github.com/rstudio/rstudio/issues/3463
- [ ] https://github.com/rstudio/rstudio/issues/2451
- [ ] https://github.com/rstudio/rstudio/issues/2204
- [ ] https://github.com/rstudio/rstudio/issues/2039
- [ ] https://github.com/rstudio/rstudio/issues/8281
- [ ] https://github.com/rstudio/rstudio/issues/7546
- [ ] https://github.com/rstudio/rstudio/issues/5100
- [ ] https://github.com/rstudio/rstudio/issues/12834
- [ ] https://github.com/rstudio/rstudio/issues/14082
- [ ] https://github.com/rstudio/rstudio/issues/14113
- [ ] https://github.com/rstudio/rstudio/issues/14459

Activity

  1. jmcphers commented on Aug 17, 2020

    @jmcphers
    Member
    do-not-edit-start-codetree-epic-issues

    Issues in this epic:

    Title Milestone Assignees Stage State
    XSS and other weirdness in dataframe viewer with both rownames and list or dataframe entries #10712 Elsbeth Geranium (2022.10.0) N/A Untriaged Open
    do-not-edit-end-codetree-epic-issues

    The biggest problem with the data viewer is that it is not fully virtualized; in particular, it virtualizes rows but not columns. Visualizing wide (many columns) data sets used to bring RStudio to its knees; we eventually implemented a paging system that let you select a subset of columns, but this introduced a lot of bugs around displayed offsets, filtering (#6147, #7534), etc.

    A secondary problem is that it doesn't have a selection model, so many frequently useful features such as selecting and copying sections of data can't be implemented.

    Finally, the whole thing is glued together somewhat haphazardly from a large amount of ad-hoc JavaScript (https://github.com/rstudio/rstudio/blob/master/src/cpp/session/resources/grid/dtviewer.js) plus a third-party library (DataTables) plus an official "infinite scrolling" extension that isn't very well maintained or supported (see e.g., DataTables/Scroller#47).

    This is why at time of writing there are 40+ bugs open against the data viewer; the codebase is difficult to work on and suffers from some structural deficiencies.

    We might consider trying to find a modern alternative to DataTables that is performant with arbitrarily sized data. There are many JavaScript table visualization libraries nowadays, but most of them require all of the data to be provided up front, which is a complete nonstarter for us as we often visualize data from frames or matrices several gigabytes or more in size.

  2. changed the title [-]Data Viewer refactor[/-] [+]EPIC: Data Viewer refactor[/+] on Aug 21, 2020
  3. added this to the Later milestone on Sep 8, 2020
  4. francisbarton commented on Sep 23, 2020

    @francisbarton

    This does seem like an epic piece. My feature request for a brand new Data Viewer would be that it would have its own pane/tab, or be rendered in the Viewer tab. It has always seemed odd and inconvenient, to me, that View() opens up a tab in the Source pane.
    (also suggested in #2204)

  5. jmcphers commented on Jan 12, 2022

    @jmcphers
    Member

    The best existing art I've found for this is the Phosphor DataGrid. https://github.com/phosphorjs/phosphor/blob/master/packages/datagrid/src/datagrid.ts

    It's "abandoned", but it is the origin of JupyterLab's data viewing component. It actually supports huge data files w/o bringing the browser to its knees. Virtually every other JS library requires all the data to be sent to the client which is just a non-starter for our use case.

    Demo: http://phosphorjs.github.io/examples/datagrid/

    Its primary downside is that it's rendered with <canvas> instead of DOM elements, which is the reason it's so fast but also means that text selection and copying don't work ... at all.

    Here's a big data editor that does support a selection model (no idea re: performance): https://github.com/jupytercalpoly/jupyterlab-tabular-data-editor

  6. kevinushey commented on Jan 13, 2022

    @kevinushey
    Collaborator

    The other thing we could consider... would implementing and maintaining our own JS (or TS) table viewer be worthwhile? My worry is that any existing off-the-shelf solution might provide us with 90% of what we need, but trying to get the last 10% done will put us back into the same place we currently are, with a mixture of extensions that we've glued together that are likely to bitrot over time. Now that the team is growing, we might have the capacity to build and maintain our own solution, tailored to our own requirements.

    From what I can see, there aren't any really actively maintained JS table viewers; even phosphor's DataGrid saw its last update 2 years ago:

    https://www.npmjs.com/package/@phosphor/datagrid
    https://github.com/phosphorjs/phosphor/blob/master/packages/datagrid/src/datagrid.ts

    It's possible that it's just "done" and good enough, but that feels a bit unlikely.

  7. jmcphers commented on Jan 13, 2022

    @jmcphers
    Member

    Yes, I wasn't suggesting that we actually create a dependency on it, just learn from it since they clearly figured out how to actually make arbitrarily large data grids performant in the browser. Forking it might be an option, too.

  8. changed the title [-]EPIC: Data Viewer refactor[/-] [+]EPIC: Data Viewer refactor. *************[/+] on Jul 4, 2022
  9. changed the title [-]EPIC: Data Viewer refactor. *************[/-] [+]EPIC: Data Viewer refactor[/+] on Dec 16, 2022
  10. modified the milestones: Backlog-2, Later on Oct 5, 2023
  11. changed the title [-]EPIC: Data Viewer refactor[/-] [+]Theme: Data Viewer refactor[/+] on Sep 5, 2024
  12. gtritchie commented on Jun 4, 2026

    @gtritchie
    Member

    Data viewer has been rewritten per: #17382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions