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
package/README.md
CHANGED
|
@@ -16,7 +16,25 @@ autumnplot-gl is designed to be used with either [Mapbox GL JS](https://docs.map
|
|
|
16
16
|
npm i autumnplot-gl
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Unfortunately, you may have to modify your build tool configuration to include the WebAssembly binary. For webpack, I've found adding this to webpack.config.js works:
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
{
|
|
23
|
+
"module": {
|
|
24
|
+
"rules": [
|
|
25
|
+
{
|
|
26
|
+
test: /\.wasm$/,
|
|
27
|
+
type: "asset/resource",
|
|
28
|
+
generator: {
|
|
29
|
+
filename: "static/js/[name].wasm"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
In addition to the Typescript library, pre-built autumnplot-gl javascript files area available [here](https://tsupinie.github.io/autumnplot-gl/dist/). Adding them to your page exposes the API via the `apgl` global variable (e.g., instead of `new PlateCarreeGrid(...)` in the examples, you'd call `new apgl.PlateCarreeGrid(...)`).
|
|
20
38
|
|
|
21
39
|
### A basic contour plot
|
|
22
40
|
The first step in plotting data is to create a grid. Currently, the only supported grids are PlateCarreeGrid (a.k.a. Lat/Lon), RotatedPlateCarreeGrid, and LambertGrid (a.k.a. Lambert Conformal Conic).
|
|
@@ -65,6 +83,19 @@ map.on('load', () => {
|
|
|
65
83
|
|
|
66
84
|
The `'railway_transit_tunnel'` argument is a layer in the map style, and this means to add your layer just below that layer on the map. This usually produces better results than just blindly slapping all your layers on top of all the map (though the map style itself may require some tweaking to produce the best results).
|
|
67
85
|
|
|
86
|
+
### Contour Labeling
|
|
87
|
+
|
|
88
|
+
Typically, when plotting meteorological data, contours are labeled with their values, which you can do with `ContourLabels`:
|
|
89
|
+
|
|
90
|
+
```javascript
|
|
91
|
+
const labels = new ContourLabels(height_contour, {text_color: '#ffffff', halo: true});
|
|
92
|
+
const label_layer = new PlotLayer('label', labels);
|
|
93
|
+
|
|
94
|
+
map.on('load', () => {
|
|
95
|
+
map.addLayer(label_layer, 'railway_transit_tunnel');
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
68
99
|
### Barbs
|
|
69
100
|
|
|
70
101
|
Wind barb plotting is similar to the contours, but it requires using a `RawVectorField` with u and v data.
|
|
@@ -114,13 +145,25 @@ document.getElementById('colorbar-container').appendChild(colorbar_svg);
|
|
|
114
145
|
```
|
|
115
146
|
|
|
116
147
|
### Varying the data plots
|
|
117
|
-
The previous steps have gone through plotting a static dataset on a map, but in many instances, you want to view a dataset that changes, say over time.
|
|
148
|
+
The previous steps have gone through plotting a static dataset on a map, but in many instances, you want to view a dataset that changes, say over time. In order to switch the data currently plotted, you can call `updateField()` on the plot component (e.g, `ContourFilled`, `Barbs`, etc.) to switch what field is plotted.
|
|
149
|
+
|
|
150
|
+
```javascript
|
|
151
|
+
// Create the initial field
|
|
152
|
+
const height_field_f00 = new RawScalarField(grid, height_data_f00);
|
|
153
|
+
const fills = new Contour(height_data_f00, {interval: 30});
|
|
154
|
+
|
|
155
|
+
// Update the field plotted
|
|
156
|
+
const height_field_f01 = new RawScalarField(grid, height_data_f01);
|
|
157
|
+
fills.updateField(height_field_f01);
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Another way to vary the data is to use `MultiPlotLayer`. The main difference between this and using `updateField()` is that `MultiPlotLayer` will put all data for all times onto VRAM at once. In contrast, with `PlotLayer` and `updateField()`, only the data currently plotted are stored on VRAM. For large grids, this may take up a large amount of VRAM, so you may not want to use this, and it may be removed in later versions.
|
|
118
161
|
|
|
119
162
|
```javascript
|
|
120
163
|
// Contour some data
|
|
121
|
-
const height_contour_f00 = new Contour(
|
|
122
|
-
const height_contour_f01 = new Contour(
|
|
123
|
-
const height_contour_f02 = new Contour(
|
|
164
|
+
const height_contour_f00 = new Contour(height_f00);
|
|
165
|
+
const height_contour_f01 = new Contour(height_f01);
|
|
166
|
+
const height_contour_f02 = new Contour(height_f02);
|
|
124
167
|
|
|
125
168
|
// Create a varying map layer
|
|
126
169
|
const height_layer_time = new MultiPlotLayer('height-contour-time');
|
|
@@ -143,6 +186,20 @@ The second argument to `addField()` is the key to associate with this field. Thi
|
|
|
143
186
|
height_layer.setActiveKey('20230112_1200');
|
|
144
187
|
```
|
|
145
188
|
|
|
189
|
+
### Typescript Considerations
|
|
190
|
+
|
|
191
|
+
autumnplot-gl is written in Tyescript to facilitate type info in large projects. Typescript isn't necessary to use autumnplot-gl, but if you want to use it, there are some considerations.
|
|
192
|
+
|
|
193
|
+
Many of the plot component classes have generic types. The typescript compiler can generally figure out the generic type parameters, but if you're declaring a variable to be a plot component, you'll probably need to specify those ahead of time. The first type parameter is the array type (either Float32Array or Float16Array), and the second is the type of the Map you're using.
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
// Import the map from maplibre-gl, if that's what you're using. Mapbox should be similar.
|
|
197
|
+
import { Map } from 'maplibre-gl';
|
|
198
|
+
|
|
199
|
+
// Declare a contour field which contours an array of float float32s with the MapLibre map.
|
|
200
|
+
const cntr: Contour<Float32Array, Map>;
|
|
201
|
+
```
|
|
202
|
+
|
|
146
203
|
## Built-in color maps
|
|
147
204
|
autumnplot-gl comes with several built-in color maps, accessible via `import {colormaps} from 'autumnplot-gl'`. These are basic blue/red and red/blue diverging color maps plus a selection from [PivotalWeather](https://www.pivotalweather.com). The blue/red and red/blue are functions that take a minimum contour level, a maximum contour level, and a number of colors. For example, this creates a blue/red colormap starting at -10, ending at 10, and with 20 colors:
|
|
148
205
|
|
|
@@ -152,7 +209,8 @@ const colormap = colormaps.bluered(-10, 10, 20);
|
|
|
152
209
|
|
|
153
210
|
Here are all the colormaps available:
|
|
154
211
|
|
|
155
|
-

|
|
213
|
+
|
|
156
214
|
|
|
157
215
|
## Map tiles
|
|
158
216
|
The above exmple uses map tiles from [Maptiler](https://www.maptiler.com/). Map tiles from Maptiler or Mapbox or others are free up to a (reasonably generous) limit, but the pricing can be a tad steep after reaching the limit. The tiles from these services are extremely detailed, and really what you're paying for there is the hardware to store, process, and serve that data. While these tiles are very nice, the detail is way overkill for a lot of uses in meteorology.
|
|
@@ -160,10 +218,9 @@ The above exmple uses map tiles from [Maptiler](https://www.maptiler.com/). Map
|
|
|
160
218
|
So, I've created some [less-detailed map tiles](https://tsupinie.github.io/autumnplot-gl/tiles/) that are small enough that they can be hosted without dedicated hardware. However the tradeoff is that they're only useful down to zoom level 8 or 9 on the map, such that the viewport is somewhere between half a US state and a few counties in size. If that's good enough for you, then these tiles could be useful.
|
|
161
219
|
|
|
162
220
|
## Conspicuous absences
|
|
163
|
-
A few capabilities are missing from this library as of
|
|
221
|
+
A few capabilities are missing from this library as of v3.0.
|
|
164
222
|
* Helper functions for reading from specific data formats. For instance, I'd like to add support for reading from a zarr file.
|
|
165
223
|
* A whole bunch of little things that ought to be fairly straightforward like tweaking the size of the wind barbs and contour thicknesses.
|
|
166
|
-
* Support for contour labeling. I'd like to add it, but I'm not really sure how I'd do it with the contours as I've implemented them. Any WebGL gurus, get in touch.
|
|
167
224
|
|
|
168
225
|
## Closing thoughts
|
|
169
226
|
Even though autumnplot-gl is currently an extremely new package with relatively limited capability, I hope folks see potential and find it useful. Any contributions to fill out some missing features are welcome.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.apgl=t():e.apgl=t()}(this,(()=>(()=>{"use strict";function e(e,t,r){for(var n=1,o=r;e%o!=0||t%o!=0;)n+=1,o/=2;return n}const t=Symbol("Comlink.proxy"),r=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),o=Symbol("Comlink.thrown"),a=e=>"object"==typeof e&&null!==e||"function"==typeof e,s=new Map([["proxy",{canHandle:e=>a(e)&&e[t],serialize(e){const{port1:t,port2:r}=new MessageChannel;return i(e,t),[r,[r]]},deserialize:e=>(e.start(),u(e,[],undefined))}],["throw",{canHandle:e=>a(e)&&o in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function i(e,r=self){r.addEventListener("message",(function n(a){if(!a||!a.data)return;const{id:s,type:f,path:u}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(h);let p;try{const r=u.slice(0,-1).reduce(((e,t)=>e[t]),e),n=u.reduce(((e,t)=>e[t]),e);switch(f){case"GET":p=n;break;case"SET":r[u.slice(-1)[0]]=h(a.data.value),p=!0;break;case"APPLY":p=n.apply(r,l);break;case"CONSTRUCT":p=function(e){return Object.assign(e,{[t]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:t,port2:r}=new MessageChannel;i(e,r),p=function(e,t){return v.set(e,t),e}(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(e){p={value:e,[o]:0}}Promise.resolve(p).catch((e=>({value:e,[o]:0}))).then((e=>{const[t,o]=d(e);r.postMessage(Object.assign(Object.assign({},t),{id:s}),o),"RELEASE"===f&&(r.removeEventListener("message",n),c(r))}))})),r.start&&r.start()}function c(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function f(e){if(e)throw new Error("Proxy has been released and is not useable")}function u(e,t=[],o=function(){}){let a=!1;const s=new Proxy(o,{get(r,o){if(f(a),o===n)return()=>p(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{c(e),a=!0}));if("then"===o){if(0===t.length)return{then:()=>s};const r=p(e,{type:"GET",path:t.map((e=>e.toString()))}).then(h);return r.then.bind(r)}return u(e,[...t,o])},set(r,n,o){f(a);const[s,i]=d(o);return p(e,{type:"SET",path:[...t,n].map((e=>e.toString())),value:s},i).then(h)},apply(n,o,s){f(a);const i=t[t.length-1];if(i===r)return p(e,{type:"ENDPOINT"}).then(h);if("bind"===i)return u(e,t.slice(0,-1));const[c,v]=l(s);return p(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:c},v).then(h)},construct(r,n){f(a);const[o,s]=l(n);return p(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:o},s).then(h)}});return s}function l(e){const t=e.map(d);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const v=new WeakMap;function d(e){for(const[t,r]of s)if(r.canHandle(e)){const[n,o]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},o]}return[{type:"RAW",value:e},v.get(e)||[]]}function h(e){switch(e.type){case"HANDLER":return s.get(e.name).deserialize(e.value);case"RAW":return e.value}}function p(e,t,r){return new Promise((n=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===o&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)}))}var m=function(){function e(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(t,")"));if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}return e.prototype.toMercatorCoord=function(){return{x:(n=this.lng,(180+n)/360),y:(e=this.lat,t=Math.sin(e*Math.PI/180),r=(180-90/Math.PI*Math.log((1+t)/(1-t)))/360,Math.min(2,Math.max(-2,r)))};var e,t,r,n},e.fromMercatorCoord=function(t,r){return new e(function(e){return 360*e-180}(t),function(e){return 180*Math.atan(Math.sinh((180-360*e)*Math.PI/180))/Math.PI}(r))},e}(),y=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return s};return i({makeBBElements:function(t,r,n,o,a,s){for(var i=Math.log2(a),c=Math.max(i+1-s,0),f=Math.pow(2,c),u=Math.floor((n-1)/f)+1,l=Math.floor((o-1)/f)+1,v=u*l*6*2,d=new Float32Array(u*l*6*3),h=new Float32Array(v),p=0,y=0,g=0;g<o;g++)for(var x=0;x<n;x++){var w=g*n+x,b=t[w],E=r[w],M=e(g,x,a);if(!(M>s)){for(var A=new m(E,b).toMercatorCoord(),S=0;S<6;S++){var L=Math.max(0,Math.min(S-1,3));d[p+3*S+0]=A.x,d[p+3*S+1]=A.y,d[p+3*S+2]=4*M+L,h[y+2*S+0]=x/(n-1),h[y+2*S+1]=g/(o-1)}p+=18,y+=12}}return{pts:d,tex_coords:h}},makeDomainVerticesAndTexCoords:function(e,t,r,n,o,a){for(var s=new Float32Array(4*(r-1)*(n+1)).fill(0),i=new Float32Array(4*(r-1)*(n+1)).fill(0),c=new Float32Array(2*(r-1)*(n+1)).fill(0),f=0,u=0,l=0;l<r-1;l++)for(var v=0;v<n;v++){var d=l+v*r,h=new m(t[d],e[d]).toMercatorCoord(),p=new m(t[d+1],e[d+1]).toMercatorCoord(),y=l/(r-1)*(1-2*o)+o,g=(l+1)/(r-1)*(1-2*o)+o,x=v/(n-1)*(1-2*a)+a;0==v&&(s[f]=h.x,s[f+1]=h.y,f+=2,i[u]=y,i[u+1]=x,u+=2),s[f]=h.x,s[f+1]=h.y,s[f+2]=p.x,s[f+3]=p.y,f+=4,i[u]=y,i[u+1]=x,i[u+2]=g,i[u+3]=x,u+=4,v==n-1&&(s[f]=p.x,s[f+1]=p.y,f+=2,i[u]=g,i[u+1]=x,u+=2)}var w=0;for(l=0;l<r-1;l++)for(v=0;v<n-1;v++){var b=0==v?2*(w+1):2*w,E=s[b],M=s[b+1],A=s[b+2],S=s[b+3],L=s[b+4],j=s[b+5],k=s[b+6],C=s[b+7],P=.5*Math.abs(E*(S-j)+A*(j-M)+L*(M-S)+k*(j-S)+L*(S-C)+A*(C-j));0==v&&(c[w]=P,w+=1),c[w]=P,c[w+1]=P,w+=2,v==n-2&&(c[w]=P,c[w+1]=P,c[w+2]=P,w+=3)}return{vertices:s,tex_coords:i,grid_cell_size:c}},makePolyLines:function(e){if(0==e.length)return{vertices:new Float32Array([]),extrusion:new Float32Array([])};var t=Object.fromEntries(Object.entries(e[0]).map((function(e){var t=y(e,2),r=t[0],n=t[1];return[r,"number"==typeof n||"number"==typeof n[0]?1:n[0].length]})));t.extrusion=2,t.vertices+=1;var r=4*e.map((function(e){return e.vertices.length})).reduce((function(e,t){return e+t}))-2*e.length,n=Object.fromEntries(Object.entries(t).map((function(e){var t=y(e,2),n=t[0],o=t[1];return[n,r*o]}))),o={vertices:new Float32Array(n.vertices),extrusion:new Float32Array(n.extrusion)};"offsets"in e[0]&&(o.offsets=new Float32Array(n.offsets)),"data"in e[0]&&(o.data=new Float32Array(n.data)),"zoom"in e[0]&&(o.zoom=new Float32Array(n.zoom));var a=Object.fromEntries(Object.keys(n).map((function(e){return[e,0]}))),s=function(e,t,r){var n=t[0]-e[0],o=t[1]-e[1],a=Math.hypot(n,o),s=-n/a;return[o/a,r?-s:s]};return e.forEach((function(e){var t,r,n,i,c=e.vertices.map((function(e){var t=(new(m.bind.apply(m,function(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([void 0],y(e),!1)))).toMercatorCoord();return[t.x,t.y]})),f=void 0!==e.offsets,u=f?e.offsets:c,l=c[0],v=(c[1],u[0]),d=u[1],h=0,p=y(s(v,d,!f),2),g=p[0],x=p[1];o.vertices[a.vertices++]=l[0],o.vertices[a.vertices++]=l[1],o.vertices[a.vertices++]=h,o.extrusion[a.extrusion++]=g,o.extrusion[a.extrusion++]=x;for(var w=1;w<c.length;w++)l=c[w],r=c[w-1],v=u[w],n=u[w-1],g=(t=y(s(n,v,!f),2))[0],x=t[1],i=h,h+=Math.hypot(c[w-1][0]-c[w][0],c[w-1][1]-c[w][1]),o.vertices[a.vertices++]=r[0],o.vertices[a.vertices++]=r[1],o.vertices[a.vertices++]=i,o.vertices[a.vertices++]=r[0],o.vertices[a.vertices++]=r[1],o.vertices[a.vertices++]=i,o.vertices[a.vertices++]=l[0],o.vertices[a.vertices++]=l[1],o.vertices[a.vertices++]=h,o.vertices[a.vertices++]=l[0],o.vertices[a.vertices++]=l[1],o.vertices[a.vertices++]=h,o.extrusion[a.extrusion++]=g,o.extrusion[a.extrusion++]=x,o.extrusion[a.extrusion++]=-g,o.extrusion[a.extrusion++]=-x,o.extrusion[a.extrusion++]=g,o.extrusion[a.extrusion++]=x,o.extrusion[a.extrusion++]=-g,o.extrusion[a.extrusion++]=-x;if(o.vertices[a.vertices++]=l[0],o.vertices[a.vertices++]=l[1],o.vertices[a.vertices++]=h,o.extrusion[a.extrusion++]=-g,o.extrusion[a.extrusion++]=-x,"offsets"in o){var b=e.offsets,E=void 0,M=b[0];for(o.offsets[a.offsets++]=M[0],o.offsets[a.offsets++]=M[1],w=1;w<b.length;w++)M=b[w],E=b[w-1],o.offsets[a.offsets++]=E[0],o.offsets[a.offsets++]=E[1],o.offsets[a.offsets++]=E[0],o.offsets[a.offsets++]=E[1],o.offsets[a.offsets++]=M[0],o.offsets[a.offsets++]=M[1],o.offsets[a.offsets++]=M[0],o.offsets[a.offsets++]=M[1];o.offsets[a.offsets++]=M[0],o.offsets[a.offsets++]=M[1]}if("data"in o){var A=e.data,S=void 0,L=A[0];for(o.data[a.data++]=L,w=1;w<A.length;w++)L=A[w],S=A[w-1],o.data[a.data++]=S,o.data[a.data++]=S,o.data[a.data++]=L,o.data[a.data++]=L;o.data[a.data++]=L}if("zoom"in o)for(w=0;w<4*c.length-2;w++)o.zoom[a.zoom++]=e.zoom})),o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L,QAAUqM,EAAW,IAG/C,IAEOd,CACX,I","sources":["webpack://apgl/webpack/universalModuleDefinition","webpack://apgl/./src/utils.ts","webpack://apgl/./node_modules/comlink/dist/esm/comlink.mjs","webpack://apgl/./src/Map.ts","webpack://apgl/./src/PlotLayer.worker.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apgl\"] = factory();\n\telse\n\t\troot[\"apgl\"] = factory();\n})(this, () => {\nreturn ","\nconst hex2rgba = (hexstr: string, out_type?: string) : [number, number, number, number] => {\n out_type = out_type === undefined ? 'float' : out_type;\n\n const match = hexstr.match(/#([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?/i);\n if (match === null) {\n throw `Got '${hexstr}' in hex2rgba, which does not look like a hex color`;\n }\n\n let rgba = match.slice(1).filter(c => c !== undefined).map(c => parseInt(c, 16));\n\n if (out_type == 'float') {\n rgba = rgba.map(c => c / 255);\n }\n\n return rgba[3] === undefined ? [rgba[0], rgba[1], rgba[2], 1] : [rgba[0], rgba[1], rgba[2], rgba[3]];\n}\n\nconst rgba2hex = (rgba: [number, number, number, number], in_type?: string) : string => {\n in_type = in_type === undefined ? 'float' : in_type;\n\n let rgba_ = rgba as number[];\n if (in_type == 'float') {\n rgba_ = rgba_.map(c => Math.round(c * 255));\n }\n\n return '#' + rgba_.map(c => c.toString(16).padStart(2, '0').toUpperCase()).join('');\n}\n\nconst hex2rgb = (hexstr: string, out_type?: string) : [number, number, number] => {\n const[r, g, b, a] = hex2rgba(hexstr, out_type);\n return [r, g, b];\n}\n\nconst rgb2hex = (rgb: [number, number, number], in_type?: string) : string => {\n const [r, g, b] = rgb;\n return rgba2hex([r, g, b, 0], in_type).slice(0, -2);\n}\n\nconst rgb2hsv = (rgb: [number, number, number]) : [number, number, number] => {\n const [r, g, b] = rgb;\n\n const Cmax = Math.max(r, g, b);\n const Cmin = Math.min(r, g, b);\n const Delta = Cmax - Cmin;\n \n let H: number;\n if (Delta == 0) {\n H = 0;\n }\n else if (Cmax == r) {\n H = 60 * ((g - b) / Delta) % 6;\n }\n else if (Cmax == g) {\n H = 60 * ((b - r) / Delta + 2);\n }\n else if (Cmax == b) {\n H = 60 * ((r - g) / Delta + 4);\n }\n\n let S = Cmax == 0 ? 0 : Delta / Cmax;\n let V = Cmax;\n\n return [H, S, V];\n}\n\nconst hsv2rgb = (hsv: [number, number, number]) : [number, number, number] => {\n const [H, S, V] = hsv;\n\n const C = V * S;\n const X = C * (1 - Math.abs(H / 60 % 2 - 1));\n const m = V - C;\n\n let r_prime, g_prime, b_prime;\n if (0 <= H && H < 60) {\n r_prime = C; g_prime = X, b_prime = 0;\n }\n else if (60 <= H && H < 120) {\n r_prime = X; g_prime = C, b_prime = 0;\n }\n else if (120 <= H && H < 180) {\n r_prime = 0; g_prime = C, b_prime = X;\n }\n else if (180 <= H && H < 240) {\n r_prime = 0; g_prime = X, b_prime = C;\n }\n else if (240 <= H && H < 300) {\n r_prime = X; g_prime = 0, b_prime = C;\n }\n else if (300 <= H && H < 360) {\n r_prime = C; g_prime = 0, b_prime = X;\n }\n\n return [r_prime + m, g_prime + m, b_prime + m];\n}\n\nfunction getMinZoom(jlat: number, ilon: number, thin_fac_base: number) {\n const zoom_base = 1;\n\n let zoom = zoom_base;\n let thin_fac = thin_fac_base;\n\n while (((jlat % thin_fac) != 0) || ((ilon % thin_fac) != 0)) {\n zoom += 1;\n thin_fac /= 2;\n }\n\n return zoom;\n}\n\nfunction* zip(...args: any[]) {\n\tconst iterators = args.map(x => x[Symbol.iterator]());\n\twhile (true) {\n\t\tconst current = iterators.map(x => x.next());\n\t\tif (current.some(x => x.done)) {\n\t\t\tbreak;\n\t\t}\n\t\tyield current.map(x => x.value);\n\t}\n}\n\nfunction getOS() {\n const userAgent = window.navigator.userAgent,\n platform = window.navigator.platform,\n macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'],\n windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'],\n iosPlatforms = ['iPhone', 'iPad', 'iPod'];\n let os = null;\n\n if (macosPlatforms.indexOf(platform) !== -1 && navigator.maxTouchPoints <= 1) {\n os = 'Mac OS';\n } \n else if (iosPlatforms.indexOf(platform) !== -1 || (macosPlatforms.indexOf(platform) !== -1 && navigator.maxTouchPoints > 1)) { \n os = 'iOS';\n } \n else if (windowsPlatforms.indexOf(platform) !== -1) {\n os = 'Windows';\n } \n else if (/Android/.test(userAgent)) {\n os = 'Android';\n } \n else if (/Linux/.test(platform)) {\n os = 'Linux';\n }\n\n return os;\n}\n\nclass Cache<A extends unknown[], R> {\n private cached_values: Record<string, R>;\n private readonly compute_value: (...args: A) => R;\n private readonly make_key: (...args: A) => string;\n\n constructor(compute_value: (...args: A) => R, make_key?: (...args: A) => string) {\n this.cached_values = {};\n this.compute_value = compute_value;\n this.make_key = make_key === undefined ? (...args: A) => JSON.stringify(args) : make_key;\n }\n\n public getValue(...args: A) {\n const key = this.make_key(...args);\n\n if (!(key in this.cached_values)) {\n this.cached_values[key] = this.compute_value(...args);\n }\n\n return this.cached_values[key];\n }\n}\n\n\nfunction normalizeOptions<Type extends Record<string, any>>(opts: Type | undefined, defaults: Required<Type>) {\n const ret = {...defaults} as Required<Type>;\n\n if (opts !== undefined) {\n Object.entries(opts).forEach(([k, v]: [keyof Type, any]) => {\n ret[k] = v;\n });\n }\n\n return ret;\n}\n\nexport {hex2rgba, rgba2hex, hex2rgb, rgb2hex, rgb2hsv, hsv2rgb, zip, getMinZoom, getOS, Cache, normalizeOptions};\n","/**\r\n * Copyright 2019 Google Inc. All Rights Reserved.\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\nconst proxyMarker = Symbol(\"Comlink.proxy\");\r\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\r\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\r\nconst throwMarker = Symbol(\"Comlink.thrown\");\r\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\r\n/**\r\n * Internal transfer handle to handle objects marked to proxy.\r\n */\r\nconst proxyTransferHandler = {\r\n canHandle: (val) => isObject(val) && val[proxyMarker],\r\n serialize(obj) {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port1);\r\n return [port2, [port2]];\r\n },\r\n deserialize(port) {\r\n port.start();\r\n return wrap(port);\r\n },\r\n};\r\n/**\r\n * Internal transfer handler to handle thrown exceptions.\r\n */\r\nconst throwTransferHandler = {\r\n canHandle: (value) => isObject(value) && throwMarker in value,\r\n serialize({ value }) {\r\n let serialized;\r\n if (value instanceof Error) {\r\n serialized = {\r\n isError: true,\r\n value: {\r\n message: value.message,\r\n name: value.name,\r\n stack: value.stack,\r\n },\r\n };\r\n }\r\n else {\r\n serialized = { isError: false, value };\r\n }\r\n return [serialized, []];\r\n },\r\n deserialize(serialized) {\r\n if (serialized.isError) {\r\n throw Object.assign(new Error(serialized.value.message), serialized.value);\r\n }\r\n throw serialized.value;\r\n },\r\n};\r\n/**\r\n * Allows customizing the serialization of certain values.\r\n */\r\nconst transferHandlers = new Map([\r\n [\"proxy\", proxyTransferHandler],\r\n [\"throw\", throwTransferHandler],\r\n]);\r\nfunction expose(obj, ep = self) {\r\n ep.addEventListener(\"message\", function callback(ev) {\r\n if (!ev || !ev.data) {\r\n return;\r\n }\r\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\r\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\r\n let returnValue;\r\n try {\r\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\r\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\r\n switch (type) {\r\n case \"GET\" /* GET */:\r\n {\r\n returnValue = rawValue;\r\n }\r\n break;\r\n case \"SET\" /* SET */:\r\n {\r\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\r\n returnValue = true;\r\n }\r\n break;\r\n case \"APPLY\" /* APPLY */:\r\n {\r\n returnValue = rawValue.apply(parent, argumentList);\r\n }\r\n break;\r\n case \"CONSTRUCT\" /* CONSTRUCT */:\r\n {\r\n const value = new rawValue(...argumentList);\r\n returnValue = proxy(value);\r\n }\r\n break;\r\n case \"ENDPOINT\" /* ENDPOINT */:\r\n {\r\n const { port1, port2 } = new MessageChannel();\r\n expose(obj, port2);\r\n returnValue = transfer(port1, [port1]);\r\n }\r\n break;\r\n case \"RELEASE\" /* RELEASE */:\r\n {\r\n returnValue = undefined;\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n catch (value) {\r\n returnValue = { value, [throwMarker]: 0 };\r\n }\r\n Promise.resolve(returnValue)\r\n .catch((value) => {\r\n return { value, [throwMarker]: 0 };\r\n })\r\n .then((returnValue) => {\r\n const [wireValue, transferables] = toWireValue(returnValue);\r\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\r\n if (type === \"RELEASE\" /* RELEASE */) {\r\n // detach and deactive after sending release response above.\r\n ep.removeEventListener(\"message\", callback);\r\n closeEndPoint(ep);\r\n }\r\n });\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n}\r\nfunction isMessagePort(endpoint) {\r\n return endpoint.constructor.name === \"MessagePort\";\r\n}\r\nfunction closeEndPoint(endpoint) {\r\n if (isMessagePort(endpoint))\r\n endpoint.close();\r\n}\r\nfunction wrap(ep, target) {\r\n return createProxy(ep, [], target);\r\n}\r\nfunction throwIfProxyReleased(isReleased) {\r\n if (isReleased) {\r\n throw new Error(\"Proxy has been released and is not useable\");\r\n }\r\n}\r\nfunction createProxy(ep, path = [], target = function () { }) {\r\n let isProxyReleased = false;\r\n const proxy = new Proxy(target, {\r\n get(_target, prop) {\r\n throwIfProxyReleased(isProxyReleased);\r\n if (prop === releaseProxy) {\r\n return () => {\r\n return requestResponseMessage(ep, {\r\n type: \"RELEASE\" /* RELEASE */,\r\n path: path.map((p) => p.toString()),\r\n }).then(() => {\r\n closeEndPoint(ep);\r\n isProxyReleased = true;\r\n });\r\n };\r\n }\r\n if (prop === \"then\") {\r\n if (path.length === 0) {\r\n return { then: () => proxy };\r\n }\r\n const r = requestResponseMessage(ep, {\r\n type: \"GET\" /* GET */,\r\n path: path.map((p) => p.toString()),\r\n }).then(fromWireValue);\r\n return r.then.bind(r);\r\n }\r\n return createProxy(ep, [...path, prop]);\r\n },\r\n set(_target, prop, rawValue) {\r\n throwIfProxyReleased(isProxyReleased);\r\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\r\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\r\n const [value, transferables] = toWireValue(rawValue);\r\n return requestResponseMessage(ep, {\r\n type: \"SET\" /* SET */,\r\n path: [...path, prop].map((p) => p.toString()),\r\n value,\r\n }, transferables).then(fromWireValue);\r\n },\r\n apply(_target, _thisArg, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const last = path[path.length - 1];\r\n if (last === createEndpoint) {\r\n return requestResponseMessage(ep, {\r\n type: \"ENDPOINT\" /* ENDPOINT */,\r\n }).then(fromWireValue);\r\n }\r\n // We just pretend that `bind()` didn’t happen.\r\n if (last === \"bind\") {\r\n return createProxy(ep, path.slice(0, -1));\r\n }\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, {\r\n type: \"APPLY\" /* APPLY */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n construct(_target, rawArgumentList) {\r\n throwIfProxyReleased(isProxyReleased);\r\n const [argumentList, transferables] = processArguments(rawArgumentList);\r\n return requestResponseMessage(ep, {\r\n type: \"CONSTRUCT\" /* CONSTRUCT */,\r\n path: path.map((p) => p.toString()),\r\n argumentList,\r\n }, transferables).then(fromWireValue);\r\n },\r\n });\r\n return proxy;\r\n}\r\nfunction myFlat(arr) {\r\n return Array.prototype.concat.apply([], arr);\r\n}\r\nfunction processArguments(argumentList) {\r\n const processed = argumentList.map(toWireValue);\r\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\r\n}\r\nconst transferCache = new WeakMap();\r\nfunction transfer(obj, transfers) {\r\n transferCache.set(obj, transfers);\r\n return obj;\r\n}\r\nfunction proxy(obj) {\r\n return Object.assign(obj, { [proxyMarker]: true });\r\n}\r\nfunction windowEndpoint(w, context = self, targetOrigin = \"*\") {\r\n return {\r\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\r\n addEventListener: context.addEventListener.bind(context),\r\n removeEventListener: context.removeEventListener.bind(context),\r\n };\r\n}\r\nfunction toWireValue(value) {\r\n for (const [name, handler] of transferHandlers) {\r\n if (handler.canHandle(value)) {\r\n const [serializedValue, transferables] = handler.serialize(value);\r\n return [\r\n {\r\n type: \"HANDLER\" /* HANDLER */,\r\n name,\r\n value: serializedValue,\r\n },\r\n transferables,\r\n ];\r\n }\r\n }\r\n return [\r\n {\r\n type: \"RAW\" /* RAW */,\r\n value,\r\n },\r\n transferCache.get(value) || [],\r\n ];\r\n}\r\nfunction fromWireValue(value) {\r\n switch (value.type) {\r\n case \"HANDLER\" /* HANDLER */:\r\n return transferHandlers.get(value.name).deserialize(value.value);\r\n case \"RAW\" /* RAW */:\r\n return value.value;\r\n }\r\n}\r\nfunction requestResponseMessage(ep, msg, transfers) {\r\n return new Promise((resolve) => {\r\n const id = generateUUID();\r\n ep.addEventListener(\"message\", function l(ev) {\r\n if (!ev.data || !ev.data.id || ev.data.id !== id) {\r\n return;\r\n }\r\n ep.removeEventListener(\"message\", l);\r\n resolve(ev.data);\r\n });\r\n if (ep.start) {\r\n ep.start();\r\n }\r\n ep.postMessage(Object.assign({ id }, msg), transfers);\r\n });\r\n}\r\nfunction generateUUID() {\r\n return new Array(4)\r\n .fill(0)\r\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\r\n .join(\"-\");\r\n}\n\nexport { createEndpoint, expose, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","\n\n// Stub in required method and property types for the mapping library. God help me if these start to diverge between Mapbox and MapLibre.\ntype StyleSpecification = {\n glyphs?: string;\n}\n\ntype MapLikeType = {\n triggerRepaint: () => void;\n getCanvas: () => HTMLCanvasElement;\n getStyle: () => StyleSpecification;\n\n getZoom: () => number;\n getMaxZoom: () => number;\n getBearing: () => number;\n getPitch: () => number;\n};\n\ninterface LambertConformalConicParameters {\n lon_0: number,\n lat_0: number,\n lat_std: [number, number] | number;\n}\n\nfunction lambertConformalConic(params: LambertConformalConicParameters) {\n // Formulas from https://pubs.usgs.gov/pp/1395/report.pdf\n\n const compute_t = (lat: number) => {\n const sin_lat = Math.sin(lat);\n return Math.tan(Math.PI / 4 - lat / 2) * Math.pow((1 + eccen * sin_lat) / (1 - eccen * sin_lat), eccen / 2);\n };\n const compute_m = (lat: number) => {\n const sin_lat = Math.sin(lat);\n return Math.cos(lat) / Math.sqrt(1 - eccen * eccen * sin_lat * sin_lat);\n }\n\n // WGS 84 spheroid\n const semimajor = 6378137.0;\n const semiminor = 6356752.314245;\n const eccen = Math.sqrt(1 - (semiminor * semiminor) / (semimajor * semimajor));\n const radians = Math.PI / 180;\n\n let {lon_0, lat_0, lat_std} = params;\n lat_std = Array.isArray(lat_std) && lat_std[0] == lat_std[1] ? lat_std[0] : lat_std;\n\n lon_0 *= radians;\n lat_0 *= radians;\n\n let F: number, n: number;\n const t_0 = compute_t(lat_0);\n\n if (Array.isArray(lat_std)) {\n let [lat_1, lat_2] = lat_std;\n lat_1 *= radians;\n lat_2 *= radians;\n\n const t_1 = compute_t(lat_1);\n const t_2 = compute_t(lat_2);\n const m_1 = compute_m(lat_1);\n const m_2 = compute_m(lat_2);\n\n n = Math.log(m_1 / m_2) / Math.log(t_1 / t_2);\n F = m_1 / (n * Math.pow(t_1, n));\n }\n else {\n let lat_1 = lat_std;\n lat_1 *= radians;\n\n const t_1 = compute_t(lat_1);\n const m_1 = compute_m(lat_1);\n n = Math.sin(lat_1);\n F = m_1 / (n * Math.pow(t_1, n));\n }\n\n const rho_0 = semimajor * F * Math.pow(t_0, n);\n\n const compute_lcc = (lon: number, lat: number) : [number, number] => {\n lon *= radians;\n lat *= radians;\n\n const t = compute_t(lat);\n const rho = semimajor * F * Math.pow(t, n);\n const theta = n * (lon - lon_0);\n const x = rho * Math.sin(theta);\n const y = rho_0 - rho * Math.cos(theta);\n\n return [x, y];\n }\n\n const eccen2 = eccen * eccen;\n const eccen4 = eccen2 * eccen2;\n const eccen6 = eccen4 * eccen2;\n const eccen8 = eccen6 * eccen2;\n\n/*\n const A = eccen2 / 2 + 5 * eccen4 / 24 + eccen6 / 12 + 13 * eccen8 / 360;\n const B = 7 * eccen4 / 48 + 29 * eccen6 / 240 + 811 * eccen8 / 11520;\n const C = 7 * eccen6 / 120 + 81 * eccen8 / 1120;\n const D = 4279 * eccen8 / 161280;\n const Ap = A - C;\n const Bp = 2 * B - 4 * D;\n const Cp = 4 * C;\n const Dp = 8 * D;\n*/\n\n const Ap = eccen2 / 2 + 5 * eccen4 / 24 + 3 * eccen6 / 120 - 73 * eccen8 / 2016;\n const Bp = 7 * eccen4 / 24 + 29 * eccen6 / 120 + 233 * eccen8 / 6720;\n const Cp = 7 * eccen6 / 30 + 81 * eccen8 / 280;\n const Dp = 4729 * eccen8 / 20160;\n\n const compute_lcc_inverse = (x: number, y: number) : [number, number] => {\n const theta = Math.atan2(x, rho_0 - y); // These arguments are backwards from what I'd expect ...\n const lon = theta / n + lon_0;\n const rho = Math.hypot(x, rho_0 - y) * Math.sign(n);\n const t = Math.pow(rho / (semimajor * F), 1 / n);\n\n const chi = Math.PI / 2 - 2 * Math.atan(t);\n const sin_2chi = Math.sin(2 * chi);\n const cos_2chi = Math.cos(2 * chi);\n\n const lat = chi + sin_2chi * (Ap + cos_2chi * (Bp + cos_2chi * (Cp + Dp * cos_2chi)));\n\n return [lon / radians, lat / radians];\n }\n\n return (a: number, b: number, opts?: {inverse: boolean}) : [number, number] => {\n opts = opts === undefined ? {inverse: false} : opts;\n return opts.inverse ? compute_lcc_inverse(a, b) : compute_lcc(a, b);\n }\n}\n\ninterface RotateSphereParams {\n np_lon: number,\n np_lat: number,\n lon_shift: number,\n}\n\nfunction rotateSphere(params: RotateSphereParams) {\n const radians = Math.PI / 180;\n const np_lat = params.np_lat * radians;\n const np_lon = params.np_lon * radians;\n const lon_shift = params.lon_shift * radians;\n\n const sin_np_lat = Math.sin(np_lat);\n const cos_np_lat = Math.cos(np_lat);\n\n const compute_rotation = (lon: number, lat: number) : [number, number] => {\n lon *= radians;\n lat *= radians;\n\n const sin_lat = Math.sin(lat);\n const cos_lat = Math.cos(lat);\n const sin_lon_diff = Math.sin(lon - lon_shift);\n const cos_lon_diff = Math.cos(lon - lon_shift);\n\n const lat_p = Math.asin(sin_np_lat * sin_lat - cos_np_lat * cos_lat * cos_lon_diff);\n let lon_p = np_lon + Math.atan2((cos_lat * sin_lon_diff), (sin_np_lat * cos_lat * cos_lon_diff + cos_np_lat * sin_lat));\n\n if (lon_p > Math.PI) lon_p -= 2 * Math.PI;\n\n return [lon_p / radians, lat_p / radians];\n }\n\n const compute_rotation_inverse = (lon_p: number, lat_p: number) : [number, number] => {\n lon_p *= radians;\n lat_p *= radians;\n\n const sin_lat_p = Math.sin(lat_p);\n const cos_lat_p = Math.cos(lat_p);\n const sin_lon_p_diff = Math.sin(lon_p - np_lon);\n const cos_lon_p_diff = Math.cos(lon_p - np_lon);\n\n const lat = Math.asin(sin_np_lat * sin_lat_p + cos_np_lat * cos_lat_p * cos_lon_p_diff);\n let lon = lon_shift + Math.atan2((cos_lat_p * sin_lon_p_diff), (sin_np_lat * cos_lat_p * cos_lon_p_diff - cos_np_lat * sin_lat_p));\n\n if (lon_p > Math.PI) lon_p -= 2 * Math.PI;\n\n return [lon / radians, lat / radians];\n }\n\n return (a: number, b: number, opts?: {inverse: boolean}) => {\n opts = opts === undefined ? {inverse: false} : opts;\n return opts.inverse ? compute_rotation_inverse(a, b) : compute_rotation(a, b);\n }\n}\n\nfunction mercatorXfromLng(lng: number) {\n return (180 + lng) / 360;\n}\n\nfunction lngFromMercatorX(x: number) {\n return 360 * x - 180;\n}\n\nfunction mercatorYfromLat(lat: number) {\n const sin_lat = Math.sin(lat * Math.PI / 180);\n const y = (180 - (90 / Math.PI * Math.log((1 + sin_lat) / (1 - sin_lat)))) / 360;\n return Math.min(2, Math.max(-2, y));\n}\n\nfunction latFromMercatorY(y: number) {\n return Math.atan(Math.sinh((180 - y * 360) * Math.PI / 180)) * 180 / Math.PI;\n}\n\n/**\n * A `LngLat` object represents a given longitude and latitude coordinate, measured in degrees.\n * These coordinates are based on the [WGS84 (EPSG:4326) standard](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84).\n *\n * MapLibre GL uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match the\n * [GeoJSON specification](https://tools.ietf.org/html/rfc7946).\n *\n * @param {number} lng Longitude, measured in degrees.\n * @param {number} lat Latitude, measured in degrees.\n * @example\n * var ll = new LngLat(-123.9749, 40.7736);\n * ll.lng; // = -123.9749\n */\n class LngLat {\n public lng: number;\n public lat: number;\n\n constructor(lng: number, lat: number) {\n if (isNaN(lng) || isNaN(lat)) {\n throw new Error(`Invalid LngLat object: (${lng}, ${lat})`);\n }\n this.lng = +lng;\n this.lat = +lat;\n if (this.lat > 90 || this.lat < -90) {\n throw new Error('Invalid LngLat latitude value: must be between -90 and 90');\n }\n }\n\n public toMercatorCoord() {\n return {x: mercatorXfromLng(this.lng), y: mercatorYfromLat(this.lat)};\n }\n\n public static fromMercatorCoord(x: number, y: number) {\n return new LngLat(lngFromMercatorX(x), latFromMercatorY(y));\n }\n}\n\nexport {LngLat, lambertConformalConic, rotateSphere};\nexport type {MapLikeType};","\nimport { getMinZoom } from \"./utils\";\nimport { LineData, Polyline } from \"./AutumnTypes\";\n\nimport * as Comlink from 'comlink';\nimport { LngLat } from \"./Map\";\n\nfunction makeBBElements(field_lats: Float32Array, field_lons: Float32Array, field_ni: number, field_nj: number,\n thin_fac_base: number, max_zoom: number) {\n \n const n_pts_per_poly = 6;\n const n_coords_per_pt_pts = 3;\n const n_coords_per_pt_tc = 2;\n\n const n_density_tiers = Math.log2(thin_fac_base);\n const n_inaccessible_tiers = Math.max(n_density_tiers + 1 - max_zoom, 0);\n const trim_inaccessible = Math.pow(2, n_inaccessible_tiers);\n\n const field_ni_access = Math.floor((field_ni - 1) / trim_inaccessible) + 1;\n const field_nj_access = Math.floor((field_nj - 1) / trim_inaccessible) + 1;\n\n const n_elems_pts = field_ni_access * field_nj_access * n_pts_per_poly * n_coords_per_pt_pts;\n const n_elems_tc = field_ni_access * field_nj_access * n_pts_per_poly * n_coords_per_pt_tc;\n\n let pts = new Float32Array(n_elems_pts);\n let tex_coords = new Float32Array(n_elems_tc);\n\n let istart_pts = 0;\n let istart_tc = 0;\n\n for (let ilat = 0; ilat < field_nj; ilat++) {\n for (let ilon = 0; ilon < field_ni; ilon++) {\n const idx = ilat * field_ni + ilon;\n const lat = field_lats[idx];\n const lon = field_lons[idx];\n\n const zoom = getMinZoom(ilat, ilon, thin_fac_base);\n\n if (zoom > max_zoom) continue;\n\n const pt_ll = new LngLat(lon, lat).toMercatorCoord();\n\n // These contain a degenerate triangle on either end to imitate primitive restarting\n // (see https://groups.google.com/g/webgl-dev-list/c/KLfiwj4jax0/m/cKiezrhRz8MJ?pli=1)\n for (let icrnr = 0; icrnr < n_pts_per_poly; icrnr++) {\n const actual_icrnr = Math.max(0, Math.min(icrnr - 1, 3));\n\n pts[istart_pts + icrnr * n_coords_per_pt_pts + 0] = pt_ll.x; \n pts[istart_pts + icrnr * n_coords_per_pt_pts + 1] = pt_ll.y; \n pts[istart_pts + icrnr * n_coords_per_pt_pts + 2] = zoom * 4 + actual_icrnr;\n\n tex_coords[istart_tc + icrnr * n_coords_per_pt_tc + 0] = ilon / (field_ni - 1);\n tex_coords[istart_tc + icrnr * n_coords_per_pt_tc + 1] = ilat / (field_nj - 1);\n }\n\n istart_pts += (n_pts_per_poly * n_coords_per_pt_pts);\n istart_tc += (n_pts_per_poly * n_coords_per_pt_tc);\n }\n }\n\n return {'pts': pts, 'tex_coords': tex_coords};\n}\n\nfunction makeDomainVerticesAndTexCoords(field_lats: Float32Array, field_lons: Float32Array, field_ni: number, field_nj: number, texcoord_margin_r: number, texcoord_margin_s: number) {\n const verts = new Float32Array(2 * 2 * (field_ni - 1) * (field_nj + 1)).fill(0);\n const tex_coords = new Float32Array(2 * 2 * (field_ni - 1) * (field_nj + 1)).fill(0);\n const grid_cell_size = new Float32Array(1 * 2 * (field_ni - 1) * (field_nj + 1)).fill(0);\n\n let ivert = 0\n let itexcoord = 0;\n\n for (let i = 0; i < field_ni - 1; i++) {\n for (let j = 0; j < field_nj; j++) {\n const idx = i + j * field_ni;\n\n const pt = new LngLat(field_lons[idx], field_lats[idx]).toMercatorCoord();\n const pt_ip1 = new LngLat(field_lons[idx + 1], field_lats[idx + 1]).toMercatorCoord();\n\n const r = i / (field_ni - 1) * (1 - 2 * texcoord_margin_r) + texcoord_margin_r;\n const rp1 = (i + 1) / (field_ni - 1) * (1 - 2 * texcoord_margin_r) + texcoord_margin_r;\n const s = j / (field_nj - 1) * (1 - 2 * texcoord_margin_s) + texcoord_margin_s;\n\n if (j == 0) {\n verts[ivert] = pt.x; verts[ivert + 1] = pt.y;\n ivert += 2\n\n tex_coords[itexcoord] = r; tex_coords[itexcoord + 1] = s;\n itexcoord += 2;\n }\n\n verts[ivert ] = pt.x; verts[ivert + 1] = pt.y;\n verts[ivert + 2] = pt_ip1.x; verts[ivert + 3] = pt_ip1.y;\n ivert += 4;\n\n tex_coords[itexcoord ] = r; tex_coords[itexcoord + 1] = s;\n tex_coords[itexcoord + 2] = rp1; tex_coords[itexcoord + 3] = s;\n itexcoord += 4;\n\n if (j == field_nj - 1) {\n verts[ivert] = pt_ip1.x; verts[ivert + 1] = pt_ip1.y;\n ivert += 2;\n\n tex_coords[itexcoord] = rp1; tex_coords[itexcoord + 1] = s;\n itexcoord += 2;\n }\n }\n }\n\n let igcs = 0;\n for (let i = 0; i < field_ni - 1; i++) {\n for (let j = 0; j < field_nj - 1; j++) {\n const ivert = j == 0 ? 2 * (igcs + 1) : 2 * igcs;\n const x_ll = verts[ivert], y_ll = verts[ivert + 1],\n x_lr = verts[ivert + 2], y_lr = verts[ivert + 3],\n x_ul = verts[ivert + 4], y_ul = verts[ivert + 5],\n x_ur = verts[ivert + 6], y_ur = verts[ivert + 7];\n\n const area = 0.5 * Math.abs(x_ll * (y_lr - y_ul) + x_lr * (y_ul - y_ll) + x_ul * (y_ll - y_lr) + \n x_ur * (y_ul - y_lr) + x_ul * (y_lr - y_ur) + x_lr * (y_ur - y_ul));\n\n if (j == 0) {\n grid_cell_size[igcs] = area;\n igcs += 1;\n }\n\n grid_cell_size[igcs] = area; grid_cell_size[igcs + 1] = area;\n igcs += 2;\n\n if (j == field_nj - 2) {\n grid_cell_size[igcs] = area; grid_cell_size[igcs + 1] = area; \n grid_cell_size[igcs + 2] = area;\n igcs += 3;\n }\n }\n }\n\n return {'vertices': verts, 'tex_coords': tex_coords, 'grid_cell_size': grid_cell_size};\n}\n\n/*\nfunction makePolylinesMiter(lines) {\n const n_points_per_vert = Object.fromEntries(Object.entries(lines[0]).map(([k, v]) => {\n let n_verts;\n if (v.length === undefined) {\n n_verts = 1;\n }\n else {\n n_verts = k == 'verts' ? v[0].length : v.length;\n }\n return [k, n_verts];\n }));\n n_points_per_vert['extrusion'] = 2;\n\n const n_verts = lines.map(l => l['verts'].length).reduce((a, b) => a + b);\n const ary_lens = Object.fromEntries(Object.entries(n_points_per_vert).map(([k, nppv]) => [k, (n_verts * 2 + lines.length * 2) * nppv]));\n\n let ret = Object.fromEntries(Object.entries(ary_lens).map(([k, v]) => [k, new Float32Array(v)]));\n\n let ilns = Object.fromEntries(Object.keys(ary_lens).map(k => [k, 0]));\n\n const is_cw_winding = (pt_prev, pt_this, pt_next) => {\n const winding = (pt_this[0] - pt_prev[0]) * (pt_this[1] + pt_prev[1]) \n + (pt_next[0] - pt_this[0]) * (pt_next[1] + pt_this[1]) \n + (pt_prev[0] - pt_next[0]) * (pt_prev[1] + pt_next[1]);\n\n return winding > 0;\n }\n\n const calculate_extrusion = (pt_prev, pt_this, pt_next) => {\n let line_vec_x_prev, line_vec_y_prev, line_vec_mag_prev, \n line_vec_x_next, line_vec_y_next, line_vec_mag_next;\n let ext_x, ext_y;\n\n if (pt_prev !== null) {\n line_vec_x_prev = pt_this[0] - pt_prev[0];\n line_vec_y_prev = pt_this[1] - pt_prev[1];\n line_vec_mag_prev = Math.hypot(line_vec_x_prev, line_vec_y_prev);\n line_vec_x_prev /= line_vec_mag_prev;\n line_vec_y_prev /= line_vec_mag_prev;\n }\n\n if (pt_next !== null) {\n line_vec_x_next = pt_next[0] - pt_this[0];\n line_vec_y_next = pt_next[1] - pt_this[1];\n line_vec_mag_next = Math.hypot(line_vec_x_next, line_vec_y_next);\n line_vec_x_next /= line_vec_mag_next;\n line_vec_y_next /= line_vec_mag_next;\n }\n\n if (pt_prev === null) {\n // First point in the line gets just the normal for the first segment\n ext_x = line_vec_y_next; ext_y = -line_vec_x_next;\n }\n else if (pt_this === null) {\n // Last point in the line gets just the normal for the last segment\n ext_x = line_vec_y_prev; ext_y = -line_vec_x_prev;\n }\n else {\n // Miter join: compute the extrusion vector halfway between the next and previous normal\n const dot = line_vec_x_prev * line_vec_x_next + line_vec_y_prev * line_vec_y_next;\n const ext_fac = Math.sqrt((1 - dot) / (1 + dot));\n const sign = is_cw_winding(pt_prev, pt_this, pt_this) ? -1 : 1;\n ext_x = line_vec_y_prev + sign * line_vec_x_prev * ext_fac;\n ext_y = sign * line_vec_y_prev * ext_fac - line_vec_x_prev;\n }\n\n return [ext_x, ext_y];\n }\n\n lines.forEach(line => {\n const verts = line['verts'];\n let ext_x, ext_y;\n\n let ivt = 0;\n ret['verts'][ilns['verts']] = verts[ivt][0]; ret['verts'][ilns['verts'] + 1] = verts[ivt][1];\n\n [ext_x, ext_y] = calculate_extrusion(null, verts[ivt], verts[ivt + 1]);\n ret['extrusion'][ilns['extrusion']] = ext_x; ret['extrusion'][ilns['extrusion'] + 1] = ext_y;\n\n for (ivt = 0; ivt < verts.length; ivt++) {\n const ary_ivt = ilns['verts'] + 2 * (2 * ivt + 1);\n ret['verts'][ary_ivt + 0] = verts[ivt][0]; ret['verts'][ary_ivt + 1] = verts[ivt][1];\n ret['verts'][ary_ivt + 2] = verts[ivt][0]; ret['verts'][ary_ivt + 3] = verts[ivt][1];\n\n if (ivt == 0) {\n [ext_x, ext_y] = calculate_extrusion(null, verts[ivt], verts[ivt + 1]);\n }\n else if (ivt == verts.length - 1) {\n [ext_x, ext_y] = calculate_extrusion(verts[ivt - 1], verts[ivt], null);\n }\n else {\n [ext_x, ext_y] = calculate_extrusion(verts[ivt - 1], verts[ivt], verts[ivt + 1]);\n }\n\n ret['extrusion'][ary_ivt + 0] = ext_x; ret['extrusion'][ary_ivt + 1] = ext_y;\n ret['extrusion'][ary_ivt + 2] = -ext_x; ret['extrusion'][ary_ivt + 3] = -ext_y;\n }\n\n ivt = verts.length - 1;\n ret['verts'][ilns['verts'] + 2 * (2 * ivt + 1) + 4] = verts[ivt][0]; \n ret['verts'][ilns['verts'] + 2 * (2 * ivt + 1) + 5] = verts[ivt][1];\n \n [ext_x, ext_y] = calculate_extrusion(verts[ivt - 1], verts[ivt], null);\n\n ret['extrusion'][ilns['extrusion'] + 2 * (2 * ivt + 1) + 4] = -ext_x; \n ret['extrusion'][ilns['extrusion'] + 2 * (2 * ivt + 1) + 5] = -ext_y;\n\n for (let key in ret) {\n if (key == 'verts' || key == 'extrusion') continue;\n\n for (ivt = 0; ivt < (verts.length * 2 + 2) * n_points_per_vert[key]; ivt += n_points_per_vert[key]) {\n if (line[key].length !== undefined) {\n line[key].forEach((cd, icd) => {\n ret[key][ilns[key] + ivt + icd] = cd;\n })\n }\n else {\n ret[key][ilns[key] + ivt] = line[key];\n }\n }\n }\n\n Object.keys(ilns).forEach(k => {\n ilns[k] += (verts.length * 2 + 2) * n_points_per_vert[k];\n })\n })\n\n return ret;\n}\n*/\n\nfunction makePolylines(lines: LineData[]) : Polyline {\n if (lines.length == 0) {\n return {vertices: new Float32Array([]), extrusion: new Float32Array([])};\n }\n\n const n_points_per_vert = Object.fromEntries(Object.entries(lines[0]).map(([k, v]) => {\n let n_verts: number;\n if (typeof v === 'number') {\n n_verts = 1;\n }\n else if (typeof v[0] === 'number') {\n n_verts = 1;\n }\n else {\n n_verts = v[0].length;\n }\n return [k, n_verts];\n }));\n n_points_per_vert['extrusion'] = 2;\n n_points_per_vert['vertices'] += 1;\n\n const n_verts = lines.map(l => l.vertices.length).reduce((a, b) => a + b);\n const n_out_verts = n_verts * 4 - lines.length * 2;\n const ary_lens = Object.fromEntries(Object.entries(n_points_per_vert).map(([k, nppv]) => [k, n_out_verts * nppv]));\n\n let ret: Polyline = {\n vertices: new Float32Array(ary_lens['vertices']),\n extrusion: new Float32Array(ary_lens['extrusion']),\n }\n\n if ('offsets' in lines[0]) {\n ret.offsets = new Float32Array(ary_lens['offsets']);\n }\n\n if ('data' in lines[0]) {\n ret.data = new Float32Array(ary_lens['data']);\n }\n\n if ('zoom' in lines[0]) {\n ret.zoom = new Float32Array(ary_lens['zoom']);\n }\n\n let ilns = Object.fromEntries(Object.keys(ary_lens).map(k => [k, 0]));\n\n const compute_normal_vec = (pt1: [number, number], pt2: [number, number], flip_y_coord: boolean) => {\n const line_vec_x = pt2[0] - pt1[0];\n const line_vec_y = pt2[1] - pt1[1];\n const line_vec_mag = Math.hypot(line_vec_x, line_vec_y);\n\n const ext_x = line_vec_y / line_vec_mag;\n const ext_y = -line_vec_x / line_vec_mag;\n\n return [ext_x, flip_y_coord ? -ext_y : ext_y];\n }\n\n lines.forEach(line => {\n const verts = line.vertices.map(v => {\n const v_ll = new LngLat(...v).toMercatorCoord();\n return [v_ll.x, v_ll.y] as [number, number];\n });\n\n const has_offsets = line.offsets !== undefined;\n const extrusion_verts = has_offsets ? line.offsets : verts;\n\n let pt_prev: [number, number], pt_this = verts[0], pt_next = verts[1];\n let ept_prev: [number, number], ept_this = extrusion_verts[0], ept_next = extrusion_verts[1];\n let len_prev: number, len_this = 0;\n let [ext_x, ext_y] = compute_normal_vec(ept_this, ept_next, !has_offsets);\n\n ret.vertices[ilns.vertices++] = pt_this[0]; ret.vertices[ilns.vertices++] = pt_this[1]; ret.vertices[ilns.vertices++] = len_this;\n ret.extrusion[ilns.extrusion++] = ext_x; ret.extrusion[ilns.extrusion++] = ext_y;\n\n for (let ivt = 1; ivt < verts.length; ivt++) {\n pt_this = verts[ivt]; pt_prev = verts[ivt - 1];\n ept_this = extrusion_verts[ivt]; ept_prev = extrusion_verts[ivt - 1];\n\n [ext_x, ext_y] = compute_normal_vec(ept_prev, ept_this, !has_offsets);\n len_prev = len_this; len_this += Math.hypot(verts[ivt - 1][0] - verts[ivt][0], verts[ivt - 1][1] - verts[ivt][1]);\n\n ret.vertices[ilns.vertices++] = pt_prev[0]; ret.vertices[ilns.vertices++] = pt_prev[1]; ret.vertices[ilns.vertices++] = len_prev;\n ret.vertices[ilns.vertices++] = pt_prev[0]; ret.vertices[ilns.vertices++] = pt_prev[1]; ret.vertices[ilns.vertices++] = len_prev;\n\n ret.vertices[ilns.vertices++] = pt_this[0]; ret.vertices[ilns.vertices++] = pt_this[1]; ret.vertices[ilns.vertices++] = len_this;\n ret.vertices[ilns.vertices++] = pt_this[0]; ret.vertices[ilns.vertices++] = pt_this[1]; ret.vertices[ilns.vertices++] = len_this;\n\n ret.extrusion[ilns.extrusion++] = ext_x; ret.extrusion[ilns.extrusion++] = ext_y;\n ret.extrusion[ilns.extrusion++] = -ext_x; ret.extrusion[ilns.extrusion++] = -ext_y;\n\n ret.extrusion[ilns.extrusion++] = ext_x; ret.extrusion[ilns.extrusion++] = ext_y;\n ret.extrusion[ilns.extrusion++] = -ext_x; ret.extrusion[ilns.extrusion++] = -ext_y;\n }\n\n ret.vertices[ilns.vertices++] = pt_this[0]; ret.vertices[ilns.vertices++] = pt_this[1]; ret.vertices[ilns.vertices++] = len_this;\n ret.extrusion[ilns.extrusion++] = -ext_x; ret.extrusion[ilns.extrusion++] = -ext_y;\n\n if ('offsets' in ret) {\n const offsets = line.offsets;\n let off_prev: [number, number], off_this = offsets[0];\n\n ret.offsets[ilns.offsets++] = off_this[0]; ret.offsets[ilns.offsets++] = off_this[1];\n\n for (let ivt = 1; ivt < offsets.length; ivt++) {\n off_this = offsets[ivt]; off_prev = offsets[ivt - 1];\n\n ret.offsets[ilns.offsets++] = off_prev[0]; ret.offsets[ilns.offsets++] = off_prev[1];\n ret.offsets[ilns.offsets++] = off_prev[0]; ret.offsets[ilns.offsets++] = off_prev[1];\n ret.offsets[ilns.offsets++] = off_this[0]; ret.offsets[ilns.offsets++] = off_this[1];\n ret.offsets[ilns.offsets++] = off_this[0]; ret.offsets[ilns.offsets++] = off_this[1];\n }\n\n ret.offsets[ilns.offsets++] = off_this[0]; ret.offsets[ilns.offsets++] = off_this[1];\n }\n\n if ('data' in ret) {\n const data = line.data;\n let data_prev: number, data_this = data[0];\n\n ret.data[ilns.data++] = data_this;\n \n for (let ivt = 1; ivt < data.length; ivt++) {\n data_this = data[ivt]; data_prev = data[ivt - 1];\n\n ret.data[ilns.data++] = data_prev;\n ret.data[ilns.data++] = data_prev;\n ret.data[ilns.data++] = data_this;\n ret.data[ilns.data++] = data_this;\n }\n\n ret.data[ilns.data++] = data_this;\n }\n \n if ('zoom' in ret) {\n for (let ivt = 0; ivt < verts.length * 4 - 2; ivt++) {\n ret.zoom[ilns.zoom++] = line['zoom'];\n }\n }\n })\n\n return ret;\n}\n\nconst ep_interface = {\n 'makeBBElements': makeBBElements, \n 'makeDomainVerticesAndTexCoords': makeDomainVerticesAndTexCoords,\n 'makePolyLines': makePolylines\n}\n\ntype PlotLayerWorker = typeof ep_interface;\n\nComlink.expose(ep_interface);\n\nexport type {PlotLayerWorker}"],"names":["root","factory","exports","module","define","amd","this","getMinZoom","jlat","ilon","thin_fac_base","zoom","thin_fac","proxyMarker","Symbol","createEndpoint","releaseProxy","throwMarker","isObject","val","transferHandlers","Map","canHandle","serialize","obj","port1","port2","MessageChannel","expose","deserialize","port","start","createProxy","target","value","serialized","Error","isError","message","name","stack","Object","assign","ep","self","addEventListener","callback","ev","data","id","type","path","argumentList","map","fromWireValue","returnValue","parent","slice","reduce","prop","rawValue","apply","proxy","transfers","transferCache","set","transfer","undefined","Promise","resolve","catch","then","wireValue","transferables","toWireValue","postMessage","removeEventListener","closeEndPoint","endpoint","constructor","isMessagePort","close","throwIfProxyReleased","isReleased","isProxyReleased","Proxy","get","_target","requestResponseMessage","p","toString","length","r","bind","_thisArg","rawArgumentList","last","processArguments","construct","processed","v","arr","Array","prototype","concat","WeakMap","handler","serializedValue","msg","fill","Math","floor","random","Number","MAX_SAFE_INTEGER","join","l","lng","lat","isNaN","toMercatorCoord","x","y","sin_lat","sin","PI","log","min","max","fromMercatorCoord","LngLat","lngFromMercatorX","atan","sinh","latFromMercatorY","field_lats","field_lons","field_ni","field_nj","max_zoom","n_density_tiers","log2","n_inaccessible_tiers","trim_inaccessible","pow","field_ni_access","field_nj_access","n_elems_tc","pts","Float32Array","tex_coords","istart_pts","istart_tc","ilat","idx","lon","pt_ll","icrnr","actual_icrnr","texcoord_margin_r","texcoord_margin_s","verts","grid_cell_size","ivert","itexcoord","i","j","pt","pt_ip1","rp1","s","igcs","x_ll","y_ll","x_lr","y_lr","x_ul","y_ul","x_ur","y_ur","area","abs","lines","vertices","extrusion","n_points_per_vert","fromEntries","entries","k","n_out_verts","a","b","ary_lens","nppv","ret","offsets","ilns","keys","compute_normal_vec","pt1","pt2","flip_y_coord","line_vec_x","line_vec_y","line_vec_mag","hypot","ext_y","forEach","line","pt_prev","ept_prev","len_prev","v_ll","has_offsets","extrusion_verts","pt_this","ept_this","ept_next","len_this","ext_x","ivt","off_prev","off_this","data_prev","data_this"],"sourceRoot":""}
|