https://github.com/kanaries/web-data-loader
data loader for data analytic product in working in browser
https://github.com/kanaries/web-data-loader
csv data-loader sampling streaming
Last synced: 6 months ago
JSON representation
data loader for data analytic product in working in browser
- Host: GitHub
- URL: https://github.com/kanaries/web-data-loader
- Owner: Kanaries
- License: mit
- Created: 2020-01-09T06:34:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-13T05:21:30.000Z (about 2 years ago)
- Last Synced: 2024-09-19T05:07:35.907Z (about 1 year ago)
- Topics: csv, data-loader, sampling, streaming
- Language: TypeScript
- Homepage: https://kanaries.github.io/web-data-loader/
- Size: 145 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# web-data-loader


data loader for data analytic product in working in browser
web-data-loader allows you to load larget data files in browser. It supports stream data and runs in webworker which will not block the main thread while loading the data. web-data-loader also support stream data sampling, it now support `Reservoir Sampling` methods.
## Usage
### Install
```bash
npm i --save @kanaries/web-data-loader
```### Examples
in your project file:get user upload file
```html```
use web-data-loader to load the data with sampling.
```js
(document.querySelector("#file") as HTMLInputElement).onchange = (
ev: Event
) => {
const file = (ev.target as HTMLInputElement).files[0];
FileReader.csvReader(
{
file: file,
config: {
type: "reservoirSampling",
size: 400
},
onLoading: value => {
console.log((value * 100).toFixed(2) + '%');
}
}
).then(data => console.log(data));
// FileReader.csvReader(file).then(data => console.log(data));
};```
## Docs
documents can be found at [API Reference](https://kanaries.github.io/web-data-loader/)