Socket
Socket
Sign inDemoInstall

vega-scenegraph

Package Overview
Dependencies
Maintainers
2
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-scenegraph - npm Package Compare versions

Comparing version 2.0.0-beta.30 to 2.0.0-beta.31

4

build/vega-scenegraph.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("vega-loader"),require("d3-shape"),require("d3-path")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-loader","d3-shape","d3-path"],e):e(t.vega=t.vega||{},t.vega,t.vega,t.d3,t.d3)}(this,function(t,e,n,i,r){"use strict";function o(t){this.clear(),t&&this.union(t)}function s(t){this.mark=t,this.bounds=this.bounds||new o}function a(t){s.call(this,t),this.items=this.items||[]}function u(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function l(t,e){e=e.toLowerCase();for(var n=t.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===e)return n[i]}function h(t,e,n,i){var r,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=u(t.ownerDocument,n,i),t.insertBefore(o,r)),o}function c(t,e){for(var n=t.childNodes,i=n.length;i>e;)t.removeChild(n[--i]);return t}function f(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function d(t){this._pending=0,this._loader=t||n.loader()}function v(t){t._pending+=1}function g(t){t._pending-=1}function p(t,e,n){var i=Se.hasOwnProperty(t)&&Se[t],r=null;return i&&(r=i.curve||i[e||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}function y(t,e,n,i,r,o,s,a,u){var l=Ee.call(arguments);if(Oe[l])return Oe[l];var h=s*(Math.PI/180),c=Math.sin(h),f=Math.cos(h);n=Math.abs(n),i=Math.abs(i);var d=f*(a-t)*.5+c*(u-e)*.5,v=f*(u-e)*.5-c*(a-t)*.5,g=d*d/(n*n)+v*v/(i*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);var p=f/n,y=c/n,_=-c/i,m=f/i,x=p*a+y*u,b=_*a+m*u,k=p*t+y*e,w=_*t+m*e,M=(k-x)*(k-x)+(w-b)*(w-b),T=1/M-.25;T<0&&(T=0);var A=Math.sqrt(T);o==r&&(A=-A);var C=.5*(x+k)-A*(w-b),z=.5*(b+w)+A*(k-x),P=Math.atan2(b-z,x-C),L=Math.atan2(w-z,k-C),S=L-P;S<0&&1===o?S+=2*Math.PI:S>0&&0===o&&(S-=2*Math.PI);for(var I=Math.ceil(Math.abs(S/(.5*Math.PI+.001))),q=[],N=0;N<I;++N){var O=P+N*S/I,R=P+(N+1)*S/I;q[N]=[C,z,O,R,n,i,c,f]}return Oe[l]=q}function _(t){var e=Ee.call(t);if(Re[e])return Re[e];var n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],u=t[6],l=t[7],h=l*s,c=-u*a,f=u*s,d=l*a,v=Math.cos(r),g=Math.sin(r),p=Math.cos(o),y=Math.sin(o),_=.5*(o-r),m=Math.sin(.5*_),x=8/3*m*m/Math.sin(_),b=n+v-x*g,k=i+g+x*v,w=n+p,M=i+y,T=w+x*y,A=M-x*p;return Re[e]=[h*b+c*k,f*b+d*k,h*T+c*A,f*T+d*A,h*w+c*M,f*w+d*M]}function m(t,e){var n=De[0]=t[0];if("a"===n||"A"===n)De[1]=e*t[1],De[2]=e*t[2],De[6]=e*t[6],De[7]=e*t[7];else for(var i=1,r=t.length;i<r;++i)De[i]=e*t[i];return De}function x(t,e,n,i){for(var r=y(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),o=0;o<r.length;++o){var s=_(r[o]);t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}function b(t){return We.hasOwnProperty(t)?We[t]:k(t)}function k(t){if(!je.hasOwnProperty(t)){var e=Ne(t);je[t]={draw:function(t,n){Ve(t,e,0,0,Math.sqrt(n)/2)}}}return je[t]}function w(t){return t.x}function M(t){return t.y}function T(t){return t.width}function A(t){return t.height}function C(t){return function(){return t}}function z(t){return t.x||0}function P(t){return t.y||0}function L(t){return t.width||0}function S(t){return t.size||1}function I(t){return t.height||0}function q(t){return(t.x||0)+(t.width||0)}function N(t){return(t.y||0)+(t.height||0)}function O(t){return t.cornerRadius||0}function R(t){return t.padAngle||0}function E(t){return!(t.defined===!1)}function D(t){return null==t.size?64:t.size}function V(t){return b(t.shape||"circle")}function H(t,e){return Je.context(t)(e)}function G(t,e){var n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?Ye:Qe).curve(p(i,n.orient,n.tension)).context(t)(e)}function W(t,e){var n=e[0],i=n.interpolate||"linear";return Ze.curve(p(i,n.orient,n.tension)).context(t)(e)}function j(t,e,n,i){return $e.context(t)(e,n,i)}function B(t,e){return(e.mark.shape||e.shape).context(t)(e)}function U(t,e){return Fe.context(t)(e)}function X(t,e){return Ke.context(t)(e)}function J(t){return Le=t,J}function Q(){}function Y(t,e){Le.add(t,e)}function Z(t,e){return t.zindex-e.zindex||t.index-e.index}function $(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,o=[];for(n=0,i=r.length;n<i;++n)e=r[n],e.index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(Z)}function F(t,e){var n,i,r=t.items;if(r&&r.length){var o=$(t);if(o&&o.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||e(r[n]);r=o}for(n=0,i=r.length;n<i;++n)e(r[n])}}function K(t,e){var n,i,r=t.items;if(!r||!r.length)return null;var o=$(t);for(o&&o.length&&(r=o),i=r.length;--i>=0;)if(n=e(r[i]))return n;if(r===o)for(r=t.items,i=r.length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function tt(t){return function(e,n,i){F(n,function(n){i&&!i.intersects(n.bounds)||nt(t,e,n,n)})}}function et(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||nt(t,e,n.items[0],n.items)}}function nt(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(n.fill&&ln(e,n,r)&&e.fill(),n.stroke&&cn(e,n,r)&&e.stroke()))}function it(t){return t||(t=fn),function(e,n,i,r,o,s){return e.pixelRatio>1&&(i*=e.pixelRatio,r*=e.pixelRatio),K(n,function(n){var a=n.bounds;if((!a||a.contains(o,s))&&a)return t(e,n,i,r,o,s)?n:void 0})}}function rt(t,e){return function(n,i,r,o){var s,a,u=Array.isArray(i)?i[0]:i,l=null==e?u.fill:e,h=u.stroke&&n.isPointInStroke;return h&&(s=u.strokeWidth,a=u.strokeCap,n.lineWidth=null!=s?s:1,n.lineCap=null!=a?a:"butt"),!t(n,i)&&(l&&n.isPointInPath(r,o)||h&&n.isPointInStroke(r,o))}}function ot(t){return it(rt(t))}function st(t,e){t("transform",vn(e))}function at(t,e){var n=e.stroke?.5:0;t("class","background"),t("d",j(null,e,n,n))}function ut(t,e,n){var i=e.clip?mn(n,e,e):null;t("clip-path",i)}function lt(t,e){if(!e.clip&&e.items)for(var n=e.items,i=0,r=n.length;i<r;++i)t.union(n[i].bounds);return(e.clip||e.width||e.height)&&tn(t.add(0,0).add(e.width||0,e.height||0),e),t.translate(e.x||0,e.y||0)}function ht(t,e,n){var i=this;F(e,function(e){var r,o,s=e.x||0,a=e.y||0,u=e.width||0,l=e.height||0;t.save(),t.translate(s,a),(e.stroke||e.fill)&&(o=null==e.opacity?1:e.opacity,o>0&&(t.beginPath(),r=e.stroke?.5:0,j(t,e,r,r),e.fill&&ln(t,e,o)&&t.fill(),e.stroke&&cn(t,e,o)&&t.stroke())),e.clip&&(t.beginPath(),t.rect(0,0,u,l),t.clip()),n&&n.translate(-s,-a),F(e,function(e){i.draw(t,e,n)}),n&&n.translate(s,a),t.restore()})}function ct(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;var s=this;return K(e,function(a){var u,l,h,c;if(c=a.bounds,!c||c.contains(r,o))return l=a.x||0,h=a.y||0,t.save(),t.translate(l,h),l=r-l,h=o-h,u=K(a,function(t){return ft(t,l,h)?s.pick(t,n,i,l,h):null}),t.restore(),u?u:(u=e.interactive!==!1&&(a.fill||a.stroke)&&l>=0&&l<=a.width&&h>=0&&h<=a.height,u?a:null)})}function ft(t,e,n){return(t.interactive!==!1||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}function dt(t,e){var n=t.image;return n&&n.url===t.url||(n={loaded:!1,width:0,height:0},e.loadImage(t.url).then(function(e){t.image=e,t.image.url=t.url})),n}function vt(t,e){return"center"===t?e/2:"right"===t?e:0}function gt(t,e){return"middle"===t?e/2:"bottom"===t?e:0}function pt(t,e,n){var i=dt(e,n),r=e.x||0,o=e.y||0,s=(null!=e.width?e.width:i.width)||0,a=(null!=e.height?e.height:i.height)||0,u=e.aspect===!1?"none":"xMidYMid";r-=vt(e.align,s),o-=gt(e.baseline,a),t("href",i.src||"","http://www.w3.org/1999/xlink","xlink:href"),t("transform",dn(r,o)),t("width",s),t("height",a),t("preserveAspectRatio",u)}function yt(t,e){var n=e.image,i=e.x||0,r=e.y||0,o=(null!=e.width?e.width:n&&n.width)||0,s=(null!=e.height?e.height:n&&n.height)||0;return i-=vt(e.align,o),r-=gt(e.baseline,s),t.set(i,r,i+o,r+s)}function _t(t,e,n){var i=this;F(e,function(e){if(!n||n.intersects(e.bounds)){var r,o,s,a,u=dt(e,i),l=e.x||0,h=e.y||0,c=(null!=e.width?e.width:u.width)||0,f=(null!=e.height?e.height:u.height)||0;l-=vt(e.align,c),h-=gt(e.baseline,f),e.aspect!==!1&&(o=u.width/u.height,s=e.width/e.height,o===o&&s===s&&o!==s&&(s<o?(a=c/o,h+=(f-a)/2,f=a):(a=f*o,l+=(c-a)/2,c=a))),u.loaded&&(t.globalAlpha=null!=(r=e.opacity)?r:1,t.drawImage(u,l,h,c,f))}})}function mt(t,e){t("transform",vn(e)),t("d",e.path)}function xt(t,e){var n=e.path;if(null==n)return!0;var i=e.pathCache;i&&i.path===n||((e.pathCache=i=Ne(n)).path=n),Ve(t,i,e.x,e.y)}function bt(t,e){return xt(J(t),e)?t.set(0,0,0,0):tn(t,e)}function kt(t,e){t("d",j(null,e))}function wt(t,e){var n,i;return tn(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)}function Mt(t,e){t.beginPath(),j(t,e)}function Tt(t,e){t("transform",vn(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)}function At(t,e){var n,i;return tn(t.set(n=e.x||0,i=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i),e)}function Ct(t,e,n){var i,r,o,s;return!(!e.stroke||!cn(t,e,n))&&(i=e.x||0,r=e.y||0,o=null!=e.x2?e.x2:i,s=null!=e.y2?e.y2:r,t.beginPath(),t.moveTo(i,r),t.lineTo(o,s),!0)}function zt(t,e,n){F(e,function(e){if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&Ct(t,e,i)&&t.stroke()}})}function Pt(t,e,n,i){return!!t.isPointInStroke&&(Ct(t,e,1)&&t.isPointInStroke(n,i))}function Lt(t){return sn=Nt(t),St(Rt(t))}function St(t){return~~(.8*t.length*sn)}function It(t){return on.font=Dt(t),qt(Rt(t))}function qt(t){return on.measureText(t).width}function Nt(t){return null!=t.fontSize?t.fontSize:11}function Ot(t){on=t&&(on=Ce(1,1))?on.getContext("2d"):null,zn.width=on?It:Lt}function Rt(t){var e=t.text;return null==e?"":t.limit>0?Et(t):e+""}function Et(t){var e=+t.limit,n=t.text+"",i=on?(on.font=Dt(t),qt):(sn=Nt(t),St);if(i(n)<e)return n;var r,o=t.ellipsis||"…",s="rtl"===t.dir,a=0,u=n.length;if(e-=i(o),s){for(;a<u;)r=a+u>>>1,i(n.slice(r))>e?a=r+1:u=r;return o+n.slice(a)}for(;a<u;)r=1+(a+u>>>1),i(n.slice(0,r))<e?a=r:u=r-1;return n.slice(0,a)+o}function Dt(t,e){var n=t.font;return e&&n&&(n=String(n).replace(/\"/g,"'")),""+(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Nt(t)+"px "+(n||"sans-serif")}function Vt(t){var e=t.baseline,n=Nt(t);return Math.round("top"===e?.93*n:"middle"===e?.3*n:"bottom"===e?-.21*n:0)}function Ht(t,e){var n,i=e.dx||0,r=(e.dy||0)+Vt(e),o=e.x||0,s=e.y||0,a=e.angle||0,u=e.radius||0;u&&(n=(e.theta||0)-Math.PI/2,o+=u*Math.cos(n),s+=u*Math.sin(n)),t("text-anchor",Pn[e.align]||"start"),a?(n=dn(o,s)+" rotate("+a+")",(i||r)&&(n+=" "+dn(i,r))):n=dn(o+i,s+r),t("transform",n)}function Gt(t,e,n){var i,r,o=zn.height(e),s=e.align,a=e.radius||0,u=e.x||0,l=e.y||0,h=e.dx||0,c=(e.dy||0)+Vt(e)-Math.round(.8*o);return a&&(r=(e.theta||0)-Math.PI/2,u+=a*Math.cos(r),l+=a*Math.sin(r)),i=zn.width(e),"center"===s?h-=i/2:"right"===s&&(h-=i),t.set(h+=u,c+=l,h+i,c+o),e.angle&&!n&&t.rotate(e.angle*Math.PI/180,u,l),t.expand(n?0:1)}function Wt(t,e,n){F(e,function(e){var i,r,o,s,a,u;n&&!n.intersects(e.bounds)||(u=Rt(e))&&(i=null==e.opacity?1:e.opacity,0!==i&&(t.font=Dt(e),t.textAlign=e.align||"left",r=e.x||0,o=e.y||0,(s=e.radius)&&(a=(e.theta||0)-Math.PI/2,r+=s*Math.cos(a),o+=s*Math.sin(a)),e.angle&&(t.save(),t.translate(r,o),t.rotate(e.angle*Math.PI/180),r=o=0),r+=e.dx||0,o+=(e.dy||0)+Vt(e),e.fill&&ln(t,e,i)&&t.fillText(u,r,o),e.stroke&&cn(t,e,i)&&t.strokeText(u,r,o),e.angle&&t.restore()))})}function jt(t,e,n,i,r,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var s=Gt(Ln,e,!0),a=-e.angle*Math.PI/180,u=Math.cos(a),l=Math.sin(a),h=e.x,c=e.y,f=u*r-l*o+(h-h*u+c*l),d=l*r+u*o+(c-h*l-c*u);return s.contains(f,d)}function Bt(t,e){return JSON.stringify(t,En,e)}function Ut(t){var e="string"==typeof t?JSON.parse(t):t;return Xt(e)}function Xt(t){var e,n,i,r=t.marktype,o=t.items;if(o)for(n=0,i=o.length;n<i;++n)e=r?"mark":"group",o[n][e]=t,o[n].zindex&&(o[n][e].zdirty=!0),"group"===(r||e)&&Xt(o[n]);return r&&Rn(t),t}function Jt(t){arguments.length?this.root=Ut(t):(this.root=Qt({marktype:"group",name:"root",role:"frame"}),this.root.items=[new a(this.root)])}function Qt(t,e){return{bounds:new o,clip:!!t.clip,group:e,interactive:t.interactive!==!1,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0}}function Yt(t){this._active=null,this._handlers={},this._loader=t||n.loader()}function Zt(t){this._el=null,this._bgcolor=null,this._loader=new d(t)}function $t(t){Yt.call(this,t),this._down=null,this._touch=null,this._first=!0}function Ft(t,e,n){return function(i){var r=this._active,o=this.pickEvent(i);o===r?this.fire(t,i):(r&&r.exit||this.fire(n,i),this._active=o,this.fire(e,i),this.fire(t,i))}}function Kt(t){return function(e){this.fire(t,e),this._active=null}}function te(t){Zt.call(this,t),this._redraw=!1,this._dirty=new o}function ee(t,e,n){return e.expand(1).round(),e.translate(-(n[0]%1),-(n[1]%1)),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}function ne(t,e){if(null==e)return t;for(var n=Qn.clear().union(t);null!=e;e=e.mark.group)n.translate(e.x||0,e.y||0);return n}function ie(t){Yt.call(this,t);var e=this;e._hrefHandler=re(e,function(t,n){n&&n.href&&e.handleHref(t,n,n.href)}),e._tooltipHandler=re(e,function(t,n){n&&n.tooltip&&e.handleTooltip(t,n,"mouseover"===t.type?n.tooltip:null)})}function re(t,e){return function(n){var i=n.target,r=i.__data__;n.vegaType=n.type,r=Array.isArray(r)?r[0]:r,e.call(t._obj,n,r)}}function oe(t,e,n){var i,r,o="<"+t;if(e)for(i in e)r=e[i],null!=r&&(o+=" "+i+'="'+r+'"');return n&&(o+=" "+n),o+">"}function se(t){return"</"+t+">"}function ae(t){Zt.call(this,t),this._dirtyID=1,this._dirty=[],this._svg=null,this._root=null,this._defs=null}function ue(t,e,n){var i,r,o;for(t=h(t,n,"linearGradient",Kn),t.setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2),i=0,r=e.stops.length;i<r;++i)o=h(t,i,"stop",Kn),o.setAttribute("offset",e.stops[i].offset),o.setAttribute("stop-color",e.stops[i].color);c(t,i)}function le(t,e,n){var i;t=h(t,n,"clipPath",Kn),t.setAttribute("id",e.id),i=h(t,0,"rect",Kn),i.setAttribute("x",0),i.setAttribute("y",0),i.setAttribute("width",e.width),i.setAttribute("height",e.height)}function he(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function ce(t,e,n){e=e.lastChild;var i,r=0;F(n,function(n){i=t.draw(e,n,i),++r}),c(e,1+r)}function fe(t,e,n,i){var r,o=t._svg;if(!o&&(r=e.ownerDocument,o=u(r,i,Kn),t._svg=o,t.mark&&(o.__data__=t,o.__values__={fill:"default"},"g"===i))){var s=u(r,"path",Kn);s.setAttribute("class","background"),o.appendChild(s),s.__data__=t;var a=u(r,"g",Kn);o.appendChild(a),a.__data__=t}return(r||o.previousSibling!==n)&&e.insertBefore(o,n?n.nextSibling:e.firstChild),o}function de(t,e,n){e!==ii[t]&&(null!=e?n?ni.setAttributeNS(n,t,e):ni.setAttribute(t,e):n?ni.removeAttributeNS(n,t):ni.removeAttribute(t),ii[t]=e)}function ve(){return"undefined"!=typeof window?window.location.href:""}function ge(t){Zt.call(this,t),this._text={head:"",root:"",foot:"",defs:"",body:""},this._defs={clip_id:1,gradient:{},clipping:{}}}function pe(t,e,n,i){ai[i||t]=e}function ye(t,e,n,i){if(null==t)return"";var r,o,s,a,u,l="";for("bgrect"===n&&e.interactive===!1&&(l+="pointer-events: none;"),"text"===n&&(l+="font: "+Dt(t)+";"),r=0,o=Fn.length;r<o;++r)s=Fn[r],a=$n[s],u=t[s],null==u?"fill"===a&&(l+=(l.length?" ":"")+"fill: none;"):(u.id&&(i.gradient[u.id]=u,u="url(#"+u.id+")"),l+=(l.length?" ":"")+a+": "+u+";");return l?'style="'+l+'"':null}function _e(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function me(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(di[t]=e,this):di[t]}function xe(t,n,i){return t===n||("path"===i?be(t,n):t instanceof Date&&n instanceof Date?+t===+n:e.isNumber(t)&&e.isNumber(n)?Math.abs(t-n)<=vi:t&&n&&(e.isObject(t)||e.isObject(n))?null!=t&&null!=n&&ke(t,n):t==n)}function be(t,e){return xe(Ne(t),Ne(e))}function ke(t,e){var n,i,r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(r.sort(),o.sort(),i=r.length-1;i>=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(n=r[i],!xe(t[n],e[n],n))return!1;return typeof t==typeof e}var we=o.prototype;we.clone=function(){return new o(this)},we.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},we.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},we.set=function(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},we.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},we.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},we.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},we.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},we.rotate=function(t,e,n){var i=Math.cos(t),r=Math.sin(t),o=e-e*i+n*r,s=n-e*r-n*i,a=this.x1,u=this.x2,l=this.y1,h=this.y2;return this.clear().add(i*a-r*l+o,r*a+i*l+s).add(i*a-r*h+o,r*a+i*h+s).add(i*u-r*l+o,r*u+i*l+s).add(i*u-r*h+o,r*u+i*h+s)},we.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},we.intersect=function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},we.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},we.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},we.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},we.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},we.width=function(){return this.x2-this.x1},we.height=function(){return this.y2-this.y1};var Me=0,Te=function(t,e){var n,i=[];return n={id:"gradient_"+Me++,x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}};e.inherits(a,s);var Ae;try{Ae=require("canvas")}catch(t){Ae=null}var Ce=function(t,e){var n=u(null,"canvas");if(n&&n.getContext)n.width=t,n.height=e;else if(Ae)try{n=new Ae(t,e)}catch(t){n=null}return n},ze="undefined"!=typeof Image?Image:Ae&&Ae.Image||null,Pe=d.prototype;Pe.pending=function(){return this._pending},Pe.sanitizeURL=function(t){var e=this;return v(e),e._loader.sanitize(t,{context:"href"}).then(function(t){return g(e),t}).catch(function(){return g(e),null})},Pe.loadImage=function(t){var e=this;return v(e),e._loader.sanitize(t,{context:"image"}).then(function(t){var n=t.href;if(!n||!ze)throw"Image unsupported.";var i=new ze;return i.onload=function(){g(e),i.loaded=!0},i.onerror=function(){g(e),i.loaded=!1},i.src=n,i}).catch(function(){return g(e),{loaded:!1,width:0,height:0}})},Pe.ready=function(){var t=this;return new Promise(function(e){function n(i){t.pending()?setTimeout(function(){n(!0)},10):e(i)}n(!1)})};var Le,Se={basis:{curve:i.curveBasis},"basis-closed":{curve:i.curveBasisClosed},"basis-open":{curve:i.curveBasisOpen},bundle:{curve:i.curveBundle,tension:"beta",value:.85},cardinal:{curve:i.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:i.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:i.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:i.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:i.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:i.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:i.curveLinear},"linear-closed":{curve:i.curveLinearClosed},monotone:{horizontal:i.curveMonotoneY,vertical:i.curveMonotoneX},natural:{curve:i.curveNatural},step:{curve:i.curveStep},"step-after":{curve:i.curveStepAfter},"step-before":{curve:i.curveStepBefore}},Ie={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},qe=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/],Ne=function(t){var e,n,i,r,o,s,a,u,l,h,c,f=[];for(e=t.slice().replace(qe[0],"###$1").split(qe[1]).slice(1),u=0,h=e.length;u<h;++u){for(n=e[u],i=n.slice(1).trim().replace(qe[2],"$1###$2").split(qe[3]),s=n.charAt(0),r=[s],l=0,c=i.length;l<c;++l)(o=+i[l])===o&&r.push(o);if(a=Ie[s.toLowerCase()],r.length-1>a)for(l=1,c=r.length;l<c;l+=a)f.push([s].concat(r.slice(l,l+a)));else f.push(r)}return f},Oe={},Re={},Ee=[].join,De=["l",0,0,0,0,0,0,0],Ve=function(t,e,n,i,r){var o,s,a,u,l,h=null,c=0,f=0,d=0,v=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),t.beginPath&&t.beginPath();for(var g=0,p=e.length;g<p;++g){switch(o=e[g],1!==r&&(o=m(o,r)),o[0]){case"l":c+=o[1],f+=o[2],t.lineTo(c+n,f+i);break;case"L":c=o[1],f=o[2],t.lineTo(c+n,f+i);break;case"h":c+=o[1],t.lineTo(c+n,f+i);break;case"H":c=o[1],t.lineTo(c+n,f+i);break;case"v":f+=o[1],t.lineTo(c+n,f+i);break;case"V":f=o[1],t.lineTo(c+n,f+i);break;case"m":c+=o[1],f+=o[2],t.moveTo(c+n,f+i);break;case"M":c=o[1],f=o[2],t.moveTo(c+n,f+i);break;case"c":s=c+o[5],a=f+o[6],d=c+o[3],v=f+o[4],t.bezierCurveTo(c+o[1]+n,f+o[2]+i,d+n,v+i,s+n,a+i),c=s,f=a;break;case"C":c=o[5],f=o[6],d=o[3],v=o[4],t.bezierCurveTo(o[1]+n,o[2]+i,d+n,v+i,c+n,f+i);break;case"s":s=c+o[3],a=f+o[4],d=2*c-d,v=2*f-v,t.bezierCurveTo(d+n,v+i,c+o[1]+n,f+o[2]+i,s+n,a+i),d=c+o[1],v=f+o[2],c=s,f=a;break;case"S":s=o[3],a=o[4],d=2*c-d,v=2*f-v,t.bezierCurveTo(d+n,v+i,o[1]+n,o[2]+i,s+n,a+i),c=s,f=a,d=o[1],v=o[2];break;case"q":s=c+o[3],a=f+o[4],d=c+o[1],v=f+o[2],t.quadraticCurveTo(d+n,v+i,s+n,a+i),c=s,f=a;break;case"Q":s=o[3],a=o[4],t.quadraticCurveTo(o[1]+n,o[2]+i,s+n,a+i),c=s,f=a,d=o[1],v=o[2];break;case"t":s=c+o[1],a=f+o[2],null===h[0].match(/[QqTt]/)?(d=c,v=f):"t"===h[0]?(d=2*c-u,v=2*f-l):"q"===h[0]&&(d=2*c-d,v=2*f-v),u=d,l=v,t.quadraticCurveTo(d+n,v+i,s+n,a+i),c=s,f=a,d=c+o[1],v=f+o[2];break;case"T":s=o[1],a=o[2],d=2*c-d,v=2*f-v,t.quadraticCurveTo(d+n,v+i,s+n,a+i),c=s,f=a;break;case"a":x(t,c+n,f+i,[o[1],o[2],o[3],o[4],o[5],o[6]+c+n,o[7]+f+i]),c+=o[6],f+=o[7];break;case"A":x(t,c+n,f+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),c=o[6],f=o[7];break;case"z":case"Z":t.closePath()}h=o}},He=2*Math.PI,Ge=Math.sqrt(3)/2,We={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,He)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i),t.lineTo(-n,i),t.lineTo(-i,i),t.lineTo(-i,n),t.lineTo(i,n),t.lineTo(i,i),t.lineTo(n,i),t.lineTo(n,-i),t.lineTo(i,-i),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-i,-i),t.closePath()}},diamond:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=Ge*n;t.moveTo(0,-i),t.lineTo(-n,i),t.lineTo(n,i),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=Ge*n;t.moveTo(0,i),t.lineTo(-n,-i),t.lineTo(n,-i),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=Ge*n;t.moveTo(i,0),t.lineTo(-i,-n),t.lineTo(-i,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=Ge*n;t.moveTo(-i,0),t.lineTo(i,-n),t.lineTo(i,n),t.closePath()}}},je={},Be=function(){function t(t,u,l){var h,c=null!=u?u:+e.call(this,t),f=null!=l?l:+n.call(this,t),d=+i.call(this,t),v=+o.call(this,t),g=+s.call(this,t);if(a||(a=h=r.path()),g<=0)a.rect(c,f,d,v);else{var p=c+d,y=f+v;a.moveTo(c+g,f),a.lineTo(p-g,f),a.quadraticCurveTo(p,f,p,f+g),a.lineTo(p,y-g),a.quadraticCurveTo(p,y,p-g,y),a.lineTo(c+g,y),a.quadraticCurveTo(c,y,c,y-g),a.lineTo(c,f+g),a.quadraticCurveTo(c,f,c+g,f),a.closePath()}if(h)return a=null,h+""||null}var e=w,n=M,i=T,o=A,s=C(0),a=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:C(+n),t):e},t.y=function(e){return arguments.length?(n="function"==typeof e?e:C(+e),t):n},t.width=function(e){return arguments.length?(i="function"==typeof e?e:C(+e),t):i},t.height=function(e){return arguments.length?(o="function"==typeof e?e:C(+e),t):o},t.cornerRadius=function(e){return arguments.length?(s="function"==typeof e?e:C(+e),t):s},t.context=function(e){return arguments.length?(a=null==e?null:e,t):a},t},Ue=Math.PI,Xe=function(){function t(t,e,n){var i=n/2;if(a){var r=l-e,o=t-u;if(r||o){var s=Math.sqrt(r*r+o*o),f=(r/=s)*h,d=(o/=s)*h,v=Math.atan2(o,r);c.moveTo(u-f,l-d),c.lineTo(t-r*i,e-o*i),c.arc(t,e,i,v-Ue,v),c.lineTo(u+f,l+d),c.arc(u,l,h,v,v+Ue)}else c.arc(t,e,i,0,2*Ue);c.closePath()}else a=1;u=t,l=e,h=i}function e(e){var u,l,h,f=e.length,d=!1;for(null==c&&(c=h=r.path()),u=0;u<=f;++u)!(u<f&&s(l=e[u],u,e))===d&&(d=!d)&&(a=0),d&&t(+n(l,u,e),+i(l,u,e),+o(l,u,e));if(h)return c=null,h+""||null}var n,i,o,s,a,u,l,h,c=null;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=t,e):i},e.size=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(s=t,e):s},e.context=function(t){return arguments.length?(c=null==t?null:t,e):c},e},Je=i.arc().cornerRadius(O).padAngle(R),Qe=i.area().x(z).y1(P).y0(N).defined(E),Ye=i.area().y(P).x1(z).x0(q).defined(E),Ze=i.line().x(z).y(P).defined(E),$e=Be().x(z).y(P).width(L).height(I).cornerRadius(O),Fe=i.symbol().type(V).size(D),Ke=Xe().x(z).y(P).defined(E).size(S),tn=function(t,e){return e.stroke&&0!==e.opacity&&0!==e.strokeOpacity&&t.expand(null!=e.strokeWidth?+e.strokeWidth:1),t},en=2*Math.PI,nn=en/4,rn=en-1e-8;J.beginPath=Q,J.closePath=Q,J.moveTo=Y,J.lineTo=Y,J.rect=function(t,e,n,i){Y(t,e),Y(t+n,e+i)},J.quadraticCurveTo=function(t,e,n,i){Y(t,e),Y(n,i)},J.bezierCurveTo=function(t,e,n,i,r,o){Y(t,e),Y(n,i),Y(r,o)},J.arc=function(t,e,n,i,r,o){function s(t){l=n*Math.cos(t),h=n*Math.sin(t),l<c&&(c=l),l>f&&(f=l),h<d&&(d=h),h>v&&(v=h)}if(Math.abs(r-i)>rn)return Y(t-n,e-n),void Y(t+n,e+n);var a,u,l,h,c=1/0,f=-(1/0),d=1/0,v=-(1/0);if(s(i),s(r),r!==i)if(i%=en,i<0&&(i+=en),r%=en,r<0&&(r+=en),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=en,a=i-i%nn,u=0;u<3&&a>r;++u,a-=nn)s(a);else for(a=i-i%nn+nn,u=0;u<3&&a<r;++u,a+=nn)s(a);Y(t+c,e+d),Y(t+f,e+v)};var on,sn,an=function(t,e,n){for(var i=n.width(),r=n.height(),o=n.x1+e.x1*i,s=n.y1+e.y1*r,a=n.x1+e.x2*i,u=n.y1+e.y2*r,l=e.stops,h=0,c=l.length,f=t.createLinearGradient(o,s,a,u);h<c;++h)f.addColorStop(l[h].offset,l[h].color);return f},un=function(t,e,n){return n.id?an(t,n,e.bounds):n},ln=function(t,e,n){return n*=null==e.fillOpacity?1:e.fillOpacity,n>0&&(t.globalAlpha=n,t.fillStyle=un(t,e,e.fill),!0)},hn=[],cn=function(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&(n*=null==e.strokeOpacity?1:e.strokeOpacity,n>0&&(t.globalAlpha=n,t.strokeStyle=un(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||hn),t.lineDashOffset=e.strokeDashOffset||0),!0))},fn=function(){return!0},dn=function(t,e){return"translate("+t+","+e+")"},vn=function(t){return dn(t.x||0,t.y||0)},gn=function(t,e){function n(t,n){t("transform",vn(n)),t("d",e(null,n))}function i(t,n){return e(J(t),n),tn(t,n).translate(n.x||0,n.y||0)}function r(t,n){var i=n.x||0,r=n.y||0;t.translate(i,r),t.beginPath(),e(t,n),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:n,bound:i,draw:tt(r),pick:ot(r)}},pn=gn("arc",H),yn=function(t,e){function n(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))}function i(t,n){var i=n.items;return 0===i.length?t:(e(J(t),i),tn(t,i[0]))}function r(t,n){t.beginPath(),e(t,n)}function o(t,e,n,i,r,o){var a=e.items,u=e.bounds;return!a||!a.length||u&&!u.contains(r,o)?null:(t.pixelRatio>1&&(n*=t.pixelRatio,i*=t.pixelRatio),s(t,a,n,i)?a[0]:null)}var s=rt(r);return{type:t,tag:"path",nested:!0,attr:n,bound:i,draw:et(r),pick:o}},_n=yn("area",G),mn=function(t,e,n){var i=t._defs,r=e.clip_id||(e.clip_id="clip"+i.clip_id++),o=i.clipping[r]||(i.clipping[r]={id:r});return o.width=n.width||0,o.height=n.height||0,"url(#"+r+")"},xn={type:"group",tag:"g",nested:!1,attr:st,bound:lt,draw:ht,pick:ct,background:at,foreground:ut},bn={type:"image",tag:"image",nested:!1,attr:pt,bound:yt,draw:_t,pick:it(),get:dt,xOffset:vt,yOffset:gt},kn=yn("line",W),wn={type:"path",tag:"path",nested:!1,attr:mt,bound:bt,draw:tt(xt),pick:ot(xt)},Mn={type:"rect",tag:"path",nested:!1,attr:kt,bound:wt,draw:tt(Mt),pick:ot(Mt)},Tn={type:"rule",tag:"line",nested:!1,attr:Tt,bound:At,draw:zt,pick:it(Pt)},An=gn("shape",B),Cn=gn("symbol",U),zn={height:Nt,measureWidth:It,estimateWidth:Lt,width:Lt,canvas:Ot};Ot(!0);var Pn={left:"start",center:"middle",right:"end"},Ln=new o,Sn={type:"text",tag:"text",nested:!1,attr:Ht,bound:Gt,draw:Wt,pick:it(jt)},In=yn("trail",X),qn={arc:pn,area:_n,group:xn,image:bn,line:kn,path:wn,rect:Mn,rule:Tn,shape:An,symbol:Cn,text:Sn,trail:In},Nn=function(t,e,n){var i=qn[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new o),t,n)},On={mark:null},Rn=function(t,e,n){var i,r,s,a,u=qn[t.marktype],l=u.bound,h=t.items,c=h&&h.length;if(u.nested)return s=c?h[0]:(On.mark=t,On),a=Nn(s,l,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new o,c)for(i=0,r=h.length;i<r;++i)e.union(Nn(h[i],l,n));return t.bounds=e},En=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","interpolate","tension","orient","defined","url","path","x2","y2","size","shape","text","angle","theta","radius","dx","dy","font","fontSize","fontWeight","fontStyle","fontVariant"],Dn=Jt.prototype;Dn.toJSON=function(t){return Bt(this.root,t||0)},Dn.mark=function(t,e,n){e=e||this.root.items[0];var i=Qt(t,e);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i};var Vn=Yt.prototype;Vn.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},Vn.element=function(){return this._el},Vn.origin=function(t){return this._origin=t||[0,0],this},Vn.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},Vn.on=function(){},Vn.off=function(){},Vn.handlers=function(){var t,e=this._handlers,n=[];for(t in e)n.push.apply(n,e[t]);return n},Vn.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},Vn.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then(function(e){var n=new MouseEvent(t.type,t),i=u(null,"a");for(var r in e)i.setAttribute(r,e[r]);i.dispatchEvent(n)}).catch(function(){})},Vn.handleTooltip=function(t,e,n){this._el.setAttribute("title",n||"")};var Hn=Zt.prototype;Hn.initialize=function(t,e,n,i){return this._el=t,this.resize(e,n,i)},Hn.element=function(){return this._el},Hn.scene=function(){return this._el&&this._el.firstChild},Hn.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},Hn.resize=function(t,e,n){return this._width=t,this._height=e,this._origin=n||[0,0],this},Hn.dirty=function(){},Hn.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},Hn._render=function(){},Hn.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then(function(){return e}):Promise.resolve(e)},Hn._load=function(t,e){var n=this,i=n._loader[t](e);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then(function(t){t&&r(),n._ready=null})}return i},Hn.sanitizeURL=function(t){return this._load("sanitizeURL",t)},Hn.loadImage=function(t){return this._load("loadImage",t)};var Gn=function(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]},Wn=e.inherits($t,Yt);Wn.initialize=function(t,e,n){var i=this._canvas=t&&l(t,"canvas");if(i){var r=this;this.events.forEach(function(t){i.addEventListener(t,function(e){Wn[t]?Wn[t].call(r,e):r.fire(t,e)})})}return Yt.prototype.initialize.call(this,t,e,n)},Wn.canvas=function(){return this._canvas},Wn.context=function(){return this._canvas.getContext("2d")},Wn.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],
Wn.DOMMouseScroll=function(t){this.fire("mousewheel",t)},Wn.mousemove=Ft("mousemove","mouseover","mouseout"),Wn.dragover=Ft("dragover","dragenter","dragleave"),Wn.mouseout=Kt("mouseout"),Wn.dragleave=Kt("dragleave"),Wn.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},Wn.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},Wn.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},Wn.touchmove=function(t){this.fire("touchmove",t,!0)},Wn.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},Wn.fire=function(t,e,n){var i,r,o=n?this._touch:this._active,s=this._handlers[t];if("click"===t&&o&&o.href?this.handleHref(e,o,o.href):("mouseover"===t||"mouseout"===t)&&o&&o.tooltip&&this.handleTooltip(e,o,"mouseover"===t?o.tooltip:null),s)for(e.vegaType=t,i=0,r=s.length;i<r;++i)s[i].handler.call(this._obj,e,o)},Wn.on=function(t,e){var n=this.eventName(t),i=this._handlers;return(i[n]||(i[n]=[])).push({type:t,handler:e}),this},Wn.off=function(t,e){var n,i=this.eventName(t),r=this._handlers[i];if(r){for(n=r.length;--n>=0;)r[n].type===t&&(e&&r[n].handler!==e||r.splice(n,1));return this}},Wn.pickEvent=function(t){var e=Gn(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},Wn.pick=function(t,e,n,i,r){var o=this.context(),s=qn[t.marktype];return s.pick.call(this,o,t,e,n,i,r)};var jn=function(t,e){var n=e.group;t.save(),t.beginPath(),t.rect(0,0,n.width||0,n.height||0),t.clip()},Bn="undefined"!=typeof window?window.devicePixelRatio||1:1,Un=function(t,e,n,i){var r="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,o=t.getContext("2d"),s=r?Bn:1;return t.width=e*s,t.height=n*s,1!==s&&(t.style.width=e+"px",t.style.height=n+"px"),o.pixelRatio=s,o.setTransform(s,0,0,s,s*i[0],s*i[1]),t},Xn=e.inherits(te,Zt),Jn=Zt.prototype,Qn=new o;Xn.initialize=function(t,e,n,i){return this._canvas=Ce(1,1),t&&(c(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Jn.initialize.call(this,t,e,n,i)},Xn.resize=function(t,e,n){return Jn.resize.call(this,t,e,n),Un(this._canvas,this._width,this._height,this._origin),this._redraw=!0,this},Xn.canvas=function(){return this._canvas},Xn.context=function(){return this._canvas?this._canvas.getContext("2d"):null},Xn.dirty=function(t){var e=ne(t.bounds,t.mark.group);this._dirty.union(e)},Xn._render=function(t){var e=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty;return e.save(),o=this._redraw||o.empty()?(this._redraw=!1,null):ee(e,o,n),this.clear(-n[0],-n[1],i,r),this.draw(e,t,o),e.restore(),this._dirty.clear(),this},Xn.draw=function(t,e,n){var i=qn[e.marktype];e.clip&&jn(t,e),i.draw.call(this,t,e,n),e.clip&&t.restore()},Xn.clear=function(t,e,n,i){var r=this.context();r.clearRect(t,e,n,i),null!=this._bgcolor&&(r.fillStyle=this._bgcolor,r.fillRect(t,e,n,i))};var Yn=e.inherits(ie,Yt);Yn.initialize=function(t,e,n){var i=this._svg;return i&&(i.removeEventListener("click",this._hrefHandler),i.removeEventListener("mouseover",this._tooltipHandler),i.removeEventListener("mouseout",this._tooltipHandler)),this._svg=i=t&&l(t,"svg"),i&&(i.addEventListener("click",this._hrefHandler),i.addEventListener("mouseover",this._tooltipHandler),i.addEventListener("mouseout",this._tooltipHandler)),Yt.prototype.initialize.call(this,t,e,n)},Yn.svg=function(){return this._svg},Yn.on=function(t,e){var n=this.eventName(t),i=this._handlers,r={type:t,handler:e,listener:re(this,e)};return(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener),this},Yn.off=function(t,e){var n,i=this.eventName(t),r=this._svg,o=this._handlers[i];if(o){for(n=o.length;--n>=0;)(o[n].type===t&&!e||o[n].handler===e)&&(this._svg&&r.removeEventListener(i,o[n].listener),o.splice(n,1));return this}};var Zn={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},$n={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeOpacity:"stroke-opacity",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},Fn=Object.keys($n),Kn=Zn.xmlns,ti=e.inherits(ae,Zt),ei=Zt.prototype;ti.initialize=function(t,e,n,i){return t&&(this._svg=h(t,0,"svg",Kn),this._svg.setAttribute("class","marks"),c(t,1),this._root=h(this._svg,0,"g",Kn),c(this._svg,1)),this._defs={clip_id:1,gradient:{},clipping:{}},this.background(this._bgcolor),ei.initialize.call(this,t,e,n,i)},ti.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),ei.background.apply(this,arguments)},ti.resize=function(t,e,n){return ei.resize.call(this,t,e,n),this._svg&&(this._svg.setAttribute("width",this._width),this._svg.setAttribute("height",this._height),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},ti.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width,height:this._height,viewBox:"0 0 "+this._width+" "+this._height};for(var e in Zn)t[e]=Zn[e];return oe("svg",t)+this._svg.innerHTML+se("svg")},ti._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),c(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},ti.updateDefs=function(){var t,e=this._svg,n=this._defs,i=n.el,r=0;for(t in n.gradient)i||(n.el=i=h(e,0,"defs",Kn)),ue(i,n.gradient[t],r++);for(t in n.clipping)i||(n.el=i=h(e,0,"defs",Kn)),le(i,n.clipping[t],r++);i&&(0===r?(e.removeChild(i),n.el=null):c(i,r))},ti._resetDefs=function(){var t=this._defs;t.clip_id=1,t.gradient={},t.clipping={}},ti.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},ti.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},ti._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length)return!0;var e,n,i,r,o,s,a,u=++this._dirtyID;for(o=0,s=t.length;o<s;++o)e=t[o],n=e.mark,n.marktype!==i&&(i=n.marktype,r=qn[i]),n.zdirty&&n.dirty!==u&&(this._dirtyAll=!1,n.dirty=u,he(n.group,u)),e.exit?(r.nested&&n.items.length?(a=n.items[0],a._svg&&this._update(r,a._svg,a)):e._svg&&e._svg.parentNode.removeChild(e._svg),e._svg=null):(e=r.nested?n.items[0]:e,e._update!==u&&(e._svg&&e._svg.ownerSVGElement?this._update(r,e._svg,e):(this._dirtyAll=!1,he(e,u)),e._update=u));return!this._dirtyAll},ti.draw=function(t,e,n){function i(t){var e=o.isDirty(t),n=fe(t,r,l,s.tag);e&&(o._update(s,n,t),u&&ce(o,n,t)),l=n,++h}if(!this.isDirty(e))return e._svg;var r,o=this,s=qn[e.marktype],a=e.interactive===!1?"none":null,u="g"===s.tag,l=null,h=0;return r=fe(e,t,n,"g"),r.setAttribute("class",f(e)),!u&&a&&r.style.setProperty("pointer-events",a),e.clip&&r.setAttribute("clip-path",mn(o,e,e.group)),s.nested?e.items.length&&i(e.items[0]):F(e,i),c(r,h),r};var ni=null,ii=null,ri={group:function(t,e,n){ii=e.__values__,ni=e.childNodes[1],t.foreground(de,n,this),ni=e.childNodes[0],t.background(de,n,this);var i=n.mark.interactive===!1?"none":null;i!==ii.events&&(ni.style.setProperty("pointer-events",i),ii.events=i)},text:function(t,e,n){var i=Rt(n);i!==ii.text&&(e.textContent=i,ii.text=i),i=Dt(n),i!==ii.font&&(e.style.setProperty("font",i),ii.font=i)}};ti._update=function(t,e,n){ni=e,ii=e.__values__,t.attr(de,n,this);var i=ri[t.type];i&&i.call(this,t,e,n),this.style(ni,n)},ti.style=function(t,e){if(null!=e){var n,i,r,o,s;for(n=0,i=Fn.length;n<i;++n)r=Fn[n],s=e[r],s!==ii[r]&&(o=$n[r],null==s?"fill"===o?t.style.setProperty(o,"none"):t.style.removeProperty(o):(s.id&&(this._defs.gradient[s.id]=s,s="url("+ve()+"#"+s.id+")"),t.style.setProperty(o,s+"")),ii[r]=s)}};var oi=e.inherits(ge,Zt),si=Zt.prototype;oi.resize=function(t,e,n){si.resize.call(this,t,e,n);var i=this._origin,r=this._text,o={class:"marks",width:this._width,height:this._height,viewBox:"0 0 "+this._width+" "+this._height};for(var s in Zn)o[s]=Zn[s];return r.head=oe("svg",o),r.root=oe("g",{transform:"translate("+i+")"}),r.foot=se("g")+se("svg"),this},oi.svg=function(){var t=this._text;return t.head+t.defs+t.root+t.body+t.foot},oi._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},oi.reset=function(){return this._defs.clip_id=0,this},oi.buildDefs=function(){var t,e,n,i,r=this._defs,o="";for(e in r.gradient){for(n=r.gradient[e],i=n.stops,o+=oe("linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<i.length;++t)o+=oe("stop",{offset:i[t].offset,"stop-color":i[t].color})+se("stop");o+=se("linearGradient")}for(e in r.clipping)n=r.clipping[e],o+=oe("clipPath",{id:e}),o+=oe("rect",{x:0,y:0,width:n.width,height:n.height})+se("rect"),o+=se("clipPath");return o.length>0?oe("defs")+o+se("defs"):""};var ai;oi.attributes=function(t,e){return ai={},t(pe,e,this),ai},oi.href=function(t){var e,n=this,i=t.href;if(i){if(e=n._hrefs&&n._hrefs[i])return e;n.sanitizeURL(i).then(function(t){t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[i]=t})}return null},oi.mark=function(t){function e(e){var u=i.href(e);u&&(a+=oe("a",u)),n="g"!==o?ye(e,t,o,s):null,a+=oe(o,i.attributes(r.attr,e),n),"text"===o?a+=_e(Rt(e)):"g"===o&&(a+=oe("path",i.attributes(r.background,e),ye(e,t,"bgrect",s))+se("path"),a+=oe("g",i.attributes(r.foreground,e))+i.markGroup(e)+se("g")),a+=se(o),u&&(a+=se("a"))}var n,i=this,r=qn[t.marktype],o=r.tag,s=this._defs,a="";return"g"!==o&&t.interactive===!1&&(n='style="pointer-events: none;"'),a+=oe("g",{class:f(t),"clip-path":t.clip?mn(i,t,t.group):null},n),r.nested?t.items&&t.items.length&&e(t.items[0]):F(t,e),a+se("g")},oi.markGroup=function(t){var e=this,n="";return F(t,function(t){n+=e.mark(t)}),n};var ui="canvas",li="png",hi="svg",ci="none",fi={Canvas:ui,PNG:li,SVG:hi,None:ci},di={};di[ui]=di[li]={renderer:te,headless:te,handler:$t},di[hi]={renderer:ae,headless:ge,handler:ie},di[ci]={};var vi=1e-9;t.Bounds=o,t.Gradient=Te,t.GroupItem=a,t.ResourceLoader=d,t.Item=s,t.Scenegraph=Jt,t.Handler=Yt,t.Renderer=Zt,t.CanvasHandler=$t,t.CanvasRenderer=te,t.SVGHandler=ie,t.SVGRenderer=ae,t.SVGStringRenderer=ge,t.RenderType=fi,t.renderModule=me,t.Marks=qn,t.boundContext=J,t.boundStroke=tn,t.boundItem=Nn,t.boundMark=Rn,t.pathCurves=p,t.pathSymbols=b,t.pathRectangle=Be,t.pathTrail=Xe,t.pathParse=Ne,t.pathRender=Ve,t.point=Gn,t.canvas=Ce,t.domCreate=u,t.domFind=l,t.domChild=h,t.domClear=c,t.openTag=oe,t.closeTag=se,t.font=Dt,t.textMetrics=zn,t.sceneEqual=xe,t.pathEqual=be,t.sceneToJSON=Bt,t.sceneFromJSON=Ut,t.sceneZOrder=$,t.sceneVisit=F,t.scenePickVisit=K,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util"),require("vega-loader"),require("d3-shape"),require("d3-path")):"function"==typeof define&&define.amd?define(["exports","vega-util","vega-loader","d3-shape","d3-path"],e):e(t.vega=t.vega||{},t.vega,t.vega,t.d3,t.d3)}(this,function(t,e,n,i,r){"use strict";function o(t){this.clear(),t&&this.union(t)}function s(t){this.mark=t,this.bounds=this.bounds||new o}function a(t){s.call(this,t),this.items=this.items||[]}function u(t,e,n){return!t&&"undefined"!=typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function l(t,e){e=e.toLowerCase();for(var n=t.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===e)return n[i]}function h(t,e,n,i){var r,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=u(t.ownerDocument,n,i),t.insertBefore(o,r)),o}function c(t,e){for(var n=t.childNodes,i=n.length;i>e;)t.removeChild(n[--i]);return t}function f(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function d(t){this._pending=0,this._loader=t||n.loader()}function v(t){t._pending+=1}function g(t){t._pending-=1}function p(t,e,n){var i=Ie.hasOwnProperty(t)&&Ie[t],r=null;return i&&(r=i.curve||i[e||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}function y(t,e,n,i,r,o,s,a,u){var l=De.call(arguments);if(Re[l])return Re[l];var h=s*(Math.PI/180),c=Math.sin(h),f=Math.cos(h);n=Math.abs(n),i=Math.abs(i);var d=f*(a-t)*.5+c*(u-e)*.5,v=f*(u-e)*.5-c*(a-t)*.5,g=d*d/(n*n)+v*v/(i*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);var p=f/n,y=c/n,_=-c/i,m=f/i,x=p*a+y*u,b=_*a+m*u,k=p*t+y*e,w=_*t+m*e,M=(k-x)*(k-x)+(w-b)*(w-b),T=1/M-.25;T<0&&(T=0);var A=Math.sqrt(T);o==r&&(A=-A);var C=.5*(x+k)-A*(w-b),z=.5*(b+w)+A*(k-x),P=Math.atan2(b-z,x-C),S=Math.atan2(w-z,k-C),L=S-P;L<0&&1===o?L+=2*Math.PI:L>0&&0===o&&(L-=2*Math.PI);for(var I=Math.ceil(Math.abs(L/(.5*Math.PI+.001))),q=[],N=0;N<I;++N){var O=P+N*L/I,R=P+(N+1)*L/I;q[N]=[C,z,O,R,n,i,c,f]}return Re[l]=q}function _(t){var e=De.call(t);if(Ee[e])return Ee[e];var n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],u=t[6],l=t[7],h=l*s,c=-u*a,f=u*s,d=l*a,v=Math.cos(r),g=Math.sin(r),p=Math.cos(o),y=Math.sin(o),_=.5*(o-r),m=Math.sin(.5*_),x=8/3*m*m/Math.sin(_),b=n+v-x*g,k=i+g+x*v,w=n+p,M=i+y,T=w+x*y,A=M-x*p;return Ee[e]=[h*b+c*k,f*b+d*k,h*T+c*A,f*T+d*A,h*w+c*M,f*w+d*M]}function m(t,e){var n=Ve[0]=t[0];if("a"===n||"A"===n)Ve[1]=e*t[1],Ve[2]=e*t[2],Ve[6]=e*t[6],Ve[7]=e*t[7];else for(var i=1,r=t.length;i<r;++i)Ve[i]=e*t[i];return Ve}function x(t,e,n,i){for(var r=y(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),o=0;o<r.length;++o){var s=_(r[o]);t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}function b(t){return je.hasOwnProperty(t)?je[t]:k(t)}function k(t){if(!Be.hasOwnProperty(t)){var e=Oe(t);Be[t]={draw:function(t,n){He(t,e,0,0,Math.sqrt(n)/2)}}}return Be[t]}function w(t){return t.x}function M(t){return t.y}function T(t){return t.width}function A(t){return t.height}function C(t){return function(){return t}}function z(t){return t.x||0}function P(t){return t.y||0}function S(t){return t.width||0}function L(t){return t.size||1}function I(t){return t.height||0}function q(t){return(t.x||0)+(t.width||0)}function N(t){return(t.y||0)+(t.height||0)}function O(t){return t.cornerRadius||0}function R(t){return t.padAngle||0}function E(t){return!(t.defined===!1)}function D(t){return null==t.size?64:t.size}function V(t){return b(t.shape||"circle")}function H(t,e){return Qe.context(t)(e)}function G(t,e){var n=e[0],i=n.interpolate||"linear";return("horizontal"===n.orient?Ze:Ye).curve(p(i,n.orient,n.tension)).context(t)(e)}function W(t,e){var n=e[0],i=n.interpolate||"linear";return $e.curve(p(i,n.orient,n.tension)).context(t)(e)}function j(t,e,n,i){return Fe.context(t)(e,n,i)}function B(t,e){return(e.mark.shape||e.shape).context(t)(e)}function U(t,e){return Ke.context(t)(e)}function X(t,e){return tn.context(t)(e)}function J(t){return Le=t,J}function Q(){}function Y(t,e){Le.add(t,e)}function Z(t,e){return t.zindex-e.zindex||t.index-e.index}function $(t){if(!t.zdirty)return t.zitems;var e,n,i,r=t.items,o=[];for(n=0,i=r.length;n<i;++n)e=r[n],e.index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(Z)}function F(t,e){var n,i,r=t.items;if(r&&r.length){var o=$(t);if(o&&o.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||e(r[n]);r=o}for(n=0,i=r.length;n<i;++n)e(r[n])}}function K(t,e){var n,i,r=t.items;if(!r||!r.length)return null;var o=$(t);for(o&&o.length&&(r=o),i=r.length;--i>=0;)if(n=e(r[i]))return n;if(r===o)for(r=t.items,i=r.length;--i>=0;)if(!r[i].zindex&&(n=e(r[i])))return n;return null}function tt(t){return function(e,n,i){F(n,function(n){i&&!i.intersects(n.bounds)||nt(t,e,n,n)})}}function et(t){return function(e,n,i){!n.items.length||i&&!i.intersects(n.bounds)||nt(t,e,n.items[0],n.items)}}function nt(t,e,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(t(e,i)||(n.fill&&hn(e,n,r)&&e.fill(),n.stroke&&fn(e,n,r)&&e.stroke()))}function it(t){return t||(t=dn),function(e,n,i,r,o,s){return e.pixelRatio>1&&(i*=e.pixelRatio,r*=e.pixelRatio),K(n,function(n){var a=n.bounds;if((!a||a.contains(o,s))&&a)return t(e,n,i,r,o,s)?n:void 0})}}function rt(t,e){return function(n,i,r,o){var s,a,u=Array.isArray(i)?i[0]:i,l=null==e?u.fill:e,h=u.stroke&&n.isPointInStroke;return h&&(s=u.strokeWidth,a=u.strokeCap,n.lineWidth=null!=s?s:1,n.lineCap=null!=a?a:"butt"),!t(n,i)&&(l&&n.isPointInPath(r,o)||h&&n.isPointInStroke(r,o))}}function ot(t){return it(rt(t))}function st(){xn=1}function at(t,e){t("transform",gn(e))}function ut(t,e){var n=e.stroke?.5:0;t("class","background"),t("d",j(null,e,n,n))}function lt(t,e,n){var i=e.clip?bn(n,e,e):null;t("clip-path",i)}function ht(t,e){if(!e.clip&&e.items)for(var n=e.items,i=0,r=n.length;i<r;++i)t.union(n[i].bounds);return(e.clip||e.width||e.height)&&en(t.add(0,0).add(e.width||0,e.height||0),e),t.translate(e.x||0,e.y||0)}function ct(t,e,n){var i=this;F(e,function(e){var r,o,s=e.x||0,a=e.y||0,u=e.width||0,l=e.height||0;t.save(),t.translate(s,a),(e.stroke||e.fill)&&(o=null==e.opacity?1:e.opacity,o>0&&(t.beginPath(),r=e.stroke?.5:0,j(t,e,r,r),e.fill&&hn(t,e,o)&&t.fill(),e.stroke&&fn(t,e,o)&&t.stroke())),e.clip&&(t.beginPath(),t.rect(0,0,u,l),t.clip()),n&&n.translate(-s,-a),F(e,function(e){i.draw(t,e,n)}),n&&n.translate(s,a),t.restore()})}function ft(t,e,n,i,r,o){if(e.bounds&&!e.bounds.contains(r,o)||!e.items)return null;var s=this;return K(e,function(a){var u,l,h,c;if(c=a.bounds,!c||c.contains(r,o))return l=a.x||0,h=a.y||0,t.save(),t.translate(l,h),l=r-l,h=o-h,u=K(a,function(t){return dt(t,l,h)?s.pick(t,n,i,l,h):null}),t.restore(),u?u:(u=e.interactive!==!1&&(a.fill||a.stroke)&&l>=0&&l<=a.width&&h>=0&&h<=a.height,u?a:null)})}function dt(t,e,n){return(t.interactive!==!1||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}function vt(t,e){var n=t.image;return n&&n.url===t.url||(n={loaded:!1,width:0,height:0},e.loadImage(t.url).then(function(e){t.image=e,t.image.url=t.url})),n}function gt(t,e){return"center"===t?e/2:"right"===t?e:0}function pt(t,e){return"middle"===t?e/2:"bottom"===t?e:0}function yt(t,e,n){var i=vt(e,n),r=e.x||0,o=e.y||0,s=(null!=e.width?e.width:i.width)||0,a=(null!=e.height?e.height:i.height)||0,u=e.aspect===!1?"none":"xMidYMid";r-=gt(e.align,s),o-=pt(e.baseline,a),t("href",i.src||"","http://www.w3.org/1999/xlink","xlink:href"),t("transform",vn(r,o)),t("width",s),t("height",a),t("preserveAspectRatio",u)}function _t(t,e){var n=e.image,i=e.x||0,r=e.y||0,o=(null!=e.width?e.width:n&&n.width)||0,s=(null!=e.height?e.height:n&&n.height)||0;return i-=gt(e.align,o),r-=pt(e.baseline,s),t.set(i,r,i+o,r+s)}function mt(t,e,n){var i=this;F(e,function(e){if(!n||n.intersects(e.bounds)){var r,o,s,a,u=vt(e,i),l=e.x||0,h=e.y||0,c=(null!=e.width?e.width:u.width)||0,f=(null!=e.height?e.height:u.height)||0;l-=gt(e.align,c),h-=pt(e.baseline,f),e.aspect!==!1&&(o=u.width/u.height,s=e.width/e.height,o===o&&s===s&&o!==s&&(s<o?(a=c/o,h+=(f-a)/2,f=a):(a=f*o,l+=(c-a)/2,c=a))),u.loaded&&(t.globalAlpha=null!=(r=e.opacity)?r:1,t.drawImage(u,l,h,c,f))}})}function xt(t,e){t("transform",gn(e)),t("d",e.path)}function bt(t,e){var n=e.path;if(null==n)return!0;var i=e.pathCache;i&&i.path===n||((e.pathCache=i=Oe(n)).path=n),He(t,i,e.x,e.y)}function kt(t,e){return bt(J(t),e)?t.set(0,0,0,0):en(t,e)}function wt(t,e){t("d",j(null,e))}function Mt(t,e){var n,i;return en(t.set(n=e.x||0,i=e.y||0,n+e.width||0,i+e.height||0),e)}function Tt(t,e){t.beginPath(),j(t,e)}function At(t,e){t("transform",gn(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)}function Ct(t,e){var n,i;return en(t.set(n=e.x||0,i=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i),e)}function zt(t,e,n){var i,r,o,s;return!(!e.stroke||!fn(t,e,n))&&(i=e.x||0,r=e.y||0,o=null!=e.x2?e.x2:i,s=null!=e.y2?e.y2:r,t.beginPath(),t.moveTo(i,r),t.lineTo(o,s),!0)}function Pt(t,e,n){F(e,function(e){if(!n||n.intersects(e.bounds)){var i=null==e.opacity?1:e.opacity;i&&zt(t,e,i)&&t.stroke()}})}function St(t,e,n,i){return!!t.isPointInStroke&&(zt(t,e,1)&&t.isPointInStroke(n,i))}function Lt(t){return an=Ot(t),It(Et(t))}function It(t){return~~(.8*t.length*an)}function qt(t){return sn.font=Vt(t),Nt(Et(t))}function Nt(t){return sn.measureText(t).width}function Ot(t){return null!=t.fontSize?t.fontSize:11}function Rt(t){sn=t&&(sn=ze(1,1))?sn.getContext("2d"):null,Sn.width=sn?qt:Lt}function Et(t){var e=t.text;return null==e?"":t.limit>0?Dt(t):e+""}function Dt(t){var e=+t.limit,n=t.text+"",i=sn?(sn.font=Vt(t),Nt):(an=Ot(t),It);if(i(n)<e)return n;var r,o=t.ellipsis||"…",s="rtl"===t.dir,a=0,u=n.length;if(e-=i(o),s){for(;a<u;)r=a+u>>>1,i(n.slice(r))>e?a=r+1:u=r;return o+n.slice(a)}for(;a<u;)r=1+(a+u>>>1),i(n.slice(0,r))<e?a=r:u=r-1;return n.slice(0,a)+o}function Vt(t,e){var n=t.font;return e&&n&&(n=String(n).replace(/\"/g,"'")),""+(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Ot(t)+"px "+(n||"sans-serif")}function Ht(t){var e=t.baseline,n=Ot(t);return Math.round("top"===e?.93*n:"middle"===e?.3*n:"bottom"===e?-.21*n:0)}function Gt(t,e){var n,i=e.dx||0,r=(e.dy||0)+Ht(e),o=e.x||0,s=e.y||0,a=e.angle||0,u=e.radius||0;u&&(n=(e.theta||0)-Math.PI/2,o+=u*Math.cos(n),s+=u*Math.sin(n)),t("text-anchor",Ln[e.align]||"start"),a?(n=vn(o,s)+" rotate("+a+")",(i||r)&&(n+=" "+vn(i,r))):n=vn(o+i,s+r),t("transform",n)}function Wt(t,e,n){var i,r,o=Sn.height(e),s=e.align,a=e.radius||0,u=e.x||0,l=e.y||0,h=e.dx||0,c=(e.dy||0)+Ht(e)-Math.round(.8*o);return a&&(r=(e.theta||0)-Math.PI/2,u+=a*Math.cos(r),l+=a*Math.sin(r)),i=Sn.width(e),"center"===s?h-=i/2:"right"===s&&(h-=i),t.set(h+=u,c+=l,h+i,c+o),e.angle&&!n&&t.rotate(e.angle*Math.PI/180,u,l),t.expand(n?0:1)}function jt(t,e,n){F(e,function(e){var i,r,o,s,a,u;n&&!n.intersects(e.bounds)||(u=Et(e))&&(i=null==e.opacity?1:e.opacity,0!==i&&(t.font=Vt(e),t.textAlign=e.align||"left",r=e.x||0,o=e.y||0,(s=e.radius)&&(a=(e.theta||0)-Math.PI/2,r+=s*Math.cos(a),o+=s*Math.sin(a)),e.angle&&(t.save(),t.translate(r,o),t.rotate(e.angle*Math.PI/180),r=o=0),r+=e.dx||0,o+=(e.dy||0)+Ht(e),e.fill&&hn(t,e,i)&&t.fillText(u,r,o),e.stroke&&fn(t,e,i)&&t.strokeText(u,r,o),e.angle&&t.restore()))})}function Bt(t,e,n,i,r,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var s=Wt(In,e,!0),a=-e.angle*Math.PI/180,u=Math.cos(a),l=Math.sin(a),h=e.x,c=e.y,f=u*r-l*o+(h-h*u+c*l),d=l*r+u*o+(c-h*l-c*u);return s.contains(f,d)}function Ut(t,e){return JSON.stringify(t,Vn,e)}function Xt(t){var e="string"==typeof t?JSON.parse(t):t;return Jt(e)}function Jt(t){var e,n,i,r=t.marktype,o=t.items;if(o)for(n=0,i=o.length;n<i;++n)e=r?"mark":"group",o[n][e]=t,o[n].zindex&&(o[n][e].zdirty=!0),"group"===(r||e)&&Jt(o[n]);return r&&Dn(t),t}function Qt(t){arguments.length?this.root=Xt(t):(this.root=Yt({marktype:"group",name:"root",role:"frame"}),this.root.items=[new a(this.root)])}function Yt(t,e){return{bounds:new o,clip:!!t.clip,group:e,interactive:t.interactive!==!1,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0}}function Zt(t){this._active=null,this._handlers={},this._loader=t||n.loader()}function $t(t){this._el=null,this._bgcolor=null,this._loader=new d(t)}function Ft(t){Zt.call(this,t),this._down=null,this._touch=null,this._first=!0}function Kt(t,e,n){return function(i){var r=this._active,o=this.pickEvent(i);o===r?this.fire(t,i):(r&&r.exit||this.fire(n,i),this._active=o,this.fire(e,i),this.fire(t,i))}}function te(t){return function(e){this.fire(t,e),this._active=null}}function ee(t){$t.call(this,t),this._redraw=!1,this._dirty=new o}function ne(t,e,n){return e.expand(1).round(),e.translate(-(n[0]%1),-(n[1]%1)),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}function ie(t,e){if(null==e)return t;for(var n=Zn.clear().union(t);null!=e;e=e.mark.group)n.translate(e.x||0,e.y||0);return n}function re(t){Zt.call(this,t);var e=this;e._hrefHandler=oe(e,function(t,n){n&&n.href&&e.handleHref(t,n,n.href)}),e._tooltipHandler=oe(e,function(t,n){n&&n.tooltip&&e.handleTooltip(t,n,"mouseover"===t.type?n.tooltip:null)})}function oe(t,e){return function(n){var i=n.target,r=i.__data__;n.vegaType=n.type,r=Array.isArray(r)?r[0]:r,e.call(t._obj,n,r)}}function se(t,e,n){var i,r,o="<"+t;if(e)for(i in e)r=e[i],null!=r&&(o+=" "+i+'="'+r+'"');return n&&(o+=" "+n),o+">"}function ae(t){return"</"+t+">"}function ue(t){$t.call(this,t),this._dirtyID=1,this._dirty=[],this._svg=null,this._root=null,this._defs=null}function le(t,e,n){var i,r,o;for(t=h(t,n,"linearGradient",ei),t.setAttribute("id",e.id),t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2),i=0,r=e.stops.length;i<r;++i)o=h(t,i,"stop",ei),o.setAttribute("offset",e.stops[i].offset),o.setAttribute("stop-color",e.stops[i].color);c(t,i)}function he(t,e,n){var i;t=h(t,n,"clipPath",ei),t.setAttribute("id",e.id),i=h(t,0,"rect",ei),i.setAttribute("x",0),i.setAttribute("y",0),i.setAttribute("width",e.width),i.setAttribute("height",e.height)}function ce(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function fe(t,e,n){e=e.lastChild;var i,r=0;F(n,function(n){i=t.draw(e,n,i),++r}),c(e,1+r)}function de(t,e,n,i){var r,o=t._svg;if(!o&&(r=e.ownerDocument,o=u(r,i,ei),t._svg=o,t.mark&&(o.__data__=t,o.__values__={fill:"default"},"g"===i))){var s=u(r,"path",ei);s.setAttribute("class","background"),o.appendChild(s),s.__data__=t;var a=u(r,"g",ei);o.appendChild(a),a.__data__=t}return(r||o.previousSibling!==n)&&e.insertBefore(o,n?n.nextSibling:e.firstChild),o}function ve(t,e,n){e!==oi[t]&&(null!=e?n?ri.setAttributeNS(n,t,e):ri.setAttribute(t,e):n?ri.removeAttributeNS(n,t):ri.removeAttribute(t),oi[t]=e)}function ge(){return"undefined"!=typeof window?window.location.href:""}function pe(t){$t.call(this,t),this._text={head:"",root:"",foot:"",defs:"",body:""},this._defs={gradient:{},clipping:{}}}function ye(t,e,n,i){li[i||t]=e}function _e(t,e,n,i){if(null==t)return"";var r,o,s,a,u,l="";for("bgrect"===n&&e.interactive===!1&&(l+="pointer-events: none;"),"text"===n&&(l+="font: "+Vt(t)+";"),r=0,o=ti.length;r<o;++r)s=ti[r],a=Kn[s],u=t[s],null==u?"fill"===a&&(l+=(l.length?" ":"")+"fill: none;"):(u.id&&(i.gradient[u.id]=u,u="url(#"+u.id+")"),l+=(l.length?" ":"")+a+": "+u+";");return l?'style="'+l+'"':null}function me(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function xe(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(gi[t]=e,this):gi[t]}function be(t,n,i){return t===n||("path"===i?ke(t,n):t instanceof Date&&n instanceof Date?+t===+n:e.isNumber(t)&&e.isNumber(n)?Math.abs(t-n)<=pi:t&&n&&(e.isObject(t)||e.isObject(n))?null!=t&&null!=n&&we(t,n):t==n)}function ke(t,e){return be(Oe(t),Oe(e))}function we(t,e){var n,i,r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(r.sort(),o.sort(),i=r.length-1;i>=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(n=r[i],!be(t[n],e[n],n))return!1;return typeof t==typeof e}var Me=o.prototype;Me.clone=function(){return new o(this)},Me.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},Me.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},Me.set=function(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},Me.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},Me.expand=function(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},Me.round=function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},Me.translate=function(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},Me.rotate=function(t,e,n){var i=Math.cos(t),r=Math.sin(t),o=e-e*i+n*r,s=n-e*r-n*i,a=this.x1,u=this.x2,l=this.y1,h=this.y2;return this.clear().add(i*a-r*l+o,r*a+i*l+s).add(i*a-r*h+o,r*a+i*h+s).add(i*u-r*l+o,r*u+i*l+s).add(i*u-r*h+o,r*u+i*h+s)},Me.union=function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},Me.intersect=function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},Me.encloses=function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},Me.alignsWith=function(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},Me.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},Me.contains=function(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},Me.width=function(){return this.x2-this.x1},Me.height=function(){return this.y2-this.y1};var Te=0,Ae=function(t,e){var n,i=[];return n={id:"gradient_"+Te++,x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:i,stop:function(t,e){return i.push({offset:t,color:e}),n}}};e.inherits(a,s);var Ce;try{Ce=require("canvas")}catch(t){Ce=null}var ze=function(t,e){var n=u(null,"canvas");if(n&&n.getContext)n.width=t,n.height=e;else if(Ce)try{n=new Ce(t,e)}catch(t){n=null}return n},Pe="undefined"!=typeof Image?Image:Ce&&Ce.Image||null,Se=d.prototype;Se.pending=function(){return this._pending},Se.sanitizeURL=function(t){var e=this;return v(e),e._loader.sanitize(t,{context:"href"}).then(function(t){return g(e),t}).catch(function(){return g(e),null})},Se.loadImage=function(t){var e=this;return v(e),e._loader.sanitize(t,{context:"image"}).then(function(t){var n=t.href;if(!n||!Pe)throw"Image unsupported.";var i=new Pe;return i.onload=function(){g(e),i.loaded=!0},i.onerror=function(){g(e),i.loaded=!1},i.src=n,i}).catch(function(){return g(e),{loaded:!1,width:0,height:0}})},Se.ready=function(){var t=this;return new Promise(function(e){function n(i){t.pending()?setTimeout(function(){n(!0)},10):e(i)}n(!1)})};var Le,Ie={basis:{curve:i.curveBasis},"basis-closed":{curve:i.curveBasisClosed},"basis-open":{curve:i.curveBasisOpen},bundle:{curve:i.curveBundle,tension:"beta",value:.85},cardinal:{curve:i.curveCardinal,tension:"tension",value:0},"cardinal-open":{curve:i.curveCardinalOpen,tension:"tension",value:0},"cardinal-closed":{curve:i.curveCardinalClosed,tension:"tension",value:0},"catmull-rom":{curve:i.curveCatmullRom,tension:"alpha",value:.5},"catmull-rom-closed":{curve:i.curveCatmullRomClosed,tension:"alpha",value:.5},"catmull-rom-open":{curve:i.curveCatmullRomOpen,tension:"alpha",value:.5},linear:{curve:i.curveLinear},"linear-closed":{curve:i.curveLinearClosed},monotone:{horizontal:i.curveMonotoneY,vertical:i.curveMonotoneX},natural:{curve:i.curveNatural},step:{curve:i.curveStep},"step-after":{curve:i.curveStepAfter},"step-before":{curve:i.curveStepBefore}},qe={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},Ne=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/],Oe=function(t){var e,n,i,r,o,s,a,u,l,h,c,f=[];for(e=t.slice().replace(Ne[0],"###$1").split(Ne[1]).slice(1),u=0,h=e.length;u<h;++u){for(n=e[u],i=n.slice(1).trim().replace(Ne[2],"$1###$2").split(Ne[3]),s=n.charAt(0),r=[s],l=0,c=i.length;l<c;++l)(o=+i[l])===o&&r.push(o);if(a=qe[s.toLowerCase()],r.length-1>a)for(l=1,c=r.length;l<c;l+=a)f.push([s].concat(r.slice(l,l+a)));else f.push(r)}return f},Re={},Ee={},De=[].join,Ve=["l",0,0,0,0,0,0,0],He=function(t,e,n,i,r){var o,s,a,u,l,h=null,c=0,f=0,d=0,v=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),t.beginPath&&t.beginPath();for(var g=0,p=e.length;g<p;++g){switch(o=e[g],1!==r&&(o=m(o,r)),o[0]){case"l":c+=o[1],f+=o[2],t.lineTo(c+n,f+i);break;case"L":c=o[1],f=o[2],t.lineTo(c+n,f+i);break;case"h":c+=o[1],t.lineTo(c+n,f+i);break;case"H":c=o[1],t.lineTo(c+n,f+i);break;case"v":f+=o[1],t.lineTo(c+n,f+i);break;case"V":f=o[1],t.lineTo(c+n,f+i);break;case"m":c+=o[1],f+=o[2],t.moveTo(c+n,f+i);break;case"M":c=o[1],f=o[2],t.moveTo(c+n,f+i);break;case"c":s=c+o[5],a=f+o[6],d=c+o[3],v=f+o[4],t.bezierCurveTo(c+o[1]+n,f+o[2]+i,d+n,v+i,s+n,a+i),c=s,f=a;break;case"C":c=o[5],f=o[6],d=o[3],v=o[4],t.bezierCurveTo(o[1]+n,o[2]+i,d+n,v+i,c+n,f+i);break;case"s":s=c+o[3],a=f+o[4],d=2*c-d,v=2*f-v,t.bezierCurveTo(d+n,v+i,c+o[1]+n,f+o[2]+i,s+n,a+i),d=c+o[1],v=f+o[2],c=s,f=a;break;case"S":s=o[3],a=o[4],d=2*c-d,v=2*f-v,t.bezierCurveTo(d+n,v+i,o[1]+n,o[2]+i,s+n,a+i),c=s,f=a,d=o[1],v=o[2];break;case"q":s=c+o[3],a=f+o[4],d=c+o[1],v=f+o[2],t.quadraticCurveTo(d+n,v+i,s+n,a+i),c=s,f=a;break;case"Q":s=o[3],a=o[4],t.quadraticCurveTo(o[1]+n,o[2]+i,s+n,a+i),c=s,f=a,d=o[1],v=o[2];break;case"t":s=c+o[1],a=f+o[2],null===h[0].match(/[QqTt]/)?(d=c,v=f):"t"===h[0]?(d=2*c-u,v=2*f-l):"q"===h[0]&&(d=2*c-d,v=2*f-v),u=d,l=v,t.quadraticCurveTo(d+n,v+i,s+n,a+i),c=s,f=a,d=c+o[1],v=f+o[2];break;case"T":s=o[1],a=o[2],d=2*c-d,v=2*f-v,t.quadraticCurveTo(d+n,v+i,s+n,a+i),c=s,f=a;break;case"a":x(t,c+n,f+i,[o[1],o[2],o[3],o[4],o[5],o[6]+c+n,o[7]+f+i]),c+=o[6],f+=o[7];break;case"A":x(t,c+n,f+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),c=o[6],f=o[7];break;case"z":case"Z":t.closePath()}h=o}},Ge=2*Math.PI,We=Math.sqrt(3)/2,je={circle:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,Ge)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,i=n/2.5;t.moveTo(-n,-i),t.lineTo(-n,i),t.lineTo(-i,i),t.lineTo(-i,n),t.lineTo(i,n),t.lineTo(i,i),t.lineTo(n,i),t.lineTo(n,-i),t.lineTo(i,-i),t.lineTo(i,-n),t.lineTo(-i,-n),t.lineTo(-i,-i),t.closePath()}},diamond:{draw:function(t,e){var n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,i=We*n;t.moveTo(0,-i),t.lineTo(-n,i),t.lineTo(n,i),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,i=We*n;t.moveTo(0,i),t.lineTo(-n,-i),t.lineTo(n,-i),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,i=We*n;t.moveTo(i,0),t.lineTo(-i,-n),t.lineTo(-i,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,i=We*n;t.moveTo(-i,0),t.lineTo(i,-n),t.lineTo(i,n),t.closePath()}}},Be={},Ue=function(){function t(t,u,l){var h,c=null!=u?u:+e.call(this,t),f=null!=l?l:+n.call(this,t),d=+i.call(this,t),v=+o.call(this,t),g=+s.call(this,t);if(a||(a=h=r.path()),g<=0)a.rect(c,f,d,v);else{var p=c+d,y=f+v;a.moveTo(c+g,f),a.lineTo(p-g,f),a.quadraticCurveTo(p,f,p,f+g),a.lineTo(p,y-g),a.quadraticCurveTo(p,y,p-g,y),a.lineTo(c+g,y),a.quadraticCurveTo(c,y,c,y-g),a.lineTo(c,f+g),a.quadraticCurveTo(c,f,c+g,f),a.closePath()}if(h)return a=null,h+""||null}var e=w,n=M,i=T,o=A,s=C(0),a=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:C(+n),t):e},t.y=function(e){return arguments.length?(n="function"==typeof e?e:C(+e),t):n},t.width=function(e){return arguments.length?(i="function"==typeof e?e:C(+e),t):i},t.height=function(e){return arguments.length?(o="function"==typeof e?e:C(+e),t):o},t.cornerRadius=function(e){return arguments.length?(s="function"==typeof e?e:C(+e),t):s},t.context=function(e){return arguments.length?(a=null==e?null:e,t):a},t},Xe=Math.PI,Je=function(){function t(t,e,n){var i=n/2;if(a){var r=l-e,o=t-u;if(r||o){var s=Math.sqrt(r*r+o*o),f=(r/=s)*h,d=(o/=s)*h,v=Math.atan2(o,r);c.moveTo(u-f,l-d),c.lineTo(t-r*i,e-o*i),c.arc(t,e,i,v-Xe,v),c.lineTo(u+f,l+d),c.arc(u,l,h,v,v+Xe)}else c.arc(t,e,i,0,2*Xe);c.closePath()}else a=1;u=t,l=e,h=i}function e(e){var u,l,h,f=e.length,d=!1;for(null==c&&(c=h=r.path()),u=0;u<=f;++u)!(u<f&&s(l=e[u],u,e))===d&&(d=!d)&&(a=0),d&&t(+n(l,u,e),+i(l,u,e),+o(l,u,e));if(h)return c=null,h+""||null}var n,i,o,s,a,u,l,h,c=null;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=t,e):i},e.size=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(s=t,e):s},e.context=function(t){return arguments.length?(c=null==t?null:t,e):c},e},Qe=i.arc().cornerRadius(O).padAngle(R),Ye=i.area().x(z).y1(P).y0(N).defined(E),Ze=i.area().y(P).x1(z).x0(q).defined(E),$e=i.line().x(z).y(P).defined(E),Fe=Ue().x(z).y(P).width(S).height(I).cornerRadius(O),Ke=i.symbol().type(V).size(D),tn=Je().x(z).y(P).defined(E).size(L),en=function(t,e){return e.stroke&&0!==e.opacity&&0!==e.strokeOpacity&&t.expand(null!=e.strokeWidth?+e.strokeWidth:1),t},nn=2*Math.PI,rn=nn/4,on=nn-1e-8;J.beginPath=Q,J.closePath=Q,J.moveTo=Y,J.lineTo=Y,J.rect=function(t,e,n,i){Y(t,e),Y(t+n,e+i)},J.quadraticCurveTo=function(t,e,n,i){Y(t,e),Y(n,i)},J.bezierCurveTo=function(t,e,n,i,r,o){Y(t,e),Y(n,i),Y(r,o)},J.arc=function(t,e,n,i,r,o){function s(t){l=n*Math.cos(t),h=n*Math.sin(t),l<c&&(c=l),l>f&&(f=l),h<d&&(d=h),h>v&&(v=h)}if(Math.abs(r-i)>on)return Y(t-n,e-n),void Y(t+n,e+n);var a,u,l,h,c=1/0,f=-(1/0),d=1/0,v=-(1/0);if(s(i),s(r),r!==i)if(i%=nn,i<0&&(i+=nn),r%=nn,r<0&&(r+=nn),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=nn,a=i-i%rn,u=0;u<3&&a>r;++u,a-=rn)s(a);else for(a=i-i%rn+rn,u=0;u<3&&a<r;++u,a+=rn)s(a);Y(t+c,e+d),Y(t+f,e+v)};var sn,an,un=function(t,e,n){for(var i=n.width(),r=n.height(),o=n.x1+e.x1*i,s=n.y1+e.y1*r,a=n.x1+e.x2*i,u=n.y1+e.y2*r,l=e.stops,h=0,c=l.length,f=t.createLinearGradient(o,s,a,u);h<c;++h)f.addColorStop(l[h].offset,l[h].color);return f},ln=function(t,e,n){return n.id?un(t,n,e.bounds):n},hn=function(t,e,n){return n*=null==e.fillOpacity?1:e.fillOpacity,n>0&&(t.globalAlpha=n,t.fillStyle=ln(t,e,e.fill),!0)},cn=[],fn=function(t,e,n){var i=null!=(i=e.strokeWidth)?i:1;return!(i<=0)&&(n*=null==e.strokeOpacity?1:e.strokeOpacity,n>0&&(t.globalAlpha=n,t.strokeStyle=ln(t,e,e.stroke),t.lineWidth=i,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||cn),t.lineDashOffset=e.strokeDashOffset||0),!0))},dn=function(){return!0},vn=function(t,e){return"translate("+t+","+e+")"},gn=function(t){return vn(t.x||0,t.y||0)},pn=function(t,e){function n(t,n){t("transform",gn(n)),t("d",e(null,n))}function i(t,n){return e(J(t),n),en(t,n).translate(n.x||0,n.y||0)}function r(t,n){var i=n.x||0,r=n.y||0;t.translate(i,r),t.beginPath(),e(t,n),t.translate(-i,-r)}return{type:t,tag:"path",nested:!1,attr:n,bound:i,draw:tt(r),pick:ot(r)}},yn=pn("arc",H),_n=function(t,e){function n(t,n){var i=n.mark.items;i.length&&t("d",e(null,i))}function i(t,n){var i=n.items;return 0===i.length?t:(e(J(t),i),en(t,i[0]))}function r(t,n){t.beginPath(),e(t,n)}function o(t,e,n,i,r,o){var a=e.items,u=e.bounds;return!a||!a.length||u&&!u.contains(r,o)?null:(t.pixelRatio>1&&(n*=t.pixelRatio,i*=t.pixelRatio),s(t,a,n,i)?a[0]:null)}var s=rt(r);return{type:t,tag:"path",nested:!0,attr:n,bound:i,draw:et(r),pick:o}},mn=_n("area",G),xn=1,bn=function(t,e,n){var i=t._defs,r=e.clip_id||(e.clip_id="clip"+xn++),o=i.clipping[r]||(i.clipping[r]={id:r});return o.width=n.width||0,o.height=n.height||0,"url(#"+r+")"},kn={type:"group",tag:"g",nested:!1,attr:at,bound:ht,draw:ct,pick:ft,background:ut,foreground:lt},wn={type:"image",tag:"image",nested:!1,attr:yt,bound:_t,draw:mt,pick:it(),get:vt,xOffset:gt,yOffset:pt},Mn=_n("line",W),Tn={type:"path",tag:"path",nested:!1,attr:xt,bound:kt,draw:tt(bt),pick:ot(bt)},An={type:"rect",tag:"path",nested:!1,attr:wt,bound:Mt,draw:tt(Tt),pick:ot(Tt)},Cn={type:"rule",tag:"line",nested:!1,attr:At,bound:Ct,draw:Pt,pick:it(St)},zn=pn("shape",B),Pn=pn("symbol",U),Sn={height:Ot,measureWidth:qt,estimateWidth:Lt,width:Lt,canvas:Rt};Rt(!0);var Ln={left:"start",center:"middle",right:"end"},In=new o,qn={type:"text",tag:"text",nested:!1,attr:Gt,bound:Wt,draw:jt,pick:it(Bt)},Nn=_n("trail",X),On={arc:yn,area:mn,group:kn,image:wn,line:Mn,path:Tn,rect:An,rule:Cn,shape:zn,symbol:Pn,text:qn,trail:Nn},Rn=function(t,e,n){var i=On[t.mark.marktype],r=e||i.bound;return i.nested&&(t=t.mark),r(t.bounds||(t.bounds=new o),t,n)},En={mark:null},Dn=function(t,e,n){var i,r,s,a,u=On[t.marktype],l=u.bound,h=t.items,c=h&&h.length;if(u.nested)return s=c?h[0]:(En.mark=t,En),a=Rn(s,l,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new o,c)for(i=0,r=h.length;i<r;++i)e.union(Rn(h[i],l,n));return t.bounds=e},Vn=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","interpolate","tension","orient","defined","url","path","x2","y2","size","shape","text","angle","theta","radius","dx","dy","font","fontSize","fontWeight","fontStyle","fontVariant"],Hn=Qt.prototype;Hn.toJSON=function(t){return Ut(this.root,t||0)},Hn.mark=function(t,e,n){e=e||this.root.items[0];var i=Yt(t,e);return e.items[n]=i,i.zindex&&(i.group.zdirty=!0),i};var Gn=Zt.prototype;Gn.initialize=function(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},Gn.element=function(){return this._el},Gn.origin=function(t){return this._origin=t||[0,0],this},Gn.scene=function(t){return arguments.length?(this._scene=t,this):this._scene},Gn.on=function(){},Gn.off=function(){},Gn.handlers=function(){var t,e=this._handlers,n=[];for(t in e)n.push.apply(n,e[t]);return n},Gn.eventName=function(t){var e=t.indexOf(".");return e<0?t:t.slice(0,e)},Gn.handleHref=function(t,e,n){this._loader.sanitize(n,{context:"href"}).then(function(e){var n=new MouseEvent(t.type,t),i=u(null,"a");for(var r in e)i.setAttribute(r,e[r]);i.dispatchEvent(n)}).catch(function(){})},Gn.handleTooltip=function(t,e,n){this._el.setAttribute("title",n||"")};var Wn=$t.prototype;Wn.initialize=function(t,e,n,i){return this._el=t,this.resize(e,n,i)},Wn.element=function(){return this._el},Wn.scene=function(){return this._el&&this._el.firstChild},Wn.background=function(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},Wn.resize=function(t,e,n){return this._width=t,this._height=e,this._origin=n||[0,0],this},Wn.dirty=function(){},Wn.render=function(t){var e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},Wn._render=function(){},Wn.renderAsync=function(t){var e=this.render(t);return this._ready?this._ready.then(function(){return e}):Promise.resolve(e)},Wn._load=function(t,e){var n=this,i=n._loader[t](e);if(!n._ready){var r=n._call;n._ready=n._loader.ready().then(function(t){t&&r(),n._ready=null})}return i},Wn.sanitizeURL=function(t){return this._load("sanitizeURL",t)},Wn.loadImage=function(t){return this._load("loadImage",t)};var jn=function(t,e){var n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]},Bn=e.inherits(Ft,Zt);Bn.initialize=function(t,e,n){var i=this._canvas=t&&l(t,"canvas");if(i){var r=this;this.events.forEach(function(t){i.addEventListener(t,function(e){Bn[t]?Bn[t].call(r,e):r.fire(t,e)})})}return Zt.prototype.initialize.call(this,t,e,n)},Bn.canvas=function(){return this._canvas},Bn.context=function(){return this._canvas.getContext("2d")},Bn.events=["keydown","keypress","keyup","dragenter","dragleave","dragover","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"],
Bn.DOMMouseScroll=function(t){this.fire("mousewheel",t)},Bn.mousemove=Kt("mousemove","mouseover","mouseout"),Bn.dragover=Kt("dragover","dragenter","dragleave"),Bn.mouseout=te("mouseout"),Bn.dragleave=te("dragleave"),Bn.mousedown=function(t){this._down=this._active,this.fire("mousedown",t)},Bn.click=function(t){this._down===this._active&&(this.fire("click",t),this._down=null)},Bn.touchstart=function(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire("touchstart",t,!0)},Bn.touchmove=function(t){this.fire("touchmove",t,!0)},Bn.touchend=function(t){this.fire("touchend",t,!0),this._touch=null},Bn.fire=function(t,e,n){var i,r,o=n?this._touch:this._active,s=this._handlers[t];if("click"===t&&o&&o.href?this.handleHref(e,o,o.href):("mouseover"===t||"mouseout"===t)&&o&&o.tooltip&&this.handleTooltip(e,o,"mouseover"===t?o.tooltip:null),s)for(e.vegaType=t,i=0,r=s.length;i<r;++i)s[i].handler.call(this._obj,e,o)},Bn.on=function(t,e){var n=this.eventName(t),i=this._handlers;return(i[n]||(i[n]=[])).push({type:t,handler:e}),this},Bn.off=function(t,e){var n,i=this.eventName(t),r=this._handlers[i];if(r){for(n=r.length;--n>=0;)r[n].type===t&&(e&&r[n].handler!==e||r.splice(n,1));return this}},Bn.pickEvent=function(t){var e=jn(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},Bn.pick=function(t,e,n,i,r){var o=this.context(),s=On[t.marktype];return s.pick.call(this,o,t,e,n,i,r)};var Un=function(t,e){var n=e.group;t.save(),t.beginPath(),t.rect(0,0,n.width||0,n.height||0),t.clip()},Xn="undefined"!=typeof window?window.devicePixelRatio||1:1,Jn=function(t,e,n,i){var r="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,o=t.getContext("2d"),s=r?Xn:1;return t.width=e*s,t.height=n*s,1!==s&&(t.style.width=e+"px",t.style.height=n+"px"),o.pixelRatio=s,o.setTransform(s,0,0,s,s*i[0],s*i[1]),t},Qn=e.inherits(ee,$t),Yn=$t.prototype,Zn=new o;Qn.initialize=function(t,e,n,i){return this._canvas=ze(1,1),t&&(c(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Yn.initialize.call(this,t,e,n,i)},Qn.resize=function(t,e,n){return Yn.resize.call(this,t,e,n),Jn(this._canvas,this._width,this._height,this._origin),this._redraw=!0,this},Qn.canvas=function(){return this._canvas},Qn.context=function(){return this._canvas?this._canvas.getContext("2d"):null},Qn.dirty=function(t){var e=ie(t.bounds,t.mark.group);this._dirty.union(e)},Qn._render=function(t){var e=this.context(),n=this._origin,i=this._width,r=this._height,o=this._dirty;return e.save(),o=this._redraw||o.empty()?(this._redraw=!1,null):ne(e,o,n),this.clear(-n[0],-n[1],i,r),this.draw(e,t,o),e.restore(),this._dirty.clear(),this},Qn.draw=function(t,e,n){var i=On[e.marktype];e.clip&&Un(t,e),i.draw.call(this,t,e,n),e.clip&&t.restore()},Qn.clear=function(t,e,n,i){var r=this.context();r.clearRect(t,e,n,i),null!=this._bgcolor&&(r.fillStyle=this._bgcolor,r.fillRect(t,e,n,i))};var $n=e.inherits(re,Zt);$n.initialize=function(t,e,n){var i=this._svg;return i&&(i.removeEventListener("click",this._hrefHandler),i.removeEventListener("mouseover",this._tooltipHandler),i.removeEventListener("mouseout",this._tooltipHandler)),this._svg=i=t&&l(t,"svg"),i&&(i.addEventListener("click",this._hrefHandler),i.addEventListener("mouseover",this._tooltipHandler),i.addEventListener("mouseout",this._tooltipHandler)),Zt.prototype.initialize.call(this,t,e,n)},$n.svg=function(){return this._svg},$n.on=function(t,e){var n=this.eventName(t),i=this._handlers,r={type:t,handler:e,listener:oe(this,e)};return(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener),this},$n.off=function(t,e){var n,i=this.eventName(t),r=this._svg,o=this._handlers[i];if(o){for(n=o.length;--n>=0;)(o[n].type===t&&!e||o[n].handler===e)&&(this._svg&&r.removeEventListener(i,o[n].listener),o.splice(n,1));return this}};var Fn={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},Kn={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeOpacity:"stroke-opacity",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},ti=Object.keys(Kn),ei=Fn.xmlns,ni=e.inherits(ue,$t),ii=$t.prototype;ni.initialize=function(t,e,n,i){return t&&(this._svg=h(t,0,"svg",ei),this._svg.setAttribute("class","marks"),c(t,1),this._root=h(this._svg,0,"g",ei),c(this._svg,1)),this._defs={gradient:{},clipping:{}},this.background(this._bgcolor),ii.initialize.call(this,t,e,n,i)},ni.background=function(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),ii.background.apply(this,arguments)},ni.resize=function(t,e,n){return ii.resize.call(this,t,e,n),this._svg&&(this._svg.setAttribute("width",this._width),this._svg.setAttribute("height",this._height),this._svg.setAttribute("viewBox","0 0 "+this._width+" "+this._height),this._root.setAttribute("transform","translate("+this._origin+")")),this._dirty=[],this},ni.svg=function(){if(!this._svg)return null;var t={class:"marks",width:this._width,height:this._height,viewBox:"0 0 "+this._width+" "+this._height};for(var e in Fn)t[e]=Fn[e];return se("svg",t)+this._svg.innerHTML+ae("svg")},ni._render=function(t){return this._dirtyCheck()&&(this._dirtyAll&&this._resetDefs(),this.draw(this._root,t),c(this._root,1)),this.updateDefs(),this._dirty=[],++this._dirtyID,this},ni.updateDefs=function(){var t,e=this._svg,n=this._defs,i=n.el,r=0;for(t in n.gradient)i||(n.el=i=h(e,0,"defs",ei)),le(i,n.gradient[t],r++);for(t in n.clipping)i||(n.el=i=h(e,0,"defs",ei)),he(i,n.clipping[t],r++);i&&(0===r?(e.removeChild(i),n.el=null):c(i,r))},ni._resetDefs=function(){var t=this._defs;t.gradient={},t.clipping={}},ni.dirty=function(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},ni.isDirty=function(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},ni._dirtyCheck=function(){this._dirtyAll=!0;var t=this._dirty;if(!t.length)return!0;var e,n,i,r,o,s,a,u=++this._dirtyID;for(o=0,s=t.length;o<s;++o)e=t[o],n=e.mark,n.marktype!==i&&(i=n.marktype,r=On[i]),n.zdirty&&n.dirty!==u&&(this._dirtyAll=!1,n.dirty=u,ce(n.group,u)),e.exit?(r.nested&&n.items.length?(a=n.items[0],a._svg&&this._update(r,a._svg,a)):e._svg&&e._svg.parentNode.removeChild(e._svg),e._svg=null):(e=r.nested?n.items[0]:e,e._update!==u&&(e._svg&&e._svg.ownerSVGElement?this._update(r,e._svg,e):(this._dirtyAll=!1,ce(e,u)),e._update=u));return!this._dirtyAll},ni.draw=function(t,e,n){function i(t){var e=o.isDirty(t),n=de(t,r,l,s.tag);e&&(o._update(s,n,t),u&&fe(o,n,t)),l=n,++h}if(!this.isDirty(e))return e._svg;var r,o=this,s=On[e.marktype],a=e.interactive===!1?"none":null,u="g"===s.tag,l=null,h=0;return r=de(e,t,n,"g"),r.setAttribute("class",f(e)),!u&&a&&r.style.setProperty("pointer-events",a),e.clip&&r.setAttribute("clip-path",bn(o,e,e.group)),s.nested?e.items.length&&i(e.items[0]):F(e,i),c(r,h),r};var ri=null,oi=null,si={group:function(t,e,n){oi=e.__values__,ri=e.childNodes[1],t.foreground(ve,n,this),ri=e.childNodes[0],t.background(ve,n,this);var i=n.mark.interactive===!1?"none":null;i!==oi.events&&(ri.style.setProperty("pointer-events",i),oi.events=i)},text:function(t,e,n){var i=Et(n);i!==oi.text&&(e.textContent=i,oi.text=i),i=Vt(n),i!==oi.font&&(e.style.setProperty("font",i),oi.font=i)}};ni._update=function(t,e,n){ri=e,oi=e.__values__,t.attr(ve,n,this);var i=si[t.type];i&&i.call(this,t,e,n),this.style(ri,n)},ni.style=function(t,e){if(null!=e){var n,i,r,o,s;for(n=0,i=ti.length;n<i;++n)r=ti[n],s=e[r],s!==oi[r]&&(o=Kn[r],null==s?"fill"===o?t.style.setProperty(o,"none"):t.style.removeProperty(o):(s.id&&(this._defs.gradient[s.id]=s,s="url("+ge()+"#"+s.id+")"),t.style.setProperty(o,s+"")),oi[r]=s)}};var ai=e.inherits(pe,$t),ui=$t.prototype;ai.resize=function(t,e,n){ui.resize.call(this,t,e,n);var i=this._origin,r=this._text,o={class:"marks",width:this._width,height:this._height,viewBox:"0 0 "+this._width+" "+this._height};for(var s in Fn)o[s]=Fn[s];return r.head=se("svg",o),r.root=se("g",{transform:"translate("+i+")"}),r.foot=ae("g")+ae("svg"),this},ai.svg=function(){var t=this._text;return t.head+t.defs+t.root+t.body+t.foot},ai._render=function(t){return this._text.body=this.mark(t),this._text.defs=this.buildDefs(),this},ai.buildDefs=function(){var t,e,n,i,r=this._defs,o="";for(e in r.gradient){for(n=r.gradient[e],i=n.stops,o+=se("linearGradient",{id:e,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2}),t=0;t<i.length;++t)o+=se("stop",{offset:i[t].offset,"stop-color":i[t].color})+ae("stop");o+=ae("linearGradient")}for(e in r.clipping)n=r.clipping[e],o+=se("clipPath",{id:e}),o+=se("rect",{x:0,y:0,width:n.width,height:n.height})+ae("rect"),o+=ae("clipPath");return o.length>0?se("defs")+o+ae("defs"):""};var li;ai.attributes=function(t,e){return li={},t(ye,e,this),li},ai.href=function(t){var e,n=this,i=t.href;if(i){if(e=n._hrefs&&n._hrefs[i])return e;n.sanitizeURL(i).then(function(t){t["xlink:href"]=t.href,t.href=null,(n._hrefs||(n._hrefs={}))[i]=t})}return null},ai.mark=function(t){function e(e){var u=i.href(e);u&&(a+=se("a",u)),n="g"!==o?_e(e,t,o,s):null,a+=se(o,i.attributes(r.attr,e),n),"text"===o?a+=me(Et(e)):"g"===o&&(a+=se("path",i.attributes(r.background,e),_e(e,t,"bgrect",s))+ae("path"),a+=se("g",i.attributes(r.foreground,e))+i.markGroup(e)+ae("g")),a+=ae(o),u&&(a+=ae("a"))}var n,i=this,r=On[t.marktype],o=r.tag,s=this._defs,a="";return"g"!==o&&t.interactive===!1&&(n='style="pointer-events: none;"'),a+=se("g",{class:f(t),"clip-path":t.clip?bn(i,t,t.group):null},n),r.nested?t.items&&t.items.length&&e(t.items[0]):F(t,e),a+ae("g")},ai.markGroup=function(t){var e=this,n="";return F(t,function(t){n+=e.mark(t)}),n};var hi="canvas",ci="png",fi="svg",di="none",vi={Canvas:hi,PNG:ci,SVG:fi,None:di},gi={};gi[hi]=gi[ci]={renderer:ee,headless:ee,handler:Ft},gi[fi]={renderer:ue,headless:pe,handler:re},gi[di]={};var pi=1e-9;t.Bounds=o,t.Gradient=Ae,t.GroupItem=a,t.ResourceLoader=d,t.Item=s,t.Scenegraph=Qt,t.Handler=Zt,t.Renderer=$t,t.CanvasHandler=Ft,t.CanvasRenderer=ee,t.SVGHandler=re,t.SVGRenderer=ue,t.SVGStringRenderer=pe,t.RenderType=vi,t.renderModule=xe,t.Marks=On,t.boundContext=J,t.boundStroke=en,t.boundItem=Rn,t.boundMark=Dn,t.pathCurves=p,t.pathSymbols=b,t.pathRectangle=Ue,t.pathTrail=Je,t.pathParse=Oe,t.pathRender=He,t.point=jn,t.canvas=ze,t.domCreate=u,t.domFind=l,t.domChild=h,t.domClear=c,t.openTag=se,t.closeTag=ae,t.font=Vt,t.textMetrics=Sn,t.resetSVGClipId=st,t.sceneEqual=be,t.pathEqual=ke,t.sceneToJSON=Ut,t.sceneFromJSON=Xt,t.sceneZOrder=$,t.sceneVisit=F,t.scenePickVisit=K,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -36,2 +36,3 @@ export {default as Bounds} from './src/Bounds';

export {font, textMetrics} from './src/util/text';
export {resetSVGClipId} from './src/util/svg/clip';

@@ -38,0 +39,0 @@ export {sceneEqual, pathEqual} from './src/util/equal';

{
"name": "vega-scenegraph",
"version": "2.0.0-beta.30",
"version": "2.0.0-beta.31",
"description": "Vega scenegraph and renderers.",

@@ -5,0 +5,0 @@ "license": "BSD-3-Clause",

@@ -38,3 +38,2 @@ import Renderer from './Renderer';

this._defs = {
clip_id: 1,
gradient: {},

@@ -168,3 +167,2 @@ clipping: {}

var def = this._defs;
def.clip_id = 1;
def.gradient = {};

@@ -171,0 +169,0 @@ def.clipping = {};

@@ -24,3 +24,2 @@ import Renderer from './Renderer';

this._defs = {
clip_id: 1,
gradient: {},

@@ -69,7 +68,2 @@ clipping: {}

prototype.reset = function() {
this._defs.clip_id = 0;
return this;
};
prototype.buildDefs = function() {

@@ -76,0 +70,0 @@ var all = this._defs,

@@ -0,4 +1,10 @@

var clip_id = 1;
export function resetSVGClipId() {
clip_id = 1;
}
export default function(renderer, item, size) {
var defs = renderer._defs,
id = item.clip_id || (item.clip_id = 'clip' + defs.clip_id++),
id = item.clip_id || (item.clip_id = 'clip' + clip_id++),
c = defs.clipping[id] || (defs.clipping[id] = {id: id});

@@ -5,0 +11,0 @@ c.width = size.width || 0;

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc