@fxi/zartigl 0.14.0 → 0.14.2
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 -1
- package/dist/catalog.d.ts +17 -0
- package/dist/catalog.js +20 -19
- package/dist/{engine-CiDquHYk.js → engine-C8ZNzILO.js} +2 -2
- package/dist/engine.d.ts +56 -2
- package/dist/engine.js +1 -1
- package/dist/{index-Cd7Nk4ve.js → index-B1lj-XR_.js} +169 -147
- package/dist/zartigl.d.ts +50 -1
- package/dist/zartigl.js +605 -558
- package/package.json +10 -4
package/dist/zartigl.d.ts
CHANGED
|
@@ -65,6 +65,8 @@ export declare interface CatalogEntry {
|
|
|
65
65
|
aliases?: string[];
|
|
66
66
|
title: LocalizedText;
|
|
67
67
|
description?: LocalizedText;
|
|
68
|
+
/** Methodology and sources: an immutable page published with the catalog. */
|
|
69
|
+
documentation?: string;
|
|
68
70
|
category: string;
|
|
69
71
|
tags?: string[];
|
|
70
72
|
kind: "scalar" | "vector";
|
|
@@ -172,6 +174,42 @@ declare interface CatalogZarrSource extends CatalogSourceBase {
|
|
|
172
174
|
variables: CatalogVariables;
|
|
173
175
|
}
|
|
174
176
|
|
|
177
|
+
/**
|
|
178
|
+
* A persistent store of Zarr chunks, as the compressed bytes the server sent,
|
|
179
|
+
* in the browser's Cache Storage. ZarrSource reads it before the network when
|
|
180
|
+
* given one (opt-in), so an app opens the chunks of a past session at once.
|
|
181
|
+
*
|
|
182
|
+
* Chunks of the to_zarr stores never change once written, except those of the
|
|
183
|
+
* last time chunk, which grows as months are appended. Those carry a revision
|
|
184
|
+
* (the length of the time axis): a stored chunk of another revision is stale
|
|
185
|
+
* and is read again, then replaced under the same key. A new store version has
|
|
186
|
+
* new URLs, so it never meets the chunks of the previous one.
|
|
187
|
+
*/
|
|
188
|
+
/** A stored chunk, without its bytes. */
|
|
189
|
+
declare interface ChunkEntry {
|
|
190
|
+
url: string;
|
|
191
|
+
/** Bytes on disk (compressed). */
|
|
192
|
+
size: number;
|
|
193
|
+
/** When the chunk was stored, ms since the epoch. */
|
|
194
|
+
storedAt: number;
|
|
195
|
+
revision: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
declare interface ChunkStore {
|
|
199
|
+
/** The bytes of `url`, or undefined when missing or of another revision. */
|
|
200
|
+
get(url: string, revision?: string): Promise<Uint8Array | undefined>;
|
|
201
|
+
put(url: string, bytes: Uint8Array, revision?: string): Promise<void>;
|
|
202
|
+
/** Every stored chunk whose URL starts with `prefix`. */
|
|
203
|
+
entries(prefix?: string): Promise<ChunkEntry[]>;
|
|
204
|
+
/** Removes these chunks. */
|
|
205
|
+
delete(urls: Iterable<string>): Promise<void>;
|
|
206
|
+
/** Origin storage use and quota, bytes, when the browser reports them. */
|
|
207
|
+
estimate(): Promise<{
|
|
208
|
+
usage: number;
|
|
209
|
+
quota: number;
|
|
210
|
+
} | undefined>;
|
|
211
|
+
}
|
|
212
|
+
|
|
175
213
|
export declare const COLOR_GRADE_OFF: Readonly<ColorGrade>;
|
|
176
214
|
|
|
177
215
|
export declare const COLOR_GRADE_VIBRANT: Readonly<ColorGrade>;
|
|
@@ -1438,7 +1476,18 @@ export declare class ZarrSource {
|
|
|
1438
1476
|
private maxCacheSize;
|
|
1439
1477
|
private abortControllers;
|
|
1440
1478
|
private bloscCodecCache;
|
|
1441
|
-
|
|
1479
|
+
private chunkStore;
|
|
1480
|
+
/**
|
|
1481
|
+
* `options.chunkStore` keeps the compressed chunks across sessions (see
|
|
1482
|
+
* chunkStore.ts); without it, chunks are only kept in memory.
|
|
1483
|
+
*/
|
|
1484
|
+
constructor(root: string, maxCacheSize?: number, options?: {
|
|
1485
|
+
chunkStore?: ChunkStore;
|
|
1486
|
+
});
|
|
1487
|
+
/** The URL of a chunk, as fetched and as stored. */
|
|
1488
|
+
chunkUrl(variable: string, indices: number[]): string;
|
|
1489
|
+
/** The revision a stored chunk must carry to be current (see chunkRevision). */
|
|
1490
|
+
chunkRevision(variable: string, indices: number[]): string;
|
|
1442
1491
|
init(): Promise<void>;
|
|
1443
1492
|
private getArrayMeta;
|
|
1444
1493
|
private getAttrs;
|