Comparing version 0.0.60 to 0.0.61
@@ -1,1 +0,1 @@ | ||
function a(b){b=this.options=f.deepMerge(a.options,b),this.initialize(b),b.child.id=b.child.id||b.id,b.child.text=b.child.text||b.text,b.child.lat=b.child.lat||b.lat,b.child.lng=b.child.lng||b.lng,b.child.range=b.child.range||b.range,b.child.value=b.child.value||b.value,b.child.css=b.child.css||b.css}var b=require('leaflet');require('./../core/utils');var c=require('bcore/event'),d=require('./scatter_marker'),e=b.dmap=b.dmap||{},f=e.Utils;a.options={lat:f.getLat,lng:f.getLng,filter:function(a,b){return!0},range:[0,1],id:function(a,b){return a.id||b},text:function(a){return a.text},value:function(a){return a.value||a.num||a[0]},zoom:{max:15,min:3},child:{size:function(a,b,c){return 15},shape:{normal:{}}}},a=c.extend(a,{initialize:function(a){this.cache={},this.isable=!0},addTo:function(a){if(!a)return;this._map=a,this.initEventsMap()},data:function(a){this._data=a},clean:function(){var a=this.cache,c,b;if(!a)return;for(var d in a)c=a[d],b=c.visual,b&&b.destroy&&(b.destroy(),delete c.visual)},updateData:function(a){this.processing(a),this.cleanOld()},updateFilter:function(a){if(typeof a!=='function')return;this.options.filter=a,this.updateMap()},cleanOld:function(){var c=this.versionID,b=this.cache,d,a,f;if(!(c&&b))return;for(var e in b)d=b[e],f=d.versionID,f!==c&&(a=d.visual,a&&(a.off&&a.off(),a.destroy&&a.destroy()),delete b[e])},processing:function(y){var t=this.versionID=Math.random(),j=this._map;if(!j)return;var b=this.options,w=b.child,a,i,u,v,e,c,n=this.isInZoom(),o=this._map.getZoom(),p=b.id,q=b.lat,r=b.lng,s=b.filter,g=b.groups,k,h,l=this.cache,m=this.isable;for(var f in y){if(a=y[f],b.processing&&b.processing(a),i=p(a,f),u=q(a),v=r(a),e=l[i],k=!0,k=s(a,o),h=!0,g){h=!1;for(var f in g){var x=g[f];if(x.filter(a)){h=!0;break}}}if(e?e.data=a:e=l[i]={data:a},e.versionID=t,n&&k&&h&&this.isInView(u,v)&&m){var c=e.visual;c?c.updateData(a):m&&(c=e.visual=new d(w),c.addTo(j),c.render(a),this.initEventsScatter(c))}}this.updateRange()},render:function(a){a&&this.data(a),a=this._data,this.updateData(a)},enable:function(){this.isable=!0},disable:function(){this.isable=!1},isInZoom:function(){var a=this.options.zoom;if(!a)return!0;var c=this._map,d=a.max,e=a.min,b=c.getZoom();return b>d||b<e?!1:!0},isInView:function(b,c,a){a=a||this._map.getBounds();var d=a._northEast.lng,e=a._northEast.lat,f=a._southWest.lng,g=a._southWest.lat;return b<e&&b>g&&c<d&&c>f},updateOptions:function(a){a=this.options=f.deepMerge(this.options,a),this.draw()},draw:function(){var f=this.options,g=this.cache,e,a,l,h,b,j=f.lng,k=f.lat,c,m,n=f.filter,o=this._map.getZoom(),p,q=this.isInZoom(),t=f.groups;if(!q)return this.clean();if(!g)return;if(!this.isable)return;var s=this.options.child,r=this._map;for(var i in g)e=g[i],b=e.data,l=k(b),h=j(b),p=this.isInView(l,h),c=!0,c=n(b,o),m=!0,c=c&&m,a=e.visual,p&&c?a?(a.updateData(b),a.updateZIndex()):(a=e.visual=new d(s),a.addTo(r),a.render(b),this.initEventsScatter(a)):a&&(a.off&&a.off(),a.destroy&&a.destroy(),delete e.visual)},updateMap:function(){this.draw()},updateRange:function(){var c=this.cache,d=this.ranges=this.ranges||{},e=this.options.value,a=d.value=[];for(var f in c){var g=c[f].data,b=e(g);a[0]||(a=[b,b]),b<a[0]&&(a[0]=b),b>a[1]&&(a[1]=b)}},initEventsMap:function(){this._map.on('moveend',this.updateMap.bind(this))},initEventsScatter:function(b){var a=this;b.on('click',function(b){a.emit('click-scatter',b)})},destroy:function(){this.clean()}}),e.ScatterMarkers=a,e.scatterMarkers=function(b){return new a(b)},module.exports=a | ||
function a(b){b=this.options=f.deepMerge(a.options,b),this.initialize(b),b.child.id=b.child.id||b.id,b.child.text=b.child.text||b.text,b.child.lat=b.child.lat||b.lat,b.child.lng=b.child.lng||b.lng,b.child.range=b.child.range||b.range,b.child.value=b.child.value||b.value,b.child.css=b.child.css||b.css}var b=require('leaflet');require('./../core/utils');var c=require('bcore/event'),d=require('./scatter_marker'),e=b.dmap=b.dmap||{},f=e.Utils;a.options={lat:f.getLat,lng:f.getLng,filter:function(a,b){return!0},range:[0,1],id:function(a,b){return a.id||b},text:function(a){return a.text},value:function(a){return a.value||a.num||a[0]},zoom:{max:15,min:3},child:{size:function(a,b,c){return 15},shape:{normal:{}}}},a=c.extend(a,{initialize:function(a){this.cache={},this.isable=!0},addTo:function(a){if(!a)return;this._map=a,this.initEventsMap()},data:function(a){this._data=a},clean:function(){var a=this.cache,c,b;if(!a)return;for(var d in a)c=a[d],b=c.visual,b&&b.destroy&&(b.destroy(),delete c.visual)},updateData:function(a){this.processing(a),this.cleanOld()},updateFilter:function(a){if(typeof a!=='function')return;this.options.filter=a,this.updateMap()},cleanOld:function(){var c=this.versionID,b=this.cache,d,a,f;if(!(c&&b))return;for(var e in b)d=b[e],f=d.versionID,f!==c&&(a=d.visual,a&&(a.off&&a.off(),a.destroy&&a.destroy()),delete b[e])},processing:function(y){var t=this.versionID=Math.random(),j=this._map;if(!j)return;var b=this.options,w=b.child,a,i,u,v,e,c,n=this.isInZoom(),o=this._map.getZoom(),p=b.id,q=b.lat,r=b.lng,s=b.filter,g=b.groups,k,h,l=this.cache,m=this.isable;for(var f in y){if(a=y[f],b.processing&&b.processing(a),i=p(a,f),u=q(a),v=r(a),e=l[i],k=!0,k=s(a,o),h=!0,g){h=!1;for(var f in g){var x=g[f];if(x.filter(a)){h=!0;break}}}if(e?e.data=a:e=l[i]={data:a},e.versionID=t,n&&k&&h&&this.isInView(u,v)&&m){var c=e.visual;c?c.updateData(a):m&&(c=e.visual=new d(w),c.addTo(j),c.render(a),this.initEventsScatter(c))}}this.updateRange()},render:function(a){a&&this.data(a),a=this._data,this.updateData(a)},enable:function(){this.isable=!0},disable:function(){this.isable=!1},isInZoom:function(){var a=this.options.zoom;if(!a)return!0;var c=this._map,d=a.max,e=a.min,b=c.getZoom();return b>d||b<e?!1:!0},isInView:function(b,c,a){a=a||this._map.getBounds();var d=a._northEast.lng,e=a._northEast.lat,f=a._southWest.lng,g=a._southWest.lat;return b<e&&b>g&&c<d&&c>f},updateOptions:function(a){a=this.options=f.deepMerge(this.options,a),this.draw()},draw:function(){var f=this.options,g=this.cache,e,a,l,h,b,j=f.lng,k=f.lat,c,m,n=f.filter,o=this._map.getZoom(),p,q=this.isInZoom(),t=f.groups;if(!q)return this.clean();if(!g)return;if(!this.isable)return;var s=this.options.child,r=this._map;for(var i in g)e=g[i],b=e.data,l=k(b),h=j(b),p=this.isInView(l,h),c=!0,c=n(b,o),m=!0,c=c&&m,a=e.visual,p&&c?a?(a.updateData(b),a.updateZIndex()):(a=e.visual=new d(s),a.addTo(r),a.render(b),this.initEventsScatter(a)):a&&(a.off&&a.off(),a.destroy&&a.destroy(),delete e.visual)},updateMap:function(){this.draw()},updateRange:function(){var c=this.cache,d=this.ranges=this.ranges||{},e=this.options.value,a=d.value=[];for(var f in c){var g=c[f].data,b=e(g);a[0]||(a=[b,b]),b<a[0]&&(a[0]=b),b>a[1]&&(a[1]=b)}},initEventsMap:function(){this._map.on('moveend',this.updateMap.bind(this))},initEventsScatter:function(b){var a=this;b.on('click',function(b){a.emit('click-scatter',b)})},destroy:function(){this.clean(),this.cache={}}}),e.ScatterMarkers=a,e.scatterMarkers=function(b){return new a(b)},module.exports=a |
@@ -5,3 +5,3 @@ { | ||
"description": "2d map visualization lib", | ||
"version": "0.0.60", | ||
"version": "0.0.61", | ||
"scripts": { | ||
@@ -8,0 +8,0 @@ "test": "mocha -r jscoverage test" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
315172