metacatui icon indicating copy to clipboard operation
metacatui copied to clipboard

Data table previews

Open laurenwalker opened this issue 4 years ago • 11 comments

Display a preview of the data table so researchers can browse a few rows of data before downloading.

Milestone CI-14 in ADC proposal.

laurenwalker avatar May 18 '21 16:05 laurenwalker

As part of the markdown editor, I created a TableEditorView. Just wanted to point this out in case the view can be re-purposed as a data table previewer. The view would need to be updated to include a non-editable mode, and to parse csv data (in addition to the currently supported markdown and JSON formats).

robyngit avatar May 18 '21 18:05 robyngit

This would be a great addition.

Seems like we might want to tweak the behavior of MNRead.get to support either HTTP range requests and/or streaming out responses. For very small files, grabbing the entire thing in order to build a preview isn't terrible but the experience gets worse as the size of the previewed file grows. Range requests would allow us to do a lot of neat things beyond just previews too. If we did this, we might consider whether or not partial reads count as read events.

amoeba avatar May 18 '21 18:05 amoeba

I think partial reads should definitely count as view events, but not as download events, which they currently would be.

laurenwalker avatar May 18 '21 19:05 laurenwalker

We also recently had a request via #1969 to display previews of .txt files as well. We should include that in our overall design for previewing data tables, too.

laurenwalker avatar Mar 22 '22 16:03 laurenwalker

Hi there @robyngit I would like to +1 this issue ticket.

vchendrix avatar Sep 29 '23 20:09 vchendrix

Thanks @vchendrix, looking into what would be involved to implement this

robyngit avatar Oct 02 '23 13:10 robyngit

@vchendrix we discussed this as a team today. There are some backend changes required before we're able to move forward with this in MetacatUI. These are implied in the comments above, but to summarize:

  • Metacat doesn't support downloading a portion of a file, so to preview files we'd need to download the entire thing. This would be very slow, especially for large files.
  • Other than performance, the issue is that there is currently no way to download a file for preview without counting it as a download event. So a preview feature like this would skew our metrics pretty badly.

I've made in new a new Metacat issue to cover this. It's on the roadmap, but not currently a high priority for us.

robyngit avatar Oct 02 '23 21:10 robyngit

What about something simpler? Like a preview of an entire file of certain types? e.g html, pdf, csv ( with a size threshold), text, images.

vchendrix avatar Oct 05 '23 13:10 vchendrix

Previewing only smaller and simple files was my initial thought as well @vchendrix! There would still be a problem with inflating the metrics though. We can't retrieve files without adding a "download" event to the metrics counts. So anytime someone viewed a dataset with some of the data previewed, download events would be recorded, and eventually those statistics would be inflated and not very representative anymore.

If the preview wasn't automatic, for example, a user had to click a button to explore a file, then perhaps there's an argument for counting that as a download... But probably something to get some feedback on and discuss. What do you think?

robyngit avatar Oct 05 '23 15:10 robyngit

Previewing only smaller and simple files was my initial thought as well @vchendrix! There would still be a problem with inflating the metrics though. We can't retrieve files without adding a "download" event to the metrics counts. So anytime someone viewed a dataset with some of the data previewed, download events would be recorded, and eventually those statistics would be inflated and not very representative anymore.

If the preview wasn't automatic, for example, a user had to click a button to explore a file, then perhaps there's an argument for counting that as a download... But probably something to get some feedback on and discuss. What do you think?

That is what I had in mind. Not an automatic preview but an intentional one. And maybe "preview" is the wrong term if they are downloading and viewing the file in their browser. I was thinking that there doesn't need to be any additional javascript for viewing the file just use the browser capabilities as most browsers can render files of different types in their native format.

vchendrix avatar Oct 05 '23 16:10 vchendrix

I think the MVP for this feature is:

  • Include a "preview" button for files under a maximum file size and of certain file types
  • This will open a modal with the data displayed

robyngit avatar Jul 08 '24 18:07 robyngit