From 4b4bac5dd6efdda4dbbd618394974c3e8446c8d5 Mon Sep 17 00:00:00 2001 From: jgaffuri Date: Mon, 23 Oct 2023 15:37:26 +0200 Subject: [PATCH] correct blen modes --- dist/gridviz.min.js | 2 +- examples/DE.html | 24 ++++++++++++------------ examples/EUR.html | 14 +++++++------- examples/EUR_bu.html | 2 +- examples/FR.html | 24 ++++++++++++------------ examples/FR_pop.html | 4 +++- examples/NO.html | 6 +++--- 7 files changed, 39 insertions(+), 37 deletions(-) diff --git a/dist/gridviz.min.js b/dist/gridviz.min.js index 0e582b7ab..679f40c37 100644 --- a/dist/gridviz.min.js +++ b/dist/gridviz.min.js @@ -1,2 +1,2 @@ /*! For license information please see gridviz.min.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gviz=e():t.gviz=e()}(self,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(){}function n(t){return null==t?r:function(){return this.querySelector(t)}}function o(){return[]}function i(t){return null==t?o:function(){return this.querySelectorAll(t)}}function a(t){return function(){return this.matches(t)}}function u(t){return function(e){return e.matches(t)}}t.r(e),t.d(e,{App:()=>go,BackgroundLayer:()=>qn,BackgroundLayerWMS:()=>Qn,BoundaryLayer:()=>yo,CSVGrid:()=>_n,ColorCategoryLegend:()=>bu,ColorDiscreteLegend:()=>yu,ColorLegend:()=>lu,CompositionStyle:()=>qo,ContourStyle:()=>Pi,Dataset:()=>Yr,DatasetComponent:()=>pn,DotDensityStyle:()=>Yi,GeoCanvas:()=>Nr,GridTile:()=>Ln,JoyPlotStyle:()=>Zo,LGrid:()=>En,LabelLayer:()=>ao,Layer:()=>Gr,LegoStyle:()=>xa,MosaicStyle:()=>Ca,NinjaStarStyle:()=>La,PillarStyle:()=>vi,SegmentOrientationLegend:()=>Ru,SegmentStyle:()=>ri,SegmentWidthLegend:()=>Cu,ShapeColorSizeStyle:()=>To,SideCatStyle:()=>Mi,SideStyle:()=>Si,SizeLegend:()=>_u,SquareColorCatWGLStyle:()=>ha,SquareColorWGLStyle:()=>ea,StrokeStyle:()=>Fo,Style:()=>Oo,TanakaStyle:()=>oa,TextStyle:()=>li,TiledGrid:()=>Hn,TimeSeriesStyle:()=>Ga,getClass:()=>zn,getParameterByName:()=>Uu,sCircleHigh:()=>Bu,sCircleLow:()=>Nu,sExp:()=>Fu,sExpInverse:()=>Du,sExpRev:()=>Iu,sExpRevInverse:()=>Gu,sPow:()=>Lu,sPowInverse:()=>Zu,sPowRev:()=>zu,sPowRevInverse:()=>Wu});var l=Array.prototype.find;function c(){return this.firstElementChild}var s=Array.prototype.filter;function f(){return Array.from(this.children)}function h(t){return new Array(t.length)}function y(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function p(t,e,r,n,o,i){for(var a,u=0,l=e.length,c=i.length;ue?1:t>=e?0:NaN}y.prototype={constructor:y,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var g="http://www.w3.org/1999/xhtml";const w={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function x(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),w.hasOwnProperty(e)?{space:w[e],local:t}:t}function S(t){return function(){this.removeAttribute(t)}}function _(t){return function(){this.removeAttributeNS(t.space,t.local)}}function O(t,e){return function(){this.setAttribute(t,e)}}function j(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function P(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function k(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function C(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function E(t){return function(){this.style.removeProperty(t)}}function T(t,e,r){return function(){this.style.setProperty(t,e,r)}}function A(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function M(t,e){return t.style.getPropertyValue(e)||C(t).getComputedStyle(t,null).getPropertyValue(e)}function R(t){return function(){delete this[t]}}function L(t,e){return function(){this[t]=e}}function z(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function F(t){return t.trim().split(/^|\s+/)}function I(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function B(t,e){for(var r=I(t),n=-1,o=e.length;++n=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var st=[null];function ft(t,e){this._groups=t,this._parents=e}function ht(){return new ft([[document.documentElement]],st)}ft.prototype=ht.prototype={constructor:ft,select:function(t){"function"!=typeof t&&(t=n(t));for(var e=this._groups,r=e.length,o=new Array(r),i=0;i=j&&(j=O+1);!(_=x[j])&&++j=0;)(n=o[i])&&(a&&4^n.compareDocumentPosition(a)&&a.parentNode.insertBefore(n,a),a=n);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=b);for(var r=this._groups,n=r.length,o=new Array(n),i=0;i1?this.each((null==e?E:"function"==typeof e?A:T)(t,e,null==r?"":r)):M(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?R:"function"==typeof e?z:L)(t,e)):this.node()[t]},classed:function(t,e){var r=F(t+"");if(arguments.length<2){for(var n=I(this.node()),o=-1,i=r.length;++o=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,n=0;n{}};function dt(){for(var t,e=0,r=arguments.length,n={};e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var r,n,o=new Array(r),i=0;i=0&&e._call.call(void 0,t),e=e._next;--Ct}()}finally{Ct=0,function(){for(var t,e,r=Pt,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:Pt=e);kt=t,Wt(n)}(),Rt=0}}function Zt(){var t=zt.now(),e=t-Mt;e>At&&(Lt-=e,Mt=t)}function Wt(t){Ct||(Et&&(Et=clearTimeout(Et)),t-Rt>24?(t<1/0&&(Et=setTimeout(Gt,t-zt.now()-Lt)),Tt&&(Tt=clearInterval(Tt))):(Tt||(Mt=zt.now(),Tt=setInterval(Zt,At)),Ct=1,Ft(Gt)))}function Ut(t,e,r){var n=new Bt;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}Bt.prototype=Dt.prototype={constructor:Bt,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?It():+r)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=r,Wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wt())}};var $t=wt("start","end","cancel","interrupt"),Yt=[],Ht=0,Xt=2,Vt=3,qt=5,Jt=6;function Kt(t,e,r,n,o,i){var a=t.__transition;if(a){if(r in a)return}else t.__transition={};!function(t,e,r){var n,o=t.__transition;function i(l){var c,s,f,h;if(1!==r.state)return u();for(c in o)if((h=o[c]).name===r.name){if(h.state===Vt)return Ut(i);4===h.state?(h.state=Jt,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[c]):+cHt)throw new Error("too late; already scheduled");return r}function te(t,e){var r=ee(t,e);if(r.state>Vt)throw new Error("too late; already running");return r}function ee(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function re(t,e){var r,n,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(r=i[o]).name===e?(n=r.state>Xt&&r.state180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(o(r)+"rotate(",null,n)-2,x:ne(t,e)})):e&&r.push(o(r)+"rotate("+e+n)}(i.rotate,a.rotate,u,l),function(t,e,r,i){t!==e?i.push({i:r.push(o(r)+"skewX(",null,n)-2,x:ne(t,e)}):e&&r.push(o(r)+"skewX("+e+n)}(i.skewX,a.skewX,u,l),function(t,e,r,n,i,a){if(t!==r||e!==n){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:ne(t,r)},{i:u-2,x:ne(e,n)})}else 1===r&&1===n||i.push(o(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,l),i=a=null,function(t){for(var e,r=-1,n=l.length;++r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Le(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=_e.exec(t))?new Fe(e[1],e[2],e[3],1):(e=Oe.exec(t))?new Fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=je.exec(t))?Le(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ke.exec(t))?Ze(e[1],e[2]/100,e[3]/100,1):(e=Ce.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Ee.hasOwnProperty(t)?Re(Ee[t]):"transparent"===t?new Fe(NaN,NaN,NaN,0):null}function Re(t){return new Fe(t>>16&255,t>>8&255,255&t,1)}function Le(t,e,r,n){return n<=0&&(t=e=r=NaN),new Fe(t,e,r,n)}function ze(t,e,r,n){return 1===arguments.length?((o=t)instanceof de||(o=Me(o)),o?new Fe((o=o.rgb()).r,o.g,o.b,o.opacity):new Fe):new Fe(t,e,r,null==n?1:n);var o}function Fe(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function Ie(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}`}function Ne(){const t=Be(this.opacity);return`${1===t?"rgb(":"rgba("}${De(this.r)}, ${De(this.g)}, ${De(this.b)}${1===t?")":`, ${t})`}`}function Be(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function De(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ge(t){return((t=De(t))<16?"0":"")+t.toString(16)}function Ze(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ue(t,e,r,n)}function We(t){if(t instanceof Ue)return new Ue(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new Ue;if(t instanceof Ue)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,u=i-o,l=(i+o)/2;return u?(a=e===i?(r-n)/u+6*(r0&&l<1?0:a,new Ue(a,u,l,t.opacity)}function Ue(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function $e(t){return(t=(t||0)%360)<0?t+360:t}function Ye(t){return Math.max(0,Math.min(1,t||0))}function He(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function Xe(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}pe(de,Me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Te,formatHex:Te,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return We(this).formatHsl()},formatRgb:Ae,toString:Ae}),pe(Fe,ze,ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Fe(De(this.r),De(this.g),De(this.b),Be(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ie,formatHex:Ie,formatHex8:function(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}${Ge(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ne,toString:Ne})),pe(Ue,(function(t,e,r,n){return 1===arguments.length?We(t):new Ue(t,e,r,null==n?1:n)}),ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new Ue(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new Ue(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new Fe(He(t>=240?t-240:t+120,o,n),He(t,o,n),He(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new Ue($e(this.h),Ye(this.s),Ye(this.l),Be(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Be(this.opacity);return`${1===t?"hsl(":"hsla("}${$e(this.h)}, ${100*Ye(this.s)}%, ${100*Ye(this.l)}%${1===t?")":`, ${t})`}`}}));const Ve=t=>()=>t;function qe(t,e){var r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):Ve(isNaN(t)?e:t)}const Je=function t(e){var r=function(t){return 1==(t=+t)?qe:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):Ve(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=ze(t)).r,(e=ze(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=qe(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function Ke(t){return function(e){var r,n,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,u=ni&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(n=n[0])?u[a]?u[a]+=n:u[++a]=n:(u[++a]=null,l.push({i:a,x:ne(r,n)})),i=tr.lastIndex;return i=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Qt:te;return function(){var a=i(this,t),u=a.on;u!==n&&(o=(n=u).copy()).on(e,r),a.on=o}}(r,t,e))},attr:function(t,e){var r=x(t),n="transform"===r?se:rr;return this.attrTween(t,"function"==typeof e?(r.local?lr:ur)(r,n,ye(this,"attr."+t,e)):null==e?(r.local?or:nr)(r):(r.local?ar:ir)(r,n,e))},attrTween:function(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var n=x(t);return this.tween(r,(n.local?cr:sr)(n,e))},style:function(t,e,r){var n="transform"==(t+="")?ce:rr;return null==e?this.styleTween(t,function(t,e){var r,n,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===r&&a===n?o:o=e(r=i,n=a)}}(t,n)).on("end.style."+t,dr(t)):"function"==typeof e?this.styleTween(t,function(t,e,r){var n,o,i;return function(){var a=M(this,t),u=r(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=M(this,t)),a===l?null:a===n&&l===o?i:(o=l,i=e(n=a,u))}}(t,n,ye(this,"style."+t,e))).each(function(t,e){var r,n,o,i,a="style."+e,u="end."+a;return function(){var l=te(this,t),c=l.on,s=null==l.value[a]?i||(i=dr(e)):void 0;c===r&&o===s||(n=(r=c).copy()).on(u,o=s),l.on=n}}(this._id,t)):this.styleTween(t,function(t,e,r){var n,o,i=r+"";return function(){var a=M(this,t);return a===i?null:a===n?o:o=e(n=a,r)}}(t,n,e),r).on("end.style."+t,null)},styleTween:function(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;return this.tween(n,function(t,e,r){var n,o;function i(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&function(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}(t,i,r)),n}return i._value=e,i}(t,e,null==r?"":r))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(ye(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,r;function n(){var n=t.apply(this,arguments);return n!==r&&(e=(r=n)&&function(t){return function(e){this.textContent=t.call(this,e)}}(n)),e}return n._value=t,n}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n,o=ee(this.node(),r).tween,i=0,a=o.length;i()=>t;function Or(t,{sourceEvent:e,target:r,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function jr(t,e,r){this.k=t,this.x=e,this.y=r}jr.prototype={constructor:jr,scale:function(t){return 1===t?this:new jr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new jr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Pr=new jr(1,0,0);function kr(t){t.stopImmediatePropagation()}function Cr(t){t.preventDefault(),t.stopImmediatePropagation()}function Er(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Tr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Ar(){return this.__zoom||Pr}function Mr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Rr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lr(t,e,r){var n=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],i=t.invertY(e[0][1])-r[0][1],a=t.invertY(e[1][1])-r[1][1];return t.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function zr(t){return zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zr(t)}function Fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rv}a.event(t).zoom("mouse",i(g(a.that.__zoom,a.mouse[0]=jt(t,o),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,e){var r=t.document.documentElement,n=pt(t).on("dragstart.drag",null);e&&(n.on("click.drag",St,xt),setTimeout((function(){n.on("click.drag",null)}),0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}(t.view,a.moved),Cr(t),a.event(t).end()}),!0),l=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,r=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?r.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),kr(t),a.mouse=[l,this.__zoom.invert(l)],re(this),a.start()}}function P(t,...e){if(n.apply(this,arguments)){var r=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=r.invert(a),l=r.k*(t.shiftKey?.5:2),f=i(g(b(r,l),a,u),o.apply(this,e),c);Cr(t),s>0?pt(this).transition().duration(s).call(x,f,a,t):pt(this).call(m.transform,f,a,t)}}function k(r,...o){if(n.apply(this,arguments)){var i,a,u,l,c=r.touches,s=c.length,f=S(this,o,r.changedTouches.length===s).event(r);for(kr(r),a=0;a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(a.targetTouches);try{for(f.s();!(l=f.n()).done;){var h=l.value;c+=h.clientX,s+=h.clientY}}catch(t){f.e(t)}finally{f.f()}c/=a.targetTouches.length,s/=a.targetTouches.length,i.zoom(r,i.pixToGeoX(c),i.pixToGeoY(s))}}u=e,i.onZoomFun&&i.onZoomFun(t)})).on("start",(function(t){i.canvasSave.c=document.createElement("canvas"),i.canvasSave.c.setAttribute("width",""+i.w),i.canvasSave.c.setAttribute("height",""+i.h),i.canvasSave.c.getContext("2d").drawImage(i.canvas,0,0),i.canvasSave.dx=0,i.canvasSave.dy=0,i.canvasSave.f=1,i.onZoomStartFun&&i.onZoomStartFun(t)})).on("end",(function(t){i.redraw(!0),i.canvasSave={c:null,dx:0,dy:0,f:1},i.onZoomEndFun&&i.onZoomEndFun(t)}))(pt(this.canvas))}this.zfExtent=[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}var e,r,n;return e=t,r=[{key:"setCenter",value:function(t){this.center=t}},{key:"getCenter",value:function(){return this.center}},{key:"setZf",value:function(t){this.zf=t,this.slider&&this.slider.attr("value",+this.zf)}},{key:"getZf",value:function(){return this.zf}},{key:"setZfExtent",value:function(t){this.zfExtent=t}},{key:"getZfExtent",value:function(){return this.zfExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.getZf(),e=-this.center.x/this.getZf()+.5*this.w,r=this.center.y/this.getZf()+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,r)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.getZf()),e=2/(this.h*this.getZf());return[t,0,0,0,e,0,-t*this.center.x,-e*this.center.y,1]}},{key:"redraw",value:function(){throw new Error("Method redraw not implemented.")}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";this.opts.transparentBackground?this.ctx.clearRect(0,0,this.w,this.h):(this.ctx&&(this.ctx.fillStyle=t),this.ctx.fillRect(0,0,this.w,this.h))}},{key:"pan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.center.x+=t,this.center.y+=e,this.updateExtentGeo(),this.canvasSave.c&&(this.canvasSave.dx-=t/this.getZf(),this.canvasSave.dy+=e/this.getZf(),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy))}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.center.x,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.center.y;if(!(this.zfExtent[0]==this.getZf()&&t<=1||this.zfExtent[1]==this.getZf()&&t>=1)){var n=t*this.getZf();nthis.zfExtent[1]&&(t=this.zfExtent[1]/this.getZf()),this.setZf(t*this.getZf());var o=(e-this.center.x)*(1-t);this.center.x+=o;var i=(r-this.center.y)*(1-t);this.center.y+=i,this.updateExtentGeo(),this.canvasSave.c&&(this.clear(this.backgroundColor),this.canvasSave.f/=t,this.canvasSave.dx=this.geoToPixX(e)*(1-this.canvasSave.f),this.canvasSave.dy=this.geoToPixY(r)*(1-this.canvasSave.f),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy,this.canvasSave.f*this.canvasSave.c.width,this.canvasSave.f*this.canvasSave.c.height))}}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.extGeo={xMin:this.pixToGeoX(-t),xMax:this.pixToGeoX(this.w+t),yMin:this.pixToGeoY(this.h+t),yMax:this.pixToGeoY(-t)},this.extGeo}},{key:"toDraw",value:function(t){return!(t.xthis.extGeo.xMax||t.ythis.extGeo.yMax)}},{key:"geoToPixX",value:function(t){return(t-this.center.x)/this.getZf()+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.center.y)/this.getZf()+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.getZf()+this.center.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.getZf()+this.center.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),r=t.getParameterByName("y"),n=t.getParameterByName("z"),o=this.getCenter();null==e||null==e||isNaN(+e)||(o.x=+e),null==r||null==r||isNaN(+r)||(o.y=+r),null==n||null==n||isNaN(+n)||this.setZf(+n)}},{key:"addZoomSlider",value:function(t,e){(e=e||{}).width=e.width||"30px",e.height=e.height||"300px";var r=pt("#"+t);if(r.empty())return console.error("Could not find div element to build zoom slider. Id: "+t),this;var n=this;return this.slider=r.append("input").attr("type","range").attr("min",this.getZfExtent()[0]).attr("max",this.getZfExtent()[1]).attr("value",this.getZf()).on("input",(function(t){if(this&&this.value){var e=+this.value;pt(this).attr("value",e),n.setZf(e),n.redraw()}})).style("width",e.width).style("height",e.height).style("opacity",.7).on("mouseover",(function(t){pt(this).style("opacity",1)})).on("mouseout",(function(t){pt(this).style("opacity",.7)})).style("-webkit-appearance","slider-vertical").style("writing-mode","bt-lr").attr("orient","vertical").style("background","lightgray").style("outline","none").style("-webkit-transition",".2s").style("transition","opacity .2s"),this}}],n=[{key:"getParameterByName",value:function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}}],r&&Ir(e.prototype,r),n&&Ir(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Br(t){return Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(t)}function Dr(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.dataset=e,this.styles=r,this.visible=!1!==n.visible,this.alpha=n.alpha,this.blendOperation=n.blendOperation||function(t){return"normal"},this.minZoom=n.minZoom||0,this.maxZoom=n.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.pixNb=n.pixNb||3,this.cellInfoHTML=n.cellInfoHTML||t.defaultCellInfoHTML}var e,r,n;return e=t,n=[{key:"defaultCellInfoHTML",value:function(t){for(var e=[],r=0,n=Object.keys(t);r",o,""," : ",t[o],"
")}return e.join("")}}],(r=[{key:"getDatasetComponent",value:function(t){if(!(tthis.maxZoom)){if(1==this.dataset.datasetComponents.length)return this.dataset.datasetComponents[0];for(var e=this.dataset.resolutions,r=0,n=e[r]/this.pixNb;n=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.datasetComponents=e,this.resolutions=r,this.datasetComponents.length>1&&this.datasetComponents.length!=this.resolutions.length)throw new Error("Uncompatible number of datasets and resolutions: "+this.datasetComponents.length+" "+this.resolutions.length);n.preprocess&&this.setPrepocesses(n.preprocess)}var e,r,n;return e=t,n=[{key:"make",value:function(e,r,n){var o,i=[],a=Wr(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;i.push(r(u))}}catch(t){a.e(t)}finally{a.f()}return new t(i,e,n)}}],(r=[{key:"setPrepocesses",value:function(t){var e,r=Wr(this.datasetComponents);try{for(r.s();!(e=r.n()).done;)e.value.preprocess=t}catch(t){r.e(t)}finally{r.f()}return this}}])&&$r(e.prototype,r),n&&$r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hr(t){return Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(t)}function Xr(t,e){for(var r=0;rn){var o=t.pageX-e.left-r.clientWidth-this.xOffset;if(r.style.left=o+"px",r.offsetLeft+r.clientWidth+e.left>t.pageX){var i=t.pageX-(r.clientWidth+this.xOffset+e.left);r.style.left=i+"px"}}r.offsetTop+r.clientHeight>e.height&&(r.style.top=r.offsetTop-r.clientHeight+"px")},(n=Vr(n="ensureTooltipInsideContainer"))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,e=e||{},this.div=e.div||"tooltip_eurostat",this.maxWidth=e.maxWidth||"20em",this.fontSize=e.fontSize||"1.2em",this.background=e.background||"white",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"5px",this["box-shadow"]=e["box-shadow"]||"5px 5px 5px grey",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.transitionDuration=e.transitionDuration||100,this.xOffset=e.xOffset||30,this.yOffset=e.yOffset||20,this.yMouseOffset=e.yMouseOffset||0,this.xMouseOffset=e.xMouseOffset||0,this.parentElement=e.parentElement||document.body,this.tooltip=pt("#"+this.div),this.tooltip.empty()&&(this.tooltip=pt((this.parentElement.id,""!=this.parentElement.id?"#"+this.parentElement.id:"body")).append("div").attr("id",this.div)),this.tooltip.style("max-width",this.maxWidth),this.tooltip.style("overflow","hidden"),this.tooltip.style("font-size",this.fontSize),this.tooltip.style("background",this.background),this.tooltip.style("padding",this.padding),this.tooltip.style("border",this.border),this.tooltip.style("border-radius",this["border-radius"]),this.tooltip.style("box-shadow",this["box-shadow"]),this.tooltip.style("font-family",this["font-family"]),this.tooltip.style("position","absolute"),this.tooltip.style("pointer-events","none"),this.tooltip.style("opacity","0"),this.tooltip.attr("role","tooltip").attr("aria-live","polite")}var e,r;return e=t,r=[{key:"show",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",1)}},{key:"hide",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",0)}},{key:"html",value:function(t){this.tooltip.html(t)}},{key:"setPosition",value:function(t){var e=this.parentElement.getBoundingClientRect();this.tooltip.style("left",t.pageX-e.left+this.xOffset+"px").style("top",t.pageY-e.top-this.yOffset+"px"),this.ensureTooltipInsideContainer(t,e)}},{key:"style",value:function(t,e){return 1==arguments.length?this.tooltip.style(t):(this.tooltip.style(t,e),this)}},{key:"attr",value:function(t,e){return 1==arguments.length?this.tooltip.attr(t):(this.tooltip.attr(t,e),this)}}],r&&Xr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Jr={},Kr={};function Qr(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function tn(t){var e=Object.create(null),r=[];return t.forEach((function(t){for(var n in t)n in e||r.push(e[n]=n)})),r}function en(t,e){var r=t+"",n=r.length;return n=i?l=!0:10===(n=t.charCodeAt(a++))?c=!0:13===n&&(c=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+en(n,6):en(n,4))+"-"+en(r.getUTCMonth()+1,2)+"-"+en(r.getUTCDate(),2)+(u?"T"+en(o,2)+":"+en(i,2)+":"+en(a,2)+"."+en(u,3)+"Z":a?"T"+en(o,2)+":"+en(i,2)+":"+en(a,2)+"Z":i||o?"T"+en(o,2)+":"+en(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var r,n,o,i,a,u}return{parse:function(t,e){var r,o,i=n(t,(function(t,n){if(r)return r(t,n-1);o=t,r=e?function(t,e){var r=Qr(t);return function(n,o){return e(r(n),o,t)}}(t,e):Qr(t)}));return i.columns=o||[],i},parseRows:n,format:function(e,r){return null==r&&(r=tn(e)),[r.map(a).join(t)].concat(o(e,r)).join("\n")},formatBody:function(t,e){return null==e&&(e=tn(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var nn=rn(","),on=nn.parse,an=(nn.parseRows,nn.format,nn.formatBody,nn.formatRows,nn.formatRow,nn.formatValue,rn("\t")),un=an.parse;function ln(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function cn(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=void 0),function(t,e){return fetch(t,e).then(ln)}(e,r).then((function(e){return t(e,n)}))}}an.parseRows,an.format,an.formatBody,an.formatRows,an.formatRow,an.formatValue;var sn=cn(on);function fn(t){return fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fn(t)}function hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.url=e,this.resolution=r,this.preprocess=n.preprocess||void 0,this.cellsViewCache=[]}var e,r;return e=t,(r=[{key:"getData",value:function(t,e){throw new Error("Method getData not implemented.")}},{key:"updateViewCache",value:function(t){throw new Error("Method updateViewCache not implemented.")}},{key:"getCellFromPosition",value:function(t,e){var r,n=this.getResolution(),o=n*Math.floor(t.x/n),i=n*Math.floor(t.y/n),a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return hn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(e);try{for(a.s();!(r=a.n()).done;){var u=r.value;if(u.x==o&&u.y==i)return u}}catch(t){a.e(t)}finally{a.f()}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}}])&&yn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vn(t){return vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vn(t)}function dn(){dn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,u){var l=s(t[n],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==vn(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function mn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return bn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(r=i.call(this,t,e,n)).cells=[],r.infoLoadingStatus="notLoaded",r}return e=a,r=[{key:"getData",value:function(t,e){var r,n=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(r=dn().mark((function t(){var r,o,i,a,u,l,c;return dn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,sn(n.url);case 3:r=t.sent,o=mn(r);try{for(o.s();!(i=o.n()).done;)(a=i.value).x=+a.x,a.y=+a.y}catch(t){o.e(t)}finally{o.f()}if(!n.preprocess){t.next=29;break}n.cells=[],u=mn(r),t.prev=9,u.s();case 11:if((l=u.n()).done){t.next=19;break}if(c=l.value,0!=n.preprocess(c)){t.next=16;break}return t.abrupt("continue",17);case 16:n.cells.push(c);case 17:t.next=11;break;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(9),u.e(t.t0);case 24:return t.prev=24,u.f(),t.finish(24);case 27:t.next=30;break;case 29:n.cells=r;case 30:e&&e(),n.infoLoadingStatus="loaded",t.next=38;break;case 34:t.prev=34,t.t1=t.catch(0),n.infoLoadingStatus="failed",n.cells=[];case 38:case"end":return t.stop()}}),t,null,[[0,34],[9,21,24,27]])})),function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){gn(i,n,o,a,u,"next",t)}function u(t){gn(i,n,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=mn(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolutiont.xMax||+n.y+this.resolutiont.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}],r&&wn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function On(t){return On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},On(t)}function jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolutiont.xMax||+n.y+this.resolutiont.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}])&&Pn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function Tn(t){return Tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tn(t)}function An(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.cells);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.x=this.extGeo.xMin+c.x*i,c.y=this.extGeo.yMin+c.y*i}}catch(t){l.e(t)}finally{l.f()}}));function zn(t,e){if(e){if(0==e.length)return 0;if(t<=e[0])return 0;for(var r=1;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Zn(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function Wn(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Zn(i,n,o,a,u,"next",t)}function u(t){Zn(i,n,o,a,u,"throw",t)}a(void 0)}))}}function Un(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(r=i.call(this,t,0,n)).app=e,r.info=void 0,r.infoLoadingStatus="notLoaded",r.cache={},r}return e=a,(r=[{key:"loadInfo",value:function(t){var e=this;return this.info||"notLoaded"!==this.infoLoadingStatus?!t||"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||t():Wn(Gn().mark((function r(){var n;return Gn().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,In(e.url+"info.json");case 3:n=r.sent,e.info=n,e.resolution=n.resolutionGeo,e.infoLoadingStatus="loaded",t&&t(),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),e.infoLoadingStatus="failed";case 13:case"end":return r.stop()}}),r,null,[[0,10]])})))(),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,r=this.info.resolutionGeo,n=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(r*n)),xMax:Math.floor((t.xMax-e.x)/(r*n)),yMin:Math.floor((t.yMin-e.y)/(r*n)),yMax:Math.floor((t.yMax-e.y)/(r*n))}}this.loadInfo((function(){}))}},{key:"getData",value:function(t,e){var r=this;if(!this.info)return this;var n=this.getTilingEnvelope(t);if(!n)return this;for(var o=this.info.tilingBounds,i=function(t){for(var i=function(n){if(r.cache[t]||(r.cache[t]={}),r.cache[t][n])return"continue";r.cache[t][n]="loading",Wn(Gn().mark((function o(){var i,a,u,l,c,s,f,h,y,p,v,d,m;return Gn().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,sn(r.url+t+"/"+n+".csv");case 3:if(a=o.sent,!r.preprocess){o.next=28;break}i=[],u=Bn(a),o.prev=8,u.s();case 10:if((l=u.n()).done){o.next=18;break}if(c=l.value,0!=r.preprocess(c)){o.next=15;break}return o.abrupt("continue",16);case 15:i.push(c);case 16:o.next=10;break;case 18:o.next=23;break;case 20:o.prev=20,o.t0=o.catch(8),u.e(o.t0);case 23:return o.prev=23,u.f(),o.finish(23);case 26:o.next=29;break;case 28:i=a;case 29:o.next=36;break;case 32:return o.prev=32,o.t1=o.catch(0),r.cache[t][n]="failed",o.abrupt("return");case 36:if(r.info){o.next=39;break}return console.error("Tile info inknown"),o.abrupt("return");case 39:if(s=new Ln(i,t,n,r.info),r.cache[t][n]=s,e){o.next=44;break}return o.abrupt("return");case 44:f=!1,h=r.app.getZoomFactor(),y=Bn(r.app.layers),o.prev=47,y.s();case 49:if((p=y.n()).done){o.next=59;break}if((v=p.value).visible){o.next=53;break}return o.abrupt("continue",57);case 53:if(v.getDatasetComponent(h)==r){o.next=55;break}return o.abrupt("continue",57);case 55:return f=!0,o.abrupt("break",59);case 57:o.next=49;break;case 59:o.next=64;break;case 61:o.prev=61,o.t2=o.catch(47),y.e(o.t2);case 64:return o.prev=64,y.f(),o.finish(64);case 67:if(f){o.next=70;break}return o.abrupt("return");case 70:if(d=r.app.updateExtentGeo(),m=s.extGeo,!(d.xMax<=m.xMin)){o.next=74;break}return o.abrupt("return");case 74:if(!(d.xMin>=m.xMax)){o.next=76;break}return o.abrupt("return");case 76:if(!(d.yMax<=m.yMin)){o.next=78;break}return o.abrupt("return");case 78:if(!(d.yMin>=m.yMax)){o.next=80;break}return o.abrupt("return");case 80:e();case 83:case"end":return o.stop()}}),o,null,[[0,32],[8,20,23,26],[47,61,64,67]])})))()},a=Math.max(n.yMin,o.yMin);a<=Math.min(n.yMax,o.yMax);a++)i(a)},a=Math.max(n.xMin,o.xMin);a<=Math.min(n.xMax,o.xMax);a++)i(a);return this}},{key:"updateViewCache",value:function(t){if(this.cellsViewCache=[],this.info){var e=this.getTilingEnvelope(t);if(e)for(var r=this.info.tilingBounds,n=Math.max(e.xMin,r.xMin);n<=Math.min(e.xMax,r.xMax);n++)if(this.cache[n])for(var o=Math.max(e.yMin,r.yMin);o<=Math.min(e.yMax,r.yMax);o++){var i=this.cache[n][o];if(i&&"string"!=typeof i){var a,u=Bn(i.cells);try{for(u.s();!(a=u.n()).done;){var l=a.value;+l.x+this.resolutiont.xMax||+l.y+this.resolutiont.yMax||this.cellsViewCache.push(l)}}catch(t){u.e(t)}finally{u.f()}}}}}}])&&Un(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function Xn(t){return Xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xn(t)}function Vn(t,e){for(var r=0;r=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");if(this.cache={},this.url=e.url,this.urlFun=e.urlFun||function(t,e,n){return r.url+n+"/"+t+"/"+e+".png"},this.resolutions=e.resolutions,!this.resolutions||0==this.resolutions.length)throw new Error("No resolutions provided for background layer");this.nbPix=e.nbPix||256,this.origin=e.origin||[0,0],this.z0=e.z0||0,this.filterColor=e.filterColor}var e,r;return e=t,(r=[{key:"get",value:function(t,e,r){var n=this.cache[t];if(n&&(n=n[e]))return n[r]}},{key:"put",value:function(t,e,r,n){this.cache[e]||(this.cache[e]={}),this.cache[e][r]||(this.cache[e][r]={}),this.cache[e][r][n]=t}},{key:"draw",value:function(t){var e=this;if(this.resolutions&&0!=this.resolutions.length){var r=t.getZf(),n=this.origin[0],o=this.origin[1],i=0;for(i=0;i=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.url=e.url,this.filterColor=e.filterColor,this.img=void 0,this.xMin=void 0,this.xMax=void 0,this.yMin=void 0,this.yMax=void 0}var e,r;return e=t,(r=[{key:"hasMoved",value:function(t){return t.xMin!=this.xMin||t.xMax!=this.xMax||t.yMin!=this.yMin||t.yMax!=this.yMax}},{key:"draw",value:function(t){if(t.updateExtentGeo(0),!this.hasMoved(t.extGeo)&&this.img)t.ctx.drawImage(this.img,0,0,t.w,t.h);else{this.xMin=t.extGeo.xMin,this.xMax=t.extGeo.xMax,this.yMin=t.extGeo.yMin,this.yMax=t.extGeo.yMax;var e=[];e.push(this.url),e.push("&width="),e.push(t.w),e.push("&height="),e.push(t.h),e.push("&bbox="),e.push(t.extGeo.xMin),e.push(","),e.push(t.extGeo.yMin),e.push(","),e.push(t.extGeo.xMax),e.push(","),e.push(t.extGeo.yMax);var r=e.join("");this.img||(this.img=new Image,this.img.onload=function(){t.redraw()},this.img.onerror=function(){console.warn("Could not retrieve WMS background image from",r)}),this.img.src=r}var n=t.getZf();if(this.filterColor){var o=this.filterColor(n);o&&"none"!=o&&(t.ctx.fillStyle=o,t.ctx.fillRect(0,0,t.w,t.h))}}}])&&Kn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function to(t){return to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},to(t)}function eo(){eo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,u){var l=s(t[n],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==to(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ro(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function no(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return oo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function oo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&(t.ctx.strokeStyle=l,t.ctx.lineWidth=c,t.ctx.strokeText(o.name,a,u))}if(this.color){var s=this.color(o,e);s&&(t.ctx.fillStyle=s,t.ctx.fillText(o.name,a,u))}}}}catch(t){n.e(t)}finally{n.f()}}else this.load(t.redraw)}},{key:"load",value:(n=eo().mark((function t(e){var r,n,o,i;return eo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.url){t.next=5;break}return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.abrupt("return");case 5:if("notLoaded"==this.loadingStatus){t.next=7;break}return t.abrupt("return");case 7:return this.loadingStatus="loading",t.prev=8,t.next=11,sn(this.url);case 11:if(r=t.sent,!this.preprocess){t.next=35;break}this.labels=[],n=no(r),t.prev=15,n.s();case 17:if((o=n.n()).done){t.next=25;break}if(i=o.value,0!=this.preprocess(i)){t.next=22;break}return t.abrupt("continue",23);case 22:this.labels.push(i);case 23:t.next=17;break;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(15),n.e(t.t0);case 30:return t.prev=30,n.f(),t.finish(30);case 33:t.next=36;break;case 35:this.labels=r;case 36:this.loadingStatus="loaded",e&&e(),t.next=45;break;case 40:t.prev=40,t.t1=t.catch(8),console.log("Failed loading labels from "+this.url),this.labels=[],this.loadingStatus="failed";case 45:case"end":return t.stop()}}),t,this,[[8,40],[15,27,30,33]])})),o=function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){ro(i,r,o,a,u,"next",t)}function u(t){ro(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&io(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function uo(t){return uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uo(t)}function lo(){lo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,u){var l=s(t[n],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==uo(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function co(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function so(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return fo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0])||arguments[0];n.legend&&t&&n.legend.selectAll("*").remove(),n.cg.initCanvasTransform(),n.cg.clear(n.cg.backgroundColor);var e=n.getZoomFactor();if(n.updateExtentGeo(),n.showBgLayers){var r,i=vo(n.bgLayers);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.visible&&(e>a.maxZoom||ec.maxZoom||ey.maxZoom||ed.maxZoom||eS.maxZoom||e0&&void 0!==arguments[0]?arguments[0]:20;return this.cg.updateExtentGeo(t)}},{key:"getCellFocusInfo",value:function(t){for(var e=this.getZoomFactor(),r=this.layers.length-1;r>=0;r--){var n=this.layers[r];if(n.visible&&n.cellInfoHTML&&"none"!==n.cellInfoHTML){var o=n.getDatasetComponent(e);if(o){var i=o.getCellFromPosition(t,o.getViewCache());if(!i)return;var a=n.cellInfoHTML(i,o.getResolution());if(!a)return;return{cell:i,html:a,resolution:o.getResolution()}}}}}},{key:"getGeoCenter",value:function(){return this.cg.getCenter()}},{key:"setGeoCenter",value:function(t){return this.cg.setCenter(t),this}},{key:"getZoomFactor",value:function(){return this.cg.getZf()}},{key:"setZoomFactor",value:function(t){return this.cg.setZf(t),this}},{key:"getZoomFactorExtent",value:function(){return this.cg.getZfExtent()}},{key:"setZoomFactorExtent",value:function(t){return this.cg.setZfExtent(t),this}},{key:"getBackgroundColor",value:function(){return this.cg.backgroundColor}},{key:"setBackgroundColor",value:function(t){return this.cg.backgroundColor=t,this}},{key:"getBoundaryLayer",value:function(){return this.boundaryLayer}},{key:"setBoundaryLayer",value:function(t){return this.boundaryLayer=new yo(t),this}},{key:"getLabelLayer",value:function(){return this.labelLayer}},{key:"setLabelLayer",value:function(t){return this.labelLayer=new ao(t),this}},{key:"redraw",value:function(){return this.cg.redraw(),this}},{key:"addLayerFromDataset",value:function(t,e,r){var n=new Gr(t,e,r);return this.layers.push(n),this}},{key:"makeLGridDataset",value:function(t,e,r){return new Yr([new En(t,e)],[],r)}},{key:"makeCSVGridDataset",value:function(t,e,r){var n=this;return new Yr([new _n(t,e,r).getData(void 0,(function(){n.cg.redraw()}))],[],r)}},{key:"makeTiledGridDataset",value:function(t,e){var r=this;return new Yr([new Hn(t,this,e).loadInfo((function(){r.cg.redraw()}))],[],e)}},{key:"makeMultiScaleCSVGridDataset",value:function(t,e,r){var n=this;return Yr.make(t,(function(t){return new _n(e(t),t,r).getData(void 0,(function(){n.cg.redraw()}))}),r)}},{key:"makeMultiScaleTiledGridDataset",value:function(t,e,r){var n=this;return Yr.make(t,(function(t){return new Hn(e(t),n,r).loadInfo((function(){n.cg.redraw()}))}),r)}},{key:"addCSVGridLayer",value:function(t,e,r,n){var o=this.makeCSVGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addTiledGridLayer",value:function(t,e,r){var n=this.makeTiledGridDataset(t,r);return this.addLayerFromDataset(n,e,r)}},{key:"addMultiScaleCSVGridLayer",value:function(t,e,r,n){var o=this.makeMultiScaleCSVGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addMultiScaleTiledGridLayer",value:function(t,e,r,n){var o=this.makeMultiScaleTiledGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addBackgroundLayer",value:function(t){return this.bgLayers.push(new qn(t)),this.redraw(),this}},{key:"addBackgroundLayerWMS",value:function(t){return this.bgLayers.push(new Qn(t)),this.redraw(),this}},{key:"addZoomSlider",value:function(t,e){return this.cg.addZoomSlider(t,e),this}},{key:"setViewFromURL",value:function(){return this.cg.setViewFromURL(),this}},{key:"defineResizeObserver",value:function(t,e){var r=this;new ResizeObserver((function(n){t.clientWidth>0&&t.clientHeight>0&&window.requestAnimationFrame((function(){Array.isArray(n)&&n.length&&(r.h===t.clientHeight&&r.w===t.clientWidth||(r.h=t.clientHeight,r.w=t.clientWidth,r.cg.h=t.clientHeight,r.cg.w=t.clientWidth,e.setAttribute("width",""+r.w),e.setAttribute("height",""+r.h),r.redraw()))}))})).observe(t)}},{key:"destroy",value:function(){var t,e;this.layers=[],this.bgLayers=[],this.container.removeEventListener("mouseover",this.mouseOverHandler),this.container.removeEventListener("mousemove",this.mouseMoveHandler),this.container.removeEventListener("mouseout",this.mouseOutHandler),this.cg.canvas.remove(),null===(t=this.legend)||void 0===t||t.remove(),null===(e=this.tooltip.tooltip)||void 0===e||e.remove()}}],r&&bo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function wo(t){return wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wo(t)}function xo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return So(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?So(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function So(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.legends=[]}var e,r,n;return e=t,n=[{key:"getStatistics",value:function(t,e,r){if(t&&0!=t.length){var n,o=1/0,i=-1/0,a=xo(t);try{for(a.s();!(n=a.n()).done;){var u=+e(n.value);r&&!u||(ui&&(i=u))}}catch(t){a.e(t)}finally{a.f()}return{min:o,max:i}}}}],(r=[{key:"draw",value:function(t,e,r){throw new Error("Method draw not implemented.")}},{key:"getOffset",value:function(){return this.offset}},{key:"setOffset",value:function(t){return this.offset=t,this}},{key:"updateLegends",value:function(t){var e,r=xo(this.legends);try{for(r.s();!(e=r.n()).done;)e.value.update(t)}catch(t){r.e(t)}finally{r.f()}return this}}])&&_o(e.prototype,r),n&&_o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function jo(t){return jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jo(t)}function Po(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var s=u.value,f=this.color?this.color(s[this.colorCol],e,i,a):void 0;if(f&&"none"!==f){r.ctx.fillStyle=f;var h=this.shape?this.shape(s):"square";if("none"!==h){var y=(this.size||function(){return e})(s[this.sizeCol],e,o,a),p=this.offset(s,e,a);if("square"===h){var v=e*(1-y/e)*.5;r.ctx.fillRect(s.x+v+p.dx,s.y+v+p.dy,y,y)}else if("circle"===h)r.ctx.beginPath(),r.ctx.arc(s.x+l+p.dx,s.y+l+p.dy,.5*y,0,2*Math.PI,!1),r.ctx.fill();else if("donut"===h){var d=s.x+l+p.dx,m=s.y+l+p.dy;r.ctx.beginPath(),r.ctx.moveTo(d,m),r.ctx.arc(d,m,l,0,2*Math.PI),r.ctx.arc(d,m,(1-y/e)*l,0,2*Math.PI,!0),r.ctx.closePath(),r.ctx.fill()}else{if("diamond"!==h)throw new Error("Unexpected shape:"+h);var b=.5*y;r.ctx.beginPath(),r.ctx.moveTo(s.x+l-b,s.y+l),r.ctx.lineTo(s.x+l,s.y+l+b),r.ctx.lineTo(s.x+l+b,s.y+l),r.ctx.lineTo(s.x+l,s.y+l-b),r.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&ko(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Ao(t){return Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ao(t)}function Mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(l=s.n()).done;){var f=l.value,h=this.strokeColor?this.strokeColor(f[this.strokeColorCol],e,o):void 0;if(h&&"none"!==h){r.ctx.strokeStyle=h;var y=(this.size||function(){return e})(f[this.sizeCol],e,i,u),p=this.strokeWidth?this.strokeWidth(f[this.strokeWidthCol],e,a,u):1*u;if(p&&!(p<=0)){r.ctx.lineWidth=p;var v=this.shape?this.shape(f):"square";if("none"!==v){var d=this.offset(f,e,u);if("square"===v){var m=e*(1-y/e)*.5;r.ctx.beginPath(),r.ctx.rect(f.x+m+d.dx,f.y+m+d.dy,y,y),r.ctx.stroke()}else if("circle"===v)r.ctx.beginPath(),r.ctx.arc(f.x+c+d.dx,f.y+c+d.dy,.5*y,0,2*Math.PI,!1),r.ctx.stroke();else if("diamond"===v){var b=.5*y;r.ctx.beginPath(),r.ctx.moveTo(f.x+c-b,f.y+c),r.ctx.lineTo(f.x+c,f.y+c+b),r.ctx.lineTo(f.x+c+b,f.y+c),r.ctx.lineTo(f.x+c,f.y+c-b),r.ctx.lineTo(f.x+c-b,f.y+c),r.ctx.stroke()}else{if("donut"!==v)throw new Error("Unexpected shape:"+v);console.error("Not implemented")}}}}}}catch(t){s.e(t)}finally{s.f()}}}])&&Ro(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Io(t){return Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Io(t)}function No(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(o=l.n()).done;){var c=o.value,s=u[c.y];s||(s={},u[c.y]=s),s[c.x]=this.height(c[this.heightCol],e,a,i)}}catch(t){l.e(t)}finally{l.f()}var f=r.extGeo;if(f){var h=Math.floor(f.xMin/e)*e,y=Math.floor(f.xMax/e)*e,p=Math.floor(f.yMin/e)*e,v=Math.floor(f.yMax/e)*e,d={min:p,max:v};r.setCanvasTransform();for(var m=v;m>=p;m-=e){var b=u[m];if(b){r.ctx.beginPath(),r.ctx.moveTo(h-e/2,m);for(var g=void 0,w=h;w<=y;w+=e){var x=b[w];x||(x=0),x||g?r.ctx.lineTo(w+e/2,m+x):r.ctx.moveTo(w+e/2,m),g=x}g&&r.ctx.lineTo(y+e/2,m);var S=this.fillColor(m,d,e,i);S&&"none"!=S&&(r.ctx.fillStyle=S,r.ctx.fill());var _=this.lineColor(m,d,e,i),O=this.lineWidth(m,d,e,i);_&&"none"!=_&&O>0&&(r.ctx.strokeStyle=_,r.ctx.lineWidth=O,r.ctx.stroke())}}}}}])&&Bo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Wo(t){return Wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wo(t)}function Uo(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||$o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $o(t,e){if(t){if("string"==typeof t)return Yo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yo(t,e):void 0}}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(u=l.n()).done;){var c=u.value,s=(this.size||function(){return e})(c[this.sizeCol],e,o,i),f=this.offset(c,e,i),h=this.type?this.type(c):"flag",y=c.x+f.dx+("agepyramid"===h?0:.5*e),p=c.y+f.dy+("agepyramid"===h?0:.5*e),v=this.offsetAngle?this.offsetAngle(c,e,i)*Math.PI/180:0;if("agepyramid"===h||"radar"===h||"halftone"===h){for(var d=-1/0,m=0,b=Object.keys(this.color);md&&(d=g)}var w=0;"agepyramid"===h&&this.agePyramidHeight&&(w=(e-this.agePyramidHeight(c,e,i))/2),"radar"!==h&&"halftone"!==h||(w=Math.PI/2+v);var x="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(c,e,i):e)/a:"radar"===h||"halftone"===h?2*Math.PI/a:void 0;if(void 0===x)throw new Error("Unexpected symbol type:"+h);for(var S=0,_=Object.entries(this.color);S<_.length;S++){var O=Uo(_[S],2),j=O[0],P=O[1];if("agepyramid"===h){r.ctx.fillStyle=P;var k=s*c[j]/d;r.ctx.fillRect(y+(e-k)/2,p+w,k,x),w+=x}else if("radar"===h){r.ctx.fillStyle=P;var C=c[j],E=s/2*Math.sqrt(C/d);r.ctx.beginPath(),r.ctx.moveTo(y,p),r.ctx.arc(y,p,E,w-x,w),r.ctx.lineTo(y,p),r.ctx.fill(),w+=x}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);r.ctx.fillStyle=P;var T=c[j],A=.333*s*Math.sqrt(T/d);r.ctx.beginPath(),r.ctx.arc(y+.25*e*Math.cos(w),p+.25*e*Math.sin(w),A,0,2*Math.PI),r.ctx.fill(),w+=x}}}else{for(var M=0,R=0,L=Object.keys(this.color);Rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(c=s.n()).done;){var f=c.value,h=this.color?this.color(f[this.colorCol],e,o):void 0;if(h){var y=this.width?this.width(f[this.widthCol],e,a,u):void 0;if(y&&!(y<0)){var p=this.length?this.length(f[this.lengthCol],e,i,u):void 0;if(p&&!(p<0)){var v=this.orientation(f)*l;if(void 0!==v&&!isNaN(v)){var d=this.offset(f,e,u);r.ctx.strokeStyle=h,r.ctx.lineWidth=y;var m=f.x+e/2+d.dx,b=f.y+e/2+d.dy,g=.5*Math.cos(v)*p,w=.5*Math.sin(v)*p;r.ctx.beginPath(),r.ctx.moveTo(m-g,b-w),r.ctx.lineTo(m+g,b+w),r.ctx.stroke()}}}}}}catch(t){s.e(t)}finally{s.f()}this.updateLegends({style:this,r:e,zf:u,sColor:o,sLength:i,sWidth:a})}}])&&Qo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function ni(t){return ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ni(t)}function oi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var s=l.value,f=this.text?this.text(s[this.textCol],e,o,u):void 0;if(null!=f&&null!=f&&f+""!=""){var h=this.color?this.color(s[this.colorCol],e,i,u):void 0;if(h){r.ctx.fillStyle=h;var y=this.fontSize(s[this.fontSizeCol],e,a,u)/u,p=this.fontFamily||"Arial",v=this.fontWeight||"bold";r.ctx.font=v+" "+y+"px "+p;var d=this.offset(s,e,u);r.ctx.textAlign="center";var m=r.geoToPixX(s.x+.5*e+d.dx),b=r.geoToPixY(s.y+.5*e+d.dy)+.3*y;r.ctx.fillText(f,m,b)}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:u,sColor:i})}}])&&ii(e.prototype,r),n&&ii(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Oo);function ci(t){return ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ci(t)}function si(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return fi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function bi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);ro&&(o=a))}}catch(t){i.e(t)}finally{i.f()}return{min:n,max:o}}}}],(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();this.valueCol&&(o=Oo.getStatistics(t,(function(t){return t[n.valueCol]}),!0));var a=[],l=.001*e;t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var c=t[0],s=1;st.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.fillColor(v);d&&"none"!=d&&(r.ctx.fillStyle=d,r.ctx.fillRect(v.x,v.y,e,e))}}catch(t){p.e(t)}finally{p.f()}}r.ctx.lineCap="butt";for(var m=0,b=o;m1);return t+r*i*Math.sqrt(-2*Math.log(o)/o)}}return r.source=t,r}(Math.random);function Li(t,e,r){var n=document.createElement("canvas");n.setAttribute("width",t),n.setAttribute("height",e);var o=n.getContext("webgl",r);if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:n,gl:o}}function zi(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o2?n-2:0),i=2;i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Zi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r3&&void 0!==arguments[3]?arguments[3]:10,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e;var a=Fi(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float t;\n varying float vt;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vt = t;\n }\n "),u="precision mediump float;\nvarying float vt;\nuniform float alpha;\n"+function(){for(var t=[],e=0;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(f.s();!(u=f.n()).done;){var h=u.value,y=this.tFun(h[this.colorCol],e,i);null!=y&&null!=y&&(c.push(h.x+l,h.y+l),s.push(y>1?1:y<0?0:y))}}catch(t){f.e(t)}finally{f.f()}var p=this.size?this.size(e,o):e+.2*o,v=this.opacity?this.opacity(e,o):void 0;new Vi(a.gl,this.colors,this.stretching,p/o,v).draw(c,s,r.getWebGLTransform()),r.initCanvasTransform(),r.ctx.drawImage(a.canvas,0,0),this.updateLegends({style:this,r:e,zf:o,sColor:i})}else console.error("No webGL")}}}])&&Ki(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function ra(t){return ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ra(t)}function na(t,e){for(var r=0;r0&&"h"===t.or||t.value<0&&"v"===t.or?"rgba(255,255,100,"+i+")":"rgba(0,0,0,"+i+")"}:function(t,r,n,o){if(0!==t.value)return"v"===t.or?t.value<0?e.colBright:e.colDark:t.value<0?e.colDark:e.colBright},width:e.newShading?function(t,r,n,o){return e.newShadingWidthPix*o}:function(t,r,n,o){return e.widthFactor*r*Math.abs(t.value)*("v"===t.or?.5:1)},filter:e.filter})]}}],null&&na(e.prototype,null),r&&na(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ia(t){return ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ia(t)}function aa(t,e){for(var r=0;r0&&r.push(","),r.push(" c"+n);r.push(";\n"),r.push("void main(void) {\n");for(var o=0;o0&&r.push("else "),r.push("if(vi=="),r.push(o),r.push(".0) gl_FragColor = vec4(c"),r.push(o),r.push("[0], c"),r.push(o),r.push("[1], c"),r.push(o),r.push("[2], c"),r.push(o),r.push("[3]);\n");r.push("else gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}"),this.fshString=r.join("")}var e,r;return e=t,r=[{key:"draw",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=zi(t,Fi(t,t.VERTEX_SHADER,this.vshString),Fi(t,t.FRAGMENT_SHADER,this.fshString));t.useProgram(i),t.uniform1f(t.getUniformLocation(i,"sizePix"),1*o);for(var a=0;a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function va(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var s=l.value,f=this.color?this.color(s[this.colorCol],e,o):void 0;if(f&&"none"!==f){r.ctx.fillStyle=f;var h=this.offset(s,e,i),y=u(),p=u(),v=u(),d=u();this.shadowFactor>0&&(r.ctx.beginPath(),r.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),r.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),r.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),r.ctx.stroke()),r.ctx.beginPath(),r.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),r.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),r.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),r.ctx.lineTo(s.x+h.dx+p.x,s.y+h.dy+e-p.y),r.ctx.fill()}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:i,sColor:o})}}])&&ja(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Ea(t){return Ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ea(t)}function Ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var s=u.value,f=this.color?this.color(s[this.colorCol],e,i,a):void 0;if(f&&"none"!==f){r.ctx.fillStyle=f;var h=this.shape?this.shape(s):"o";if("none"!==h){var y=(this.size||function(){return.5})(s[this.sizeCol],e,o,a)*l,p=s.x+l,v=s.y+l;if("p"===h)r.ctx.beginPath(),r.ctx.moveTo(p,v+l),r.ctx.lineTo(p+y,v+y),r.ctx.lineTo(p+l,v),r.ctx.lineTo(p+y,v-y),r.ctx.lineTo(p,v-l),r.ctx.lineTo(p-y,v-y),r.ctx.lineTo(p-l,v),r.ctx.lineTo(p-y,v+y),r.ctx.fill();else{if("o"!==h)throw new Error("Unexpected shape:"+h);r.ctx.beginPath(),r.ctx.moveTo(p,v+y),r.ctx.lineTo(p+l,v+l),r.ctx.lineTo(p+y,v),r.ctx.lineTo(p+l,v-l),r.ctx.lineTo(p,v-y),r.ctx.lineTo(p-l,v-l),r.ctx.lineTo(p-y,v),r.ctx.lineTo(p-l,v+l),r.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&Aa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function za(t){return za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},za(t)}function Fa(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ia(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ia(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rr)&&(r=a))}}catch(t){i.e(t)}finally{i.f()}if(null!=e)return r-e},s=Fa(t);try{for(s.s();!(l=s.n()).done;){var f=c(l.value);null!=f&&(null==u||f>u)&&(u=f)}}catch(t){s.e(t)}finally{s.f()}if(u){var h=this.ts.length;r.setCanvasTransform(),r.ctx.lineCap="butt";var y,p=Fa(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.lineWidth?this.lineWidth(v[this.lineWidthCol],e,o,a):void 0;if(d&&!(d<0)){var m=this.color?this.color(v[this.colorCol],e,i,a):void 0;if(m){var b=this.offsetX?this.offsetX(v,e,a):0;if(null!=b&&!isNaN(b)){var g=this.width?this.width(v,e,a):e;if(null!=g&&!isNaN(g)){var w=this.offsetY?this.offsetY(v,e,a):0;if(null!=w&&!isNaN(w)){var x=this.height?this.height(v,e,a):e;if(null!=x&&!isNaN(x)){var S=this.anchorModeY?this.anchorModeY(v,e,a):"center";if(S){r.ctx.lineWidth=d,r.ctx.strokeStyle=m;var _=void 0,O=void 0;if("first"===S)_=v[this.ts[0]],O=0;else if("last"===S)_=v[this.ts[this.ts.length-1]],O=0;else if("bottom"===S){var j,P=Fa(this.ts);try{for(P.s();!(j=P.n()).done;){var k=+v[j.value];null!=k&&(null==_||k<_)&&(_=k)}}catch(t){P.e(t)}finally{P.f()}O=0}else if("top"===S){var C,E=Fa(this.ts);try{for(E.s();!(C=E.n()).done;){var T=+v[C.value];null!=T&&(null==_||T>_)&&(_=T)}}catch(t){E.e(t)}finally{E.f()}O=e}else{if("center"!==S){console.log("Unexpected anchorModeY: "+S);continue}var A,M=void 0,R=void 0,L=Fa(this.ts);try{for(L.s();!(A=L.n()).done;){var z=v[A.value];null!=z&&((null==M||zR)&&(R=z))}}catch(t){L.e(t)}finally{L.f()}_=.5*(+R+ +M),O=e/2}var F=g/(h-1),I=v[this.ts[0]];this.noData(I)||(r.ctx.beginPath(),r.ctx.moveTo(v.x+b,v.y+O+(I-_)*x/u+w));for(var N=void 0,B=1;B1?n[0]+n.slice(2):n,+t.slice(r+1)]}var Ya,Ha=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xa(t){if(!(e=Ha.exec(t)))throw new Error("invalid format: "+t);var e;return new Va({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Va(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function qa(t,e){var r=$a(t,e);if(!r)return t+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}Xa.prototype=Va.prototype,Va.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Ja={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>qa(100*t,e),r:qa,s:function(t,e){var r=$a(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(Ya=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+$a(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ka(t){return t}var Qa,tu,eu=Array.prototype.map,ru=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nu(t){return Qa=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?Ka:(e=eu.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var o=t.length,i=[],a=0,u=e[0],l=0;o>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),i.push(t.substring(o-=u,o+u)),!((l+=u+1)>n));)u=e[a=(a+1)%e.length];return i.reverse().join(r)}),o=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Ka:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(eu.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Xa(t)).fill,r=t.align,f=t.sign,h=t.symbol,y=t.zero,p=t.width,v=t.comma,d=t.precision,m=t.trim,b=t.type;"n"===b?(v=!0,b="g"):Ja[b]||(void 0===d&&(d=12),m=!0,b="g"),(y||"0"===e&&"="===r)&&(y=!0,e="0",r="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===h?i:/[%p]/.test(b)?l:"",x=Ja[b],S=/[defgprs%]/.test(b);function _(t){var o,i,l,h=g,_=w;if("c"===b)_=x(t)+_,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),d),m&&(t=function(t){t:for(var e,r=t.length,n=1,o=-1;n0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:c:"-"===f||"("===f?"":f)+h,_=("s"===b?ru[8+Ya/3]:"")+_+(O&&"("===f?")":""),S)for(o=-1,i=t.length;++o(l=t.charCodeAt(o))||l>57){_=(46===l?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}v&&!y&&(t=n(t,1/0));var j=h.length+t.length+_.length,P=j>1)+h+t+_+P.slice(j);break;default:t=P+h+t+_}return u(t)}return d=void 0===d?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),_.toString=function(){return t+""},_}return{format:f,formatPrefix:function(t,e){var r,n=f(((t=Xa(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=$a(Math.abs(r)))?r[1]:NaN)/3)))),i=Math.pow(10,-o),a=ru[8+o/3];return function(t){return n(i*t)+a}}}}(t),tu=Qa.format,Qa.formatPrefix,Qa}function ou(t){return ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ou(t)}function iu(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,e)},zu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,1/e)},Fu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:(Math.exp(t*e)-1)/(Math.exp(e)-1)},Iu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1-1/e*Math.log(Math.exp(e)*(1-t)+t)},Nu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8;if(0==e)return t;if(1==e)return Math.sqrt(t*(2-t));var r=e/(1-e);return Math.sqrt(1/(r*r)+t*(2/r+2-t))-1/r},Bu=function(t){return 1-Nu(1-t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8)},Du=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1/e*Math.log(1-t+t*Math.exp(e))},Gu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return(Math.exp(-e*t)-1)/(Math.exp(-e)-1)},Zu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,1/e)},Wu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,e)},Uu=Nr.getParameterByName;return nu({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})())); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gviz=e():t.gviz=e()}(self,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(){}function n(t){return null==t?r:function(){return this.querySelector(t)}}function o(){return[]}function i(t){return null==t?o:function(){return this.querySelectorAll(t)}}function a(t){return function(){return this.matches(t)}}function u(t){return function(e){return e.matches(t)}}t.r(e),t.d(e,{App:()=>go,BackgroundLayer:()=>qn,BackgroundLayerWMS:()=>Qn,BoundaryLayer:()=>yo,CSVGrid:()=>_n,ColorCategoryLegend:()=>bu,ColorDiscreteLegend:()=>yu,ColorLegend:()=>lu,CompositionStyle:()=>qo,ContourStyle:()=>Pi,Dataset:()=>Yr,DatasetComponent:()=>pn,DotDensityStyle:()=>Yi,GeoCanvas:()=>Nr,GridTile:()=>Ln,JoyPlotStyle:()=>Zo,LGrid:()=>En,LabelLayer:()=>ao,Layer:()=>Gr,LegoStyle:()=>xa,MosaicStyle:()=>Ca,NinjaStarStyle:()=>La,PillarStyle:()=>vi,SegmentOrientationLegend:()=>Ru,SegmentStyle:()=>ri,SegmentWidthLegend:()=>Cu,ShapeColorSizeStyle:()=>To,SideCatStyle:()=>Mi,SideStyle:()=>Si,SizeLegend:()=>_u,SquareColorCatWGLStyle:()=>ha,SquareColorWGLStyle:()=>ea,StrokeStyle:()=>Fo,Style:()=>Oo,TanakaStyle:()=>oa,TextStyle:()=>li,TiledGrid:()=>Hn,TimeSeriesStyle:()=>Ga,getClass:()=>zn,getParameterByName:()=>Uu,sCircleHigh:()=>Bu,sCircleLow:()=>Nu,sExp:()=>Fu,sExpInverse:()=>Du,sExpRev:()=>Iu,sExpRevInverse:()=>Gu,sPow:()=>Lu,sPowInverse:()=>Zu,sPowRev:()=>zu,sPowRevInverse:()=>Wu});var l=Array.prototype.find;function c(){return this.firstElementChild}var s=Array.prototype.filter;function f(){return Array.from(this.children)}function h(t){return new Array(t.length)}function y(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function p(t,e,r,n,o,i){for(var a,u=0,l=e.length,c=i.length;ue?1:t>=e?0:NaN}y.prototype={constructor:y,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var g="http://www.w3.org/1999/xhtml";const w={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function x(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),w.hasOwnProperty(e)?{space:w[e],local:t}:t}function S(t){return function(){this.removeAttribute(t)}}function _(t){return function(){this.removeAttributeNS(t.space,t.local)}}function O(t,e){return function(){this.setAttribute(t,e)}}function j(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function P(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function k(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function C(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function E(t){return function(){this.style.removeProperty(t)}}function T(t,e,r){return function(){this.style.setProperty(t,e,r)}}function A(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function M(t,e){return t.style.getPropertyValue(e)||C(t).getComputedStyle(t,null).getPropertyValue(e)}function R(t){return function(){delete this[t]}}function L(t,e){return function(){this[t]=e}}function z(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function F(t){return t.trim().split(/^|\s+/)}function I(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function B(t,e){for(var r=I(t),n=-1,o=e.length;++n=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var st=[null];function ft(t,e){this._groups=t,this._parents=e}function ht(){return new ft([[document.documentElement]],st)}ft.prototype=ht.prototype={constructor:ft,select:function(t){"function"!=typeof t&&(t=n(t));for(var e=this._groups,r=e.length,o=new Array(r),i=0;i=j&&(j=O+1);!(_=x[j])&&++j=0;)(n=o[i])&&(a&&4^n.compareDocumentPosition(a)&&a.parentNode.insertBefore(n,a),a=n);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=b);for(var r=this._groups,n=r.length,o=new Array(n),i=0;i1?this.each((null==e?E:"function"==typeof e?A:T)(t,e,null==r?"":r)):M(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?R:"function"==typeof e?z:L)(t,e)):this.node()[t]},classed:function(t,e){var r=F(t+"");if(arguments.length<2){for(var n=I(this.node()),o=-1,i=r.length;++o=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,n=0;n{}};function dt(){for(var t,e=0,r=arguments.length,n={};e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var r,n,o=new Array(r),i=0;i=0&&e._call.call(void 0,t),e=e._next;--Ct}()}finally{Ct=0,function(){for(var t,e,r=Pt,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:Pt=e);kt=t,Wt(n)}(),Rt=0}}function Zt(){var t=zt.now(),e=t-Mt;e>At&&(Lt-=e,Mt=t)}function Wt(t){Ct||(Et&&(Et=clearTimeout(Et)),t-Rt>24?(t<1/0&&(Et=setTimeout(Gt,t-zt.now()-Lt)),Tt&&(Tt=clearInterval(Tt))):(Tt||(Mt=zt.now(),Tt=setInterval(Zt,At)),Ct=1,Ft(Gt)))}function Ut(t,e,r){var n=new Bt;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}Bt.prototype=Dt.prototype={constructor:Bt,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?It():+r)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=r,Wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wt())}};var $t=wt("start","end","cancel","interrupt"),Yt=[],Ht=0,Xt=2,Vt=3,qt=5,Jt=6;function Kt(t,e,r,n,o,i){var a=t.__transition;if(a){if(r in a)return}else t.__transition={};!function(t,e,r){var n,o=t.__transition;function i(l){var c,s,f,h;if(1!==r.state)return u();for(c in o)if((h=o[c]).name===r.name){if(h.state===Vt)return Ut(i);4===h.state?(h.state=Jt,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[c]):+cHt)throw new Error("too late; already scheduled");return r}function te(t,e){var r=ee(t,e);if(r.state>Vt)throw new Error("too late; already running");return r}function ee(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function re(t,e){var r,n,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(r=i[o]).name===e?(n=r.state>Xt&&r.state180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(o(r)+"rotate(",null,n)-2,x:ne(t,e)})):e&&r.push(o(r)+"rotate("+e+n)}(i.rotate,a.rotate,u,l),function(t,e,r,i){t!==e?i.push({i:r.push(o(r)+"skewX(",null,n)-2,x:ne(t,e)}):e&&r.push(o(r)+"skewX("+e+n)}(i.skewX,a.skewX,u,l),function(t,e,r,n,i,a){if(t!==r||e!==n){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:ne(t,r)},{i:u-2,x:ne(e,n)})}else 1===r&&1===n||i.push(o(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,l),i=a=null,function(t){for(var e,r=-1,n=l.length;++r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Le(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=_e.exec(t))?new Fe(e[1],e[2],e[3],1):(e=Oe.exec(t))?new Fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=je.exec(t))?Le(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ke.exec(t))?Ze(e[1],e[2]/100,e[3]/100,1):(e=Ce.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Ee.hasOwnProperty(t)?Re(Ee[t]):"transparent"===t?new Fe(NaN,NaN,NaN,0):null}function Re(t){return new Fe(t>>16&255,t>>8&255,255&t,1)}function Le(t,e,r,n){return n<=0&&(t=e=r=NaN),new Fe(t,e,r,n)}function ze(t,e,r,n){return 1===arguments.length?((o=t)instanceof de||(o=Me(o)),o?new Fe((o=o.rgb()).r,o.g,o.b,o.opacity):new Fe):new Fe(t,e,r,null==n?1:n);var o}function Fe(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function Ie(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}`}function Ne(){const t=Be(this.opacity);return`${1===t?"rgb(":"rgba("}${De(this.r)}, ${De(this.g)}, ${De(this.b)}${1===t?")":`, ${t})`}`}function Be(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function De(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ge(t){return((t=De(t))<16?"0":"")+t.toString(16)}function Ze(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ue(t,e,r,n)}function We(t){if(t instanceof Ue)return new Ue(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new Ue;if(t instanceof Ue)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,u=i-o,l=(i+o)/2;return u?(a=e===i?(r-n)/u+6*(r0&&l<1?0:a,new Ue(a,u,l,t.opacity)}function Ue(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function $e(t){return(t=(t||0)%360)<0?t+360:t}function Ye(t){return Math.max(0,Math.min(1,t||0))}function He(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function Xe(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}pe(de,Me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Te,formatHex:Te,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return We(this).formatHsl()},formatRgb:Ae,toString:Ae}),pe(Fe,ze,ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Fe(De(this.r),De(this.g),De(this.b),Be(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ie,formatHex:Ie,formatHex8:function(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}${Ge(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ne,toString:Ne})),pe(Ue,(function(t,e,r,n){return 1===arguments.length?We(t):new Ue(t,e,r,null==n?1:n)}),ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new Ue(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new Ue(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new Fe(He(t>=240?t-240:t+120,o,n),He(t,o,n),He(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new Ue($e(this.h),Ye(this.s),Ye(this.l),Be(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Be(this.opacity);return`${1===t?"hsl(":"hsla("}${$e(this.h)}, ${100*Ye(this.s)}%, ${100*Ye(this.l)}%${1===t?")":`, ${t})`}`}}));const Ve=t=>()=>t;function qe(t,e){var r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):Ve(isNaN(t)?e:t)}const Je=function t(e){var r=function(t){return 1==(t=+t)?qe:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):Ve(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=ze(t)).r,(e=ze(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=qe(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function Ke(t){return function(e){var r,n,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,u=ni&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(n=n[0])?u[a]?u[a]+=n:u[++a]=n:(u[++a]=null,l.push({i:a,x:ne(r,n)})),i=tr.lastIndex;return i=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Qt:te;return function(){var a=i(this,t),u=a.on;u!==n&&(o=(n=u).copy()).on(e,r),a.on=o}}(r,t,e))},attr:function(t,e){var r=x(t),n="transform"===r?se:rr;return this.attrTween(t,"function"==typeof e?(r.local?lr:ur)(r,n,ye(this,"attr."+t,e)):null==e?(r.local?or:nr)(r):(r.local?ar:ir)(r,n,e))},attrTween:function(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var n=x(t);return this.tween(r,(n.local?cr:sr)(n,e))},style:function(t,e,r){var n="transform"==(t+="")?ce:rr;return null==e?this.styleTween(t,function(t,e){var r,n,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===r&&a===n?o:o=e(r=i,n=a)}}(t,n)).on("end.style."+t,dr(t)):"function"==typeof e?this.styleTween(t,function(t,e,r){var n,o,i;return function(){var a=M(this,t),u=r(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=M(this,t)),a===l?null:a===n&&l===o?i:(o=l,i=e(n=a,u))}}(t,n,ye(this,"style."+t,e))).each(function(t,e){var r,n,o,i,a="style."+e,u="end."+a;return function(){var l=te(this,t),c=l.on,s=null==l.value[a]?i||(i=dr(e)):void 0;c===r&&o===s||(n=(r=c).copy()).on(u,o=s),l.on=n}}(this._id,t)):this.styleTween(t,function(t,e,r){var n,o,i=r+"";return function(){var a=M(this,t);return a===i?null:a===n?o:o=e(n=a,r)}}(t,n,e),r).on("end.style."+t,null)},styleTween:function(t,e,r){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;return this.tween(n,function(t,e,r){var n,o;function i(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&function(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}(t,i,r)),n}return i._value=e,i}(t,e,null==r?"":r))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(ye(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,r;function n(){var n=t.apply(this,arguments);return n!==r&&(e=(r=n)&&function(t){return function(e){this.textContent=t.call(this,e)}}(n)),e}return n._value=t,n}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n,o=ee(this.node(),r).tween,i=0,a=o.length;i()=>t;function Or(t,{sourceEvent:e,target:r,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function jr(t,e,r){this.k=t,this.x=e,this.y=r}jr.prototype={constructor:jr,scale:function(t){return 1===t?this:new jr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new jr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Pr=new jr(1,0,0);function kr(t){t.stopImmediatePropagation()}function Cr(t){t.preventDefault(),t.stopImmediatePropagation()}function Er(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Tr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Ar(){return this.__zoom||Pr}function Mr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Rr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lr(t,e,r){var n=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],i=t.invertY(e[0][1])-r[0][1],a=t.invertY(e[1][1])-r[1][1];return t.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function zr(t){return zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zr(t)}function Fr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rv}a.event(t).zoom("mouse",i(g(a.that.__zoom,a.mouse[0]=jt(t,o),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,e){var r=t.document.documentElement,n=pt(t).on("dragstart.drag",null);e&&(n.on("click.drag",St,xt),setTimeout((function(){n.on("click.drag",null)}),0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}(t.view,a.moved),Cr(t),a.event(t).end()}),!0),l=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,r=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?r.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),kr(t),a.mouse=[l,this.__zoom.invert(l)],re(this),a.start()}}function P(t,...e){if(n.apply(this,arguments)){var r=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=r.invert(a),l=r.k*(t.shiftKey?.5:2),f=i(g(b(r,l),a,u),o.apply(this,e),c);Cr(t),s>0?pt(this).transition().duration(s).call(x,f,a,t):pt(this).call(m.transform,f,a,t)}}function k(r,...o){if(n.apply(this,arguments)){var i,a,u,l,c=r.touches,s=c.length,f=S(this,o,r.changedTouches.length===s).event(r);for(kr(r),a=0;a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(a.targetTouches);try{for(f.s();!(l=f.n()).done;){var h=l.value;c+=h.clientX,s+=h.clientY}}catch(t){f.e(t)}finally{f.f()}c/=a.targetTouches.length,s/=a.targetTouches.length,i.zoom(r,i.pixToGeoX(c),i.pixToGeoY(s))}}u=e,i.onZoomFun&&i.onZoomFun(t)})).on("start",(function(t){i.canvasSave.c=document.createElement("canvas"),i.canvasSave.c.setAttribute("width",""+i.w),i.canvasSave.c.setAttribute("height",""+i.h),i.canvasSave.c.getContext("2d").drawImage(i.canvas,0,0),i.canvasSave.dx=0,i.canvasSave.dy=0,i.canvasSave.f=1,i.onZoomStartFun&&i.onZoomStartFun(t)})).on("end",(function(t){i.redraw(!0),i.canvasSave={c:null,dx:0,dy:0,f:1},i.onZoomEndFun&&i.onZoomEndFun(t)}))(pt(this.canvas))}this.zfExtent=[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}var e,r,n;return e=t,r=[{key:"setCenter",value:function(t){this.center=t}},{key:"getCenter",value:function(){return this.center}},{key:"setZf",value:function(t){this.zf=t,this.slider&&this.slider.attr("value",+this.zf)}},{key:"getZf",value:function(){return this.zf}},{key:"setZfExtent",value:function(t){this.zfExtent=t}},{key:"getZfExtent",value:function(){return this.zfExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.getZf(),e=-this.center.x/this.getZf()+.5*this.w,r=this.center.y/this.getZf()+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,r)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.getZf()),e=2/(this.h*this.getZf());return[t,0,0,0,e,0,-t*this.center.x,-e*this.center.y,1]}},{key:"redraw",value:function(){throw new Error("Method redraw not implemented.")}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";this.opts.transparentBackground?this.ctx.clearRect(0,0,this.w,this.h):(this.ctx&&(this.ctx.fillStyle=t),this.ctx.fillRect(0,0,this.w,this.h))}},{key:"pan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.center.x+=t,this.center.y+=e,this.updateExtentGeo(),this.canvasSave.c&&(this.canvasSave.dx-=t/this.getZf(),this.canvasSave.dy+=e/this.getZf(),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy))}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.center.x,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.center.y;if(!(this.zfExtent[0]==this.getZf()&&t<=1||this.zfExtent[1]==this.getZf()&&t>=1)){var n=t*this.getZf();nthis.zfExtent[1]&&(t=this.zfExtent[1]/this.getZf()),this.setZf(t*this.getZf());var o=(e-this.center.x)*(1-t);this.center.x+=o;var i=(r-this.center.y)*(1-t);this.center.y+=i,this.updateExtentGeo(),this.canvasSave.c&&(this.clear(this.backgroundColor),this.canvasSave.f/=t,this.canvasSave.dx=this.geoToPixX(e)*(1-this.canvasSave.f),this.canvasSave.dy=this.geoToPixY(r)*(1-this.canvasSave.f),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy,this.canvasSave.f*this.canvasSave.c.width,this.canvasSave.f*this.canvasSave.c.height))}}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.extGeo={xMin:this.pixToGeoX(-t),xMax:this.pixToGeoX(this.w+t),yMin:this.pixToGeoY(this.h+t),yMax:this.pixToGeoY(-t)},this.extGeo}},{key:"toDraw",value:function(t){return!(t.xthis.extGeo.xMax||t.ythis.extGeo.yMax)}},{key:"geoToPixX",value:function(t){return(t-this.center.x)/this.getZf()+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.center.y)/this.getZf()+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.getZf()+this.center.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.getZf()+this.center.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),r=t.getParameterByName("y"),n=t.getParameterByName("z"),o=this.getCenter();null==e||null==e||isNaN(+e)||(o.x=+e),null==r||null==r||isNaN(+r)||(o.y=+r),null==n||null==n||isNaN(+n)||this.setZf(+n)}},{key:"addZoomSlider",value:function(t,e){(e=e||{}).width=e.width||"30px",e.height=e.height||"300px";var r=pt("#"+t);if(r.empty())return console.error("Could not find div element to build zoom slider. Id: "+t),this;var n=this;return this.slider=r.append("input").attr("type","range").attr("min",this.getZfExtent()[0]).attr("max",this.getZfExtent()[1]).attr("value",this.getZf()).on("input",(function(t){if(this&&this.value){var e=+this.value;pt(this).attr("value",e),n.setZf(e),n.redraw()}})).style("width",e.width).style("height",e.height).style("opacity",.7).on("mouseover",(function(t){pt(this).style("opacity",1)})).on("mouseout",(function(t){pt(this).style("opacity",.7)})).style("-webkit-appearance","slider-vertical").style("writing-mode","bt-lr").attr("orient","vertical").style("background","lightgray").style("outline","none").style("-webkit-transition",".2s").style("transition","opacity .2s"),this}}],n=[{key:"getParameterByName",value:function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}}],r&&Ir(e.prototype,r),n&&Ir(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Br(t){return Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(t)}function Dr(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.dataset=e,this.styles=r,this.visible=!1!==n.visible,this.alpha=n.alpha,this.blendOperation=n.blendOperation||function(t){return"source-over"},this.minZoom=n.minZoom||0,this.maxZoom=n.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.pixNb=n.pixNb||3,this.cellInfoHTML=n.cellInfoHTML||t.defaultCellInfoHTML}var e,r,n;return e=t,n=[{key:"defaultCellInfoHTML",value:function(t){for(var e=[],r=0,n=Object.keys(t);r",o,""," : ",t[o],"
")}return e.join("")}}],(r=[{key:"getDatasetComponent",value:function(t){if(!(tthis.maxZoom)){if(1==this.dataset.datasetComponents.length)return this.dataset.datasetComponents[0];for(var e=this.dataset.resolutions,r=0,n=e[r]/this.pixNb;n=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.datasetComponents=e,this.resolutions=r,this.datasetComponents.length>1&&this.datasetComponents.length!=this.resolutions.length)throw new Error("Uncompatible number of datasets and resolutions: "+this.datasetComponents.length+" "+this.resolutions.length);n.preprocess&&this.setPrepocesses(n.preprocess)}var e,r,n;return e=t,n=[{key:"make",value:function(e,r,n){var o,i=[],a=Wr(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;i.push(r(u))}}catch(t){a.e(t)}finally{a.f()}return new t(i,e,n)}}],(r=[{key:"setPrepocesses",value:function(t){var e,r=Wr(this.datasetComponents);try{for(r.s();!(e=r.n()).done;)e.value.preprocess=t}catch(t){r.e(t)}finally{r.f()}return this}}])&&$r(e.prototype,r),n&&$r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Hr(t){return Hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hr(t)}function Xr(t,e){for(var r=0;rn){var o=t.pageX-e.left-r.clientWidth-this.xOffset;if(r.style.left=o+"px",r.offsetLeft+r.clientWidth+e.left>t.pageX){var i=t.pageX-(r.clientWidth+this.xOffset+e.left);r.style.left=i+"px"}}r.offsetTop+r.clientHeight>e.height&&(r.style.top=r.offsetTop-r.clientHeight+"px")},(n=Vr(n="ensureTooltipInsideContainer"))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,e=e||{},this.div=e.div||"tooltip_eurostat",this.maxWidth=e.maxWidth||"20em",this.fontSize=e.fontSize||"1.2em",this.background=e.background||"white",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"5px",this["box-shadow"]=e["box-shadow"]||"5px 5px 5px grey",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.transitionDuration=e.transitionDuration||100,this.xOffset=e.xOffset||30,this.yOffset=e.yOffset||20,this.yMouseOffset=e.yMouseOffset||0,this.xMouseOffset=e.xMouseOffset||0,this.parentElement=e.parentElement||document.body,this.tooltip=pt("#"+this.div),this.tooltip.empty()&&(this.tooltip=pt((this.parentElement.id,""!=this.parentElement.id?"#"+this.parentElement.id:"body")).append("div").attr("id",this.div)),this.tooltip.style("max-width",this.maxWidth),this.tooltip.style("overflow","hidden"),this.tooltip.style("font-size",this.fontSize),this.tooltip.style("background",this.background),this.tooltip.style("padding",this.padding),this.tooltip.style("border",this.border),this.tooltip.style("border-radius",this["border-radius"]),this.tooltip.style("box-shadow",this["box-shadow"]),this.tooltip.style("font-family",this["font-family"]),this.tooltip.style("position","absolute"),this.tooltip.style("pointer-events","none"),this.tooltip.style("opacity","0"),this.tooltip.attr("role","tooltip").attr("aria-live","polite")}var e,r;return e=t,r=[{key:"show",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",1)}},{key:"hide",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",0)}},{key:"html",value:function(t){this.tooltip.html(t)}},{key:"setPosition",value:function(t){var e=this.parentElement.getBoundingClientRect();this.tooltip.style("left",t.pageX-e.left+this.xOffset+"px").style("top",t.pageY-e.top-this.yOffset+"px"),this.ensureTooltipInsideContainer(t,e)}},{key:"style",value:function(t,e){return 1==arguments.length?this.tooltip.style(t):(this.tooltip.style(t,e),this)}},{key:"attr",value:function(t,e){return 1==arguments.length?this.tooltip.attr(t):(this.tooltip.attr(t,e),this)}}],r&&Xr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Jr={},Kr={};function Qr(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function tn(t){var e=Object.create(null),r=[];return t.forEach((function(t){for(var n in t)n in e||r.push(e[n]=n)})),r}function en(t,e){var r=t+"",n=r.length;return n=i?l=!0:10===(n=t.charCodeAt(a++))?c=!0:13===n&&(c=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+en(n,6):en(n,4))+"-"+en(r.getUTCMonth()+1,2)+"-"+en(r.getUTCDate(),2)+(u?"T"+en(o,2)+":"+en(i,2)+":"+en(a,2)+"."+en(u,3)+"Z":a?"T"+en(o,2)+":"+en(i,2)+":"+en(a,2)+"Z":i||o?"T"+en(o,2)+":"+en(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var r,n,o,i,a,u}return{parse:function(t,e){var r,o,i=n(t,(function(t,n){if(r)return r(t,n-1);o=t,r=e?function(t,e){var r=Qr(t);return function(n,o){return e(r(n),o,t)}}(t,e):Qr(t)}));return i.columns=o||[],i},parseRows:n,format:function(e,r){return null==r&&(r=tn(e)),[r.map(a).join(t)].concat(o(e,r)).join("\n")},formatBody:function(t,e){return null==e&&(e=tn(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var nn=rn(","),on=nn.parse,an=(nn.parseRows,nn.format,nn.formatBody,nn.formatRows,nn.formatRow,nn.formatValue,rn("\t")),un=an.parse;function ln(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function cn(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=void 0),function(t,e){return fetch(t,e).then(ln)}(e,r).then((function(e){return t(e,n)}))}}an.parseRows,an.format,an.formatBody,an.formatRows,an.formatRow,an.formatValue;var sn=cn(on);function fn(t){return fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fn(t)}function hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.url=e,this.resolution=r,this.preprocess=n.preprocess||void 0,this.cellsViewCache=[]}var e,r;return e=t,(r=[{key:"getData",value:function(t,e){throw new Error("Method getData not implemented.")}},{key:"updateViewCache",value:function(t){throw new Error("Method updateViewCache not implemented.")}},{key:"getCellFromPosition",value:function(t,e){var r,n=this.getResolution(),o=n*Math.floor(t.x/n),i=n*Math.floor(t.y/n),a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return hn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(e);try{for(a.s();!(r=a.n()).done;){var u=r.value;if(u.x==o&&u.y==i)return u}}catch(t){a.e(t)}finally{a.f()}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}}])&&yn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function vn(t){return vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vn(t)}function dn(){dn=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"source-over",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,u){var l=s(t[n],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==vn(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(t,e,r);if("source-over"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="source-over",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function mn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return bn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(r=i.call(this,t,e,n)).cells=[],r.infoLoadingStatus="notLoaded",r}return e=a,r=[{key:"getData",value:function(t,e){var r,n=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(r=dn().mark((function t(){var r,o,i,a,u,l,c;return dn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,sn(n.url);case 3:r=t.sent,o=mn(r);try{for(o.s();!(i=o.n()).done;)(a=i.value).x=+a.x,a.y=+a.y}catch(t){o.e(t)}finally{o.f()}if(!n.preprocess){t.next=29;break}n.cells=[],u=mn(r),t.prev=9,u.s();case 11:if((l=u.n()).done){t.next=19;break}if(c=l.value,0!=n.preprocess(c)){t.next=16;break}return t.abrupt("continue",17);case 16:n.cells.push(c);case 17:t.next=11;break;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(9),u.e(t.t0);case 24:return t.prev=24,u.f(),t.finish(24);case 27:t.next=30;break;case 29:n.cells=r;case 30:e&&e(),n.infoLoadingStatus="loaded",t.next=38;break;case 34:t.prev=34,t.t1=t.catch(0),n.infoLoadingStatus="failed",n.cells=[];case 38:case"end":return t.stop()}}),t,null,[[0,34],[9,21,24,27]])})),function(){var t=this,e=arguments;return new Promise((function(n,o){var i=r.apply(t,e);function a(t){gn(i,n,o,a,u,"next",t)}function u(t){gn(i,n,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=mn(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolutiont.xMax||+n.y+this.resolutiont.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}],r&&wn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function On(t){return On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},On(t)}function jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolutiont.xMax||+n.y+this.resolutiont.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}])&&Pn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function Tn(t){return Tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tn(t)}function An(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.cells);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.x=this.extGeo.xMin+c.x*i,c.y=this.extGeo.yMin+c.y*i}}catch(t){l.e(t)}finally{l.f()}}));function zn(t,e){if(e){if(0==e.length)return 0;if(t<=e[0])return 0;for(var r=1;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Zn(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function Wn(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Zn(i,n,o,a,u,"next",t)}function u(t){Zn(i,n,o,a,u,"throw",t)}a(void 0)}))}}function Un(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(r=i.call(this,t,0,n)).app=e,r.info=void 0,r.infoLoadingStatus="notLoaded",r.cache={},r}return e=a,(r=[{key:"loadInfo",value:function(t){var e=this;return this.info||"notLoaded"!==this.infoLoadingStatus?!t||"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||t():Wn(Gn().mark((function r(){var n;return Gn().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,In(e.url+"info.json");case 3:n=r.sent,e.info=n,e.resolution=n.resolutionGeo,e.infoLoadingStatus="loaded",t&&t(),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),e.infoLoadingStatus="failed";case 13:case"end":return r.stop()}}),r,null,[[0,10]])})))(),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,r=this.info.resolutionGeo,n=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(r*n)),xMax:Math.floor((t.xMax-e.x)/(r*n)),yMin:Math.floor((t.yMin-e.y)/(r*n)),yMax:Math.floor((t.yMax-e.y)/(r*n))}}this.loadInfo((function(){}))}},{key:"getData",value:function(t,e){var r=this;if(!this.info)return this;var n=this.getTilingEnvelope(t);if(!n)return this;for(var o=this.info.tilingBounds,i=function(t){for(var i=function(n){if(r.cache[t]||(r.cache[t]={}),r.cache[t][n])return"continue";r.cache[t][n]="loading",Wn(Gn().mark((function o(){var i,a,u,l,c,s,f,h,y,p,v,d,m;return Gn().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,sn(r.url+t+"/"+n+".csv");case 3:if(a=o.sent,!r.preprocess){o.next=28;break}i=[],u=Bn(a),o.prev=8,u.s();case 10:if((l=u.n()).done){o.next=18;break}if(c=l.value,0!=r.preprocess(c)){o.next=15;break}return o.abrupt("continue",16);case 15:i.push(c);case 16:o.next=10;break;case 18:o.next=23;break;case 20:o.prev=20,o.t0=o.catch(8),u.e(o.t0);case 23:return o.prev=23,u.f(),o.finish(23);case 26:o.next=29;break;case 28:i=a;case 29:o.next=36;break;case 32:return o.prev=32,o.t1=o.catch(0),r.cache[t][n]="failed",o.abrupt("return");case 36:if(r.info){o.next=39;break}return console.error("Tile info inknown"),o.abrupt("return");case 39:if(s=new Ln(i,t,n,r.info),r.cache[t][n]=s,e){o.next=44;break}return o.abrupt("return");case 44:f=!1,h=r.app.getZoomFactor(),y=Bn(r.app.layers),o.prev=47,y.s();case 49:if((p=y.n()).done){o.next=59;break}if((v=p.value).visible){o.next=53;break}return o.abrupt("continue",57);case 53:if(v.getDatasetComponent(h)==r){o.next=55;break}return o.abrupt("continue",57);case 55:return f=!0,o.abrupt("break",59);case 57:o.next=49;break;case 59:o.next=64;break;case 61:o.prev=61,o.t2=o.catch(47),y.e(o.t2);case 64:return o.prev=64,y.f(),o.finish(64);case 67:if(f){o.next=70;break}return o.abrupt("return");case 70:if(d=r.app.updateExtentGeo(),m=s.extGeo,!(d.xMax<=m.xMin)){o.next=74;break}return o.abrupt("return");case 74:if(!(d.xMin>=m.xMax)){o.next=76;break}return o.abrupt("return");case 76:if(!(d.yMax<=m.yMin)){o.next=78;break}return o.abrupt("return");case 78:if(!(d.yMin>=m.yMax)){o.next=80;break}return o.abrupt("return");case 80:e();case 83:case"end":return o.stop()}}),o,null,[[0,32],[8,20,23,26],[47,61,64,67]])})))()},a=Math.max(n.yMin,o.yMin);a<=Math.min(n.yMax,o.yMax);a++)i(a)},a=Math.max(n.xMin,o.xMin);a<=Math.min(n.xMax,o.xMax);a++)i(a);return this}},{key:"updateViewCache",value:function(t){if(this.cellsViewCache=[],this.info){var e=this.getTilingEnvelope(t);if(e)for(var r=this.info.tilingBounds,n=Math.max(e.xMin,r.xMin);n<=Math.min(e.xMax,r.xMax);n++)if(this.cache[n])for(var o=Math.max(e.yMin,r.yMin);o<=Math.min(e.yMax,r.yMax);o++){var i=this.cache[n][o];if(i&&"string"!=typeof i){var a,u=Bn(i.cells);try{for(u.s();!(a=u.n()).done;){var l=a.value;+l.x+this.resolutiont.xMax||+l.y+this.resolutiont.yMax||this.cellsViewCache.push(l)}}catch(t){u.e(t)}finally{u.f()}}}}}}])&&Un(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(pn);function Xn(t){return Xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xn(t)}function Vn(t,e){for(var r=0;r=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");if(this.cache={},this.url=e.url,this.urlFun=e.urlFun||function(t,e,n){return r.url+n+"/"+t+"/"+e+".png"},this.resolutions=e.resolutions,!this.resolutions||0==this.resolutions.length)throw new Error("No resolutions provided for background layer");this.nbPix=e.nbPix||256,this.origin=e.origin||[0,0],this.z0=e.z0||0,this.filterColor=e.filterColor}var e,r;return e=t,(r=[{key:"get",value:function(t,e,r){var n=this.cache[t];if(n&&(n=n[e]))return n[r]}},{key:"put",value:function(t,e,r,n){this.cache[e]||(this.cache[e]={}),this.cache[e][r]||(this.cache[e][r]={}),this.cache[e][r][n]=t}},{key:"draw",value:function(t){var e=this;if(this.resolutions&&0!=this.resolutions.length){var r=t.getZf(),n=this.origin[0],o=this.origin[1],i=0;for(i=0;i=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.url=e.url,this.filterColor=e.filterColor,this.img=void 0,this.xMin=void 0,this.xMax=void 0,this.yMin=void 0,this.yMax=void 0}var e,r;return e=t,(r=[{key:"hasMoved",value:function(t){return t.xMin!=this.xMin||t.xMax!=this.xMax||t.yMin!=this.yMin||t.yMax!=this.yMax}},{key:"draw",value:function(t){if(t.updateExtentGeo(0),!this.hasMoved(t.extGeo)&&this.img)t.ctx.drawImage(this.img,0,0,t.w,t.h);else{this.xMin=t.extGeo.xMin,this.xMax=t.extGeo.xMax,this.yMin=t.extGeo.yMin,this.yMax=t.extGeo.yMax;var e=[];e.push(this.url),e.push("&width="),e.push(t.w),e.push("&height="),e.push(t.h),e.push("&bbox="),e.push(t.extGeo.xMin),e.push(","),e.push(t.extGeo.yMin),e.push(","),e.push(t.extGeo.xMax),e.push(","),e.push(t.extGeo.yMax);var r=e.join("");this.img||(this.img=new Image,this.img.onload=function(){t.redraw()},this.img.onerror=function(){console.warn("Could not retrieve WMS background image from",r)}),this.img.src=r}var n=t.getZf();if(this.filterColor){var o=this.filterColor(n);o&&"none"!=o&&(t.ctx.fillStyle=o,t.ctx.fillRect(0,0,t.w,t.h))}}}])&&Kn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function to(t){return to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},to(t)}function eo(){eo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"source-over",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,u){var l=s(t[n],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==to(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(t,e,r);if("source-over"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="source-over",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ro(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function no(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return oo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function oo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&(t.ctx.strokeStyle=l,t.ctx.lineWidth=c,t.ctx.strokeText(o.name,a,u))}if(this.color){var s=this.color(o,e);s&&(t.ctx.fillStyle=s,t.ctx.fillText(o.name,a,u))}}}}catch(t){n.e(t)}finally{n.f()}}else this.load(t.redraw)}},{key:"load",value:(n=eo().mark((function t(e){var r,n,o,i;return eo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.url){t.next=5;break}return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.abrupt("return");case 5:if("notLoaded"==this.loadingStatus){t.next=7;break}return t.abrupt("return");case 7:return this.loadingStatus="loading",t.prev=8,t.next=11,sn(this.url);case 11:if(r=t.sent,!this.preprocess){t.next=35;break}this.labels=[],n=no(r),t.prev=15,n.s();case 17:if((o=n.n()).done){t.next=25;break}if(i=o.value,0!=this.preprocess(i)){t.next=22;break}return t.abrupt("continue",23);case 22:this.labels.push(i);case 23:t.next=17;break;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(15),n.e(t.t0);case 30:return t.prev=30,n.f(),t.finish(30);case 33:t.next=36;break;case 35:this.labels=r;case 36:this.loadingStatus="loaded",e&&e(),t.next=45;break;case 40:t.prev=40,t.t1=t.catch(8),console.log("Failed loading labels from "+this.url),this.labels=[],this.loadingStatus="failed";case 45:case"end":return t.stop()}}),t,this,[[8,40],[15,27,30,33]])})),o=function(){var t=this,e=arguments;return new Promise((function(r,o){var i=n.apply(t,e);function a(t){ro(i,r,o,a,u,"next",t)}function u(t){ro(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&io(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function uo(t){return uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uo(t)}function lo(){lo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"source-over",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function y(){}function p(){}var v={};l(v,i,(function(){return this}));var d=Object.getPrototypeOf,m=d&&d(d(P([])));m&&m!==e&&r.call(m,i)&&(v=m);var b=p.prototype=h.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,u){var l=s(t[n],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==uo(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,u)}))}u(l.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(t,e,r);if("source-over"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="source-over",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function co(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function so(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return fo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0])||arguments[0];n.legend&&t&&n.legend.selectAll("*").remove(),n.cg.initCanvasTransform(),n.cg.clear(n.cg.backgroundColor);var e=n.getZoomFactor();if(n.updateExtentGeo(),n.showBgLayers){var r,i=vo(n.bgLayers);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.visible&&(e>a.maxZoom||ec.maxZoom||ey.maxZoom||ed.maxZoom||eS.maxZoom||e0&&void 0!==arguments[0]?arguments[0]:20;return this.cg.updateExtentGeo(t)}},{key:"getCellFocusInfo",value:function(t){for(var e=this.getZoomFactor(),r=this.layers.length-1;r>=0;r--){var n=this.layers[r];if(n.visible&&n.cellInfoHTML&&"none"!==n.cellInfoHTML){var o=n.getDatasetComponent(e);if(o){var i=o.getCellFromPosition(t,o.getViewCache());if(!i)return;var a=n.cellInfoHTML(i,o.getResolution());if(!a)return;return{cell:i,html:a,resolution:o.getResolution()}}}}}},{key:"getGeoCenter",value:function(){return this.cg.getCenter()}},{key:"setGeoCenter",value:function(t){return this.cg.setCenter(t),this}},{key:"getZoomFactor",value:function(){return this.cg.getZf()}},{key:"setZoomFactor",value:function(t){return this.cg.setZf(t),this}},{key:"getZoomFactorExtent",value:function(){return this.cg.getZfExtent()}},{key:"setZoomFactorExtent",value:function(t){return this.cg.setZfExtent(t),this}},{key:"getBackgroundColor",value:function(){return this.cg.backgroundColor}},{key:"setBackgroundColor",value:function(t){return this.cg.backgroundColor=t,this}},{key:"getBoundaryLayer",value:function(){return this.boundaryLayer}},{key:"setBoundaryLayer",value:function(t){return this.boundaryLayer=new yo(t),this}},{key:"getLabelLayer",value:function(){return this.labelLayer}},{key:"setLabelLayer",value:function(t){return this.labelLayer=new ao(t),this}},{key:"redraw",value:function(){return this.cg.redraw(),this}},{key:"addLayerFromDataset",value:function(t,e,r){var n=new Gr(t,e,r);return this.layers.push(n),this}},{key:"makeLGridDataset",value:function(t,e,r){return new Yr([new En(t,e)],[],r)}},{key:"makeCSVGridDataset",value:function(t,e,r){var n=this;return new Yr([new _n(t,e,r).getData(void 0,(function(){n.cg.redraw()}))],[],r)}},{key:"makeTiledGridDataset",value:function(t,e){var r=this;return new Yr([new Hn(t,this,e).loadInfo((function(){r.cg.redraw()}))],[],e)}},{key:"makeMultiScaleCSVGridDataset",value:function(t,e,r){var n=this;return Yr.make(t,(function(t){return new _n(e(t),t,r).getData(void 0,(function(){n.cg.redraw()}))}),r)}},{key:"makeMultiScaleTiledGridDataset",value:function(t,e,r){var n=this;return Yr.make(t,(function(t){return new Hn(e(t),n,r).loadInfo((function(){n.cg.redraw()}))}),r)}},{key:"addCSVGridLayer",value:function(t,e,r,n){var o=this.makeCSVGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addTiledGridLayer",value:function(t,e,r){var n=this.makeTiledGridDataset(t,r);return this.addLayerFromDataset(n,e,r)}},{key:"addMultiScaleCSVGridLayer",value:function(t,e,r,n){var o=this.makeMultiScaleCSVGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addMultiScaleTiledGridLayer",value:function(t,e,r,n){var o=this.makeMultiScaleTiledGridDataset(t,e,n);return this.addLayerFromDataset(o,r,n)}},{key:"addBackgroundLayer",value:function(t){return this.bgLayers.push(new qn(t)),this.redraw(),this}},{key:"addBackgroundLayerWMS",value:function(t){return this.bgLayers.push(new Qn(t)),this.redraw(),this}},{key:"addZoomSlider",value:function(t,e){return this.cg.addZoomSlider(t,e),this}},{key:"setViewFromURL",value:function(){return this.cg.setViewFromURL(),this}},{key:"defineResizeObserver",value:function(t,e){var r=this;new ResizeObserver((function(n){t.clientWidth>0&&t.clientHeight>0&&window.requestAnimationFrame((function(){Array.isArray(n)&&n.length&&(r.h===t.clientHeight&&r.w===t.clientWidth||(r.h=t.clientHeight,r.w=t.clientWidth,r.cg.h=t.clientHeight,r.cg.w=t.clientWidth,e.setAttribute("width",""+r.w),e.setAttribute("height",""+r.h),r.redraw()))}))})).observe(t)}},{key:"destroy",value:function(){var t,e;this.layers=[],this.bgLayers=[],this.container.removeEventListener("mouseover",this.mouseOverHandler),this.container.removeEventListener("mousemove",this.mouseMoveHandler),this.container.removeEventListener("mouseout",this.mouseOutHandler),this.cg.canvas.remove(),null===(t=this.legend)||void 0===t||t.remove(),null===(e=this.tooltip.tooltip)||void 0===e||e.remove()}}],r&&bo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function wo(t){return wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wo(t)}function xo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return So(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?So(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function So(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.legends=[]}var e,r,n;return e=t,n=[{key:"getStatistics",value:function(t,e,r){if(t&&0!=t.length){var n,o=1/0,i=-1/0,a=xo(t);try{for(a.s();!(n=a.n()).done;){var u=+e(n.value);r&&!u||(ui&&(i=u))}}catch(t){a.e(t)}finally{a.f()}return{min:o,max:i}}}}],(r=[{key:"draw",value:function(t,e,r){throw new Error("Method draw not implemented.")}},{key:"getOffset",value:function(){return this.offset}},{key:"setOffset",value:function(t){return this.offset=t,this}},{key:"updateLegends",value:function(t){var e,r=xo(this.legends);try{for(r.s();!(e=r.n()).done;)e.value.update(t)}catch(t){r.e(t)}finally{r.f()}return this}}])&&_o(e.prototype,r),n&&_o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function jo(t){return jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jo(t)}function Po(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var s=u.value,f=this.color?this.color(s[this.colorCol],e,i,a):void 0;if(f&&"none"!==f){r.ctx.fillStyle=f;var h=this.shape?this.shape(s):"square";if("none"!==h){var y=(this.size||function(){return e})(s[this.sizeCol],e,o,a),p=this.offset(s,e,a);if("square"===h){var v=e*(1-y/e)*.5;r.ctx.fillRect(s.x+v+p.dx,s.y+v+p.dy,y,y)}else if("circle"===h)r.ctx.beginPath(),r.ctx.arc(s.x+l+p.dx,s.y+l+p.dy,.5*y,0,2*Math.PI,!1),r.ctx.fill();else if("donut"===h){var d=s.x+l+p.dx,m=s.y+l+p.dy;r.ctx.beginPath(),r.ctx.moveTo(d,m),r.ctx.arc(d,m,l,0,2*Math.PI),r.ctx.arc(d,m,(1-y/e)*l,0,2*Math.PI,!0),r.ctx.closePath(),r.ctx.fill()}else{if("diamond"!==h)throw new Error("Unexpected shape:"+h);var b=.5*y;r.ctx.beginPath(),r.ctx.moveTo(s.x+l-b,s.y+l),r.ctx.lineTo(s.x+l,s.y+l+b),r.ctx.lineTo(s.x+l+b,s.y+l),r.ctx.lineTo(s.x+l,s.y+l-b),r.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&ko(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Ao(t){return Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ao(t)}function Mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(l=s.n()).done;){var f=l.value,h=this.strokeColor?this.strokeColor(f[this.strokeColorCol],e,o):void 0;if(h&&"none"!==h){r.ctx.strokeStyle=h;var y=(this.size||function(){return e})(f[this.sizeCol],e,i,u),p=this.strokeWidth?this.strokeWidth(f[this.strokeWidthCol],e,a,u):1*u;if(p&&!(p<=0)){r.ctx.lineWidth=p;var v=this.shape?this.shape(f):"square";if("none"!==v){var d=this.offset(f,e,u);if("square"===v){var m=e*(1-y/e)*.5;r.ctx.beginPath(),r.ctx.rect(f.x+m+d.dx,f.y+m+d.dy,y,y),r.ctx.stroke()}else if("circle"===v)r.ctx.beginPath(),r.ctx.arc(f.x+c+d.dx,f.y+c+d.dy,.5*y,0,2*Math.PI,!1),r.ctx.stroke();else if("diamond"===v){var b=.5*y;r.ctx.beginPath(),r.ctx.moveTo(f.x+c-b,f.y+c),r.ctx.lineTo(f.x+c,f.y+c+b),r.ctx.lineTo(f.x+c+b,f.y+c),r.ctx.lineTo(f.x+c,f.y+c-b),r.ctx.lineTo(f.x+c-b,f.y+c),r.ctx.stroke()}else{if("donut"!==v)throw new Error("Unexpected shape:"+v);console.error("Not implemented")}}}}}}catch(t){s.e(t)}finally{s.f()}}}])&&Ro(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Io(t){return Io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Io(t)}function No(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(o=l.n()).done;){var c=o.value,s=u[c.y];s||(s={},u[c.y]=s),s[c.x]=this.height(c[this.heightCol],e,a,i)}}catch(t){l.e(t)}finally{l.f()}var f=r.extGeo;if(f){var h=Math.floor(f.xMin/e)*e,y=Math.floor(f.xMax/e)*e,p=Math.floor(f.yMin/e)*e,v=Math.floor(f.yMax/e)*e,d={min:p,max:v};r.setCanvasTransform();for(var m=v;m>=p;m-=e){var b=u[m];if(b){r.ctx.beginPath(),r.ctx.moveTo(h-e/2,m);for(var g=void 0,w=h;w<=y;w+=e){var x=b[w];x||(x=0),x||g?r.ctx.lineTo(w+e/2,m+x):r.ctx.moveTo(w+e/2,m),g=x}g&&r.ctx.lineTo(y+e/2,m);var S=this.fillColor(m,d,e,i);S&&"none"!=S&&(r.ctx.fillStyle=S,r.ctx.fill());var _=this.lineColor(m,d,e,i),O=this.lineWidth(m,d,e,i);_&&"none"!=_&&O>0&&(r.ctx.strokeStyle=_,r.ctx.lineWidth=O,r.ctx.stroke())}}}}}])&&Bo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Wo(t){return Wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wo(t)}function Uo(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||$o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $o(t,e){if(t){if("string"==typeof t)return Yo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yo(t,e):void 0}}function Yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(u=l.n()).done;){var c=u.value,s=(this.size||function(){return e})(c[this.sizeCol],e,o,i),f=this.offset(c,e,i),h=this.type?this.type(c):"flag",y=c.x+f.dx+("agepyramid"===h?0:.5*e),p=c.y+f.dy+("agepyramid"===h?0:.5*e),v=this.offsetAngle?this.offsetAngle(c,e,i)*Math.PI/180:0;if("agepyramid"===h||"radar"===h||"halftone"===h){for(var d=-1/0,m=0,b=Object.keys(this.color);md&&(d=g)}var w=0;"agepyramid"===h&&this.agePyramidHeight&&(w=(e-this.agePyramidHeight(c,e,i))/2),"radar"!==h&&"halftone"!==h||(w=Math.PI/2+v);var x="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(c,e,i):e)/a:"radar"===h||"halftone"===h?2*Math.PI/a:void 0;if(void 0===x)throw new Error("Unexpected symbol type:"+h);for(var S=0,_=Object.entries(this.color);S<_.length;S++){var O=Uo(_[S],2),j=O[0],P=O[1];if("agepyramid"===h){r.ctx.fillStyle=P;var k=s*c[j]/d;r.ctx.fillRect(y+(e-k)/2,p+w,k,x),w+=x}else if("radar"===h){r.ctx.fillStyle=P;var C=c[j],E=s/2*Math.sqrt(C/d);r.ctx.beginPath(),r.ctx.moveTo(y,p),r.ctx.arc(y,p,E,w-x,w),r.ctx.lineTo(y,p),r.ctx.fill(),w+=x}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);r.ctx.fillStyle=P;var T=c[j],A=.333*s*Math.sqrt(T/d);r.ctx.beginPath(),r.ctx.arc(y+.25*e*Math.cos(w),p+.25*e*Math.sin(w),A,0,2*Math.PI),r.ctx.fill(),w+=x}}}else{for(var M=0,R=0,L=Object.keys(this.color);Rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(c=s.n()).done;){var f=c.value,h=this.color?this.color(f[this.colorCol],e,o):void 0;if(h){var y=this.width?this.width(f[this.widthCol],e,a,u):void 0;if(y&&!(y<0)){var p=this.length?this.length(f[this.lengthCol],e,i,u):void 0;if(p&&!(p<0)){var v=this.orientation(f)*l;if(void 0!==v&&!isNaN(v)){var d=this.offset(f,e,u);r.ctx.strokeStyle=h,r.ctx.lineWidth=y;var m=f.x+e/2+d.dx,b=f.y+e/2+d.dy,g=.5*Math.cos(v)*p,w=.5*Math.sin(v)*p;r.ctx.beginPath(),r.ctx.moveTo(m-g,b-w),r.ctx.lineTo(m+g,b+w),r.ctx.stroke()}}}}}}catch(t){s.e(t)}finally{s.f()}this.updateLegends({style:this,r:e,zf:u,sColor:o,sLength:i,sWidth:a})}}])&&Qo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function ni(t){return ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ni(t)}function oi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var s=l.value,f=this.text?this.text(s[this.textCol],e,o,u):void 0;if(null!=f&&null!=f&&f+""!=""){var h=this.color?this.color(s[this.colorCol],e,i,u):void 0;if(h){r.ctx.fillStyle=h;var y=this.fontSize(s[this.fontSizeCol],e,a,u)/u,p=this.fontFamily||"Arial",v=this.fontWeight||"bold";r.ctx.font=v+" "+y+"px "+p;var d=this.offset(s,e,u);r.ctx.textAlign="center";var m=r.geoToPixX(s.x+.5*e+d.dx),b=r.geoToPixY(s.y+.5*e+d.dy)+.3*y;r.ctx.fillText(f,m,b)}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:u,sColor:i})}}])&&ii(e.prototype,r),n&&ii(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(Oo);function ci(t){return ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ci(t)}function si(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return fi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function bi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);ro&&(o=a))}}catch(t){i.e(t)}finally{i.f()}return{min:n,max:o}}}}],(r=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i=r.getZf();this.valueCol&&(o=Oo.getStatistics(t,(function(t){return t[n.valueCol]}),!0));var a=[],l=.001*e;t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var c=t[0],s=1;st.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.fillColor(v);d&&"none"!=d&&(r.ctx.fillStyle=d,r.ctx.fillRect(v.x,v.y,e,e))}}catch(t){p.e(t)}finally{p.f()}}r.ctx.lineCap="butt";for(var m=0,b=o;m1);return t+r*i*Math.sqrt(-2*Math.log(o)/o)}}return r.source=t,r}(Math.random);function Li(t,e,r){var n=document.createElement("canvas");n.setAttribute("width",t),n.setAttribute("height",e);var o=n.getContext("webgl",r);if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:n,gl:o}}function zi(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o2?n-2:0),i=2;i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Zi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r3&&void 0!==arguments[3]?arguments[3]:10,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e;var a=Fi(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float t;\n varying float vt;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vt = t;\n }\n "),u="precision mediump float;\nvarying float vt;\nuniform float alpha;\n"+function(){for(var t=[],e=0;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(f.s();!(u=f.n()).done;){var h=u.value,y=this.tFun(h[this.colorCol],e,i);null!=y&&null!=y&&(c.push(h.x+l,h.y+l),s.push(y>1?1:y<0?0:y))}}catch(t){f.e(t)}finally{f.f()}var p=this.size?this.size(e,o):e+.2*o,v=this.opacity?this.opacity(e,o):void 0;new Vi(a.gl,this.colors,this.stretching,p/o,v).draw(c,s,r.getWebGLTransform()),r.initCanvasTransform(),r.ctx.drawImage(a.canvas,0,0),this.updateLegends({style:this,r:e,zf:o,sColor:i})}else console.error("No webGL")}}}])&&Ki(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function ra(t){return ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ra(t)}function na(t,e){for(var r=0;r0&&"h"===t.or||t.value<0&&"v"===t.or?"rgba(255,255,100,"+i+")":"rgba(0,0,0,"+i+")"}:function(t,r,n,o){if(0!==t.value)return"v"===t.or?t.value<0?e.colBright:e.colDark:t.value<0?e.colDark:e.colBright},width:e.newShading?function(t,r,n,o){return e.newShadingWidthPix*o}:function(t,r,n,o){return e.widthFactor*r*Math.abs(t.value)*("v"===t.or?.5:1)},filter:e.filter})]}}],null&&na(e.prototype,null),r&&na(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ia(t){return ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ia(t)}function aa(t,e){for(var r=0;r0&&r.push(","),r.push(" c"+n);r.push(";\n"),r.push("void main(void) {\n");for(var o=0;o0&&r.push("else "),r.push("if(vi=="),r.push(o),r.push(".0) gl_FragColor = vec4(c"),r.push(o),r.push("[0], c"),r.push(o),r.push("[1], c"),r.push(o),r.push("[2], c"),r.push(o),r.push("[3]);\n");r.push("else gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}"),this.fshString=r.join("")}var e,r;return e=t,r=[{key:"draw",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=zi(t,Fi(t,t.VERTEX_SHADER,this.vshString),Fi(t,t.FRAGMENT_SHADER,this.fshString));t.useProgram(i),t.uniform1f(t.getUniformLocation(i,"sizePix"),1*o);for(var a=0;a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function va(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var s=l.value,f=this.color?this.color(s[this.colorCol],e,o):void 0;if(f&&"none"!==f){r.ctx.fillStyle=f;var h=this.offset(s,e,i),y=u(),p=u(),v=u(),d=u();this.shadowFactor>0&&(r.ctx.beginPath(),r.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),r.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),r.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),r.ctx.stroke()),r.ctx.beginPath(),r.ctx.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),r.ctx.lineTo(s.x+h.dx+e-v.x,s.y+h.dy+v.y),r.ctx.lineTo(s.x+h.dx+e-d.x,s.y+h.dy+e-d.y),r.ctx.lineTo(s.x+h.dx+p.x,s.y+h.dy+e-p.y),r.ctx.fill()}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:i,sColor:o})}}])&&ja(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function Ea(t){return Ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ea(t)}function Ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var s=u.value,f=this.color?this.color(s[this.colorCol],e,i,a):void 0;if(f&&"none"!==f){r.ctx.fillStyle=f;var h=this.shape?this.shape(s):"o";if("none"!==h){var y=(this.size||function(){return.5})(s[this.sizeCol],e,o,a)*l,p=s.x+l,v=s.y+l;if("p"===h)r.ctx.beginPath(),r.ctx.moveTo(p,v+l),r.ctx.lineTo(p+y,v+y),r.ctx.lineTo(p+l,v),r.ctx.lineTo(p+y,v-y),r.ctx.lineTo(p,v-l),r.ctx.lineTo(p-y,v-y),r.ctx.lineTo(p-l,v),r.ctx.lineTo(p-y,v+y),r.ctx.fill();else{if("o"!==h)throw new Error("Unexpected shape:"+h);r.ctx.beginPath(),r.ctx.moveTo(p,v+y),r.ctx.lineTo(p+l,v+l),r.ctx.lineTo(p+y,v),r.ctx.lineTo(p+l,v-l),r.ctx.lineTo(p,v-y),r.ctx.lineTo(p-l,v-l),r.ctx.lineTo(p-y,v),r.ctx.lineTo(p-l,v+l),r.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:o,sColor:i})}}])&&Aa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Oo);function za(t){return za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},za(t)}function Fa(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ia(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ia(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rr)&&(r=a))}}catch(t){i.e(t)}finally{i.f()}if(null!=e)return r-e},s=Fa(t);try{for(s.s();!(l=s.n()).done;){var f=c(l.value);null!=f&&(null==u||f>u)&&(u=f)}}catch(t){s.e(t)}finally{s.f()}if(u){var h=this.ts.length;r.setCanvasTransform(),r.ctx.lineCap="butt";var y,p=Fa(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.lineWidth?this.lineWidth(v[this.lineWidthCol],e,o,a):void 0;if(d&&!(d<0)){var m=this.color?this.color(v[this.colorCol],e,i,a):void 0;if(m){var b=this.offsetX?this.offsetX(v,e,a):0;if(null!=b&&!isNaN(b)){var g=this.width?this.width(v,e,a):e;if(null!=g&&!isNaN(g)){var w=this.offsetY?this.offsetY(v,e,a):0;if(null!=w&&!isNaN(w)){var x=this.height?this.height(v,e,a):e;if(null!=x&&!isNaN(x)){var S=this.anchorModeY?this.anchorModeY(v,e,a):"center";if(S){r.ctx.lineWidth=d,r.ctx.strokeStyle=m;var _=void 0,O=void 0;if("first"===S)_=v[this.ts[0]],O=0;else if("last"===S)_=v[this.ts[this.ts.length-1]],O=0;else if("bottom"===S){var j,P=Fa(this.ts);try{for(P.s();!(j=P.n()).done;){var k=+v[j.value];null!=k&&(null==_||k<_)&&(_=k)}}catch(t){P.e(t)}finally{P.f()}O=0}else if("top"===S){var C,E=Fa(this.ts);try{for(E.s();!(C=E.n()).done;){var T=+v[C.value];null!=T&&(null==_||T>_)&&(_=T)}}catch(t){E.e(t)}finally{E.f()}O=e}else{if("center"!==S){console.log("Unexpected anchorModeY: "+S);continue}var A,M=void 0,R=void 0,L=Fa(this.ts);try{for(L.s();!(A=L.n()).done;){var z=v[A.value];null!=z&&((null==M||zR)&&(R=z))}}catch(t){L.e(t)}finally{L.f()}_=.5*(+R+ +M),O=e/2}var F=g/(h-1),I=v[this.ts[0]];this.noData(I)||(r.ctx.beginPath(),r.ctx.moveTo(v.x+b,v.y+O+(I-_)*x/u+w));for(var N=void 0,B=1;B1?n[0]+n.slice(2):n,+t.slice(r+1)]}var Ya,Ha=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xa(t){if(!(e=Ha.exec(t)))throw new Error("invalid format: "+t);var e;return new Va({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Va(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function qa(t,e){var r=$a(t,e);if(!r)return t+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}Xa.prototype=Va.prototype,Va.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Ja={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>qa(100*t,e),r:qa,s:function(t,e){var r=$a(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(Ya=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+$a(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ka(t){return t}var Qa,tu,eu=Array.prototype.map,ru=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nu(t){return Qa=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?Ka:(e=eu.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var o=t.length,i=[],a=0,u=e[0],l=0;o>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),i.push(t.substring(o-=u,o+u)),!((l+=u+1)>n));)u=e[a=(a+1)%e.length];return i.reverse().join(r)}),o=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Ka:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(eu.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Xa(t)).fill,r=t.align,f=t.sign,h=t.symbol,y=t.zero,p=t.width,v=t.comma,d=t.precision,m=t.trim,b=t.type;"n"===b?(v=!0,b="g"):Ja[b]||(void 0===d&&(d=12),m=!0,b="g"),(y||"0"===e&&"="===r)&&(y=!0,e="0",r="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===h?i:/[%p]/.test(b)?l:"",x=Ja[b],S=/[defgprs%]/.test(b);function _(t){var o,i,l,h=g,_=w;if("c"===b)_=x(t)+_,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),d),m&&(t=function(t){t:for(var e,r=t.length,n=1,o=-1;n0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:c:"-"===f||"("===f?"":f)+h,_=("s"===b?ru[8+Ya/3]:"")+_+(O&&"("===f?")":""),S)for(o=-1,i=t.length;++o(l=t.charCodeAt(o))||l>57){_=(46===l?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}v&&!y&&(t=n(t,1/0));var j=h.length+t.length+_.length,P=j>1)+h+t+_+P.slice(j);break;default:t=P+h+t+_}return u(t)}return d=void 0===d?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),_.toString=function(){return t+""},_}return{format:f,formatPrefix:function(t,e){var r,n=f(((t=Xa(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=$a(Math.abs(r)))?r[1]:NaN)/3)))),i=Math.pow(10,-o),a=ru[8+o/3];return function(t){return n(i*t)+a}}}}(t),tu=Qa.format,Qa.formatPrefix,Qa}function ou(t){return ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ou(t)}function iu(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,e)},zu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,1/e)},Fu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:(Math.exp(t*e)-1)/(Math.exp(e)-1)},Iu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1-1/e*Math.log(Math.exp(e)*(1-t)+t)},Nu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8;if(0==e)return t;if(1==e)return Math.sqrt(t*(2-t));var r=e/(1-e);return Math.sqrt(1/(r*r)+t*(2/r+2-t))-1/r},Bu=function(t){return 1-Nu(1-t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8)},Du=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1/e*Math.log(1-t+t*Math.exp(e))},Gu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return(Math.exp(-e*t)-1)/(Math.exp(-e)-1)},Zu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,1/e)},Wu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,e)},Uu=Nr.getParameterByName;return nu({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})())); \ No newline at end of file diff --git a/examples/DE.html b/examples/DE.html index e57792e08..723b11ff2 100644 --- a/examples/DE.html +++ b/examples/DE.html @@ -233,7 +233,7 @@ stretching: { fun: 'expRev', alpha: -7 }, //set alpha and blend operation //alpha: (zf) => zf < 70 ? 0.75 : 1.0, - blendOperation: (zf) => zf < 10 ? "multiply" : "normal" + blendOperation: (zf) => zf < 10 ? "multiply" : "source-over" }), new gviz.StrokeStyle({ maxZoom: 7 }), ], @@ -276,7 +276,7 @@ }, //set alpha and blend operation //alpha: (zf) => zf < 70 ? 0.75 : 1.0, - blendOperation: (zf) => zf < 50 ? "multiply" : "normal" + blendOperation: (zf) => zf < 50 ? "multiply" : "source-over" }) ] }), @@ -319,7 +319,7 @@ shape: () => 'circle', sizeCol: 'TOT', size: (v, r, s, zf) => 1.3 * r * gviz.sPow(v / s.max, 0.2), - blendOperation: (zf) => zf < 4 ? "multiply" : "normal" + blendOperation: (zf) => zf < 4 ? "multiply" : "source-over" }), ], { @@ -384,7 +384,7 @@ size: (v, r, s, zf) => 1 * r * gviz.sPow(v / s.max, 0.25, 0), stripesOrientation: () => 90, //agePyramidHeight: (c, r) => 0.95 * r, - blendOperation: (zf) => zf < 6 ? "multiply" : "normal" + blendOperation: (zf) => zf < 6 ? "multiply" : "source-over" }), ], { @@ -448,7 +448,7 @@ size: (v, r, s, zf) => r * gviz.sPow(v / s.max, 0.25, 0), stripesOrientation: () => 90, //agePyramidHeight: (c, r) => 0.95 * r, - blendOperation: (zf) => zf < 4 ? "multiply" : "normal" + blendOperation: (zf) => zf < 4 ? "multiply" : "source-over" }), ], { @@ -503,7 +503,7 @@ colorCol: 'age_ratio', color: (v, r, s) => d3.interpolateSpectral(1 - v), shape: () => 'circle', - blendOperation: (zf) => zf < 4 ? "multiply" : "normal" + blendOperation: (zf) => zf < 4 ? "multiply" : "source-over" }), ], { @@ -564,7 +564,7 @@ size: sized ? (v, r, s, zf) => 1.3 * r * gviz.sPow(v / s.max, 0.25, 0) : undefined, stripesOrientation: sized ? undefined : () => 90, //agePyramidHeight: (c, r) => 0.95 * r, - blendOperation: sized ? undefined : (zf) => zf < 6 ? "multiply" : "normal" + blendOperation: sized ? undefined : (zf) => zf < 6 ? "multiply" : "source-over" }), ], { @@ -632,7 +632,7 @@ size: sized ? (v, r, s, zf) => 1.3 * r * gviz.sPow(v / s.max, 0.25, 0) : undefined, stripesOrientation: sized ? undefined : () => 90, //agePyramidHeight: (c, r) => 0.95 * r, - blendOperation: sized ? undefined : (zf) => zf < 6 ? "multiply" : "normal" + blendOperation: sized ? undefined : (zf) => zf < 6 ? "multiply" : "source-over" }), ], { @@ -700,7 +700,7 @@ size: sized ? (v, r, s, zf) => 1 * r * gviz.sPow(v / s.max, 0.25, 0) : undefined, stripesOrientation: () => 90, //agePyramidHeight: (c, r) => 0.95 * r, - blendOperation: (zf) => zf < 4 ? "multiply" : "normal" + blendOperation: (zf) => zf < 4 ? "multiply" : "source-over" }), ], { @@ -759,7 +759,7 @@ sizeCol: 'TOT', size: (v, r, s, zf) => 1 * r * gviz.sPow(v / s.max, 0.25, 0), stripesOrientation: () => 90, - blendOperation: (zf) => zf < 4 ? "multiply" : "normal" + blendOperation: (zf) => zf < 4 ? "multiply" : "source-over" }), ], { @@ -843,7 +843,7 @@ sizeCol: 'TOT', size: (v, r, s, zf) => 1 * r * gviz.sPow(v / s.max, 0.25, 0), stripesOrientation: () => 90, - blendOperation: (zf) => zf < 4 ? "multiply" : "normal" + blendOperation: (zf) => zf < 4 ? "multiply" : "source-over" }), ], { @@ -898,7 +898,7 @@ size: (v, r, s, zf) => 1.2 * r * gviz.sPow(v / s.max, 0.25, 0), //stripesOrientation: () => 90, //agePyramidHeight: (c, r) => 0.95 * r, - blendOperation: (zf) => zf < 4 ? "multiply" : "normal" + blendOperation: (zf) => zf < 4 ? "multiply" : "source-over" }), ], { diff --git a/examples/EUR.html b/examples/EUR.html index 9e928de82..1fcb67af0 100644 --- a/examples/EUR.html +++ b/examples/EUR.html @@ -238,7 +238,7 @@ colorCol: layCode_, color: d3.interpolateOrRd, stretching: { fun: 'expRev', alpha: -7 }, - blendOperation: (zf) => zf < 50 ? "multiply" : "normal" + blendOperation: (zf) => zf < 50 ? "multiply" : "source-over" }), new gviz.StrokeStyle({ strokeColorCol: layCode_, @@ -281,7 +281,7 @@ return d3.interpolateSpectral(1 - t) }, shape: () => 'square', - blendOperation: (zf) => zf < 50 ? "multiply" : "normal" + blendOperation: (zf) => zf < 50 ? "multiply" : "source-over" }), new gviz.StrokeStyle({ maxZoom: 80 }), ], @@ -474,7 +474,7 @@ color: d3.interpolateGnBu, tFun: (v, r, s) => Math.min(v, 100) / 100, stretching: { fun: 'expRev', alpha: 2 }, - blendOperation: (zf) => zf < 50 ? "multiply" : "normal" + blendOperation: (zf) => zf < 50 ? "multiply" : "source-over" }), new gviz.StrokeStyle({ strokeColorCol: 'rp', @@ -532,7 +532,7 @@ sizeCol: 'TOT_P', size: (v, r, s, zf) => 1.2 * r * gviz.sPow(v / s.max, 0.3), shape: () => 'circle', - blendOperation: (zf) => zf < 50 ? "multiply" : "normal" + blendOperation: (zf) => zf < 50 ? "multiply" : "source-over" }) //set legend popStyle.legends.push( @@ -549,7 +549,7 @@ new gviz.SquareColorCatWGLStyle({ colorCol: 'cH', color: colorsH, - blendOperation: (zf) => zf < 50 ? "multiply" : "normal" + blendOperation: (zf) => zf < 50 ? "multiply" : "source-over" }), strokeStyle, ], @@ -610,7 +610,7 @@ sizeCol: 'TOT_P', size: (v, r, s, zf) => 1.2 * r * gviz.sPow(v / s.max, 0.3), shape: () => 'circle', - blendOperation: (zf) => zf < 50 ? "multiply" : "normal" + blendOperation: (zf) => zf < 50 ? "multiply" : "source-over" }) //set legend popStyle.legends.push( @@ -627,7 +627,7 @@ new gviz.SquareColorCatWGLStyle({ colorCol: 'cE', color: colorsE, - blendOperation: (zf) => zf < 50 ? "multiply" : "normal" + blendOperation: (zf) => zf < 50 ? "multiply" : "source-over" }), strokeStyle, ], diff --git a/examples/EUR_bu.html b/examples/EUR_bu.html index 636a82963..bb94ad288 100644 --- a/examples/EUR_bu.html +++ b/examples/EUR_bu.html @@ -71,7 +71,7 @@ if (value == -999) return; return gviz.sExp(value / stats.max, -25) },*/ - blendOperation: (zf) => zf < 50 ? "multiply" : "normal" + blendOperation: (zf) => zf < 50 ? "multiply" : "source-over" }), /*new gviz.SquareColorCatWGLStyle({ diff --git a/examples/FR.html b/examples/FR.html index 40ab8a32e..61b63cd32 100644 --- a/examples/FR.html +++ b/examples/FR.html @@ -208,7 +208,7 @@ colorCol: 'ind', color: d3.interpolateYlOrRd, stretching: { fun: 'expRev', alpha: -7 }, - blendOperation: (zf) => zf < 20 ? "multiply" : "normal" + blendOperation: (zf) => zf < 20 ? "multiply" : "source-over" }), new gviz.StrokeStyle({ maxZoom: 15 }), new gviz.ShapeColorSizeStyle({ @@ -388,7 +388,7 @@ colorCol: 'age_ratio', color: (v, r, s) => d3.interpolateSpectral(1 - v), shape: () => 'circle', - blendOperation: (zf) => zf < 10 ? "multiply" : "normal" + blendOperation: (zf) => zf < 10 ? "multiply" : "source-over" }), ], { @@ -435,7 +435,7 @@ //t = t > 1 ? 1 : t < 0 ? 0 : t return 1 - Math.pow(t < 0 ? 0 : t, 1.5) }, - blendOperation: (zf) => zf < 20 ? "multiply" : "normal" + blendOperation: (zf) => zf < 20 ? "multiply" : "source-over" }), new gviz.StrokeStyle({ maxZoom: 15 }), ], @@ -467,7 +467,7 @@ return d3.interpolateYlOrRd(gviz.sPow(v, 0.65)) }, shape: () => 'circle', - blendOperation: (zf) => zf < 10 ? "multiply" : "normal" + blendOperation: (zf) => zf < 10 ? "multiply" : "source-over" }), ], { @@ -510,7 +510,7 @@ stripesOrientation: () => 90, sizeCol: "men", size: (v, r, s, zf) => 1.3 * r * gviz.sPow(v / s.max, 0.15, 0), - //blendOperation: (zf) => zf < 10 ? "multiply" : "normal" + //blendOperation: (zf) => zf < 10 ? "multiply" : "source-over" }), ], { @@ -557,7 +557,7 @@ color: (v, r, s) => v == 0 ? '#ccc' : d3.interpolateYlOrRd(gviz.sPow(v, 0.4)), shape: () => 'circle', - blendOperation: (zf) => zf < 10 ? "multiply" : "normal" + blendOperation: (zf) => zf < 10 ? "multiply" : "source-over" }), ], { @@ -598,7 +598,7 @@ colorCol: 'rMen_prop', color: (v) => d3.interpolatePuBuGn(1 - gviz.sPow(1 - v, 0.6)), shape: () => 'circle', - blendOperation: (zf) => zf < 10 ? "multiply" : "normal" + blendOperation: (zf) => zf < 10 ? "multiply" : "source-over" }), ], { @@ -637,7 +637,7 @@ colorCol: 'rMenSurf', color: d3.interpolateSpectral, tFun: (v, r, s) => 1 - (v - s.min) / (s.max - s.min), - blendOperation: (zf) => zf < 20 ? "multiply" : "normal" + blendOperation: (zf) => zf < 20 ? "multiply" : "source-over" }), new gviz.StrokeStyle({ maxZoom: 15 }), ], @@ -676,7 +676,7 @@ stripesOrientation: () => 90, sizeCol: "men", size: (v, r, s, zf) => r * gviz.sPow(v / s.max, 0.15, 0), - blendOperation: (zf) => zf < 10 ? "multiply" : "normal" + blendOperation: (zf) => zf < 10 ? "multiply" : "source-over" }), ], { @@ -725,7 +725,7 @@ //stripesOrientation: () => 90, sizeCol: "log", size: (v, r, s, zf) => r * gviz.sPow(v / s.max, 0.1, 0), - blendOperation: (zf) => zf < 10 ? "multiply" : "normal" + blendOperation: (zf) => zf < 10 ? "multiply" : "source-over" }), ], { @@ -788,7 +788,7 @@ type: () => 'ring', sizeCol: "log", size: (v, r, s, zf) => 1.3 * r * gviz.sPow(v / s.max, 0.15, 0), - blendOperation: (zf) => zf < 10 ? "multiply" : "normal" + blendOperation: (zf) => zf < 10 ? "multiply" : "source-over" }), ], { @@ -837,7 +837,7 @@ color: d3.interpolatePuBuGn, tFun: (v, r, s) => (+v == 0 ? null : v), //if (!v) return "#ccc" - blendOperation: (zf) => zf < 20 ? "multiply" : "normal" + blendOperation: (zf) => zf < 20 ? "multiply" : "source-over" }), new gviz.StrokeStyle({ maxZoom: 15 }), ], diff --git a/examples/FR_pop.html b/examples/FR_pop.html index 1787ce601..05284e05e 100644 --- a/examples/FR_pop.html +++ b/examples/FR_pop.html @@ -97,7 +97,7 @@ let containerDiv = document.getElementById('viz-container') const app = new gviz.App(containerDiv) - .setZoomFactorExtent([10, 1500]) + .setZoomFactorExtent([3, 1500]) .setViewFromURL() //load datasets, one per geo region @@ -173,6 +173,7 @@ colorCol: year, color: colR, stretching: { fun: 'expRev', alpha: -7 }, + blendOperation: (zf) => zf < 25 ? "multiply" : "source-over" }), new gviz.StrokeStyle({ strokeColorCol: year, @@ -211,6 +212,7 @@ colorCol: year, color: colR, stretching: { fun: 'expRev', alpha: -7 }, + //blendOperation: (zf) => zf < 25 ? "multiply" : "source-over" }), new gviz.StrokeStyle({ strokeColorCol: year, diff --git a/examples/NO.html b/examples/NO.html index 8d2af78ba..7354a1494 100644 --- a/examples/NO.html +++ b/examples/NO.html @@ -175,7 +175,7 @@ stretching: { fun: 'expRev', alpha: -7 }, //set alpha and blend operation //alpha: (zf) => zf < 70 ? 0.75 : 1.0, - //blendOperation: (zf) => zf < 10 ? "multiply" : "normal" + //blendOperation: (zf) => zf < 10 ? "multiply" : "source-over" }), //show stroke for low resolutions new gviz.StrokeStyle({ maxZoom: 7 }), @@ -226,7 +226,7 @@ }, //set alpha and blend operation //alpha: (zf) => zf < 70 ? 0.75 : 1.0, - blendOperation: (zf) => zf < 50 ? "multiply" : "normal" + blendOperation: (zf) => zf < 50 ? "multiply" : "source-over" }) ] }), @@ -267,7 +267,7 @@ shape: () => 'circle', sizeCol: 'p', size: (v, r, s, zf) => 1.3 * r * gviz.sPow(v / s.max, 0.2), - blendOperation: (zf) => zf < 4 ? "multiply" : "normal" + blendOperation: (zf) => zf < 4 ? "multiply" : "source-over" }), ], {