Socket
Socket
Sign inDemoInstall

vega-scenegraph

Package Overview
Dependencies
Maintainers
2
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-scenegraph - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

2

build/vega-scenegraph.min.js

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

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

@@ -41,3 +41,4 @@ "license": "BSD-3-Clause",

"optionalDependencies": {
"canvas": "^1.6"
"canvas": "^1.6",
"canvas-prebuilt": "^1.6"
},

@@ -53,4 +54,5 @@ "devDependencies": {

"browser": {
"canvas": false
"canvas": false,
"canvas-prebuilt": false
}
}
}

@@ -21,4 +21,8 @@ import curves from './curves';

function yh(item) { return (item.y || 0) + (item.height || 0); }
function sa(item) { return item.startAngle || 0; }
function ea(item) { return item.endAngle || 0; }
function pa(item) { return item.padAngle || 0; }
function ir(item) { return item.innerRadius || 0; }
function or(item) { return item.outerRadius || 0; }
function cr(item) { return item.cornerRadius || 0; }
function pa(item) { return item.padAngle || 0; }
function def(item) { return !(item.defined === false); }

@@ -28,3 +32,4 @@ function size(item) { return item.size == null ? 64 : item.size; }

var arcShape = d3_arc().cornerRadius(cr).padAngle(pa),
var arcShape = d3_arc().startAngle(sa).endAngle(ea).padAngle(pa)
.innerRadius(ir).outerRadius(or).cornerRadius(cr),
areavShape = d3_area().x(x).y1(y).y0(yh).defined(def),

@@ -31,0 +36,0 @@ areahShape = d3_area().y(y).x1(x).x0(xw).defined(def),

@@ -5,3 +5,14 @@ import {domCreate} from '../dom';

try { Canvas = require('canvas'); } catch (e) { Canvas = null; }
try {
// try to load canvas module
Canvas = require('canvas');
} catch (e) {
try {
// if canvas fails, try to load canvas-prebuilt
Canvas = require('canvas-prebuilt');
} catch (e2) {
// if all options fail, set to null
Canvas = null;
}
}

@@ -8,0 +19,0 @@ export default function(w, h) {

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