gridviz-parquet 1.1.2 → 1.2.1

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 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
+ A tile whose request fails is tried again every 1.5 s. Some servers send their 404 without a CORS header, which the browser reports as a failure of the network, so a missing tile is asked for again and again. For such a server, set `TiledParquetGrid.failuresToEmpty` to how many failures with no answer make a tile count as empty (never, by default).
29
+
30
+ After changing `src/parquetTileWorker.js` or `src/readParquetTable.js`, run `npm run build-worker` (`npm run bp` does it too).