gridviz-parquet 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/gridviz-parquet.min.js +2 -2
- package/package.json +3 -2
- package/src/TiledParquetGrid.js +36 -58
- package/src/parquetTileWorker.generated.js +2 -0
- package/src/parquetTileWorker.js +20 -0
- package/src/readParquetTable.js +54 -0
- package/src/tileTable.js +137 -0
package/README.md
CHANGED
|
@@ -11,3 +11,20 @@
|
|
|
11
11
|
- See [this example for multiscale Parquet data](https://eurostat.github.io/gridviz-parquet/examples/basic_multiscale_parquet.html) ([code](https://github.com/eurostat/gridviz-parquet/blob/main/examples/basic_multiscale_parquet.html)).
|
|
12
12
|
- See [this example for tiled Parquet data](https://eurostat.github.io/gridviz-parquet/examples/basic_tiled_parquet.html) ([code](https://github.com/eurostat/gridviz-parquet/blob/main/examples/basic_tiled_parquet.html)).
|
|
13
13
|
- See [this example for both tiled and multiscale Parquet data](https://eurostat.github.io/gridviz-parquet/examples/basic_multiscale_tiled_parquet.html) ([code](https://github.com/eurostat/gridviz-parquet/blob/main/examples/basic_multiscale_tiled_parquet.html)).
|
|
14
|
+
|
|
15
|
+
## Tiles are decoded in workers
|
|
16
|
+
|
|
17
|
+
The tiles of a `TiledParquetGrid` are fetched and decoded in web workers, and their cells are made a little on each animation frame, so a map being panned does not stand still while a tile comes in. The workers run from a Blob, so nothing needs to be configured or served. Where they cannot run (no `Worker`, a Content Security Policy without `blob:`), tiles are decoded on the main thread.
|
|
18
|
+
|
|
19
|
+
A worker's requests are not seen by a wrapper of the page's `fetch`. To follow them, for a loading indicator for example:
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
TiledParquetGrid.onTileRequest = (dataset, xT, yT) => {
|
|
23
|
+
showLoading()
|
|
24
|
+
return () => hideLoading() // called when the tile has been answered
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`TiledParquetGrid.failuresToEmpty` (2 by default) is how many failures with no answer from the server make a tile count as empty: some servers send their 404 without a CORS header, and the browser reports it as a failure of the network.
|
|
29
|
+
|
|
30
|
+
After changing `src/parquetTileWorker.js` or `src/readParquetTable.js`, run `npm run build-worker` (`npm run bp` does it too).
|