planet
planet copied to clipboard
resources: support csv files viewer (fixes #8368)
Fixes #8368
In the planet resource viewer add support viewing csv files.
Using lightweight 3rd party package papaparse. If we want to support viewing xls/x files we can use sheetJS - xlsx.
To test:
- stop running the dev server
- install deps: run
npm i - run the dev server:
ng s
Oops, sorry. Missed that this was a draft.
It works for most CSV files, but when a CSV file has duplicate column names, it cannot be displayed on the screen.
@Mutugiii or maybe solve it in another issue?
It works for most CSV files, but when a CSV file has duplicate column names, it cannot be displayed on the screen.
Pushed a fix for this
With headers: true you can handle blank column headers with transformHeader
(from https://www.papaparse.com/docs#config)

