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 3.2.1 to 3.2.2

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

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

"canvas": "^1.6.11",
"eslint": "4",
"eslint": "5",
"jsdom": "11",
"rollup": "0.60.4",
"rollup": "0.62.0",
"tape": "4",

@@ -48,0 +48,0 @@ "tv4": "1",

@@ -35,9 +35,8 @@ import {rectangle} from '../path/shapes';

if (group.clip || group.width || group.height) {
boundStroke(
bounds.add(0, 0).add(group.width || 0, group.height || 0),
group
);
if ((group.clip || group.width || group.height) && !group.noBound) {
bounds.add(0, 0).add(group.width || 0, group.height || 0);
}
boundStroke(bounds, group);
return bounds.translate(group.x || 0, group.y || 0);

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