datahub
datahub copied to clipboard
[epic] Excel Viewer for Data Literate documents
When I have an excel file (either remote or local) in a data literate document I want to be able to (pre)view it so that I get a sense of its content
Imagined use:
<ExcelViewer src="link-to-excel-file" />
This would render the excel file:
- A list of the sheets (bulleted list) - perhaps with some info e.g. number of active cells
- For each sheet a table preview
- BONUS: toggle to show hide (all) sheets
Other features
- Want to support both "local" and remote files
- Want to be able to reference remote files and have this just work ... => having a proxy to handle cors issues
Tasks
- [x] Working viewer app where you for (local) excel files using xlsx lib plus some basic rendering DONE: see https://data-literate.datopian.com/excel-viewer
- [x] Working viewer inline in markdown e.g.
Excel src={url}
using xlsx lib plus some basic rendering DONE: see https://data-literate.datopian.com/demo#display-excel-files - [x] Get this working for remote files DONE. Using a local proxy API
- [ ] Make the presentation better e.g. show all sheets etc Showing a list of sheets but no switcher yet
- [ ] Show list of sheets
- [ ] Show each sheet
- [ ] Hide all but first one and toggle display based on which sheet you click on
UX stuff
- [ ] show loading spinner whilst loading ...
Analysis
graph TD
excel[Excel file] -- xlsx lib --> wb[Workbook]
wb --> fd[Frictionless dataset]
fd -- dataset renderer --> render[Rendered Tables]
Remote support
Issue is that most data urls don't support cors ... so excel viewer does not work well (nor would other data viewers where i inline raw data urls ...)
Solutions
- Only allow for CORs hosted files
- Excludes all stuff uploaded to github in issues etc
- Proxy
- Con: now not pure static (unless proxy generic and outside this tool)
- Con: could be abused (minor)
- Cache locally the data files ...
- Con: have to download and cache all data files referenced in a markdown file ...