autumnplot-gl 4.0.0-beta → 4.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.
Files changed (84) hide show
  1. package/README.md +13 -207
  2. package/dist/812.autumnplot-gl.js +2 -0
  3. package/dist/812.autumnplot-gl.js.map +1 -0
  4. package/dist/983.autumnplot-gl.js +2 -0
  5. package/dist/983.autumnplot-gl.js.map +1 -0
  6. package/dist/autumnplot-gl.js +1 -1
  7. package/dist/autumnplot-gl.js.map +1 -1
  8. package/dist/marchingsquares.wasm +0 -0
  9. package/lib/AutumnTypes.d.ts +38 -5
  10. package/lib/AutumnTypes.js +7 -1
  11. package/lib/Barbs.d.ts +12 -2
  12. package/lib/Barbs.js +9 -0
  13. package/lib/BillboardCollection.d.ts +2 -2
  14. package/lib/BillboardCollection.js +14 -14
  15. package/lib/Color.d.ts +1 -0
  16. package/lib/Color.js +1 -0
  17. package/lib/ColorBar.d.ts +14 -0
  18. package/lib/ColorBar.js +15 -8
  19. package/lib/Colormap.d.ts +9 -1
  20. package/lib/Colormap.js +24 -1
  21. package/lib/Contour.d.ts +26 -1
  22. package/lib/Contour.js +24 -2
  23. package/lib/ContourCreator.worker.d.ts +25 -0
  24. package/lib/{ContourCreator.js → ContourCreator.worker.js} +15 -14
  25. package/lib/Fill.d.ts +31 -11
  26. package/lib/Fill.js +38 -18
  27. package/lib/Hodographs.d.ts +19 -3
  28. package/lib/Hodographs.js +45 -20
  29. package/lib/Map.d.ts +13 -1
  30. package/lib/Map.js +62 -8
  31. package/lib/Paintball.d.ts +14 -5
  32. package/lib/Paintball.js +96 -46
  33. package/lib/PlotComponent.d.ts +9 -3
  34. package/lib/PlotComponent.js +36 -1
  35. package/lib/PlotLayer.d.ts +2 -2
  36. package/lib/PlotLayer.js +2 -2
  37. package/lib/PlotLayer.worker.js +9 -3
  38. package/lib/RawField.d.ts +223 -27
  39. package/lib/RawField.js +413 -59
  40. package/lib/StationPlot.d.ts +78 -11
  41. package/lib/StationPlot.js +113 -30
  42. package/lib/TextCollection.d.ts +5 -0
  43. package/lib/TextCollection.js +82 -9
  44. package/lib/WasmInterface.d.ts +7 -0
  45. package/lib/WasmInterface.js +11 -0
  46. package/lib/WorkerPool.d.ts +8 -0
  47. package/lib/WorkerPool.js +77 -0
  48. package/lib/cpp/marchingsquares.js +127 -13
  49. package/lib/cpp/marchingsquares.wasm +0 -0
  50. package/lib/cpp/marchingsquares_embind.d.ts +16 -3
  51. package/lib/grids/AutoZoom.d.ts +21 -0
  52. package/lib/grids/AutoZoom.js +63 -0
  53. package/lib/grids/DomainBuffer.d.ts +14 -0
  54. package/lib/grids/DomainBuffer.js +16 -0
  55. package/lib/grids/Geostationary.d.ts +35 -0
  56. package/lib/grids/Geostationary.js +47 -0
  57. package/lib/grids/Grid.d.ts +36 -0
  58. package/lib/grids/Grid.js +12 -0
  59. package/lib/grids/GridCoordinates.d.ts +10 -0
  60. package/lib/grids/GridCoordinates.js +64 -0
  61. package/lib/grids/LambertGrid.d.ts +73 -0
  62. package/lib/grids/LambertGrid.js +92 -0
  63. package/lib/grids/PlateCarreeGrid.d.ts +46 -0
  64. package/lib/grids/PlateCarreeGrid.js +55 -0
  65. package/lib/grids/PlateCarreeRotatedGrid.d.ts +53 -0
  66. package/lib/grids/PlateCarreeRotatedGrid.js +65 -0
  67. package/lib/grids/RadarSweepGrid.d.ts +46 -0
  68. package/lib/grids/RadarSweepGrid.js +74 -0
  69. package/lib/grids/StructuredGrid.d.ts +49 -0
  70. package/lib/grids/StructuredGrid.js +103 -0
  71. package/lib/grids/UnstructuredGrid.d.ts +56 -0
  72. package/lib/grids/UnstructuredGrid.js +102 -0
  73. package/lib/index.d.ts +23 -6
  74. package/lib/index.js +18 -8
  75. package/lib/utils.d.ts +11 -2
  76. package/lib/utils.js +63 -1
  77. package/package.json +4 -3
  78. package/dist/110.autumnplot-gl.js +0 -2
  79. package/dist/110.autumnplot-gl.js.map +0 -1
  80. package/lib/ContourCreator.d.ts +0 -22
  81. package/lib/Grid.d.ts +0 -263
  82. package/lib/Grid.js +0 -547
  83. package/lib/ParticleTracer.d.ts +0 -19
  84. package/lib/ParticleTracer.js +0 -37
package/lib/Grid.d.ts DELETED
@@ -1,263 +0,0 @@
1
- import { WGLBuffer, WGLTexture } from "autumn-wgl";
2
- import { TypedArray, WebGLAnyRenderingContext } from "./AutumnTypes";
3
- interface EarthCoords {
4
- lons: Float32Array;
5
- lats: Float32Array;
6
- }
7
- interface GridCoords {
8
- x: Float32Array;
9
- y: Float32Array;
10
- }
11
- type GridType = 'latlon' | 'latlonrot' | 'lcc' | 'unstructured';
12
- declare abstract class Grid {
13
- readonly type: GridType;
14
- readonly ni: number;
15
- readonly nj: number;
16
- readonly is_conformal: boolean;
17
- private readonly billboard_buffer_cache;
18
- private readonly vector_rotation_cache;
19
- constructor(type: GridType, is_conformal: boolean, ni: number, nj: number);
20
- abstract getEarthCoords(): EarthCoords;
21
- abstract getGridCoords(): GridCoords;
22
- abstract transform(x: number, y: number, opts?: {
23
- inverse?: boolean;
24
- }): [number, number];
25
- abstract sampleNearestGridPoint(lon: number, lat: number, ary: TypedArray): {
26
- sample: number;
27
- sample_lon: number;
28
- sample_lat: number;
29
- };
30
- abstract getThinnedGrid(thin_fac: number, map_max_zoom: number): Grid;
31
- abstract thinDataArray<ArrayType extends TypedArray>(original_grid: Grid, ary: ArrayType): ArrayType;
32
- abstract getMinVisibleZoom(thin_fac: number): Uint8Array;
33
- getWGLBillboardBuffers(gl: WebGLAnyRenderingContext, thin_fac: number, max_zoom: number): Promise<{
34
- vertices: WGLBuffer;
35
- texcoords: WGLBuffer;
36
- }>;
37
- abstract copy(): Grid;
38
- getVectorRotationAtPoint(lon: number, lat: number): number;
39
- getVectorRotationTexture(gl: WebGLAnyRenderingContext, data_are_earth_relative: boolean): {
40
- rotation: WGLTexture;
41
- };
42
- }
43
- /** A structured grid (in this case meaning a cartesian grid with i and j coordinates) */
44
- declare abstract class StructuredGrid extends Grid {
45
- private readonly buffer_cache;
46
- protected readonly thin_x: number;
47
- protected readonly thin_y: number;
48
- constructor(type: GridType, is_conformal: boolean, ni: number, nj: number, thin_x?: number, thin_y?: number);
49
- abstract getEarthCoords(ni?: number, nj?: number): EarthCoords;
50
- /** @internal */
51
- protected xyThinFromMaxZoom(thin_fac: number, map_max_zoom: number): [number, number];
52
- /** @internal */
53
- getMinVisibleZoom(thin_fac: number): Uint8Array;
54
- /** @internal */
55
- thinDataArray<ArrayType extends TypedArray>(original_grid: StructuredGrid, ary: ArrayType): ArrayType;
56
- abstract copy(opts?: {
57
- ni?: number;
58
- nj?: number;
59
- }): Grid;
60
- getWGLBuffers(gl: WebGLAnyRenderingContext): Promise<{
61
- vertices: WGLBuffer;
62
- texcoords: WGLBuffer;
63
- }>;
64
- sampleNearestGridPoint(lon: number, lat: number, ary: TypedArray): {
65
- sample: number;
66
- sample_lon: number;
67
- sample_lat: number;
68
- };
69
- }
70
- /** A plate carree (a.k.a. lat/lon) grid with uniform grid spacing */
71
- declare class PlateCarreeGrid extends StructuredGrid {
72
- readonly ll_lon: number;
73
- readonly ll_lat: number;
74
- readonly ur_lon: number;
75
- readonly ur_lat: number;
76
- private readonly ll_cache;
77
- private readonly gc_cache;
78
- /**
79
- * Create a plate carree grid
80
- * @param ni - The number of grid points in the i (longitude) direction
81
- * @param nj - The number of grid points in the j (latitude) direction
82
- * @param ll_lon - The longitude of the lower left corner of the grid
83
- * @param ll_lat - The latitude of the lower left corner of the grid
84
- * @param ur_lon - The longitude of the upper right corner of the grid
85
- * @param ur_lat - The latitude of the upper right corner of the grid
86
- */
87
- constructor(ni: number, nj: number, ll_lon: number, ll_lat: number, ur_lon: number, ur_lat: number, thin_x?: number, thin_y?: number);
88
- /** @internal */
89
- copy(opts?: {
90
- ni?: number;
91
- nj?: number;
92
- ll_lon?: number;
93
- ll_lat?: number;
94
- ur_lon?: number;
95
- ur_lat?: number;
96
- }): PlateCarreeGrid;
97
- /**
98
- * @internal
99
- * Get a list of longitudes and latitudes on the grid (internal method)
100
- */
101
- getEarthCoords(ni?: number, nj?: number): EarthCoords;
102
- /** @internal */
103
- getGridCoords(): GridCoords;
104
- /** @internal */
105
- transform(x: number, y: number, opts?: {
106
- inverse?: boolean;
107
- }): [number, number];
108
- /** @internal */
109
- getThinnedGrid(thin_fac: number, map_max_zoom: number): PlateCarreeGrid;
110
- }
111
- /** A rotated lat-lon (plate carree) grid with uniform grid spacing */
112
- declare class PlateCarreeRotatedGrid extends StructuredGrid {
113
- readonly np_lon: number;
114
- readonly np_lat: number;
115
- readonly lon_shift: number;
116
- readonly ll_lon: number;
117
- readonly ll_lat: number;
118
- readonly ur_lon: number;
119
- readonly ur_lat: number;
120
- private readonly llrot;
121
- private readonly ll_cache;
122
- private readonly gc_cache;
123
- /**
124
- * Create a Lambert conformal conic grid
125
- * @param ni - The number of grid points in the i (longitude) direction
126
- * @param nj - The number of grid points in the j (latitude) direction
127
- * @param np_lon - The longitude of the north pole for the rotated grid
128
- * @param np_lat - The latitude of the north pole for the rotated grid
129
- * @param lon_shift - The angle around the rotated north pole to shift the central meridian
130
- * @param ll_lon - The longitude of the lower left corner of the grid (on the rotated earth)
131
- * @param ll_lat - The latitude of the lower left corner of the grid (on the rotated earth)
132
- * @param ur_lon - The longitude of the upper right corner of the grid (on the rotated earth)
133
- * @param ur_lat - The latitude of the upper right corner of the grid (on the rotated earth)
134
- */
135
- constructor(ni: number, nj: number, np_lon: number, np_lat: number, lon_shift: number, ll_lon: number, ll_lat: number, ur_lon: number, ur_lat: number, thin_x?: number, thin_y?: number);
136
- /** @internal */
137
- copy(opts?: {
138
- ni?: number;
139
- nj?: number;
140
- ll_lon?: number;
141
- ll_lat?: number;
142
- ur_lon?: number;
143
- ur_lat?: number;
144
- }): PlateCarreeRotatedGrid;
145
- /**
146
- * @internal
147
- * Get a list of longitudes and latitudes on the grid
148
- */
149
- getEarthCoords(ni?: number, nj?: number): EarthCoords;
150
- /** @internal */
151
- getGridCoords(): GridCoords;
152
- /** @internal */
153
- transform(x: number, y: number, opts?: {
154
- inverse?: boolean;
155
- }): [number, number];
156
- /** @internal */
157
- getThinnedGrid(thin_fac: number, map_max_zoom: number): PlateCarreeRotatedGrid;
158
- }
159
- /** A Lambert conformal conic grid with uniform grid spacing */
160
- declare class LambertGrid extends StructuredGrid {
161
- readonly lon_0: number;
162
- readonly lat_0: number;
163
- readonly lat_std: [number, number];
164
- readonly ll_x: number;
165
- readonly ll_y: number;
166
- readonly ur_x: number;
167
- readonly ur_y: number;
168
- private readonly lcc;
169
- private readonly ll_cache;
170
- private readonly gc_cache;
171
- /**
172
- * Create a Lambert conformal conic grid from the lower-left and upper-right corner x/y values.
173
- * @param ni - The number of grid points in the i (longitude) direction
174
- * @param nj - The number of grid points in the j (latitude) direction
175
- * @param lon_0 - The standard longitude for the projection; this is also the center longitude for the projection
176
- * @param lat_0 - The center latitude for the projection
177
- * @param lat_std - The standard latitudes for the projection
178
- * @param ll_x - The x coordinate in projection space of the lower-left corner of the grid
179
- * @param ll_y - The y coordinate in projection space of the lower-left corner of the grid
180
- * @param ur_x - The x coordinate in projection space of the upper-right corner of the grid
181
- * @param ur_y - The y coordinate in projection space of the upper-right corner of the grid
182
- */
183
- constructor(ni: number, nj: number, lon_0: number, lat_0: number, lat_std: [number, number], ll_x: number, ll_y: number, ur_x: number, ur_y: number, thin_x?: number, thin_y?: number);
184
- /**
185
- * Create a Lambert conformal conic grid from the lower-left grid point coordinate and a dx and dy.
186
- * @param ni - The number of grid points in the i (longitude) direction
187
- * @param nj - The number of grid points in the j (latitude) direction
188
- * @param lon_0 - The standard longitude for the projection; this is also the center longitude for the projection
189
- * @param lat_0 - The center latitude for the projection
190
- * @param lat_std - The standard latitudes for the projection
191
- * @param ll_lon - The longitude of the lower-left corner of the grid
192
- * @param ll_lat - The latitude of the lower-left corner of the grid
193
- * @param dx - The grid dx in meters
194
- * @param dy - The grid dy in meters
195
- * @returns
196
- */
197
- static fromLLCornerLonLat(ni: number, nj: number, lon_0: number, lat_0: number, lat_std: [number, number], ll_lon: number, ll_lat: number, dx: number, dy: number): LambertGrid;
198
- /** @internal */
199
- copy(opts?: {
200
- ni?: number;
201
- nj?: number;
202
- ll_x?: number;
203
- ll_y?: number;
204
- ur_x?: number;
205
- ur_y?: number;
206
- }): LambertGrid;
207
- /**
208
- * @internal
209
- * Get a list of longitudes and latitudes on the grid
210
- */
211
- getEarthCoords(ni?: number, nj?: number): EarthCoords;
212
- /** @internal */
213
- getGridCoords(): GridCoords;
214
- /** @internal */
215
- transform(x: number, y: number, opts?: {
216
- inverse?: boolean;
217
- }): [number, number];
218
- /** @internal */
219
- getThinnedGrid(thin_fac: number, map_max_zoom: number): LambertGrid;
220
- }
221
- /** An unstructured grid */
222
- declare class UnstructuredGrid extends Grid {
223
- readonly coords: {
224
- lon: number;
225
- lat: number;
226
- }[];
227
- private readonly zoom_cache;
228
- private readonly zoom_arg;
229
- /**
230
- * Create an unstructured grid
231
- * @param coords - The lat/lon coordinates of the grid points
232
- */
233
- constructor(coords: {
234
- lon: number;
235
- lat: number;
236
- }[], zoom?: Uint8Array);
237
- /** @internal */
238
- copy(): UnstructuredGrid;
239
- /** @internal */
240
- getEarthCoords(): {
241
- lons: Float32Array;
242
- lats: Float32Array;
243
- };
244
- /** @internal */
245
- getGridCoords(): GridCoords;
246
- /** @internal */
247
- transform(x: number, y: number, opts?: {
248
- inverse?: boolean;
249
- }): [number, number];
250
- /** @internal */
251
- getMinVisibleZoom(thin_fac: number): Uint8Array;
252
- /** @internal */
253
- getThinnedGrid(thin_fac: number, map_max_zoom: number): UnstructuredGrid;
254
- /** @internal */
255
- thinDataArray<ArrayType extends TypedArray>(original_grid: UnstructuredGrid, ary: ArrayType): ArrayType;
256
- sampleNearestGridPoint(lon: number, lat: number, ary: TypedArray): {
257
- sample: number;
258
- sample_lon: number;
259
- sample_lat: number;
260
- };
261
- }
262
- export { Grid, StructuredGrid, PlateCarreeGrid, PlateCarreeRotatedGrid, LambertGrid, UnstructuredGrid };
263
- export type { GridType };