@deck.gl/aggregation-layers 8.9.0 → 8.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +9 -1
- package/dist.min.js +9 -1
- package/package.json +2 -2
package/dist/dist.dev.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if (typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
|
+
else if (typeof exports === 'object') exports['deck'] = factory();
|
|
6
|
+
else root['deck'] = factory();})(globalThis, function () {
|
|
1
7
|
"use strict";
|
|
2
|
-
var
|
|
8
|
+
var __exports__ = (() => {
|
|
3
9
|
var __create = Object.create;
|
|
4
10
|
var __defProp = Object.defineProperty;
|
|
5
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -6355,3 +6361,5 @@ void main() {
|
|
|
6355
6361
|
__publicField(HeatmapLayer, "defaultProps", defaultProps10);
|
|
6356
6362
|
return __toCommonJS(bundle_exports);
|
|
6357
6363
|
})();
|
|
6364
|
+
return __exports__;
|
|
6365
|
+
});
|
package/dist.min.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if (typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
|
+
else if (typeof exports === 'object') exports['deck'] = factory();
|
|
6
|
+
else root['deck'] = factory();})(globalThis, function () {
|
|
7
|
+
"use strict";var __exports__=(()=>{var Mo=Object.create;var ft=Object.defineProperty;var Eo=Object.getOwnPropertyDescriptor;var Ro=Object.getOwnPropertyNames;var No=Object.getPrototypeOf,Io=Object.prototype.hasOwnProperty;var F=(t,a)=>()=>(a||t((a={exports:{}}).exports,a),a.exports),Lo=(t,a)=>{for(var e in a)ft(t,e,{get:a[e],enumerable:!0})},lt=(t,a,e,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of Ro(a))!Io.call(t,r)&&r!==e&&ft(t,r,{get:()=>a[r],enumerable:!(n=Eo(a,r))||n.enumerable});return t},ie=(t,a,e)=>(lt(t,a,"default"),e&<(e,a,"default")),v=(t,a,e)=>(e=t!=null?Mo(No(t)):{},lt(a||!t||!t.__esModule?ft(e,"default",{value:t,enumerable:!0}):e,t)),Fo=t=>lt(ft({},"__esModule",{value:!0}),t);var Se=F((rl,Dr)=>{Dr.exports=globalThis.deck});var z=F((al,Er)=>{function Bo(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}Er.exports=Bo});var U=F((il,Nr)=>{function Rr(t,a){for(var e=0;e<a.length;e++){var n=a[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function zo(t,a,e){return a&&Rr(t.prototype,a),e&&Rr(t,e),t}Nr.exports=zo});var ae=F((ol,Ir)=>{function Uo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}Ir.exports=Uo});var j=F((sl,Yt)=>{function qt(t){return Yt.exports=qt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qt(t)}Yt.exports=qt});var Fr=F((ul,Lr)=>{var ko=j();function Go(t,a){for(;!Object.prototype.hasOwnProperty.call(t,a)&&(t=ko(t),t!==null););return t}Lr.exports=Go});var K=F((ll,ct)=>{var Wo=Fr();function gt(t,a,e){return typeof Reflect<"u"&&Reflect.get?ct.exports=gt=Reflect.get:ct.exports=gt=function(r,i,o){var s=Wo(r,i);if(s){var u=Object.getOwnPropertyDescriptor(s,i);return u.get?u.get.call(o):u.value}},gt(t,a,e||t)}ct.exports=gt});var Br=F((fl,Qt)=>{function Kt(t,a){return Qt.exports=Kt=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Kt(t,a)}Qt.exports=Kt});var H=F((gl,zr)=>{var jo=Br();function Vo(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&jo(t,a)}zr.exports=Vo});var Zt=F((cl,vt)=>{function pt(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vt.exports=pt=function(e){return typeof e}:vt.exports=pt=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pt(t)}vt.exports=pt});var $=F((pl,Ur)=>{var Ho=Zt(),$o=ae();function Xo(t,a){return a&&(Ho(a)==="object"||typeof a=="function")?a:$o(t)}Ur.exports=Xo});var L=F((vl,kr)=>{function qo(t,a,e){return a in t?Object.defineProperty(t,a,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[a]=e,t}kr.exports=qo});var B=F((ml,Gr)=>{Gr.exports=globalThis.deck});var Q=F((dl,Wr)=>{Wr.exports=globalThis.luma});var Vr=F((hl,jr)=>{function Yo(t){if(Array.isArray(t))return t}jr.exports=Yo});var $r=F((yl,Hr)=>{function Ko(t,a){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]"){var e=[],n=!0,r=!1,i=void 0;try{for(var o=t[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(e.push(s.value),!(a&&e.length===a));n=!0);}catch(u){r=!0,i=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(r)throw i}}return e}}Hr.exports=Ko});var qr=F((xl,Xr)=>{function Qo(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}Xr.exports=Qo});var Ye=F((Sl,Yr)=>{var Zo=Vr(),Jo=$r(),es=qr();function ts(t,a){return Zo(t)||Jo(t,a)||es()}Yr.exports=ts});var it={};Lo(it,{AGGREGATION_OPERATION:()=>E,CPUGridLayer:()=>ve,ContourLayer:()=>Bt,GPUGridLayer:()=>he,GridLayer:()=>jt,HeatmapLayer:()=>Xt,HexagonLayer:()=>Et,ScreenGridLayer:()=>Pt,_AggregationLayer:()=>Z,_BinSorter:()=>Me,_CPUAggregator:()=>Ie,_GPUGridAggregator:()=>G});var re={},Mr=v(Se());ie(re,v(Se()));if(!Mr.GeoJsonLayer)throw new Error("@deck.gl/layers is not found");ie(it,re);var ma=v(z()),da=v(U()),ha=v(ae()),Ct=v(K()),ya=v(H()),xa=v($()),Ne=v(j()),pe=v(L()),lr=v(B());var yt=v(L()),vn=v(z()),mn=v(U()),R=v(Q());function Jt(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=Math.fround(t),r=t-n;return a[e]=n,a[e+1]=r,a}function Kr(t){return t-Math.fround(t)}function Qr(t){for(var a=new Float32Array(32),e=0;e<4;++e)for(var n=0;n<4;++n){var r=e*4+n;Jt(t[n*4+e],a,r*2)}return a}var Zr=`uniform float ONE;
|
|
2
8
|
vec2 split(float a) {
|
|
3
9
|
const float SPLIT = 4097.0;
|
|
4
10
|
float t = a * SPLIT;
|
|
@@ -566,3 +572,5 @@ void main() {
|
|
|
566
572
|
gl_FragColor.g = outTexture.r / max(1.0, outTexture.a);
|
|
567
573
|
}
|
|
568
574
|
`;var Xe;function bo(t,a){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);a&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function qe(t){for(var a=1;a<arguments.length;a++){var e=arguments[a]!=null?arguments[a]:{};a%2?bo(Object(e),!0).forEach(function(n){(0,ee.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):bo(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Xu(t){var a=qu();return function(){var n=(0,ye.default)(t),r;if(a){var i=(0,ye.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,wo.default)(this,r)}}function qu(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Yu=2,Cr={mipmaps:!1,parameters:(Xe={},(0,ee.default)(Xe,10240,9729),(0,ee.default)(Xe,10241,9729),(0,ee.default)(Xe,10242,33071),(0,ee.default)(Xe,10243,33071),Xe),dataFormat:6408},Ao=[0,0],Ku={SUM:0,MEAN:1},Qu={getPosition:{type:"accessor",value:function(a){return a.position}},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:Y,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},Zu=[I.FEATURES.BLEND_EQUATION_MINMAX,I.FEATURES.TEXTURE_FLOAT],Ju=[I.FEATURES.COLOR_ATTACHMENT_RGBA32F,I.FEATURES.FLOAT_BLEND],el={data:{props:["radiusPixels"]}},Xt=function(t){(0,Po.default)(e,t);var a=Xu(e);function e(){var n;(0,Oo.default)(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=a.call.apply(a,[this].concat(i)),(0,ee.default)((0,Co.default)(n),"state",void 0),n}return(0,To.default)(e,[{key:"initializeState",value:function(){var r=this.context.gl;if(!(0,I.hasFeatures)(r,Zu)){this.setState({supported:!1}),ne.log.error("HeatmapLayer: ".concat(this.id," is not supported on this browser"))();return}(0,at.default)((0,ye.default)(e.prototype),"initializeAggregationLayer",this).call(this,el),this.setState({supported:!0,colorDomain:Ao}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}},{key:"shouldUpdateState",value:function(r){var i=r.changeFlags;return i.somethingChanged}},{key:"updateState",value:function(r){this.state.supported&&((0,at.default)((0,ye.default)(e.prototype),"updateState",this).call(this,r),this._updateHeatmapState(r))}},{key:"_updateHeatmapState",value:function(r){var i=r.props,o=r.oldProps,s=this._getChangeFlags(r);(s.dataChanged||s.viewportChanged)&&(s.boundsChanged=this._updateBounds(s.dataChanged),this._updateTextureRenderingBounds()),s.dataChanged||s.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):s.viewportZoomChanged&&this._debouncedUpdateWeightmap(),i.colorRange!==o.colorRange&&this._updateColorTexture(r),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:r.context.viewport.zoom})}},{key:"renderLayers",value:function(){if(!this.state.supported)return[];var r=this.state,i=r.weightsTexture,o=r.triPositionBuffer,s=r.triTexCoordBuffer,u=r.maxWeightsTexture,l=r.colorTexture,g=r.colorDomain,f=this.props,c=f.updateTriggers,d=f.intensity,h=f.threshold,m=f.aggregation,y=this.getSubLayerClass("triangle",Tr);return new y(this.getSubLayerProps({id:"triangle-layer",updateTriggers:c}),{coordinateSystem:ne.COORDINATE_SYSTEM.DEFAULT,data:{attributes:{positions:o,texCoords:s}},vertexCount:4,maxTexture:u,colorTexture:l,aggregationMode:Ku[m]||0,texture:i,intensity:d,threshold:h,colorDomain:g})}},{key:"finalizeState",value:function(r){(0,at.default)((0,ye.default)(e.prototype),"finalizeState",this).call(this,r);var i=this.state,o=i.weightsTransform,s=i.weightsTexture,u=i.maxWeightTransform,l=i.maxWeightsTexture,g=i.triPositionBuffer,f=i.triTexCoordBuffer,c=i.colorTexture,d=i.updateTimer;o?.delete(),s?.delete(),u?.delete(),l?.delete(),g?.delete(),f?.delete(),c?.delete(),d&&clearTimeout(d)}},{key:"_getAttributeManager",value:function(){return new ne.AttributeManager(this.context.gl,{id:this.props.id,stats:this.context.stats})}},{key:"_getChangeFlags",value:function(r){var i={},o=this.state.dimensions;i.dataChanged=this.isAttributeChanged()||this.isAggregationDirty(r,{compareAll:!0,dimension:o.data}),i.viewportChanged=r.changeFlags.viewportChanged;var s=this.state.zoom;return(!r.context.viewport||r.context.viewport.zoom!==s)&&(i.viewportZoomChanged=!0),i}},{key:"_createTextures",value:function(){var r=this.context.gl,i=this.state,o=i.textureSize,s=i.format,u=i.type;this.setState({weightsTexture:new I.Texture2D(r,qe({width:o,height:o,format:s,type:u},Cr)),maxWeightsTexture:new I.Texture2D(r,qe({format:s,type:u},Cr))})}},{key:"_setupAttributes",value:function(){var r=this.getAttributeManager();r.add({positions:{size:3,type:5130,accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}},{key:"_setupTextureParams",value:function(){var r=this.context.gl,i=this.props.weightsTextureSize,o=Math.min(i,(0,I.getParameters)(r,3379)),s=(0,I.hasFeatures)(r,Ju),u=lo({gl:r,floatTargetSupport:s}),l=u.format,g=u.type,f=s?1:1/255;this.setState({textureSize:o,format:l,type:g,weightsScale:f}),s||ne.log.warn("HeatmapLayer: ".concat(this.id," rendering to float texture not supported, fallingback to low precession format"))()}},{key:"getShaders",value:function(r){return(0,at.default)((0,ye.default)(e.prototype),"getShaders",this).call(this,r==="max-weights-transform"?{vs:So,_fs:_o}:{vs:yo,_fs:xo})}},{key:"_createWeightsTransform",value:function(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=this.context.gl,s=this.state.weightsTransform,u=this.state.weightsTexture;(r=s)===null||r===void 0||r.delete(),s=new I.Transform(o,qe({id:"".concat(this.id,"-weights-transform"),elementCount:1,_targetTexture:u,_targetTextureVarying:"weightsTexture"},i)),this.setState({weightsTransform:s})}},{key:"_setupResources",value:function(){var r=this.context.gl;this._createTextures();var i=this.state,o=i.textureSize,s=i.weightsTexture,u=i.maxWeightsTexture,l=this.getShaders("weights-transform");this._createWeightsTransform(l);var g=this.getShaders("max-weights-transform"),f=new I.Transform(r,qe(qe({id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:s},_targetTexture:u,_targetTextureVarying:"outTexture"},g),{},{elementCount:o*o}));this.setState({weightsTexture:s,maxWeightsTexture:u,maxWeightTransform:f,zoom:null,triPositionBuffer:new I.Buffer(r,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new I.Buffer(r,{byteLength:48,accessor:{size:2}})})}},{key:"updateShaders",value:function(r){this._createWeightsTransform(r)}},{key:"_updateMaxWeightValue",value:function(){var r=this.state.maxWeightTransform;r.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}},{key:"_updateBounds",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.context.viewport,o=[i.unproject([0,0]),i.unproject([i.width,0]),i.unproject([i.width,i.height]),i.unproject([0,i.height])].map(function(d){return d.map(Math.fround)}),s=io(o),u={visibleWorldBounds:s,viewportCorners:o},l=!1;if(r||!this.state.worldBounds||!oo(this.state.worldBounds,s)){var g=this._worldToCommonBounds(s),f=this._commonToWorldBounds(g);this.props.coordinateSystem===ne.COORDINATE_SYSTEM.LNGLAT&&(f[1]=Math.max(f[1],-85.051129),f[3]=Math.min(f[3],85.051129),f[0]=Math.max(f[0],-360),f[2]=Math.min(f[2],360));var c=this._worldToCommonBounds(f);u.worldBounds=f,u.normalizedCommonBounds=c,l=!0}return this.setState(u),l}},{key:"_updateTextureRenderingBounds",value:function(){var r=this.state,i=r.triPositionBuffer,o=r.triTexCoordBuffer,s=r.normalizedCommonBounds,u=r.viewportCorners,l=this.context.viewport;i.subData(br(u,3));var g=u.map(function(f){return uo(l.projectPosition(f),s)});o.subData(br(g,2))}},{key:"_updateColorTexture",value:function(r){var i=r.props.colorRange,o=this.state.colorTexture,s=se(i,!1,Uint8Array);o?o.setImageData({data:s,width:i.length}):o=new I.Texture2D(this.context.gl,qe({data:s,width:i.length,height:1},Cr)),this.setState({colorTexture:o})}},{key:"_updateWeightmap",value:function(){var r=this,i,o=this.props,s=o.radiusPixels,u=o.colorDomain,l=o.aggregation,g=this.state,f=g.weightsTransform,c=g.worldBounds,d=g.textureSize,h=g.weightsTexture,m=g.weightsScale;this.state.isWeightMapDirty=!1;var y=this._worldToCommonBounds(c,{useLayerCoordinateSystem:!0});if(u&&l==="SUM"){var O=this.context.viewport,C=O.distanceScales.metersPerUnit[2]*(y[2]-y[0])/d;this.state.colorDomain=u.map(function(P){return P*C*m})}else this.state.colorDomain=u||Ao;var b={radiusPixels:s,commonBounds:y,textureWidth:d,weightsScale:m};f.update({elementCount:this.getNumInstances()}),(0,I.withParameters)(this.context.gl,{clearColor:[0,0,0,0]},function(){f.run({uniforms:b,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0,attributes:r.getAttributes(),moduleSettings:r.getModuleSettings()})}),this._updateMaxWeightValue(),h.setParameters((i={},(0,ee.default)(i,10240,9729),(0,ee.default)(i,10241,9729),i))}},{key:"_debouncedUpdateWeightmap",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.state.updateTimer,o=this.props.debounceTimeout;r?(i=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(i),i=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),o)),this.setState({updateTimer:i})}},{key:"_worldToCommonBounds",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.useLayerCoordinateSystem,s=o===void 0?!1:o,u=(0,Pr.default)(r,4),l=u[0],g=u[1],f=u[2],c=u[3],d=this.context.viewport,h=this.state.textureSize,m=this.props.coordinateSystem,y=s&&(m===ne.COORDINATE_SYSTEM.LNGLAT_OFFSETS||m===ne.COORDINATE_SYSTEM.METER_OFFSETS),O=y?d.projectPosition(this.props.coordinateOrigin):[0,0],C=h*Yu/d.scale,b,P;return s&&!y?(b=this.projectPosition([l,g,0]),P=this.projectPosition([f,c,0])):(b=d.projectPosition([l,g,0]),P=d.projectPosition([f,c,0])),so([b[0]-O[0],b[1]-O[1],P[0]-O[0],P[1]-O[1]],C,C)}},{key:"_commonToWorldBounds",value:function(r){var i=(0,Pr.default)(r,4),o=i[0],s=i[1],u=i[2],l=i[3],g=this.context.viewport,f=g.unprojectPosition([o,s]),c=g.unprojectPosition([u,l]);return f.slice(0,2).concat(c.slice(0,2))}}]),e}(Z);(0,ee.default)(Xt,"layerName","HeatmapLayer");(0,ee.default)(Xt,"defaultProps",Qu);return Fo(it);})();
|
|
575
|
+
return __exports__;
|
|
576
|
+
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@deck.gl/aggregation-layers",
|
|
3
3
|
"description": "deck.gl layers that aggregate the input data into alternative representations",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "8.9.
|
|
5
|
+
"version": "8.9.2",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"@deck.gl/layers": "^8.0.0",
|
|
41
41
|
"@luma.gl/core": "^8.0.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "b43c2515c1fdac0a41fe653c98d6a315939ef0e1"
|
|
44
44
|
}
|