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.1.0 to 2.2.0

2

build/vega-scenegraph.min.js

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

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

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

export {default as point} from './src/util/point';
export {default as canvas} from './src/util/canvas/canvas';
export {domCreate, domFind, domChild, domClear} from './src/util/dom';

@@ -35,0 +34,0 @@ export {openTag, closeTag} from './src/util/tags';

{
"name": "vega-scenegraph",
"version": "2.1.0",
"version": "2.2.0",
"description": "Vega scenegraph and renderers.",

@@ -29,3 +29,3 @@ "license": "BSD-3-Clause",

"build": "npm run test && uglifyjs build/vega-scenegraph.js -c -m -o build/vega-scenegraph.min.js",
"pretest": "rm -rf build && mkdir build && rollup -f umd -g d3-path:d3,d3-shape:d3,vega-loader:vega,vega-util:vega -n vega -o build/vega-scenegraph.js -- index.js && bin/schema > build/vega-scenegraph-schema.json",
"pretest": "rm -rf build && mkdir build && rollup -f umd -g d3-path:d3,d3-shape:d3,vega-canvas:vega,vega-loader:vega,vega-util:vega -n vega -o build/vega-scenegraph.js -- index.js && bin/schema > build/vega-scenegraph-schema.json",
"test": "tape 'test/**/*-test.js' && eslint index.js src test",

@@ -38,10 +38,8 @@ "prepublish": "npm run build",

"d3-shape": "1",
"vega-canvas": "1",
"vega-loader": "2",
"vega-util": "^1.1"
},
"optionalDependencies": {
"devDependencies": {
"canvas": "^1.6",
"canvas-prebuilt": "^1.6"
},
"devDependencies": {
"eslint": "4",

@@ -48,0 +46,0 @@ "jsdom": "11",

@@ -7,4 +7,4 @@ import Renderer from './Renderer';

import clip from './util/canvas/clip';
import Canvas from './util/canvas/canvas';
import resize from './util/canvas/resize';
import {canvas} from 'vega-canvas';
import {inherits} from 'vega-util';

@@ -23,3 +23,3 @@

prototype.initialize = function(el, width, height, origin, scaleFactor) {
this._canvas = Canvas(1, 1); // instantiate a small canvas
this._canvas = canvas(1, 1); // instantiate a small canvas
if (el) {

@@ -26,0 +26,0 @@ domClear(el, 0).appendChild(this._canvas);

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

import Image from './util/canvas/image';
import {image} from 'vega-canvas';
import {loader} from 'vega-loader';

@@ -39,7 +39,8 @@

prototype.loadImage = function(uri) {
var loader = this;
var loader = this,
Image = image();
increment(loader);
return loader._loader
.sanitize(uri, {context:'image'})
.sanitize(uri, {context: 'image'})
.then(function(opt) {

@@ -49,16 +50,16 @@ var url = opt.href;

var image = new Image();
var img = new Image();
image.onload = function() {
img.onload = function() {
decrement(loader);
image.loaded = true;
img.loaded = true;
};
image.onerror = function() {
img.onerror = function() {
decrement(loader);
image.loaded = false;
img.loaded = false;
}
image.src = url;
return image;
img.src = url;
return img;
})

@@ -65,0 +66,0 @@ .catch(function(e) {

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

import Canvas from './canvas/canvas';
import {canvas} from 'vega-canvas';

@@ -11,6 +11,6 @@ var context,

width: estimateWidth,
canvas: canvas
canvas: useCanvas
};
canvas(true);
useCanvas(true);

@@ -41,4 +41,4 @@ // make dumb, simple estimate if no canvas is available

function canvas(use) {
context = use && (context = Canvas(1,1)) ? context.getContext('2d') : null;
function useCanvas(use) {
context = use && (context = canvas(1,1)) ? context.getContext('2d') : null;
textMetrics.width = context ? measureWidth : estimateWidth;

@@ -45,0 +45,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