Closed laurenwalker closed 1 month ago
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).
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.
I think partial reads should definitely count as view events, but not as download events, which they currently would be.
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.
Hi there @robyngit I would like to +1 this issue ticket.
Thanks @vchendrix, looking into what would be involved to implement this
@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:
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.
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.
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?
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.
I think the MVP for this feature is:
Display a preview of the data table so researchers can browse a few rows of data before downloading.
Milestone CI-14 in ADC proposal.