@oceanum/layers 0.1.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 +206 -0
- package/dist/README.md +206 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +539 -0
- package/dist/oceanum-base-layer.d.ts +72 -0
- package/dist/oceanum-base-layer.d.ts.map +1 -0
- package/dist/oceanum-contour-layer.d.ts +45 -0
- package/dist/oceanum-contour-layer.d.ts.map +1 -0
- package/dist/oceanum-particle-layer.d.ts +40 -0
- package/dist/oceanum-particle-layer.d.ts.map +1 -0
- package/dist/oceanum-partmesh-layer.d.ts +50 -0
- package/dist/oceanum-partmesh-layer.d.ts.map +1 -0
- package/dist/oceanum-pcolor-layer.d.ts +22 -0
- package/dist/oceanum-pcolor-layer.d.ts.map +1 -0
- package/dist/utils/coordinates.d.ts +31 -0
- package/dist/utils/coordinates.d.ts.map +1 -0
- package/dist/utils/dataset-slice.d.ts +22 -0
- package/dist/utils/dataset-slice.d.ts.map +1 -0
- package/dist/utils/viewport.d.ts +18 -0
- package/dist/utils/viewport.d.ts.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oceanum-particle-layer.d.ts","sourceRoot":"","sources":["../src/oceanum-particle-layer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAWD,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,gBAAgB;IAChE,OAAgB,SAAS,SAA0B;IACnD,OAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;MAAgB;IAEnC,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI;IAa/D,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc;IAItD,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc;CAsB5E"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { PartmeshLayer } from './test/__mocks__/deck-gl-grid.ts';
|
|
2
|
+
import { default as OceanumBaseLayer, OceanumLayerProps } from './oceanum-base-layer';
|
|
3
|
+
import { CoordNames, VectorDatakeys } from './utils/coordinates';
|
|
4
|
+
import { SlicedData } from './utils/dataset-slice';
|
|
5
|
+
export interface OceanumPartmeshLayerProps extends OceanumLayerProps {
|
|
6
|
+
speed: number;
|
|
7
|
+
size: number;
|
|
8
|
+
color: [number, number, number];
|
|
9
|
+
meshShape: string;
|
|
10
|
+
meshLength: number;
|
|
11
|
+
meshWidth: number;
|
|
12
|
+
meshSize: number;
|
|
13
|
+
}
|
|
14
|
+
export default class OceanumPartmeshLayer extends OceanumBaseLayer {
|
|
15
|
+
static layerName: string;
|
|
16
|
+
static defaultProps: {
|
|
17
|
+
speed: {
|
|
18
|
+
type: string;
|
|
19
|
+
value: number;
|
|
20
|
+
};
|
|
21
|
+
size: {
|
|
22
|
+
type: string;
|
|
23
|
+
value: number;
|
|
24
|
+
};
|
|
25
|
+
color: {
|
|
26
|
+
type: string;
|
|
27
|
+
value: number[];
|
|
28
|
+
};
|
|
29
|
+
meshShape: {
|
|
30
|
+
type: string;
|
|
31
|
+
value: string;
|
|
32
|
+
};
|
|
33
|
+
meshLength: {
|
|
34
|
+
type: string;
|
|
35
|
+
value: number;
|
|
36
|
+
};
|
|
37
|
+
meshWidth: {
|
|
38
|
+
type: string;
|
|
39
|
+
value: number;
|
|
40
|
+
};
|
|
41
|
+
meshSize: {
|
|
42
|
+
type: string;
|
|
43
|
+
value: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
_validateVariableProps(props: OceanumLayerProps): string | null;
|
|
47
|
+
_buildDatakeys(coordNames: CoordNames): VectorDatakeys;
|
|
48
|
+
_createInnerLayer(slicedData: SlicedData, datakeys: VectorDatakeys): PartmeshLayer;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=oceanum-partmesh-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oceanum-partmesh-layer.d.ts","sourceRoot":"","sources":["../src/oceanum-partmesh-layer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAaD,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,gBAAgB;IAChE,OAAgB,SAAS,SAA0B;IACnD,OAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAgB;IAEnC,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI;IAa/D,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc;IAItD,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc;CA0B5E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PcolorLayer } from './test/__mocks__/deck-gl-grid.ts';
|
|
2
|
+
import { default as OceanumBaseLayer, OceanumLayerProps } from './oceanum-base-layer';
|
|
3
|
+
import { CoordNames, ScalarDatakeys } from './utils/coordinates';
|
|
4
|
+
import { SlicedData } from './utils/dataset-slice';
|
|
5
|
+
export interface OceanumPcolorLayerProps extends OceanumLayerProps {
|
|
6
|
+
color: [number, number, number];
|
|
7
|
+
material: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default class OceanumPcolorLayer extends OceanumBaseLayer {
|
|
10
|
+
static layerName: string;
|
|
11
|
+
static defaultProps: {
|
|
12
|
+
color: {
|
|
13
|
+
type: string;
|
|
14
|
+
value: number[];
|
|
15
|
+
};
|
|
16
|
+
material: boolean;
|
|
17
|
+
};
|
|
18
|
+
_validateVariableProps(props: OceanumLayerProps): string | null;
|
|
19
|
+
_buildDatakeys(coordNames: CoordNames): ScalarDatakeys;
|
|
20
|
+
_createInnerLayer(slicedData: SlicedData, datakeys: ScalarDatakeys): PcolorLayer;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=oceanum-pcolor-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oceanum-pcolor-layer.d.ts","sourceRoot":"","sources":["../src/oceanum-pcolor-layer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAQD,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,gBAAgB;IAC9D,OAAgB,SAAS,SAAwB;IACjD,OAAgB,YAAY;;;;;;MAAgB;IAEnC,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI;IAS/D,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc;IAItD,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc;CAkB5E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface CoordNames {
|
|
2
|
+
x: string;
|
|
3
|
+
y: string;
|
|
4
|
+
t?: string;
|
|
5
|
+
z?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface VariableProps {
|
|
8
|
+
magnitude?: string;
|
|
9
|
+
xvector?: string;
|
|
10
|
+
yvector?: string;
|
|
11
|
+
direction?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ScalarDatakeys {
|
|
14
|
+
x: string;
|
|
15
|
+
y: string;
|
|
16
|
+
c?: string;
|
|
17
|
+
u?: string;
|
|
18
|
+
v?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface VectorDatakeys {
|
|
21
|
+
x: string;
|
|
22
|
+
y: string;
|
|
23
|
+
u?: string;
|
|
24
|
+
v?: string;
|
|
25
|
+
m?: string;
|
|
26
|
+
d?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function buildScalarDatakeys(coordNames: CoordNames, props: VariableProps): ScalarDatakeys;
|
|
29
|
+
export declare function buildVectorDatakeys(coordNames: CoordNames, props: VariableProps): VectorDatakeys;
|
|
30
|
+
export declare function getVariableNames(props: VariableProps): string[];
|
|
31
|
+
//# sourceMappingURL=coordinates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.d.ts","sourceRoot":"","sources":["../../src/utils/coordinates.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,aAAa,GACnB,cAAc,CAShB;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,aAAa,GACnB,cAAc,CAUhB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,CAO/D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CoordNames } from './coordinates';
|
|
2
|
+
type TimeCoords = Float64Array | number[];
|
|
3
|
+
export declare function nearestTimeIndex(timeCoords: TimeCoords, target: string | Date): number;
|
|
4
|
+
export declare function clampLevelIndex(index: number, nlevels: number): number;
|
|
5
|
+
export declare function indexRange(coords: Float64Array | number[], min: number, max: number): [number, number];
|
|
6
|
+
type DatasetVariable = {
|
|
7
|
+
dimensions: string[];
|
|
8
|
+
get: (spec: any) => Promise<any>;
|
|
9
|
+
};
|
|
10
|
+
interface DatasetLike {
|
|
11
|
+
variables: Record<string, DatasetVariable>;
|
|
12
|
+
}
|
|
13
|
+
interface SlicedCoord {
|
|
14
|
+
data: any;
|
|
15
|
+
}
|
|
16
|
+
export interface SlicedData {
|
|
17
|
+
coords: Record<string, SlicedCoord>;
|
|
18
|
+
data_vars: Record<string, SlicedCoord>;
|
|
19
|
+
}
|
|
20
|
+
export declare function sliceDataset(dataset: DatasetLike, coordNames: CoordNames, variableNames: string[], timeIndex: number, levelIndex: number, latRange: [number, number], lonRange: [number, number]): Promise<SlicedData>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=dataset-slice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset-slice.d.ts","sourceRoot":"","sources":["../../src/utils/dataset-slice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,KAAK,UAAU,GAAG,YAAY,GAAG,MAAM,EAAE,CAAC;AAE1C,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,MAAM,CAoBR;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAGtE;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,YAAY,GAAG,MAAM,EAAE,EAC/B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,CAAC,MAAM,EAAE,MAAM,CAAC,CA8ClB;AAaD,KAAK,eAAe,GAAG;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC;AAClF,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC5C;AAED,UAAU,WAAW;IAEnB,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACxC;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,MAAM,EAAE,EACvB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GACzB,OAAO,CAAC,UAAU,CAAC,CAoCrB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface Bbox {
|
|
2
|
+
west: number;
|
|
3
|
+
south: number;
|
|
4
|
+
east: number;
|
|
5
|
+
north: number;
|
|
6
|
+
}
|
|
7
|
+
interface Viewport {
|
|
8
|
+
getBounds: () => [[number, number], [number, number]];
|
|
9
|
+
}
|
|
10
|
+
export declare function getViewportBbox(viewport: Viewport, padding?: number): Bbox;
|
|
11
|
+
export declare function bboxContained(current: Bbox, fetched: Bbox | null): boolean;
|
|
12
|
+
export interface DebouncedFn {
|
|
13
|
+
(...args: unknown[]): void;
|
|
14
|
+
cancel: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function debounce(fn: (...args: unknown[]) => void, wait: number): DebouncedFn;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../../src/utils/viewport.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,QAAQ;IAChB,SAAS,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACvD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,SAAM,GAAG,IAAI,CAkBvE;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,GAAG,IAAI,GACnB,OAAO,CAQT;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAgBpF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oceanum/layers",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "deck.gl layers for visualising gridded data from Oceanum datamesh zarr datasets",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "vite build",
|
|
7
|
+
"build:docs": "typedoc"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@oceanum/datamesh": "^0.8.0",
|
|
17
|
+
"@oceanum/deck-gl-grid": "^9.2.2"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"@deck.gl/core": "^9.2.0",
|
|
21
|
+
"@deck.gl/layers": "^9.2.0",
|
|
22
|
+
"@luma.gl/core": "^9.2.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@deck.gl/core": "^9.2.0",
|
|
26
|
+
"@deck.gl/layers": "^9.2.0",
|
|
27
|
+
"@luma.gl/core": "^9.2.0"
|
|
28
|
+
},
|
|
29
|
+
"type": "module",
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"module": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js",
|
|
37
|
+
"require": "./dist/index.cjs"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|