autumnplot-gl 2.2.3 → 3.1.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 +65 -8
- package/dist/110.autumnplot-gl.js +2 -0
- package/dist/110.autumnplot-gl.js.map +1 -0
- package/dist/autumnplot-gl.js +3 -0
- package/dist/autumnplot-gl.js.LICENSE.txt +12 -0
- package/dist/autumnplot-gl.js.map +1 -0
- package/dist/marchingsquares.wasm +0 -0
- package/lib/AutumnTypes.d.ts +14 -13
- package/lib/Barbs.d.ts +10 -5
- package/lib/Barbs.js +22 -5
- package/lib/BillboardCollection.d.ts +11 -7
- package/lib/BillboardCollection.js +52 -30
- package/lib/ColorBar.js +51 -7
- package/lib/Colormap.d.ts +14 -3
- package/lib/Colormap.js +63 -12
- package/lib/Contour.d.ts +73 -18
- package/lib/Contour.js +180 -148
- package/lib/ContourCreator.d.ts +18 -0
- package/lib/ContourCreator.js +23 -0
- package/lib/Fill.d.ts +18 -7
- package/lib/Fill.js +73 -41
- package/lib/Grid.d.ts +167 -0
- package/lib/Grid.js +339 -0
- package/lib/Hodographs.d.ts +13 -6
- package/lib/Hodographs.js +58 -71
- package/lib/Map.d.ts +14 -3
- package/lib/Map.js +9 -0
- package/lib/Paintball.d.ts +11 -5
- package/lib/Paintball.js +35 -15
- package/lib/PlotComponent.d.ts +5 -5
- package/lib/PlotLayer.d.ts +12 -12
- package/lib/PlotLayer.js +16 -14
- package/lib/PlotLayer.worker.d.ts +2 -2
- package/lib/PlotLayer.worker.js +105 -66
- package/lib/PolylineCollection.d.ts +20 -9
- package/lib/PolylineCollection.js +158 -32
- package/lib/RawField.d.ts +11 -167
- package/lib/RawField.js +37 -383
- package/lib/TextCollection.d.ts +31 -0
- package/lib/TextCollection.js +295 -0
- package/lib/cpp/marchingsquares.d.ts +6 -0
- package/lib/cpp/marchingsquares.js +3449 -0
- package/lib/cpp/marchingsquares.wasm +0 -0
- package/lib/cpp/marchingsquares_embind.d.ts +6 -0
- package/lib/index.d.ts +13 -6
- package/lib/index.js +12 -3
- package/lib/utils.d.ts +5 -3
- package/lib/utils.js +17 -6
- package/package.json +14 -9
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface MainModule {
|
|
2
|
+
makeContoursFloat32(_0: any, _1: any, _2: any, _3: any, _4: any): any;
|
|
3
|
+
makeContoursFloat16(_0: any, _1: any, _2: any, _3: any, _4: any): any;
|
|
4
|
+
getContourLevelsFloat32(_0: any, _1: number, _2: number, _3: number): any;
|
|
5
|
+
getContourLevelsFloat16(_0: any, _1: number, _2: number, _3: number): any;
|
|
6
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { PlotComponent } from "./PlotComponent";
|
|
2
|
-
import Contour, { ContourOptions } from "./Contour";
|
|
2
|
+
import Contour, { ContourOptions, ContourLabels, ContourLabelOptions } from "./Contour";
|
|
3
3
|
import { ContourFill, Raster, ContourFillOptions, RasterOptions } from "./Fill";
|
|
4
4
|
import Barbs, { BarbsOptions } from "./Barbs";
|
|
5
5
|
import Paintball, { PaintballOptions } from "./Paintball";
|
|
6
6
|
import Hodographs, { HodographOptions } from './Hodographs';
|
|
7
7
|
import { PlotLayer, MultiPlotLayer } from './PlotLayer';
|
|
8
|
-
import { WindProfile, WebGLAnyRenderingContext, TypedArray } from "./AutumnTypes";
|
|
9
|
-
import {
|
|
10
|
-
import { ColorMap, Color } from './Colormap';
|
|
8
|
+
import { WindProfile, WebGLAnyRenderingContext, TypedArray, ContourData } from "./AutumnTypes";
|
|
9
|
+
import { MapLikeType } from "./Map";
|
|
10
|
+
import { ColorMap, ColorMapOptions, Color } from './Colormap';
|
|
11
11
|
import { makeColorBar, makePaintballKey, ColorbarOrientation, ColorbarTickDirection, ColorBarOptions, PaintballKeyOptions } from "./ColorBar";
|
|
12
|
-
import { RawScalarField, RawVectorField, RawProfileField,
|
|
12
|
+
import { RawScalarField, RawVectorField, RawProfileField, VectorRelativeTo, RawVectorFieldOptions } from "./RawField";
|
|
13
|
+
import { Grid, GridType, PlateCarreeGrid, PlateCarreeRotatedGrid, LambertGrid } from './Grid';
|
|
14
|
+
import { FieldContourOpts } from './ContourCreator';
|
|
13
15
|
declare const colormaps: {
|
|
14
16
|
bluered: (level_min: number, level_max: number, n_colors: number) => ColorMap;
|
|
15
17
|
redblue: (level_min: number, level_max: number, n_colors: number) => ColorMap;
|
|
@@ -20,4 +22,9 @@ declare const colormaps: {
|
|
|
20
22
|
pw_td2m: ColorMap;
|
|
21
23
|
nws_storm_clear_refl: ColorMap;
|
|
22
24
|
};
|
|
23
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Initialize the WebAssembly module in autumnplot-gl. It's not strictly necessary to call it first, but if you call it
|
|
27
|
+
* first, you can prevent races when you contour a bunch of fields at once.
|
|
28
|
+
*/
|
|
29
|
+
declare function initAutumnPlot(): void;
|
|
30
|
+
export { PlotComponent, Barbs, BarbsOptions, Contour, ContourOptions, ContourLabels, ContourLabelOptions, ContourFill, Raster, ContourFillOptions, RasterOptions, Paintball, PaintballOptions, Hodographs, HodographOptions, WindProfile, PlotLayer, MultiPlotLayer, MapLikeType, ColorMap, ColorMapOptions, colormaps, makeColorBar, makePaintballKey, Color, ColorbarOrientation, ColorbarTickDirection, ColorBarOptions, PaintballKeyOptions, RawScalarField, RawVectorField, RawProfileField, Grid, GridType, VectorRelativeTo, RawVectorFieldOptions, PlateCarreeGrid, PlateCarreeRotatedGrid, LambertGrid, WebGLAnyRenderingContext, TypedArray, ContourData, initAutumnPlot, FieldContourOpts };
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlotComponent } from "./PlotComponent";
|
|
2
|
-
import Contour from "./Contour";
|
|
2
|
+
import Contour, { ContourLabels } from "./Contour";
|
|
3
3
|
import { ContourFill, Raster } from "./Fill";
|
|
4
4
|
import Barbs from "./Barbs";
|
|
5
5
|
import Paintball from "./Paintball";
|
|
@@ -7,7 +7,9 @@ import Hodographs from './Hodographs';
|
|
|
7
7
|
import { PlotLayer, MultiPlotLayer } from './PlotLayer';
|
|
8
8
|
import { ColorMap, bluered, redblue, pw_speed500mb, pw_speed850mb, pw_cape, pw_t2m, pw_td2m, nws_storm_clear_refl } from './Colormap';
|
|
9
9
|
import { makeColorBar, makePaintballKey } from "./ColorBar";
|
|
10
|
-
import { RawScalarField, RawVectorField, RawProfileField
|
|
10
|
+
import { RawScalarField, RawVectorField, RawProfileField } from "./RawField";
|
|
11
|
+
import { Grid, PlateCarreeGrid, PlateCarreeRotatedGrid, LambertGrid } from './Grid';
|
|
12
|
+
import { initMSModule } from './ContourCreator';
|
|
11
13
|
const colormaps = {
|
|
12
14
|
bluered: bluered,
|
|
13
15
|
redblue: redblue,
|
|
@@ -18,4 +20,11 @@ const colormaps = {
|
|
|
18
20
|
pw_td2m: pw_td2m,
|
|
19
21
|
nws_storm_clear_refl: nws_storm_clear_refl,
|
|
20
22
|
};
|
|
21
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Initialize the WebAssembly module in autumnplot-gl. It's not strictly necessary to call it first, but if you call it
|
|
25
|
+
* first, you can prevent races when you contour a bunch of fields at once.
|
|
26
|
+
*/
|
|
27
|
+
function initAutumnPlot() {
|
|
28
|
+
initMSModule();
|
|
29
|
+
}
|
|
30
|
+
export { PlotComponent, Barbs, Contour, ContourLabels, ContourFill, Raster, Paintball, Hodographs, PlotLayer, MultiPlotLayer, ColorMap, colormaps, makeColorBar, makePaintballKey, RawScalarField, RawVectorField, RawProfileField, Grid, PlateCarreeGrid, PlateCarreeRotatedGrid, LambertGrid, initAutumnPlot };
|
package/lib/utils.d.ts
CHANGED
|
@@ -8,9 +8,11 @@ declare function getMinZoom(jlat: number, ilon: number, thin_fac_base: number):
|
|
|
8
8
|
declare function zip(...args: any[]): Generator<any[], void, unknown>;
|
|
9
9
|
declare function getOS(): string;
|
|
10
10
|
declare class Cache<A extends unknown[], R> {
|
|
11
|
-
private
|
|
11
|
+
private cached_values;
|
|
12
12
|
private readonly compute_value;
|
|
13
|
-
|
|
13
|
+
private readonly make_key;
|
|
14
|
+
constructor(compute_value: (...args: A) => R, make_key?: (...args: A) => string);
|
|
14
15
|
getValue(...args: A): R;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
declare function normalizeOptions<Type extends Record<string, any>>(opts: Type | undefined, defaults: Required<Type>): Required<Type>;
|
|
18
|
+
export { hex2rgba, rgba2hex, hex2rgb, rgb2hex, rgb2hsv, hsv2rgb, zip, getMinZoom, getOS, Cache, normalizeOptions };
|
package/lib/utils.js
CHANGED
|
@@ -121,15 +121,26 @@ function getOS() {
|
|
|
121
121
|
return os;
|
|
122
122
|
}
|
|
123
123
|
class Cache {
|
|
124
|
-
constructor(compute_value) {
|
|
125
|
-
this.
|
|
124
|
+
constructor(compute_value, make_key) {
|
|
125
|
+
this.cached_values = {};
|
|
126
126
|
this.compute_value = compute_value;
|
|
127
|
+
this.make_key = make_key === undefined ? (...args) => JSON.stringify(args) : make_key;
|
|
127
128
|
}
|
|
128
129
|
getValue(...args) {
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
const key = this.make_key(...args);
|
|
131
|
+
if (!(key in this.cached_values)) {
|
|
132
|
+
this.cached_values[key] = this.compute_value(...args);
|
|
131
133
|
}
|
|
132
|
-
return this.
|
|
134
|
+
return this.cached_values[key];
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
|
-
|
|
137
|
+
function normalizeOptions(opts, defaults) {
|
|
138
|
+
const ret = { ...defaults };
|
|
139
|
+
if (opts !== undefined) {
|
|
140
|
+
Object.entries(opts).forEach(([k, v]) => {
|
|
141
|
+
ret[k] = v;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return ret;
|
|
145
|
+
}
|
|
146
|
+
export { hex2rgba, rgba2hex, hex2rgb, rgb2hex, rgb2hsv, hsv2rgb, zip, getMinZoom, getOS, Cache, normalizeOptions };
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autumnplot-gl",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
|
-
"lib/**/*"
|
|
8
|
+
"lib/**/*",
|
|
9
|
+
"dist/*"
|
|
9
10
|
],
|
|
10
11
|
"scripts": {
|
|
11
12
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -18,13 +19,14 @@
|
|
|
18
19
|
"author": "Tim Supinie",
|
|
19
20
|
"license": "MIT",
|
|
20
21
|
"devDependencies": {
|
|
22
|
+
"@types/emscripten": "^1.39.10",
|
|
23
|
+
"@types/kd-tree-javascript": "^1.0.3",
|
|
21
24
|
"@types/luxon": "^3.2.0",
|
|
22
|
-
"@types/
|
|
23
|
-
"@types/maplibre-gl": "^1.14.0",
|
|
25
|
+
"@types/pbf": "^3.0.5",
|
|
24
26
|
"ts-loader": "^9.4.2",
|
|
25
|
-
"typedoc": "^0.
|
|
26
|
-
"typedoc-plugin-markdown": "^
|
|
27
|
-
"typescript": "^4.
|
|
27
|
+
"typedoc": "^0.25.13",
|
|
28
|
+
"typedoc-plugin-markdown": "^4.0.2",
|
|
29
|
+
"typescript": "^5.4.5",
|
|
28
30
|
"webpack": "^5.75.0",
|
|
29
31
|
"webpack-cli": "^5.0.1",
|
|
30
32
|
"webpack-dev-server": "^4.11.1",
|
|
@@ -32,7 +34,10 @@
|
|
|
32
34
|
},
|
|
33
35
|
"dependencies": {
|
|
34
36
|
"@petamoriken/float16": "^3.8.4",
|
|
35
|
-
"autumn-wgl": "^1.
|
|
36
|
-
"comlink": "^4.3.1"
|
|
37
|
+
"autumn-wgl": "^1.4.0",
|
|
38
|
+
"comlink": "^4.3.1",
|
|
39
|
+
"kd-tree-javascript": "^1.0.3",
|
|
40
|
+
"pbf": "^3.2.1",
|
|
41
|
+
"potpack": "^2.0.0"
|
|
37
42
|
}
|
|
38
43
|
}
|